s3: re-run make samba3-idl.
[samba.git] / librpc / gen_ndr / ndr_rap.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_rap.h"
5
6 static enum ndr_err_code ndr_push_rap_share_info_0(struct ndr_push *ndr, int ndr_flags, const struct rap_share_info_0 *r)
7 {
8         if (ndr_flags & NDR_SCALARS) {
9                 NDR_CHECK(ndr_push_align(ndr, 1));
10                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->share_name, 13));
11                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
12         }
13         if (ndr_flags & NDR_BUFFERS) {
14         }
15         return NDR_ERR_SUCCESS;
16 }
17
18 static enum ndr_err_code ndr_pull_rap_share_info_0(struct ndr_pull *ndr, int ndr_flags, struct rap_share_info_0 *r)
19 {
20         if (ndr_flags & NDR_SCALARS) {
21                 NDR_CHECK(ndr_pull_align(ndr, 1));
22                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->share_name, 13));
23                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
24         }
25         if (ndr_flags & NDR_BUFFERS) {
26         }
27         return NDR_ERR_SUCCESS;
28 }
29
30 _PUBLIC_ void ndr_print_rap_share_info_0(struct ndr_print *ndr, const char *name, const struct rap_share_info_0 *r)
31 {
32         ndr_print_struct(ndr, name, "rap_share_info_0");
33         ndr->depth++;
34         ndr_print_array_uint8(ndr, "share_name", r->share_name, 13);
35         ndr->depth--;
36 }
37
38 static enum ndr_err_code ndr_push_rap_share_info_1(struct ndr_push *ndr, int ndr_flags, const struct rap_share_info_1 *r)
39 {
40         if (ndr_flags & NDR_SCALARS) {
41                 NDR_CHECK(ndr_push_align(ndr, 5));
42                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->share_name, 13));
43                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->reserved1));
44                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->share_type));
45                 {
46                         uint32_t _flags_save_string = ndr->flags;
47                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
48                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment));
49                         ndr->flags = _flags_save_string;
50                 }
51                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
52         }
53         if (ndr_flags & NDR_BUFFERS) {
54                 {
55                         uint32_t _flags_save_string = ndr->flags;
56                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
57                         if (r->comment) {
58                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
59                         }
60                         ndr->flags = _flags_save_string;
61                 }
62         }
63         return NDR_ERR_SUCCESS;
64 }
65
66 static enum ndr_err_code ndr_pull_rap_share_info_1(struct ndr_pull *ndr, int ndr_flags, struct rap_share_info_1 *r)
67 {
68         uint32_t _ptr_comment;
69         TALLOC_CTX *_mem_save_comment_0;
70         if (ndr_flags & NDR_SCALARS) {
71                 NDR_CHECK(ndr_pull_align(ndr, 5));
72                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->share_name, 13));
73                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->reserved1));
74                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->share_type));
75                 {
76                         uint32_t _flags_save_string = ndr->flags;
77                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
78                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
79                         if (_ptr_comment) {
80                                 NDR_PULL_ALLOC(ndr, r->comment);
81                         } else {
82                                 r->comment = NULL;
83                         }
84                         ndr->flags = _flags_save_string;
85                 }
86                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
87         }
88         if (ndr_flags & NDR_BUFFERS) {
89                 {
90                         uint32_t _flags_save_string = ndr->flags;
91                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
92                         if (r->comment) {
93                                 _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
94                                 NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
95                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
96                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
97                         }
98                         ndr->flags = _flags_save_string;
99                 }
100         }
101         return NDR_ERR_SUCCESS;
102 }
103
104 _PUBLIC_ void ndr_print_rap_share_info_1(struct ndr_print *ndr, const char *name, const struct rap_share_info_1 *r)
105 {
106         ndr_print_struct(ndr, name, "rap_share_info_1");
107         ndr->depth++;
108         ndr_print_array_uint8(ndr, "share_name", r->share_name, 13);
109         ndr_print_uint8(ndr, "reserved1", r->reserved1);
110         ndr_print_uint16(ndr, "share_type", r->share_type);
111         ndr_print_ptr(ndr, "comment", r->comment);
112         ndr->depth++;
113         if (r->comment) {
114                 ndr_print_string(ndr, "comment", r->comment);
115         }
116         ndr->depth--;
117         ndr->depth--;
118 }
119
120 static enum ndr_err_code ndr_push_rap_share_info_2(struct ndr_push *ndr, int ndr_flags, const struct rap_share_info_2 *r)
121 {
122         if (ndr_flags & NDR_SCALARS) {
123                 NDR_CHECK(ndr_push_align(ndr, 5));
124                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->share_name, 13));
125                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->reserved1));
126                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->share_type));
127                 {
128                         uint32_t _flags_save_string = ndr->flags;
129                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
130                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment));
131                         ndr->flags = _flags_save_string;
132                 }
133                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->perms));
134                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->maximum_users));
135                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->active_users));
136                 {
137                         uint32_t _flags_save_string = ndr->flags;
138                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
139                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->path));
140                         ndr->flags = _flags_save_string;
141                 }
142                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->password, 9));
143                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->reserved2));
144                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
145         }
146         if (ndr_flags & NDR_BUFFERS) {
147                 {
148                         uint32_t _flags_save_string = ndr->flags;
149                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
150                         if (r->comment) {
151                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
152                         }
153                         ndr->flags = _flags_save_string;
154                 }
155                 {
156                         uint32_t _flags_save_string = ndr->flags;
157                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
158                         if (r->path) {
159                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path));
160                         }
161                         ndr->flags = _flags_save_string;
162                 }
163         }
164         return NDR_ERR_SUCCESS;
165 }
166
167 static enum ndr_err_code ndr_pull_rap_share_info_2(struct ndr_pull *ndr, int ndr_flags, struct rap_share_info_2 *r)
168 {
169         uint32_t _ptr_comment;
170         TALLOC_CTX *_mem_save_comment_0;
171         uint32_t _ptr_path;
172         TALLOC_CTX *_mem_save_path_0;
173         if (ndr_flags & NDR_SCALARS) {
174                 NDR_CHECK(ndr_pull_align(ndr, 5));
175                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->share_name, 13));
176                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->reserved1));
177                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->share_type));
178                 {
179                         uint32_t _flags_save_string = ndr->flags;
180                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
181                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
182                         if (_ptr_comment) {
183                                 NDR_PULL_ALLOC(ndr, r->comment);
184                         } else {
185                                 r->comment = NULL;
186                         }
187                         ndr->flags = _flags_save_string;
188                 }
189                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->perms));
190                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->maximum_users));
191                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->active_users));
192                 {
193                         uint32_t _flags_save_string = ndr->flags;
194                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
195                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path));
196                         if (_ptr_path) {
197                                 NDR_PULL_ALLOC(ndr, r->path);
198                         } else {
199                                 r->path = NULL;
200                         }
201                         ndr->flags = _flags_save_string;
202                 }
203                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->password, 9));
204                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->reserved2));
205                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
206         }
207         if (ndr_flags & NDR_BUFFERS) {
208                 {
209                         uint32_t _flags_save_string = ndr->flags;
210                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
211                         if (r->comment) {
212                                 _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
213                                 NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
214                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
215                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
216                         }
217                         ndr->flags = _flags_save_string;
218                 }
219                 {
220                         uint32_t _flags_save_string = ndr->flags;
221                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
222                         if (r->path) {
223                                 _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
224                                 NDR_PULL_SET_MEM_CTX(ndr, r->path, 0);
225                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path));
226                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0);
227                         }
228                         ndr->flags = _flags_save_string;
229                 }
230         }
231         return NDR_ERR_SUCCESS;
232 }
233
234 _PUBLIC_ void ndr_print_rap_share_info_2(struct ndr_print *ndr, const char *name, const struct rap_share_info_2 *r)
235 {
236         ndr_print_struct(ndr, name, "rap_share_info_2");
237         ndr->depth++;
238         ndr_print_array_uint8(ndr, "share_name", r->share_name, 13);
239         ndr_print_uint8(ndr, "reserved1", r->reserved1);
240         ndr_print_uint16(ndr, "share_type", r->share_type);
241         ndr_print_ptr(ndr, "comment", r->comment);
242         ndr->depth++;
243         if (r->comment) {
244                 ndr_print_string(ndr, "comment", r->comment);
245         }
246         ndr->depth--;
247         ndr_print_uint16(ndr, "perms", r->perms);
248         ndr_print_uint16(ndr, "maximum_users", r->maximum_users);
249         ndr_print_uint16(ndr, "active_users", r->active_users);
250         ndr_print_ptr(ndr, "path", r->path);
251         ndr->depth++;
252         if (r->path) {
253                 ndr_print_string(ndr, "path", r->path);
254         }
255         ndr->depth--;
256         ndr_print_array_uint8(ndr, "password", r->password, 9);
257         ndr_print_uint8(ndr, "reserved2", r->reserved2);
258         ndr->depth--;
259 }
260
261 static enum ndr_err_code ndr_push_rap_share_info(struct ndr_push *ndr, int ndr_flags, const union rap_share_info *r)
262 {
263         if (ndr_flags & NDR_SCALARS) {
264                 int level = ndr_push_get_switch_value(ndr, r);
265                 NDR_CHECK(ndr_push_union_align(ndr, 5));
266                 switch (level) {
267                         case 0: {
268                                 NDR_CHECK(ndr_push_rap_share_info_0(ndr, NDR_SCALARS, &r->info0));
269                         break; }
270
271                         case 1: {
272                                 NDR_CHECK(ndr_push_rap_share_info_1(ndr, NDR_SCALARS, &r->info1));
273                         break; }
274
275                         case 2: {
276                                 NDR_CHECK(ndr_push_rap_share_info_2(ndr, NDR_SCALARS, &r->info2));
277                         break; }
278
279                         default:
280                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
281                 }
282         }
283         if (ndr_flags & NDR_BUFFERS) {
284                 int level = ndr_push_get_switch_value(ndr, r);
285                 switch (level) {
286                         case 0:
287                         break;
288
289                         case 1:
290                                 NDR_CHECK(ndr_push_rap_share_info_1(ndr, NDR_BUFFERS, &r->info1));
291                         break;
292
293                         case 2:
294                                 NDR_CHECK(ndr_push_rap_share_info_2(ndr, NDR_BUFFERS, &r->info2));
295                         break;
296
297                         default:
298                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
299                 }
300         }
301         return NDR_ERR_SUCCESS;
302 }
303
304 static enum ndr_err_code ndr_pull_rap_share_info(struct ndr_pull *ndr, int ndr_flags, union rap_share_info *r)
305 {
306         int level;
307         level = ndr_pull_get_switch_value(ndr, r);
308         if (ndr_flags & NDR_SCALARS) {
309                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
310                 switch (level) {
311                         case 0: {
312                                 NDR_CHECK(ndr_pull_rap_share_info_0(ndr, NDR_SCALARS, &r->info0));
313                         break; }
314
315                         case 1: {
316                                 NDR_CHECK(ndr_pull_rap_share_info_1(ndr, NDR_SCALARS, &r->info1));
317                         break; }
318
319                         case 2: {
320                                 NDR_CHECK(ndr_pull_rap_share_info_2(ndr, NDR_SCALARS, &r->info2));
321                         break; }
322
323                         default:
324                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
325                 }
326         }
327         if (ndr_flags & NDR_BUFFERS) {
328                 switch (level) {
329                         case 0:
330                         break;
331
332                         case 1:
333                                 NDR_CHECK(ndr_pull_rap_share_info_1(ndr, NDR_BUFFERS, &r->info1));
334                         break;
335
336                         case 2:
337                                 NDR_CHECK(ndr_pull_rap_share_info_2(ndr, NDR_BUFFERS, &r->info2));
338                         break;
339
340                         default:
341                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
342                 }
343         }
344         return NDR_ERR_SUCCESS;
345 }
346
347 _PUBLIC_ void ndr_print_rap_share_info(struct ndr_print *ndr, const char *name, const union rap_share_info *r)
348 {
349         int level;
350         level = ndr_print_get_switch_value(ndr, r);
351         ndr_print_union(ndr, name, level, "rap_share_info");
352         switch (level) {
353                 case 0:
354                         ndr_print_rap_share_info_0(ndr, "info0", &r->info0);
355                 break;
356
357                 case 1:
358                         ndr_print_rap_share_info_1(ndr, "info1", &r->info1);
359                 break;
360
361                 case 2:
362                         ndr_print_rap_share_info_2(ndr, "info2", &r->info2);
363                 break;
364
365                 default:
366                         ndr_print_bad_level(ndr, name, level);
367         }
368 }
369
370 static enum ndr_err_code ndr_push_rap_server_info_0(struct ndr_push *ndr, int ndr_flags, const struct rap_server_info_0 *r)
371 {
372         if (ndr_flags & NDR_SCALARS) {
373                 NDR_CHECK(ndr_push_align(ndr, 1));
374                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->name, 16));
375                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
376         }
377         if (ndr_flags & NDR_BUFFERS) {
378         }
379         return NDR_ERR_SUCCESS;
380 }
381
382 static enum ndr_err_code ndr_pull_rap_server_info_0(struct ndr_pull *ndr, int ndr_flags, struct rap_server_info_0 *r)
383 {
384         if (ndr_flags & NDR_SCALARS) {
385                 NDR_CHECK(ndr_pull_align(ndr, 1));
386                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->name, 16));
387                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
388         }
389         if (ndr_flags & NDR_BUFFERS) {
390         }
391         return NDR_ERR_SUCCESS;
392 }
393
394 _PUBLIC_ void ndr_print_rap_server_info_0(struct ndr_print *ndr, const char *name, const struct rap_server_info_0 *r)
395 {
396         ndr_print_struct(ndr, name, "rap_server_info_0");
397         ndr->depth++;
398         ndr_print_array_uint8(ndr, "name", r->name, 16);
399         ndr->depth--;
400 }
401
402 static enum ndr_err_code ndr_push_rap_server_info_1(struct ndr_push *ndr, int ndr_flags, const struct rap_server_info_1 *r)
403 {
404         if (ndr_flags & NDR_SCALARS) {
405                 NDR_CHECK(ndr_push_align(ndr, 5));
406                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->name, 16));
407                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->version_major));
408                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->version_minor));
409                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->servertype));
410                 {
411                         uint32_t _flags_save_string = ndr->flags;
412                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
413                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment));
414                         ndr->flags = _flags_save_string;
415                 }
416                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
417         }
418         if (ndr_flags & NDR_BUFFERS) {
419                 {
420                         uint32_t _flags_save_string = ndr->flags;
421                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
422                         if (r->comment) {
423                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
424                         }
425                         ndr->flags = _flags_save_string;
426                 }
427         }
428         return NDR_ERR_SUCCESS;
429 }
430
431 static enum ndr_err_code ndr_pull_rap_server_info_1(struct ndr_pull *ndr, int ndr_flags, struct rap_server_info_1 *r)
432 {
433         uint32_t _ptr_comment;
434         TALLOC_CTX *_mem_save_comment_0;
435         if (ndr_flags & NDR_SCALARS) {
436                 NDR_CHECK(ndr_pull_align(ndr, 5));
437                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->name, 16));
438                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->version_major));
439                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->version_minor));
440                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->servertype));
441                 {
442                         uint32_t _flags_save_string = ndr->flags;
443                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
444                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
445                         if (_ptr_comment) {
446                                 NDR_PULL_ALLOC(ndr, r->comment);
447                         } else {
448                                 r->comment = NULL;
449                         }
450                         ndr->flags = _flags_save_string;
451                 }
452                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
453         }
454         if (ndr_flags & NDR_BUFFERS) {
455                 {
456                         uint32_t _flags_save_string = ndr->flags;
457                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
458                         if (r->comment) {
459                                 _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
460                                 NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
461                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
462                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
463                         }
464                         ndr->flags = _flags_save_string;
465                 }
466         }
467         return NDR_ERR_SUCCESS;
468 }
469
470 _PUBLIC_ void ndr_print_rap_server_info_1(struct ndr_print *ndr, const char *name, const struct rap_server_info_1 *r)
471 {
472         ndr_print_struct(ndr, name, "rap_server_info_1");
473         ndr->depth++;
474         ndr_print_array_uint8(ndr, "name", r->name, 16);
475         ndr_print_uint8(ndr, "version_major", r->version_major);
476         ndr_print_uint8(ndr, "version_minor", r->version_minor);
477         ndr_print_uint32(ndr, "servertype", r->servertype);
478         ndr_print_ptr(ndr, "comment", r->comment);
479         ndr->depth++;
480         if (r->comment) {
481                 ndr_print_string(ndr, "comment", r->comment);
482         }
483         ndr->depth--;
484         ndr->depth--;
485 }
486
487 static enum ndr_err_code ndr_push_rap_server_info(struct ndr_push *ndr, int ndr_flags, const union rap_server_info *r)
488 {
489         if (ndr_flags & NDR_SCALARS) {
490                 int level = ndr_push_get_switch_value(ndr, r);
491                 NDR_CHECK(ndr_push_union_align(ndr, 5));
492                 switch (level) {
493                         case 0: {
494                                 NDR_CHECK(ndr_push_rap_server_info_0(ndr, NDR_SCALARS, &r->info0));
495                         break; }
496
497                         case 1: {
498                                 NDR_CHECK(ndr_push_rap_server_info_1(ndr, NDR_SCALARS, &r->info1));
499                         break; }
500
501                         default:
502                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
503                 }
504         }
505         if (ndr_flags & NDR_BUFFERS) {
506                 int level = ndr_push_get_switch_value(ndr, r);
507                 switch (level) {
508                         case 0:
509                         break;
510
511                         case 1:
512                                 NDR_CHECK(ndr_push_rap_server_info_1(ndr, NDR_BUFFERS, &r->info1));
513                         break;
514
515                         default:
516                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
517                 }
518         }
519         return NDR_ERR_SUCCESS;
520 }
521
522 static enum ndr_err_code ndr_pull_rap_server_info(struct ndr_pull *ndr, int ndr_flags, union rap_server_info *r)
523 {
524         int level;
525         level = ndr_pull_get_switch_value(ndr, r);
526         if (ndr_flags & NDR_SCALARS) {
527                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
528                 switch (level) {
529                         case 0: {
530                                 NDR_CHECK(ndr_pull_rap_server_info_0(ndr, NDR_SCALARS, &r->info0));
531                         break; }
532
533                         case 1: {
534                                 NDR_CHECK(ndr_pull_rap_server_info_1(ndr, NDR_SCALARS, &r->info1));
535                         break; }
536
537                         default:
538                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
539                 }
540         }
541         if (ndr_flags & NDR_BUFFERS) {
542                 switch (level) {
543                         case 0:
544                         break;
545
546                         case 1:
547                                 NDR_CHECK(ndr_pull_rap_server_info_1(ndr, NDR_BUFFERS, &r->info1));
548                         break;
549
550                         default:
551                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
552                 }
553         }
554         return NDR_ERR_SUCCESS;
555 }
556
557 _PUBLIC_ void ndr_print_rap_server_info(struct ndr_print *ndr, const char *name, const union rap_server_info *r)
558 {
559         int level;
560         level = ndr_print_get_switch_value(ndr, r);
561         ndr_print_union(ndr, name, level, "rap_server_info");
562         switch (level) {
563                 case 0:
564                         ndr_print_rap_server_info_0(ndr, "info0", &r->info0);
565                 break;
566
567                 case 1:
568                         ndr_print_rap_server_info_1(ndr, "info1", &r->info1);
569                 break;
570
571                 default:
572                         ndr_print_bad_level(ndr, name, level);
573         }
574 }
575
576 _PUBLIC_ enum ndr_err_code ndr_push_rap_PrintJStatusCode(struct ndr_push *ndr, int ndr_flags, enum rap_PrintJStatusCode r)
577 {
578         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
579         return NDR_ERR_SUCCESS;
580 }
581
582 _PUBLIC_ enum ndr_err_code ndr_pull_rap_PrintJStatusCode(struct ndr_pull *ndr, int ndr_flags, enum rap_PrintJStatusCode *r)
583 {
584         uint16_t v;
585         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
586         *r = v;
587         return NDR_ERR_SUCCESS;
588 }
589
590 _PUBLIC_ void ndr_print_rap_PrintJStatusCode(struct ndr_print *ndr, const char *name, enum rap_PrintJStatusCode r)
591 {
592         const char *val = NULL;
593
594         switch (r) {
595                 case PRJ_QS_QUEUED: val = "PRJ_QS_QUEUED"; break;
596                 case PRJ_QS_PAUSED: val = "PRJ_QS_PAUSED"; break;
597                 case PRJ_QS_SPOOLING: val = "PRJ_QS_SPOOLING"; break;
598                 case PRJ_QS_PRINTING: val = "PRJ_QS_PRINTING"; break;
599                 case PRJ_QS_ERROR: val = "PRJ_QS_ERROR"; break;
600         }
601         ndr_print_enum(ndr, name, "ENUM", val, r);
602 }
603
604 static enum ndr_err_code ndr_push_rap_PrintJobInfo1(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintJobInfo1 *r)
605 {
606         if (ndr_flags & NDR_SCALARS) {
607                 NDR_CHECK(ndr_push_align(ndr, 5));
608                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobID));
609                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->UserName, 21, sizeof(uint8_t), CH_DOS));
610                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Pad));
611                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->NotifyName, 16, sizeof(uint8_t), CH_DOS));
612                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->DataType, 10, sizeof(uint8_t), CH_DOS));
613                 {
614                         uint32_t _flags_save_string = ndr->flags;
615                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
616                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintParameterString));
617                         ndr->flags = _flags_save_string;
618                 }
619                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintParameterStringHigh));
620                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobPosition));
621                 NDR_CHECK(ndr_push_rap_PrintJStatusCode(ndr, NDR_SCALARS, r->JobStatus));
622                 {
623                         uint32_t _flags_save_string = ndr->flags;
624                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
625                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->JobStatusString));
626                         ndr->flags = _flags_save_string;
627                 }
628                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobStatusStringHigh));
629                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->TimeSubmitted));
630                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->JobSize));
631                 {
632                         uint32_t _flags_save_string = ndr->flags;
633                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
634                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->JobCommentString));
635                         ndr->flags = _flags_save_string;
636                 }
637                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobCommentStringHigh));
638                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
639         }
640         if (ndr_flags & NDR_BUFFERS) {
641                 {
642                         uint32_t _flags_save_string = ndr->flags;
643                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
644                         if (r->PrintParameterString) {
645                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintParameterString));
646                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintParameterString));
647                         }
648                         ndr->flags = _flags_save_string;
649                 }
650                 {
651                         uint32_t _flags_save_string = ndr->flags;
652                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
653                         if (r->JobStatusString) {
654                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->JobStatusString));
655                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->JobStatusString));
656                         }
657                         ndr->flags = _flags_save_string;
658                 }
659                 {
660                         uint32_t _flags_save_string = ndr->flags;
661                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
662                         if (r->JobCommentString) {
663                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->JobCommentString));
664                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->JobCommentString));
665                         }
666                         ndr->flags = _flags_save_string;
667                 }
668         }
669         return NDR_ERR_SUCCESS;
670 }
671
672 static enum ndr_err_code ndr_pull_rap_PrintJobInfo1(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintJobInfo1 *r)
673 {
674         uint16_t _ptr_PrintParameterString;
675         TALLOC_CTX *_mem_save_PrintParameterString_0;
676         uint16_t _ptr_JobStatusString;
677         TALLOC_CTX *_mem_save_JobStatusString_0;
678         uint16_t _ptr_JobCommentString;
679         TALLOC_CTX *_mem_save_JobCommentString_0;
680         if (ndr_flags & NDR_SCALARS) {
681                 NDR_CHECK(ndr_pull_align(ndr, 5));
682                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobID));
683                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->UserName, 21, sizeof(uint8_t), CH_DOS));
684                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Pad));
685                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->NotifyName, 16, sizeof(uint8_t), CH_DOS));
686                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->DataType, 10, sizeof(uint8_t), CH_DOS));
687                 {
688                         uint32_t _flags_save_string = ndr->flags;
689                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
690                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintParameterString));
691                         if (_ptr_PrintParameterString) {
692                                 NDR_PULL_ALLOC(ndr, r->PrintParameterString);
693                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintParameterString, _ptr_PrintParameterString));
694                         } else {
695                                 r->PrintParameterString = NULL;
696                         }
697                         ndr->flags = _flags_save_string;
698                 }
699                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintParameterStringHigh));
700                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobPosition));
701                 NDR_CHECK(ndr_pull_rap_PrintJStatusCode(ndr, NDR_SCALARS, &r->JobStatus));
702                 {
703                         uint32_t _flags_save_string = ndr->flags;
704                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
705                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_JobStatusString));
706                         if (_ptr_JobStatusString) {
707                                 NDR_PULL_ALLOC(ndr, r->JobStatusString);
708                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->JobStatusString, _ptr_JobStatusString));
709                         } else {
710                                 r->JobStatusString = NULL;
711                         }
712                         ndr->flags = _flags_save_string;
713                 }
714                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobStatusStringHigh));
715                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->TimeSubmitted));
716                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->JobSize));
717                 {
718                         uint32_t _flags_save_string = ndr->flags;
719                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
720                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_JobCommentString));
721                         if (_ptr_JobCommentString) {
722                                 NDR_PULL_ALLOC(ndr, r->JobCommentString);
723                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->JobCommentString, _ptr_JobCommentString));
724                         } else {
725                                 r->JobCommentString = NULL;
726                         }
727                         ndr->flags = _flags_save_string;
728                 }
729                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobCommentStringHigh));
730                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
731         }
732         if (ndr_flags & NDR_BUFFERS) {
733                 {
734                         uint32_t _flags_save_string = ndr->flags;
735                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
736                         if (r->PrintParameterString) {
737                                 uint32_t _relative_save_offset;
738                                 _relative_save_offset = ndr->offset;
739                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintParameterString));
740                                 _mem_save_PrintParameterString_0 = NDR_PULL_GET_MEM_CTX(ndr);
741                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintParameterString, 0);
742                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintParameterString));
743                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintParameterString_0, 0);
744                         }
745                         ndr->flags = _flags_save_string;
746                 }
747                 {
748                         uint32_t _flags_save_string = ndr->flags;
749                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
750                         if (r->JobStatusString) {
751                                 uint32_t _relative_save_offset;
752                                 _relative_save_offset = ndr->offset;
753                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->JobStatusString));
754                                 _mem_save_JobStatusString_0 = NDR_PULL_GET_MEM_CTX(ndr);
755                                 NDR_PULL_SET_MEM_CTX(ndr, r->JobStatusString, 0);
756                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->JobStatusString));
757                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_JobStatusString_0, 0);
758                         }
759                         ndr->flags = _flags_save_string;
760                 }
761                 {
762                         uint32_t _flags_save_string = ndr->flags;
763                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
764                         if (r->JobCommentString) {
765                                 uint32_t _relative_save_offset;
766                                 _relative_save_offset = ndr->offset;
767                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->JobCommentString));
768                                 _mem_save_JobCommentString_0 = NDR_PULL_GET_MEM_CTX(ndr);
769                                 NDR_PULL_SET_MEM_CTX(ndr, r->JobCommentString, 0);
770                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->JobCommentString));
771                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_JobCommentString_0, 0);
772                         }
773                         ndr->flags = _flags_save_string;
774                 }
775         }
776         return NDR_ERR_SUCCESS;
777 }
778
779 _PUBLIC_ void ndr_print_rap_PrintJobInfo1(struct ndr_print *ndr, const char *name, const struct rap_PrintJobInfo1 *r)
780 {
781         ndr_print_struct(ndr, name, "rap_PrintJobInfo1");
782         ndr->depth++;
783         ndr_print_uint16(ndr, "JobID", r->JobID);
784         ndr_print_string(ndr, "UserName", r->UserName);
785         ndr_print_uint8(ndr, "Pad", r->Pad);
786         ndr_print_string(ndr, "NotifyName", r->NotifyName);
787         ndr_print_string(ndr, "DataType", r->DataType);
788         ndr_print_ptr(ndr, "PrintParameterString", r->PrintParameterString);
789         ndr->depth++;
790         if (r->PrintParameterString) {
791                 ndr_print_string(ndr, "PrintParameterString", r->PrintParameterString);
792         }
793         ndr->depth--;
794         ndr_print_uint16(ndr, "PrintParameterStringHigh", r->PrintParameterStringHigh);
795         ndr_print_uint16(ndr, "JobPosition", r->JobPosition);
796         ndr_print_rap_PrintJStatusCode(ndr, "JobStatus", r->JobStatus);
797         ndr_print_ptr(ndr, "JobStatusString", r->JobStatusString);
798         ndr->depth++;
799         if (r->JobStatusString) {
800                 ndr_print_string(ndr, "JobStatusString", r->JobStatusString);
801         }
802         ndr->depth--;
803         ndr_print_uint16(ndr, "JobStatusStringHigh", r->JobStatusStringHigh);
804         ndr_print_time_t(ndr, "TimeSubmitted", r->TimeSubmitted);
805         ndr_print_uint32(ndr, "JobSize", r->JobSize);
806         ndr_print_ptr(ndr, "JobCommentString", r->JobCommentString);
807         ndr->depth++;
808         if (r->JobCommentString) {
809                 ndr_print_string(ndr, "JobCommentString", r->JobCommentString);
810         }
811         ndr->depth--;
812         ndr_print_uint16(ndr, "JobCommentStringHigh", r->JobCommentStringHigh);
813         ndr->depth--;
814 }
815
816 static enum ndr_err_code ndr_push_rap_PrintJobInfo2(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintJobInfo2 *r)
817 {
818         if (ndr_flags & NDR_SCALARS) {
819                 NDR_CHECK(ndr_push_align(ndr, 5));
820                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobID));
821                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Priority));
822                 {
823                         uint32_t _flags_save_string = ndr->flags;
824                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
825                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->UserName));
826                         ndr->flags = _flags_save_string;
827                 }
828                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->UserNameHigh));
829                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobPosition));
830                 NDR_CHECK(ndr_push_rap_PrintJStatusCode(ndr, NDR_SCALARS, r->JobStatus));
831                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->TimeSubmitted));
832                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->JobSize));
833                 {
834                         uint32_t _flags_save_string = ndr->flags;
835                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
836                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->JobCommentString));
837                         ndr->flags = _flags_save_string;
838                 }
839                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->JobCommentStringHigh));
840                 {
841                         uint32_t _flags_save_string = ndr->flags;
842                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
843                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DocumentName));
844                         ndr->flags = _flags_save_string;
845                 }
846                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->DocumentNameHigh));
847                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
848         }
849         if (ndr_flags & NDR_BUFFERS) {
850                 {
851                         uint32_t _flags_save_string = ndr->flags;
852                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
853                         if (r->UserName) {
854                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->UserName));
855                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->UserName));
856                         }
857                         ndr->flags = _flags_save_string;
858                 }
859                 {
860                         uint32_t _flags_save_string = ndr->flags;
861                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
862                         if (r->JobCommentString) {
863                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->JobCommentString));
864                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->JobCommentString));
865                         }
866                         ndr->flags = _flags_save_string;
867                 }
868                 {
869                         uint32_t _flags_save_string = ndr->flags;
870                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
871                         if (r->DocumentName) {
872                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DocumentName));
873                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DocumentName));
874                         }
875                         ndr->flags = _flags_save_string;
876                 }
877         }
878         return NDR_ERR_SUCCESS;
879 }
880
881 static enum ndr_err_code ndr_pull_rap_PrintJobInfo2(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintJobInfo2 *r)
882 {
883         uint16_t _ptr_UserName;
884         TALLOC_CTX *_mem_save_UserName_0;
885         uint16_t _ptr_JobCommentString;
886         TALLOC_CTX *_mem_save_JobCommentString_0;
887         uint16_t _ptr_DocumentName;
888         TALLOC_CTX *_mem_save_DocumentName_0;
889         if (ndr_flags & NDR_SCALARS) {
890                 NDR_CHECK(ndr_pull_align(ndr, 5));
891                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobID));
892                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Priority));
893                 {
894                         uint32_t _flags_save_string = ndr->flags;
895                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
896                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_UserName));
897                         if (_ptr_UserName) {
898                                 NDR_PULL_ALLOC(ndr, r->UserName);
899                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->UserName, _ptr_UserName));
900                         } else {
901                                 r->UserName = NULL;
902                         }
903                         ndr->flags = _flags_save_string;
904                 }
905                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UserNameHigh));
906                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobPosition));
907                 NDR_CHECK(ndr_pull_rap_PrintJStatusCode(ndr, NDR_SCALARS, &r->JobStatus));
908                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->TimeSubmitted));
909                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->JobSize));
910                 {
911                         uint32_t _flags_save_string = ndr->flags;
912                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
913                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_JobCommentString));
914                         if (_ptr_JobCommentString) {
915                                 NDR_PULL_ALLOC(ndr, r->JobCommentString);
916                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->JobCommentString, _ptr_JobCommentString));
917                         } else {
918                                 r->JobCommentString = NULL;
919                         }
920                         ndr->flags = _flags_save_string;
921                 }
922                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobCommentStringHigh));
923                 {
924                         uint32_t _flags_save_string = ndr->flags;
925                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
926                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DocumentName));
927                         if (_ptr_DocumentName) {
928                                 NDR_PULL_ALLOC(ndr, r->DocumentName);
929                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DocumentName, _ptr_DocumentName));
930                         } else {
931                                 r->DocumentName = NULL;
932                         }
933                         ndr->flags = _flags_save_string;
934                 }
935                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DocumentNameHigh));
936                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
937         }
938         if (ndr_flags & NDR_BUFFERS) {
939                 {
940                         uint32_t _flags_save_string = ndr->flags;
941                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
942                         if (r->UserName) {
943                                 uint32_t _relative_save_offset;
944                                 _relative_save_offset = ndr->offset;
945                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->UserName));
946                                 _mem_save_UserName_0 = NDR_PULL_GET_MEM_CTX(ndr);
947                                 NDR_PULL_SET_MEM_CTX(ndr, r->UserName, 0);
948                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->UserName));
949                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_UserName_0, 0);
950                         }
951                         ndr->flags = _flags_save_string;
952                 }
953                 {
954                         uint32_t _flags_save_string = ndr->flags;
955                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
956                         if (r->JobCommentString) {
957                                 uint32_t _relative_save_offset;
958                                 _relative_save_offset = ndr->offset;
959                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->JobCommentString));
960                                 _mem_save_JobCommentString_0 = NDR_PULL_GET_MEM_CTX(ndr);
961                                 NDR_PULL_SET_MEM_CTX(ndr, r->JobCommentString, 0);
962                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->JobCommentString));
963                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_JobCommentString_0, 0);
964                         }
965                         ndr->flags = _flags_save_string;
966                 }
967                 {
968                         uint32_t _flags_save_string = ndr->flags;
969                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
970                         if (r->DocumentName) {
971                                 uint32_t _relative_save_offset;
972                                 _relative_save_offset = ndr->offset;
973                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DocumentName));
974                                 _mem_save_DocumentName_0 = NDR_PULL_GET_MEM_CTX(ndr);
975                                 NDR_PULL_SET_MEM_CTX(ndr, r->DocumentName, 0);
976                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DocumentName));
977                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DocumentName_0, 0);
978                         }
979                         ndr->flags = _flags_save_string;
980                 }
981         }
982         return NDR_ERR_SUCCESS;
983 }
984
985 _PUBLIC_ void ndr_print_rap_PrintJobInfo2(struct ndr_print *ndr, const char *name, const struct rap_PrintJobInfo2 *r)
986 {
987         ndr_print_struct(ndr, name, "rap_PrintJobInfo2");
988         ndr->depth++;
989         ndr_print_uint16(ndr, "JobID", r->JobID);
990         ndr_print_uint16(ndr, "Priority", r->Priority);
991         ndr_print_ptr(ndr, "UserName", r->UserName);
992         ndr->depth++;
993         if (r->UserName) {
994                 ndr_print_string(ndr, "UserName", r->UserName);
995         }
996         ndr->depth--;
997         ndr_print_uint16(ndr, "UserNameHigh", r->UserNameHigh);
998         ndr_print_uint16(ndr, "JobPosition", r->JobPosition);
999         ndr_print_rap_PrintJStatusCode(ndr, "JobStatus", r->JobStatus);
1000         ndr_print_time_t(ndr, "TimeSubmitted", r->TimeSubmitted);
1001         ndr_print_uint32(ndr, "JobSize", r->JobSize);
1002         ndr_print_ptr(ndr, "JobCommentString", r->JobCommentString);
1003         ndr->depth++;
1004         if (r->JobCommentString) {
1005                 ndr_print_string(ndr, "JobCommentString", r->JobCommentString);
1006         }
1007         ndr->depth--;
1008         ndr_print_uint16(ndr, "JobCommentStringHigh", r->JobCommentStringHigh);
1009         ndr_print_ptr(ndr, "DocumentName", r->DocumentName);
1010         ndr->depth++;
1011         if (r->DocumentName) {
1012                 ndr_print_string(ndr, "DocumentName", r->DocumentName);
1013         }
1014         ndr->depth--;
1015         ndr_print_uint16(ndr, "DocumentNameHigh", r->DocumentNameHigh);
1016         ndr->depth--;
1017 }
1018
1019 _PUBLIC_ enum ndr_err_code ndr_push_rap_PrintQStatusCode(struct ndr_push *ndr, int ndr_flags, enum rap_PrintQStatusCode r)
1020 {
1021         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
1022         return NDR_ERR_SUCCESS;
1023 }
1024
1025 _PUBLIC_ enum ndr_err_code ndr_pull_rap_PrintQStatusCode(struct ndr_pull *ndr, int ndr_flags, enum rap_PrintQStatusCode *r)
1026 {
1027         uint16_t v;
1028         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
1029         *r = v;
1030         return NDR_ERR_SUCCESS;
1031 }
1032
1033 _PUBLIC_ void ndr_print_rap_PrintQStatusCode(struct ndr_print *ndr, const char *name, enum rap_PrintQStatusCode r)
1034 {
1035         const char *val = NULL;
1036
1037         switch (r) {
1038                 case PRQ_ACTIVE: val = "PRQ_ACTIVE"; break;
1039                 case PRQ_PAUSE: val = "PRQ_PAUSE"; break;
1040                 case PRQ_ERROR: val = "PRQ_ERROR"; break;
1041                 case PRQ_PENDING: val = "PRQ_PENDING"; break;
1042         }
1043         ndr_print_enum(ndr, name, "ENUM", val, r);
1044 }
1045
1046 static enum ndr_err_code ndr_push_rap_PrintQueue0(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintQueue0 *r)
1047 {
1048         if (ndr_flags & NDR_SCALARS) {
1049                 NDR_CHECK(ndr_push_align(ndr, 1));
1050                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->PrintQName, 13, sizeof(uint8_t), CH_DOS));
1051                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1052         }
1053         if (ndr_flags & NDR_BUFFERS) {
1054         }
1055         return NDR_ERR_SUCCESS;
1056 }
1057
1058 static enum ndr_err_code ndr_pull_rap_PrintQueue0(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintQueue0 *r)
1059 {
1060         if (ndr_flags & NDR_SCALARS) {
1061                 NDR_CHECK(ndr_pull_align(ndr, 1));
1062                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->PrintQName, 13, sizeof(uint8_t), CH_DOS));
1063                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1064         }
1065         if (ndr_flags & NDR_BUFFERS) {
1066         }
1067         return NDR_ERR_SUCCESS;
1068 }
1069
1070 _PUBLIC_ void ndr_print_rap_PrintQueue0(struct ndr_print *ndr, const char *name, const struct rap_PrintQueue0 *r)
1071 {
1072         ndr_print_struct(ndr, name, "rap_PrintQueue0");
1073         ndr->depth++;
1074         ndr_print_string(ndr, "PrintQName", r->PrintQName);
1075         ndr->depth--;
1076 }
1077
1078 static enum ndr_err_code ndr_push_rap_PrintQueue1(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintQueue1 *r)
1079 {
1080         if (ndr_flags & NDR_SCALARS) {
1081                 NDR_CHECK(ndr_push_align(ndr, 5));
1082                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->PrintQName, 13, sizeof(uint8_t), CH_DOS));
1083                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Pad1));
1084                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Priority));
1085                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->StartTime));
1086                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->UntilTime));
1087                 {
1088                         uint32_t _flags_save_string = ndr->flags;
1089                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1090                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->SeparatorPageFilename));
1091                         ndr->flags = _flags_save_string;
1092                 }
1093                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->SeparatorPageFilenameHigh));
1094                 {
1095                         uint32_t _flags_save_string = ndr->flags;
1096                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1097                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintProcessorDllName));
1098                         ndr->flags = _flags_save_string;
1099                 }
1100                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintProcessorDllNameHigh));
1101                 {
1102                         uint32_t _flags_save_string = ndr->flags;
1103                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1104                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintDestinationsName));
1105                         ndr->flags = _flags_save_string;
1106                 }
1107                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintDestinationsNameHigh));
1108                 {
1109                         uint32_t _flags_save_string = ndr->flags;
1110                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1111                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintParameterString));
1112                         ndr->flags = _flags_save_string;
1113                 }
1114                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintParameterStringHigh));
1115                 {
1116                         uint32_t _flags_save_string = ndr->flags;
1117                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1118                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->CommentString));
1119                         ndr->flags = _flags_save_string;
1120                 }
1121                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->CommentStringHigh));
1122                 NDR_CHECK(ndr_push_rap_PrintQStatusCode(ndr, NDR_SCALARS, r->PrintQStatus));
1123                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintJobCount));
1124                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1125         }
1126         if (ndr_flags & NDR_BUFFERS) {
1127                 {
1128                         uint32_t _flags_save_string = ndr->flags;
1129                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1130                         if (r->SeparatorPageFilename) {
1131                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->SeparatorPageFilename));
1132                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->SeparatorPageFilename));
1133                         }
1134                         ndr->flags = _flags_save_string;
1135                 }
1136                 {
1137                         uint32_t _flags_save_string = ndr->flags;
1138                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1139                         if (r->PrintProcessorDllName) {
1140                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintProcessorDllName));
1141                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintProcessorDllName));
1142                         }
1143                         ndr->flags = _flags_save_string;
1144                 }
1145                 {
1146                         uint32_t _flags_save_string = ndr->flags;
1147                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1148                         if (r->PrintDestinationsName) {
1149                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintDestinationsName));
1150                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintDestinationsName));
1151                         }
1152                         ndr->flags = _flags_save_string;
1153                 }
1154                 {
1155                         uint32_t _flags_save_string = ndr->flags;
1156                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1157                         if (r->PrintParameterString) {
1158                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintParameterString));
1159                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintParameterString));
1160                         }
1161                         ndr->flags = _flags_save_string;
1162                 }
1163                 {
1164                         uint32_t _flags_save_string = ndr->flags;
1165                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1166                         if (r->CommentString) {
1167                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->CommentString));
1168                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->CommentString));
1169                         }
1170                         ndr->flags = _flags_save_string;
1171                 }
1172         }
1173         return NDR_ERR_SUCCESS;
1174 }
1175
1176 static enum ndr_err_code ndr_pull_rap_PrintQueue1(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintQueue1 *r)
1177 {
1178         uint16_t _ptr_SeparatorPageFilename;
1179         TALLOC_CTX *_mem_save_SeparatorPageFilename_0;
1180         uint16_t _ptr_PrintProcessorDllName;
1181         TALLOC_CTX *_mem_save_PrintProcessorDllName_0;
1182         uint16_t _ptr_PrintDestinationsName;
1183         TALLOC_CTX *_mem_save_PrintDestinationsName_0;
1184         uint16_t _ptr_PrintParameterString;
1185         TALLOC_CTX *_mem_save_PrintParameterString_0;
1186         uint16_t _ptr_CommentString;
1187         TALLOC_CTX *_mem_save_CommentString_0;
1188         if (ndr_flags & NDR_SCALARS) {
1189                 NDR_CHECK(ndr_pull_align(ndr, 5));
1190                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->PrintQName, 13, sizeof(uint8_t), CH_DOS));
1191                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Pad1));
1192                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Priority));
1193                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->StartTime));
1194                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UntilTime));
1195                 {
1196                         uint32_t _flags_save_string = ndr->flags;
1197                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1198                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_SeparatorPageFilename));
1199                         if (_ptr_SeparatorPageFilename) {
1200                                 NDR_PULL_ALLOC(ndr, r->SeparatorPageFilename);
1201                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->SeparatorPageFilename, _ptr_SeparatorPageFilename));
1202                         } else {
1203                                 r->SeparatorPageFilename = NULL;
1204                         }
1205                         ndr->flags = _flags_save_string;
1206                 }
1207                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->SeparatorPageFilenameHigh));
1208                 {
1209                         uint32_t _flags_save_string = ndr->flags;
1210                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1211                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintProcessorDllName));
1212                         if (_ptr_PrintProcessorDllName) {
1213                                 NDR_PULL_ALLOC(ndr, r->PrintProcessorDllName);
1214                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintProcessorDllName, _ptr_PrintProcessorDllName));
1215                         } else {
1216                                 r->PrintProcessorDllName = NULL;
1217                         }
1218                         ndr->flags = _flags_save_string;
1219                 }
1220                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintProcessorDllNameHigh));
1221                 {
1222                         uint32_t _flags_save_string = ndr->flags;
1223                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1224                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintDestinationsName));
1225                         if (_ptr_PrintDestinationsName) {
1226                                 NDR_PULL_ALLOC(ndr, r->PrintDestinationsName);
1227                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintDestinationsName, _ptr_PrintDestinationsName));
1228                         } else {
1229                                 r->PrintDestinationsName = NULL;
1230                         }
1231                         ndr->flags = _flags_save_string;
1232                 }
1233                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintDestinationsNameHigh));
1234                 {
1235                         uint32_t _flags_save_string = ndr->flags;
1236                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1237                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintParameterString));
1238                         if (_ptr_PrintParameterString) {
1239                                 NDR_PULL_ALLOC(ndr, r->PrintParameterString);
1240                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintParameterString, _ptr_PrintParameterString));
1241                         } else {
1242                                 r->PrintParameterString = NULL;
1243                         }
1244                         ndr->flags = _flags_save_string;
1245                 }
1246                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintParameterStringHigh));
1247                 {
1248                         uint32_t _flags_save_string = ndr->flags;
1249                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1250                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_CommentString));
1251                         if (_ptr_CommentString) {
1252                                 NDR_PULL_ALLOC(ndr, r->CommentString);
1253                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->CommentString, _ptr_CommentString));
1254                         } else {
1255                                 r->CommentString = NULL;
1256                         }
1257                         ndr->flags = _flags_save_string;
1258                 }
1259                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->CommentStringHigh));
1260                 NDR_CHECK(ndr_pull_rap_PrintQStatusCode(ndr, NDR_SCALARS, &r->PrintQStatus));
1261                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintJobCount));
1262                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1263         }
1264         if (ndr_flags & NDR_BUFFERS) {
1265                 {
1266                         uint32_t _flags_save_string = ndr->flags;
1267                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1268                         if (r->SeparatorPageFilename) {
1269                                 uint32_t _relative_save_offset;
1270                                 _relative_save_offset = ndr->offset;
1271                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->SeparatorPageFilename));
1272                                 _mem_save_SeparatorPageFilename_0 = NDR_PULL_GET_MEM_CTX(ndr);
1273                                 NDR_PULL_SET_MEM_CTX(ndr, r->SeparatorPageFilename, 0);
1274                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->SeparatorPageFilename));
1275                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SeparatorPageFilename_0, 0);
1276                         }
1277                         ndr->flags = _flags_save_string;
1278                 }
1279                 {
1280                         uint32_t _flags_save_string = ndr->flags;
1281                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1282                         if (r->PrintProcessorDllName) {
1283                                 uint32_t _relative_save_offset;
1284                                 _relative_save_offset = ndr->offset;
1285                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintProcessorDllName));
1286                                 _mem_save_PrintProcessorDllName_0 = NDR_PULL_GET_MEM_CTX(ndr);
1287                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintProcessorDllName, 0);
1288                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintProcessorDllName));
1289                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintProcessorDllName_0, 0);
1290                         }
1291                         ndr->flags = _flags_save_string;
1292                 }
1293                 {
1294                         uint32_t _flags_save_string = ndr->flags;
1295                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1296                         if (r->PrintDestinationsName) {
1297                                 uint32_t _relative_save_offset;
1298                                 _relative_save_offset = ndr->offset;
1299                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintDestinationsName));
1300                                 _mem_save_PrintDestinationsName_0 = NDR_PULL_GET_MEM_CTX(ndr);
1301                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintDestinationsName, 0);
1302                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintDestinationsName));
1303                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintDestinationsName_0, 0);
1304                         }
1305                         ndr->flags = _flags_save_string;
1306                 }
1307                 {
1308                         uint32_t _flags_save_string = ndr->flags;
1309                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1310                         if (r->PrintParameterString) {
1311                                 uint32_t _relative_save_offset;
1312                                 _relative_save_offset = ndr->offset;
1313                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintParameterString));
1314                                 _mem_save_PrintParameterString_0 = NDR_PULL_GET_MEM_CTX(ndr);
1315                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintParameterString, 0);
1316                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintParameterString));
1317                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintParameterString_0, 0);
1318                         }
1319                         ndr->flags = _flags_save_string;
1320                 }
1321                 {
1322                         uint32_t _flags_save_string = ndr->flags;
1323                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1324                         if (r->CommentString) {
1325                                 uint32_t _relative_save_offset;
1326                                 _relative_save_offset = ndr->offset;
1327                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->CommentString));
1328                                 _mem_save_CommentString_0 = NDR_PULL_GET_MEM_CTX(ndr);
1329                                 NDR_PULL_SET_MEM_CTX(ndr, r->CommentString, 0);
1330                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->CommentString));
1331                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_CommentString_0, 0);
1332                         }
1333                         ndr->flags = _flags_save_string;
1334                 }
1335         }
1336         return NDR_ERR_SUCCESS;
1337 }
1338
1339 _PUBLIC_ void ndr_print_rap_PrintQueue1(struct ndr_print *ndr, const char *name, const struct rap_PrintQueue1 *r)
1340 {
1341         ndr_print_struct(ndr, name, "rap_PrintQueue1");
1342         ndr->depth++;
1343         ndr_print_string(ndr, "PrintQName", r->PrintQName);
1344         ndr_print_uint8(ndr, "Pad1", r->Pad1);
1345         ndr_print_uint16(ndr, "Priority", r->Priority);
1346         ndr_print_uint16(ndr, "StartTime", r->StartTime);
1347         ndr_print_uint16(ndr, "UntilTime", r->UntilTime);
1348         ndr_print_ptr(ndr, "SeparatorPageFilename", r->SeparatorPageFilename);
1349         ndr->depth++;
1350         if (r->SeparatorPageFilename) {
1351                 ndr_print_string(ndr, "SeparatorPageFilename", r->SeparatorPageFilename);
1352         }
1353         ndr->depth--;
1354         ndr_print_uint16(ndr, "SeparatorPageFilenameHigh", r->SeparatorPageFilenameHigh);
1355         ndr_print_ptr(ndr, "PrintProcessorDllName", r->PrintProcessorDllName);
1356         ndr->depth++;
1357         if (r->PrintProcessorDllName) {
1358                 ndr_print_string(ndr, "PrintProcessorDllName", r->PrintProcessorDllName);
1359         }
1360         ndr->depth--;
1361         ndr_print_uint16(ndr, "PrintProcessorDllNameHigh", r->PrintProcessorDllNameHigh);
1362         ndr_print_ptr(ndr, "PrintDestinationsName", r->PrintDestinationsName);
1363         ndr->depth++;
1364         if (r->PrintDestinationsName) {
1365                 ndr_print_string(ndr, "PrintDestinationsName", r->PrintDestinationsName);
1366         }
1367         ndr->depth--;
1368         ndr_print_uint16(ndr, "PrintDestinationsNameHigh", r->PrintDestinationsNameHigh);
1369         ndr_print_ptr(ndr, "PrintParameterString", r->PrintParameterString);
1370         ndr->depth++;
1371         if (r->PrintParameterString) {
1372                 ndr_print_string(ndr, "PrintParameterString", r->PrintParameterString);
1373         }
1374         ndr->depth--;
1375         ndr_print_uint16(ndr, "PrintParameterStringHigh", r->PrintParameterStringHigh);
1376         ndr_print_ptr(ndr, "CommentString", r->CommentString);
1377         ndr->depth++;
1378         if (r->CommentString) {
1379                 ndr_print_string(ndr, "CommentString", r->CommentString);
1380         }
1381         ndr->depth--;
1382         ndr_print_uint16(ndr, "CommentStringHigh", r->CommentStringHigh);
1383         ndr_print_rap_PrintQStatusCode(ndr, "PrintQStatus", r->PrintQStatus);
1384         ndr_print_uint16(ndr, "PrintJobCount", r->PrintJobCount);
1385         ndr->depth--;
1386 }
1387
1388 static enum ndr_err_code ndr_push_rap_PrintQueue2(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintQueue2 *r)
1389 {
1390         uint32_t cntr_job_0;
1391         if (ndr_flags & NDR_SCALARS) {
1392                 NDR_CHECK(ndr_push_align(ndr, 5));
1393                 NDR_CHECK(ndr_push_rap_PrintQueue1(ndr, NDR_SCALARS, &r->queue));
1394                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1395                         NDR_CHECK(ndr_push_rap_PrintJobInfo1(ndr, NDR_SCALARS, &r->job[cntr_job_0]));
1396                 }
1397                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1398         }
1399         if (ndr_flags & NDR_BUFFERS) {
1400                 NDR_CHECK(ndr_push_rap_PrintQueue1(ndr, NDR_BUFFERS, &r->queue));
1401                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1402                         NDR_CHECK(ndr_push_rap_PrintJobInfo1(ndr, NDR_BUFFERS, &r->job[cntr_job_0]));
1403                 }
1404         }
1405         return NDR_ERR_SUCCESS;
1406 }
1407
1408 static enum ndr_err_code ndr_pull_rap_PrintQueue2(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintQueue2 *r)
1409 {
1410         uint32_t cntr_job_0;
1411         TALLOC_CTX *_mem_save_job_0;
1412         if (ndr_flags & NDR_SCALARS) {
1413                 NDR_CHECK(ndr_pull_align(ndr, 5));
1414                 NDR_CHECK(ndr_pull_rap_PrintQueue1(ndr, NDR_SCALARS, &r->queue));
1415                 NDR_PULL_ALLOC_N(ndr, r->job, r->queue.PrintJobCount);
1416                 _mem_save_job_0 = NDR_PULL_GET_MEM_CTX(ndr);
1417                 NDR_PULL_SET_MEM_CTX(ndr, r->job, 0);
1418                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1419                         NDR_CHECK(ndr_pull_rap_PrintJobInfo1(ndr, NDR_SCALARS, &r->job[cntr_job_0]));
1420                 }
1421                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_job_0, 0);
1422                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1423         }
1424         if (ndr_flags & NDR_BUFFERS) {
1425                 NDR_CHECK(ndr_pull_rap_PrintQueue1(ndr, NDR_BUFFERS, &r->queue));
1426                 _mem_save_job_0 = NDR_PULL_GET_MEM_CTX(ndr);
1427                 NDR_PULL_SET_MEM_CTX(ndr, r->job, 0);
1428                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1429                         NDR_CHECK(ndr_pull_rap_PrintJobInfo1(ndr, NDR_BUFFERS, &r->job[cntr_job_0]));
1430                 }
1431                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_job_0, 0);
1432         }
1433         return NDR_ERR_SUCCESS;
1434 }
1435
1436 _PUBLIC_ void ndr_print_rap_PrintQueue2(struct ndr_print *ndr, const char *name, const struct rap_PrintQueue2 *r)
1437 {
1438         uint32_t cntr_job_0;
1439         ndr_print_struct(ndr, name, "rap_PrintQueue2");
1440         ndr->depth++;
1441         ndr_print_rap_PrintQueue1(ndr, "queue", &r->queue);
1442         ndr->print(ndr, "%s: ARRAY(%d)", "job", (int)r->queue.PrintJobCount);
1443         ndr->depth++;
1444         for (cntr_job_0=0;cntr_job_0<r->queue.PrintJobCount;cntr_job_0++) {
1445                 char *idx_0=NULL;
1446                 if (asprintf(&idx_0, "[%d]", cntr_job_0) != -1) {
1447                         ndr_print_rap_PrintJobInfo1(ndr, "job", &r->job[cntr_job_0]);
1448                         free(idx_0);
1449                 }
1450         }
1451         ndr->depth--;
1452         ndr->depth--;
1453 }
1454
1455 _PUBLIC_ enum ndr_err_code ndr_push_rap_PrintQueue3(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintQueue3 *r)
1456 {
1457         if (ndr_flags & NDR_SCALARS) {
1458                 NDR_CHECK(ndr_push_align(ndr, 5));
1459                 {
1460                         uint32_t _flags_save_string = ndr->flags;
1461                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1462                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintQueueName));
1463                         ndr->flags = _flags_save_string;
1464                 }
1465                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintQueueNameHigh));
1466                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Priority));
1467                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->StartTime));
1468                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->UntilTime));
1469                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Pad));
1470                 {
1471                         uint32_t _flags_save_string = ndr->flags;
1472                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1473                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->SeparatorPageFilename));
1474                         ndr->flags = _flags_save_string;
1475                 }
1476                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->SeparatorPageFilenameHigh));
1477                 {
1478                         uint32_t _flags_save_string = ndr->flags;
1479                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1480                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintProcessorDllName));
1481                         ndr->flags = _flags_save_string;
1482                 }
1483                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintProcessorDllNameHigh));
1484                 {
1485                         uint32_t _flags_save_string = ndr->flags;
1486                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1487                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintParameterString));
1488                         ndr->flags = _flags_save_string;
1489                 }
1490                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintParameterStringHigh));
1491                 {
1492                         uint32_t _flags_save_string = ndr->flags;
1493                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1494                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->CommentString));
1495                         ndr->flags = _flags_save_string;
1496                 }
1497                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->CommentStringHigh));
1498                 NDR_CHECK(ndr_push_rap_PrintQStatusCode(ndr, NDR_SCALARS, r->PrintQStatus));
1499                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintJobCount));
1500                 {
1501                         uint32_t _flags_save_string = ndr->flags;
1502                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1503                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->Printers));
1504                         ndr->flags = _flags_save_string;
1505                 }
1506                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintersHigh));
1507                 {
1508                         uint32_t _flags_save_string = ndr->flags;
1509                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1510                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DriverName));
1511                         ndr->flags = _flags_save_string;
1512                 }
1513                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->DriverNameHigh));
1514                 {
1515                         uint32_t _flags_save_string = ndr->flags;
1516                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1517                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintDriverData));
1518                         ndr->flags = _flags_save_string;
1519                 }
1520                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintDriverDataHigh));
1521                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1522         }
1523         if (ndr_flags & NDR_BUFFERS) {
1524                 {
1525                         uint32_t _flags_save_string = ndr->flags;
1526                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1527                         if (r->PrintQueueName) {
1528                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintQueueName));
1529                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintQueueName));
1530                         }
1531                         ndr->flags = _flags_save_string;
1532                 }
1533                 {
1534                         uint32_t _flags_save_string = ndr->flags;
1535                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1536                         if (r->SeparatorPageFilename) {
1537                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->SeparatorPageFilename));
1538                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->SeparatorPageFilename));
1539                         }
1540                         ndr->flags = _flags_save_string;
1541                 }
1542                 {
1543                         uint32_t _flags_save_string = ndr->flags;
1544                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1545                         if (r->PrintProcessorDllName) {
1546                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintProcessorDllName));
1547                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintProcessorDllName));
1548                         }
1549                         ndr->flags = _flags_save_string;
1550                 }
1551                 {
1552                         uint32_t _flags_save_string = ndr->flags;
1553                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1554                         if (r->PrintParameterString) {
1555                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintParameterString));
1556                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintParameterString));
1557                         }
1558                         ndr->flags = _flags_save_string;
1559                 }
1560                 {
1561                         uint32_t _flags_save_string = ndr->flags;
1562                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1563                         if (r->CommentString) {
1564                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->CommentString));
1565                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->CommentString));
1566                         }
1567                         ndr->flags = _flags_save_string;
1568                 }
1569                 {
1570                         uint32_t _flags_save_string = ndr->flags;
1571                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1572                         if (r->Printers) {
1573                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->Printers));
1574                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Printers));
1575                         }
1576                         ndr->flags = _flags_save_string;
1577                 }
1578                 {
1579                         uint32_t _flags_save_string = ndr->flags;
1580                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1581                         if (r->DriverName) {
1582                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DriverName));
1583                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DriverName));
1584                         }
1585                         ndr->flags = _flags_save_string;
1586                 }
1587                 {
1588                         uint32_t _flags_save_string = ndr->flags;
1589                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1590                         if (r->PrintDriverData) {
1591                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintDriverData));
1592                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintDriverData));
1593                         }
1594                         ndr->flags = _flags_save_string;
1595                 }
1596         }
1597         return NDR_ERR_SUCCESS;
1598 }
1599
1600 _PUBLIC_ enum ndr_err_code ndr_pull_rap_PrintQueue3(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintQueue3 *r)
1601 {
1602         uint16_t _ptr_PrintQueueName;
1603         TALLOC_CTX *_mem_save_PrintQueueName_0;
1604         uint16_t _ptr_SeparatorPageFilename;
1605         TALLOC_CTX *_mem_save_SeparatorPageFilename_0;
1606         uint16_t _ptr_PrintProcessorDllName;
1607         TALLOC_CTX *_mem_save_PrintProcessorDllName_0;
1608         uint16_t _ptr_PrintParameterString;
1609         TALLOC_CTX *_mem_save_PrintParameterString_0;
1610         uint16_t _ptr_CommentString;
1611         TALLOC_CTX *_mem_save_CommentString_0;
1612         uint16_t _ptr_Printers;
1613         TALLOC_CTX *_mem_save_Printers_0;
1614         uint16_t _ptr_DriverName;
1615         TALLOC_CTX *_mem_save_DriverName_0;
1616         uint16_t _ptr_PrintDriverData;
1617         TALLOC_CTX *_mem_save_PrintDriverData_0;
1618         if (ndr_flags & NDR_SCALARS) {
1619                 NDR_CHECK(ndr_pull_align(ndr, 5));
1620                 {
1621                         uint32_t _flags_save_string = ndr->flags;
1622                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1623                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintQueueName));
1624                         if (_ptr_PrintQueueName) {
1625                                 NDR_PULL_ALLOC(ndr, r->PrintQueueName);
1626                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintQueueName, _ptr_PrintQueueName));
1627                         } else {
1628                                 r->PrintQueueName = NULL;
1629                         }
1630                         ndr->flags = _flags_save_string;
1631                 }
1632                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintQueueNameHigh));
1633                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Priority));
1634                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->StartTime));
1635                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UntilTime));
1636                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Pad));
1637                 {
1638                         uint32_t _flags_save_string = ndr->flags;
1639                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1640                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_SeparatorPageFilename));
1641                         if (_ptr_SeparatorPageFilename) {
1642                                 NDR_PULL_ALLOC(ndr, r->SeparatorPageFilename);
1643                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->SeparatorPageFilename, _ptr_SeparatorPageFilename));
1644                         } else {
1645                                 r->SeparatorPageFilename = NULL;
1646                         }
1647                         ndr->flags = _flags_save_string;
1648                 }
1649                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->SeparatorPageFilenameHigh));
1650                 {
1651                         uint32_t _flags_save_string = ndr->flags;
1652                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1653                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintProcessorDllName));
1654                         if (_ptr_PrintProcessorDllName) {
1655                                 NDR_PULL_ALLOC(ndr, r->PrintProcessorDllName);
1656                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintProcessorDllName, _ptr_PrintProcessorDllName));
1657                         } else {
1658                                 r->PrintProcessorDllName = NULL;
1659                         }
1660                         ndr->flags = _flags_save_string;
1661                 }
1662                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintProcessorDllNameHigh));
1663                 {
1664                         uint32_t _flags_save_string = ndr->flags;
1665                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1666                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintParameterString));
1667                         if (_ptr_PrintParameterString) {
1668                                 NDR_PULL_ALLOC(ndr, r->PrintParameterString);
1669                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintParameterString, _ptr_PrintParameterString));
1670                         } else {
1671                                 r->PrintParameterString = NULL;
1672                         }
1673                         ndr->flags = _flags_save_string;
1674                 }
1675                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintParameterStringHigh));
1676                 {
1677                         uint32_t _flags_save_string = ndr->flags;
1678                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1679                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_CommentString));
1680                         if (_ptr_CommentString) {
1681                                 NDR_PULL_ALLOC(ndr, r->CommentString);
1682                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->CommentString, _ptr_CommentString));
1683                         } else {
1684                                 r->CommentString = NULL;
1685                         }
1686                         ndr->flags = _flags_save_string;
1687                 }
1688                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->CommentStringHigh));
1689                 NDR_CHECK(ndr_pull_rap_PrintQStatusCode(ndr, NDR_SCALARS, &r->PrintQStatus));
1690                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintJobCount));
1691                 {
1692                         uint32_t _flags_save_string = ndr->flags;
1693                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1694                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_Printers));
1695                         if (_ptr_Printers) {
1696                                 NDR_PULL_ALLOC(ndr, r->Printers);
1697                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->Printers, _ptr_Printers));
1698                         } else {
1699                                 r->Printers = NULL;
1700                         }
1701                         ndr->flags = _flags_save_string;
1702                 }
1703                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintersHigh));
1704                 {
1705                         uint32_t _flags_save_string = ndr->flags;
1706                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1707                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DriverName));
1708                         if (_ptr_DriverName) {
1709                                 NDR_PULL_ALLOC(ndr, r->DriverName);
1710                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DriverName, _ptr_DriverName));
1711                         } else {
1712                                 r->DriverName = NULL;
1713                         }
1714                         ndr->flags = _flags_save_string;
1715                 }
1716                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DriverNameHigh));
1717                 {
1718                         uint32_t _flags_save_string = ndr->flags;
1719                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1720                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintDriverData));
1721                         if (_ptr_PrintDriverData) {
1722                                 NDR_PULL_ALLOC(ndr, r->PrintDriverData);
1723                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintDriverData, _ptr_PrintDriverData));
1724                         } else {
1725                                 r->PrintDriverData = NULL;
1726                         }
1727                         ndr->flags = _flags_save_string;
1728                 }
1729                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintDriverDataHigh));
1730                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1731         }
1732         if (ndr_flags & NDR_BUFFERS) {
1733                 {
1734                         uint32_t _flags_save_string = ndr->flags;
1735                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1736                         if (r->PrintQueueName) {
1737                                 uint32_t _relative_save_offset;
1738                                 _relative_save_offset = ndr->offset;
1739                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintQueueName));
1740                                 _mem_save_PrintQueueName_0 = NDR_PULL_GET_MEM_CTX(ndr);
1741                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintQueueName, 0);
1742                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintQueueName));
1743                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintQueueName_0, 0);
1744                         }
1745                         ndr->flags = _flags_save_string;
1746                 }
1747                 {
1748                         uint32_t _flags_save_string = ndr->flags;
1749                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1750                         if (r->SeparatorPageFilename) {
1751                                 uint32_t _relative_save_offset;
1752                                 _relative_save_offset = ndr->offset;
1753                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->SeparatorPageFilename));
1754                                 _mem_save_SeparatorPageFilename_0 = NDR_PULL_GET_MEM_CTX(ndr);
1755                                 NDR_PULL_SET_MEM_CTX(ndr, r->SeparatorPageFilename, 0);
1756                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->SeparatorPageFilename));
1757                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SeparatorPageFilename_0, 0);
1758                         }
1759                         ndr->flags = _flags_save_string;
1760                 }
1761                 {
1762                         uint32_t _flags_save_string = ndr->flags;
1763                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1764                         if (r->PrintProcessorDllName) {
1765                                 uint32_t _relative_save_offset;
1766                                 _relative_save_offset = ndr->offset;
1767                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintProcessorDllName));
1768                                 _mem_save_PrintProcessorDllName_0 = NDR_PULL_GET_MEM_CTX(ndr);
1769                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintProcessorDllName, 0);
1770                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintProcessorDllName));
1771                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintProcessorDllName_0, 0);
1772                         }
1773                         ndr->flags = _flags_save_string;
1774                 }
1775                 {
1776                         uint32_t _flags_save_string = ndr->flags;
1777                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1778                         if (r->PrintParameterString) {
1779                                 uint32_t _relative_save_offset;
1780                                 _relative_save_offset = ndr->offset;
1781                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintParameterString));
1782                                 _mem_save_PrintParameterString_0 = NDR_PULL_GET_MEM_CTX(ndr);
1783                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintParameterString, 0);
1784                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintParameterString));
1785                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintParameterString_0, 0);
1786                         }
1787                         ndr->flags = _flags_save_string;
1788                 }
1789                 {
1790                         uint32_t _flags_save_string = ndr->flags;
1791                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1792                         if (r->CommentString) {
1793                                 uint32_t _relative_save_offset;
1794                                 _relative_save_offset = ndr->offset;
1795                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->CommentString));
1796                                 _mem_save_CommentString_0 = NDR_PULL_GET_MEM_CTX(ndr);
1797                                 NDR_PULL_SET_MEM_CTX(ndr, r->CommentString, 0);
1798                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->CommentString));
1799                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_CommentString_0, 0);
1800                         }
1801                         ndr->flags = _flags_save_string;
1802                 }
1803                 {
1804                         uint32_t _flags_save_string = ndr->flags;
1805                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1806                         if (r->Printers) {
1807                                 uint32_t _relative_save_offset;
1808                                 _relative_save_offset = ndr->offset;
1809                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->Printers));
1810                                 _mem_save_Printers_0 = NDR_PULL_GET_MEM_CTX(ndr);
1811                                 NDR_PULL_SET_MEM_CTX(ndr, r->Printers, 0);
1812                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Printers));
1813                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Printers_0, 0);
1814                         }
1815                         ndr->flags = _flags_save_string;
1816                 }
1817                 {
1818                         uint32_t _flags_save_string = ndr->flags;
1819                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1820                         if (r->DriverName) {
1821                                 uint32_t _relative_save_offset;
1822                                 _relative_save_offset = ndr->offset;
1823                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DriverName));
1824                                 _mem_save_DriverName_0 = NDR_PULL_GET_MEM_CTX(ndr);
1825                                 NDR_PULL_SET_MEM_CTX(ndr, r->DriverName, 0);
1826                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DriverName));
1827                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DriverName_0, 0);
1828                         }
1829                         ndr->flags = _flags_save_string;
1830                 }
1831                 {
1832                         uint32_t _flags_save_string = ndr->flags;
1833                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1834                         if (r->PrintDriverData) {
1835                                 uint32_t _relative_save_offset;
1836                                 _relative_save_offset = ndr->offset;
1837                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintDriverData));
1838                                 _mem_save_PrintDriverData_0 = NDR_PULL_GET_MEM_CTX(ndr);
1839                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintDriverData, 0);
1840                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintDriverData));
1841                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintDriverData_0, 0);
1842                         }
1843                         ndr->flags = _flags_save_string;
1844                 }
1845         }
1846         return NDR_ERR_SUCCESS;
1847 }
1848
1849 _PUBLIC_ void ndr_print_rap_PrintQueue3(struct ndr_print *ndr, const char *name, const struct rap_PrintQueue3 *r)
1850 {
1851         ndr_print_struct(ndr, name, "rap_PrintQueue3");
1852         ndr->depth++;
1853         ndr_print_ptr(ndr, "PrintQueueName", r->PrintQueueName);
1854         ndr->depth++;
1855         if (r->PrintQueueName) {
1856                 ndr_print_string(ndr, "PrintQueueName", r->PrintQueueName);
1857         }
1858         ndr->depth--;
1859         ndr_print_uint16(ndr, "PrintQueueNameHigh", r->PrintQueueNameHigh);
1860         ndr_print_uint16(ndr, "Priority", r->Priority);
1861         ndr_print_uint16(ndr, "StartTime", r->StartTime);
1862         ndr_print_uint16(ndr, "UntilTime", r->UntilTime);
1863         ndr_print_uint16(ndr, "Pad", r->Pad);
1864         ndr_print_ptr(ndr, "SeparatorPageFilename", r->SeparatorPageFilename);
1865         ndr->depth++;
1866         if (r->SeparatorPageFilename) {
1867                 ndr_print_string(ndr, "SeparatorPageFilename", r->SeparatorPageFilename);
1868         }
1869         ndr->depth--;
1870         ndr_print_uint16(ndr, "SeparatorPageFilenameHigh", r->SeparatorPageFilenameHigh);
1871         ndr_print_ptr(ndr, "PrintProcessorDllName", r->PrintProcessorDllName);
1872         ndr->depth++;
1873         if (r->PrintProcessorDllName) {
1874                 ndr_print_string(ndr, "PrintProcessorDllName", r->PrintProcessorDllName);
1875         }
1876         ndr->depth--;
1877         ndr_print_uint16(ndr, "PrintProcessorDllNameHigh", r->PrintProcessorDllNameHigh);
1878         ndr_print_ptr(ndr, "PrintParameterString", r->PrintParameterString);
1879         ndr->depth++;
1880         if (r->PrintParameterString) {
1881                 ndr_print_string(ndr, "PrintParameterString", r->PrintParameterString);
1882         }
1883         ndr->depth--;
1884         ndr_print_uint16(ndr, "PrintParameterStringHigh", r->PrintParameterStringHigh);
1885         ndr_print_ptr(ndr, "CommentString", r->CommentString);
1886         ndr->depth++;
1887         if (r->CommentString) {
1888                 ndr_print_string(ndr, "CommentString", r->CommentString);
1889         }
1890         ndr->depth--;
1891         ndr_print_uint16(ndr, "CommentStringHigh", r->CommentStringHigh);
1892         ndr_print_rap_PrintQStatusCode(ndr, "PrintQStatus", r->PrintQStatus);
1893         ndr_print_uint16(ndr, "PrintJobCount", r->PrintJobCount);
1894         ndr_print_ptr(ndr, "Printers", r->Printers);
1895         ndr->depth++;
1896         if (r->Printers) {
1897                 ndr_print_string(ndr, "Printers", r->Printers);
1898         }
1899         ndr->depth--;
1900         ndr_print_uint16(ndr, "PrintersHigh", r->PrintersHigh);
1901         ndr_print_ptr(ndr, "DriverName", r->DriverName);
1902         ndr->depth++;
1903         if (r->DriverName) {
1904                 ndr_print_string(ndr, "DriverName", r->DriverName);
1905         }
1906         ndr->depth--;
1907         ndr_print_uint16(ndr, "DriverNameHigh", r->DriverNameHigh);
1908         ndr_print_ptr(ndr, "PrintDriverData", r->PrintDriverData);
1909         ndr->depth++;
1910         if (r->PrintDriverData) {
1911                 ndr_print_string(ndr, "PrintDriverData", r->PrintDriverData);
1912         }
1913         ndr->depth--;
1914         ndr_print_uint16(ndr, "PrintDriverDataHigh", r->PrintDriverDataHigh);
1915         ndr->depth--;
1916 }
1917
1918 static enum ndr_err_code ndr_push_rap_PrintQueue4(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintQueue4 *r)
1919 {
1920         uint32_t cntr_job_0;
1921         if (ndr_flags & NDR_SCALARS) {
1922                 NDR_CHECK(ndr_push_align(ndr, 5));
1923                 NDR_CHECK(ndr_push_rap_PrintQueue3(ndr, NDR_SCALARS, &r->queue));
1924                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1925                         NDR_CHECK(ndr_push_rap_PrintJobInfo2(ndr, NDR_SCALARS, &r->job[cntr_job_0]));
1926                 }
1927                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1928         }
1929         if (ndr_flags & NDR_BUFFERS) {
1930                 NDR_CHECK(ndr_push_rap_PrintQueue3(ndr, NDR_BUFFERS, &r->queue));
1931                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1932                         NDR_CHECK(ndr_push_rap_PrintJobInfo2(ndr, NDR_BUFFERS, &r->job[cntr_job_0]));
1933                 }
1934         }
1935         return NDR_ERR_SUCCESS;
1936 }
1937
1938 static enum ndr_err_code ndr_pull_rap_PrintQueue4(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintQueue4 *r)
1939 {
1940         uint32_t cntr_job_0;
1941         TALLOC_CTX *_mem_save_job_0;
1942         if (ndr_flags & NDR_SCALARS) {
1943                 NDR_CHECK(ndr_pull_align(ndr, 5));
1944                 NDR_CHECK(ndr_pull_rap_PrintQueue3(ndr, NDR_SCALARS, &r->queue));
1945                 NDR_PULL_ALLOC_N(ndr, r->job, r->queue.PrintJobCount);
1946                 _mem_save_job_0 = NDR_PULL_GET_MEM_CTX(ndr);
1947                 NDR_PULL_SET_MEM_CTX(ndr, r->job, 0);
1948                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1949                         NDR_CHECK(ndr_pull_rap_PrintJobInfo2(ndr, NDR_SCALARS, &r->job[cntr_job_0]));
1950                 }
1951                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_job_0, 0);
1952                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1953         }
1954         if (ndr_flags & NDR_BUFFERS) {
1955                 NDR_CHECK(ndr_pull_rap_PrintQueue3(ndr, NDR_BUFFERS, &r->queue));
1956                 _mem_save_job_0 = NDR_PULL_GET_MEM_CTX(ndr);
1957                 NDR_PULL_SET_MEM_CTX(ndr, r->job, 0);
1958                 for (cntr_job_0 = 0; cntr_job_0 < r->queue.PrintJobCount; cntr_job_0++) {
1959                         NDR_CHECK(ndr_pull_rap_PrintJobInfo2(ndr, NDR_BUFFERS, &r->job[cntr_job_0]));
1960                 }
1961                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_job_0, 0);
1962         }
1963         return NDR_ERR_SUCCESS;
1964 }
1965
1966 _PUBLIC_ void ndr_print_rap_PrintQueue4(struct ndr_print *ndr, const char *name, const struct rap_PrintQueue4 *r)
1967 {
1968         uint32_t cntr_job_0;
1969         ndr_print_struct(ndr, name, "rap_PrintQueue4");
1970         ndr->depth++;
1971         ndr_print_rap_PrintQueue3(ndr, "queue", &r->queue);
1972         ndr->print(ndr, "%s: ARRAY(%d)", "job", (int)r->queue.PrintJobCount);
1973         ndr->depth++;
1974         for (cntr_job_0=0;cntr_job_0<r->queue.PrintJobCount;cntr_job_0++) {
1975                 char *idx_0=NULL;
1976                 if (asprintf(&idx_0, "[%d]", cntr_job_0) != -1) {
1977                         ndr_print_rap_PrintJobInfo2(ndr, "job", &r->job[cntr_job_0]);
1978                         free(idx_0);
1979                 }
1980         }
1981         ndr->depth--;
1982         ndr->depth--;
1983 }
1984
1985 static enum ndr_err_code ndr_push_rap_PrintQueue5(struct ndr_push *ndr, int ndr_flags, const struct rap_PrintQueue5 *r)
1986 {
1987         if (ndr_flags & NDR_SCALARS) {
1988                 NDR_CHECK(ndr_push_align(ndr, 5));
1989                 {
1990                         uint32_t _flags_save_string = ndr->flags;
1991                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
1992                         NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->PrintQueueName));
1993                         ndr->flags = _flags_save_string;
1994                 }
1995                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->PrintQueueNameHigh));
1996                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1997         }
1998         if (ndr_flags & NDR_BUFFERS) {
1999                 {
2000                         uint32_t _flags_save_string = ndr->flags;
2001                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2002                         if (r->PrintQueueName) {
2003                                 NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->PrintQueueName));
2004                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->PrintQueueName));
2005                         }
2006                         ndr->flags = _flags_save_string;
2007                 }
2008         }
2009         return NDR_ERR_SUCCESS;
2010 }
2011
2012 static enum ndr_err_code ndr_pull_rap_PrintQueue5(struct ndr_pull *ndr, int ndr_flags, struct rap_PrintQueue5 *r)
2013 {
2014         uint16_t _ptr_PrintQueueName;
2015         TALLOC_CTX *_mem_save_PrintQueueName_0;
2016         if (ndr_flags & NDR_SCALARS) {
2017                 NDR_CHECK(ndr_pull_align(ndr, 5));
2018                 {
2019                         uint32_t _flags_save_string = ndr->flags;
2020                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2021                         NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_PrintQueueName));
2022                         if (_ptr_PrintQueueName) {
2023                                 NDR_PULL_ALLOC(ndr, r->PrintQueueName);
2024                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->PrintQueueName, _ptr_PrintQueueName));
2025                         } else {
2026                                 r->PrintQueueName = NULL;
2027                         }
2028                         ndr->flags = _flags_save_string;
2029                 }
2030                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->PrintQueueNameHigh));
2031                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2032         }
2033         if (ndr_flags & NDR_BUFFERS) {
2034                 {
2035                         uint32_t _flags_save_string = ndr->flags;
2036                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2037                         if (r->PrintQueueName) {
2038                                 uint32_t _relative_save_offset;
2039                                 _relative_save_offset = ndr->offset;
2040                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->PrintQueueName));
2041                                 _mem_save_PrintQueueName_0 = NDR_PULL_GET_MEM_CTX(ndr);
2042                                 NDR_PULL_SET_MEM_CTX(ndr, r->PrintQueueName, 0);
2043                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->PrintQueueName));
2044                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_PrintQueueName_0, 0);
2045                         }
2046                         ndr->flags = _flags_save_string;
2047                 }
2048         }
2049         return NDR_ERR_SUCCESS;
2050 }
2051
2052 _PUBLIC_ void ndr_print_rap_PrintQueue5(struct ndr_print *ndr, const char *name, const struct rap_PrintQueue5 *r)
2053 {
2054         ndr_print_struct(ndr, name, "rap_PrintQueue5");
2055         ndr->depth++;
2056         ndr_print_ptr(ndr, "PrintQueueName", r->PrintQueueName);
2057         ndr->depth++;
2058         if (r->PrintQueueName) {
2059                 ndr_print_string(ndr, "PrintQueueName", r->PrintQueueName);
2060         }
2061         ndr->depth--;
2062         ndr_print_uint16(ndr, "PrintQueueNameHigh", r->PrintQueueNameHigh);
2063         ndr->depth--;
2064 }
2065
2066 _PUBLIC_ enum ndr_err_code ndr_push_rap_printq_info(struct ndr_push *ndr, int ndr_flags, const union rap_printq_info *r)
2067 {
2068         if (ndr_flags & NDR_SCALARS) {
2069                 int level = ndr_push_get_switch_value(ndr, r);
2070                 NDR_CHECK(ndr_push_union_align(ndr, 5));
2071                 switch (level) {
2072                         case 0: {
2073                                 NDR_CHECK(ndr_push_rap_PrintQueue0(ndr, NDR_SCALARS, &r->info0));
2074                         break; }
2075
2076                         case 1: {
2077                                 NDR_CHECK(ndr_push_rap_PrintQueue1(ndr, NDR_SCALARS, &r->info1));
2078                         break; }
2079
2080                         case 2: {
2081                                 NDR_CHECK(ndr_push_rap_PrintQueue2(ndr, NDR_SCALARS, &r->info2));
2082                         break; }
2083
2084                         case 3: {
2085                                 NDR_CHECK(ndr_push_rap_PrintQueue3(ndr, NDR_SCALARS, &r->info3));
2086                         break; }
2087
2088                         case 4: {
2089                                 NDR_CHECK(ndr_push_rap_PrintQueue4(ndr, NDR_SCALARS, &r->info4));
2090                         break; }
2091
2092                         case 5: {
2093                                 NDR_CHECK(ndr_push_rap_PrintQueue5(ndr, NDR_SCALARS, &r->info5));
2094                         break; }
2095
2096                         default:
2097                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2098                 }
2099         }
2100         if (ndr_flags & NDR_BUFFERS) {
2101                 int level = ndr_push_get_switch_value(ndr, r);
2102                 switch (level) {
2103                         case 0:
2104                         break;
2105
2106                         case 1:
2107                                 NDR_CHECK(ndr_push_rap_PrintQueue1(ndr, NDR_BUFFERS, &r->info1));
2108                         break;
2109
2110                         case 2:
2111                                 NDR_CHECK(ndr_push_rap_PrintQueue2(ndr, NDR_BUFFERS, &r->info2));
2112                         break;
2113
2114                         case 3:
2115                                 NDR_CHECK(ndr_push_rap_PrintQueue3(ndr, NDR_BUFFERS, &r->info3));
2116                         break;
2117
2118                         case 4:
2119                                 NDR_CHECK(ndr_push_rap_PrintQueue4(ndr, NDR_BUFFERS, &r->info4));
2120                         break;
2121
2122                         case 5:
2123                                 NDR_CHECK(ndr_push_rap_PrintQueue5(ndr, NDR_BUFFERS, &r->info5));
2124                         break;
2125
2126                         default:
2127                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2128                 }
2129         }
2130         return NDR_ERR_SUCCESS;
2131 }
2132
2133 _PUBLIC_ enum ndr_err_code ndr_pull_rap_printq_info(struct ndr_pull *ndr, int ndr_flags, union rap_printq_info *r)
2134 {
2135         int level;
2136         level = ndr_pull_get_switch_value(ndr, r);
2137         if (ndr_flags & NDR_SCALARS) {
2138                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
2139                 switch (level) {
2140                         case 0: {
2141                                 NDR_CHECK(ndr_pull_rap_PrintQueue0(ndr, NDR_SCALARS, &r->info0));
2142                         break; }
2143
2144                         case 1: {
2145                                 NDR_CHECK(ndr_pull_rap_PrintQueue1(ndr, NDR_SCALARS, &r->info1));
2146                         break; }
2147
2148                         case 2: {
2149                                 NDR_CHECK(ndr_pull_rap_PrintQueue2(ndr, NDR_SCALARS, &r->info2));
2150                         break; }
2151
2152                         case 3: {
2153                                 NDR_CHECK(ndr_pull_rap_PrintQueue3(ndr, NDR_SCALARS, &r->info3));
2154                         break; }
2155
2156                         case 4: {
2157                                 NDR_CHECK(ndr_pull_rap_PrintQueue4(ndr, NDR_SCALARS, &r->info4));
2158                         break; }
2159
2160                         case 5: {
2161                                 NDR_CHECK(ndr_pull_rap_PrintQueue5(ndr, NDR_SCALARS, &r->info5));
2162                         break; }
2163
2164                         default:
2165                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2166                 }
2167         }
2168         if (ndr_flags & NDR_BUFFERS) {
2169                 switch (level) {
2170                         case 0:
2171                         break;
2172
2173                         case 1:
2174                                 NDR_CHECK(ndr_pull_rap_PrintQueue1(ndr, NDR_BUFFERS, &r->info1));
2175                         break;
2176
2177                         case 2:
2178                                 NDR_CHECK(ndr_pull_rap_PrintQueue2(ndr, NDR_BUFFERS, &r->info2));
2179                         break;
2180
2181                         case 3:
2182                                 NDR_CHECK(ndr_pull_rap_PrintQueue3(ndr, NDR_BUFFERS, &r->info3));
2183                         break;
2184
2185                         case 4:
2186                                 NDR_CHECK(ndr_pull_rap_PrintQueue4(ndr, NDR_BUFFERS, &r->info4));
2187                         break;
2188
2189                         case 5:
2190                                 NDR_CHECK(ndr_pull_rap_PrintQueue5(ndr, NDR_BUFFERS, &r->info5));
2191                         break;
2192
2193                         default:
2194                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2195                 }
2196         }
2197         return NDR_ERR_SUCCESS;
2198 }
2199
2200 _PUBLIC_ void ndr_print_rap_printq_info(struct ndr_print *ndr, const char *name, const union rap_printq_info *r)
2201 {
2202         int level;
2203         level = ndr_print_get_switch_value(ndr, r);
2204         ndr_print_union(ndr, name, level, "rap_printq_info");
2205         switch (level) {
2206                 case 0:
2207                         ndr_print_rap_PrintQueue0(ndr, "info0", &r->info0);
2208                 break;
2209
2210                 case 1:
2211                         ndr_print_rap_PrintQueue1(ndr, "info1", &r->info1);
2212                 break;
2213
2214                 case 2:
2215                         ndr_print_rap_PrintQueue2(ndr, "info2", &r->info2);
2216                 break;
2217
2218                 case 3:
2219                         ndr_print_rap_PrintQueue3(ndr, "info3", &r->info3);
2220                 break;
2221
2222                 case 4:
2223                         ndr_print_rap_PrintQueue4(ndr, "info4", &r->info4);
2224                 break;
2225
2226                 case 5:
2227                         ndr_print_rap_PrintQueue5(ndr, "info5", &r->info5);
2228                 break;
2229
2230                 default:
2231                         ndr_print_bad_level(ndr, name, level);
2232         }
2233 }
2234
2235 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetShareEnum(struct ndr_push *ndr, int flags, const struct rap_NetShareEnum *r)
2236 {
2237         if (flags & NDR_IN) {
2238                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
2239                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize));
2240         }
2241         if (flags & NDR_OUT) {
2242                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2243                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2244                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.count));
2245                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.available));
2246                 if (r->out.info == NULL) {
2247                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2248                 }
2249                 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
2250                 NDR_CHECK(ndr_push_rap_share_info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
2251         }
2252         return NDR_ERR_SUCCESS;
2253 }
2254
2255 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetShareEnum(struct ndr_pull *ndr, int flags, struct rap_NetShareEnum *r)
2256 {
2257         TALLOC_CTX *_mem_save_info_0;
2258         if (flags & NDR_IN) {
2259                 ZERO_STRUCT(r->out);
2260
2261                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
2262                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize));
2263                 NDR_PULL_ALLOC(ndr, r->out.info);
2264                 ZERO_STRUCTP(r->out.info);
2265         }
2266         if (flags & NDR_OUT) {
2267                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2268                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2269                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.count));
2270                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.available));
2271                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2272                         NDR_PULL_ALLOC(ndr, r->out.info);
2273                 }
2274                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
2275                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
2276                 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
2277                 NDR_CHECK(ndr_pull_rap_share_info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
2278                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
2279         }
2280         return NDR_ERR_SUCCESS;
2281 }
2282
2283 _PUBLIC_ void ndr_print_rap_NetShareEnum(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetShareEnum *r)
2284 {
2285         ndr_print_struct(ndr, name, "rap_NetShareEnum");
2286         ndr->depth++;
2287         if (flags & NDR_SET_VALUES) {
2288                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2289         }
2290         if (flags & NDR_IN) {
2291                 ndr_print_struct(ndr, "in", "rap_NetShareEnum");
2292                 ndr->depth++;
2293                 ndr_print_uint16(ndr, "level", r->in.level);
2294                 ndr_print_uint16(ndr, "bufsize", r->in.bufsize);
2295                 ndr->depth--;
2296         }
2297         if (flags & NDR_OUT) {
2298                 ndr_print_struct(ndr, "out", "rap_NetShareEnum");
2299                 ndr->depth++;
2300                 ndr_print_uint16(ndr, "status", r->out.status);
2301                 ndr_print_uint16(ndr, "convert", r->out.convert);
2302                 ndr_print_uint16(ndr, "count", r->out.count);
2303                 ndr_print_uint16(ndr, "available", r->out.available);
2304                 ndr_print_ptr(ndr, "info", r->out.info);
2305                 ndr->depth++;
2306                 ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
2307                 ndr_print_rap_share_info(ndr, "info", r->out.info);
2308                 ndr->depth--;
2309                 ndr->depth--;
2310         }
2311         ndr->depth--;
2312 }
2313
2314 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetServerEnum2(struct ndr_push *ndr, int flags, const struct rap_NetServerEnum2 *r)
2315 {
2316         uint32_t cntr_info_0;
2317         if (flags & NDR_IN) {
2318                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
2319                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize));
2320                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servertype));
2321                 {
2322                         uint32_t _flags_save_string = ndr->flags;
2323                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2324                         if (r->in.domain == NULL) {
2325                                 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2326                         }
2327                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->in.domain));
2328                         ndr->flags = _flags_save_string;
2329                 }
2330         }
2331         if (flags & NDR_OUT) {
2332                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2333                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2334                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.count));
2335                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.available));
2336                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2337                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level));
2338                         NDR_CHECK(ndr_push_rap_server_info(ndr, NDR_SCALARS, &r->out.info[cntr_info_0]));
2339                 }
2340                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2341                         NDR_CHECK(ndr_push_rap_server_info(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0]));
2342                 }
2343         }
2344         return NDR_ERR_SUCCESS;
2345 }
2346
2347 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetServerEnum2(struct ndr_pull *ndr, int flags, struct rap_NetServerEnum2 *r)
2348 {
2349         uint32_t cntr_info_0;
2350         TALLOC_CTX *_mem_save_info_0;
2351         if (flags & NDR_IN) {
2352                 ZERO_STRUCT(r->out);
2353
2354                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
2355                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize));
2356                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servertype));
2357                 {
2358                         uint32_t _flags_save_string = ndr->flags;
2359                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2360                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->in.domain));
2361                         ndr->flags = _flags_save_string;
2362                 }
2363         }
2364         if (flags & NDR_OUT) {
2365                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2366                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2367                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.count));
2368                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.available));
2369                 NDR_PULL_ALLOC_N(ndr, r->out.info, r->out.count);
2370                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
2371                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
2372                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2373                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level));
2374                         NDR_CHECK(ndr_pull_rap_server_info(ndr, NDR_SCALARS, &r->out.info[cntr_info_0]));
2375                 }
2376                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2377                         NDR_CHECK(ndr_pull_rap_server_info(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0]));
2378                 }
2379                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
2380         }
2381         return NDR_ERR_SUCCESS;
2382 }
2383
2384 _PUBLIC_ void ndr_print_rap_NetServerEnum2(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetServerEnum2 *r)
2385 {
2386         uint32_t cntr_info_0;
2387         ndr_print_struct(ndr, name, "rap_NetServerEnum2");
2388         ndr->depth++;
2389         if (flags & NDR_SET_VALUES) {
2390                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2391         }
2392         if (flags & NDR_IN) {
2393                 ndr_print_struct(ndr, "in", "rap_NetServerEnum2");
2394                 ndr->depth++;
2395                 ndr_print_uint16(ndr, "level", r->in.level);
2396                 ndr_print_uint16(ndr, "bufsize", r->in.bufsize);
2397                 ndr_print_uint32(ndr, "servertype", r->in.servertype);
2398                 ndr_print_ptr(ndr, "domain", r->in.domain);
2399                 ndr->depth++;
2400                 ndr_print_string(ndr, "domain", r->in.domain);
2401                 ndr->depth--;
2402                 ndr->depth--;
2403         }
2404         if (flags & NDR_OUT) {
2405                 ndr_print_struct(ndr, "out", "rap_NetServerEnum2");
2406                 ndr->depth++;
2407                 ndr_print_uint16(ndr, "status", r->out.status);
2408                 ndr_print_uint16(ndr, "convert", r->out.convert);
2409                 ndr_print_uint16(ndr, "count", r->out.count);
2410                 ndr_print_uint16(ndr, "available", r->out.available);
2411                 ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->out.count);
2412                 ndr->depth++;
2413                 for (cntr_info_0=0;cntr_info_0<r->out.count;cntr_info_0++) {
2414                         char *idx_0=NULL;
2415                         if (asprintf(&idx_0, "[%d]", cntr_info_0) != -1) {
2416                                 ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level);
2417                                 ndr_print_rap_server_info(ndr, "info", &r->out.info[cntr_info_0]);
2418                                 free(idx_0);
2419                         }
2420                 }
2421                 ndr->depth--;
2422                 ndr->depth--;
2423         }
2424         ndr->depth--;
2425 }
2426
2427 _PUBLIC_ enum ndr_err_code ndr_push_rap_WserverGetInfo(struct ndr_push *ndr, int flags, const struct rap_WserverGetInfo *r)
2428 {
2429         if (flags & NDR_IN) {
2430                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
2431                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize));
2432         }
2433         if (flags & NDR_OUT) {
2434                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2435                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2436                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.available));
2437                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.info, r->in.level));
2438                 NDR_CHECK(ndr_push_rap_server_info(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.info));
2439         }
2440         return NDR_ERR_SUCCESS;
2441 }
2442
2443 _PUBLIC_ enum ndr_err_code ndr_pull_rap_WserverGetInfo(struct ndr_pull *ndr, int flags, struct rap_WserverGetInfo *r)
2444 {
2445         if (flags & NDR_IN) {
2446                 ZERO_STRUCT(r->out);
2447
2448                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
2449                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize));
2450         }
2451         if (flags & NDR_OUT) {
2452                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2453                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2454                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.available));
2455                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.info, r->in.level));
2456                 NDR_CHECK(ndr_pull_rap_server_info(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.info));
2457         }
2458         return NDR_ERR_SUCCESS;
2459 }
2460
2461 _PUBLIC_ void ndr_print_rap_WserverGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_WserverGetInfo *r)
2462 {
2463         ndr_print_struct(ndr, name, "rap_WserverGetInfo");
2464         ndr->depth++;
2465         if (flags & NDR_SET_VALUES) {
2466                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2467         }
2468         if (flags & NDR_IN) {
2469                 ndr_print_struct(ndr, "in", "rap_WserverGetInfo");
2470                 ndr->depth++;
2471                 ndr_print_uint16(ndr, "level", r->in.level);
2472                 ndr_print_uint16(ndr, "bufsize", r->in.bufsize);
2473                 ndr->depth--;
2474         }
2475         if (flags & NDR_OUT) {
2476                 ndr_print_struct(ndr, "out", "rap_WserverGetInfo");
2477                 ndr->depth++;
2478                 ndr_print_uint16(ndr, "status", r->out.status);
2479                 ndr_print_uint16(ndr, "convert", r->out.convert);
2480                 ndr_print_uint16(ndr, "available", r->out.available);
2481                 ndr_print_set_switch_value(ndr, &r->out.info, r->in.level);
2482                 ndr_print_rap_server_info(ndr, "info", &r->out.info);
2483                 ndr->depth--;
2484         }
2485         ndr->depth--;
2486 }
2487
2488 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintQEnum(struct ndr_push *ndr, int flags, const struct rap_NetPrintQEnum *r)
2489 {
2490         uint32_t cntr_info_0;
2491         if (flags & NDR_IN) {
2492                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
2493                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize));
2494         }
2495         if (flags & NDR_OUT) {
2496                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2497                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2498                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.count));
2499                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.available));
2500                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2501                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level));
2502                         NDR_CHECK(ndr_push_rap_printq_info(ndr, NDR_SCALARS, &r->out.info[cntr_info_0]));
2503                 }
2504                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2505                         NDR_CHECK(ndr_push_rap_printq_info(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0]));
2506                 }
2507         }
2508         return NDR_ERR_SUCCESS;
2509 }
2510
2511 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintQEnum(struct ndr_pull *ndr, int flags, struct rap_NetPrintQEnum *r)
2512 {
2513         uint32_t cntr_info_0;
2514         TALLOC_CTX *_mem_save_info_0;
2515         if (flags & NDR_IN) {
2516                 ZERO_STRUCT(r->out);
2517
2518                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
2519                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize));
2520         }
2521         if (flags & NDR_OUT) {
2522                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2523                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2524                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.count));
2525                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.available));
2526                 NDR_PULL_ALLOC_N(ndr, r->out.info, r->out.count);
2527                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
2528                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
2529                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2530                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level));
2531                         NDR_CHECK(ndr_pull_rap_printq_info(ndr, NDR_SCALARS, &r->out.info[cntr_info_0]));
2532                 }
2533                 for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
2534                         NDR_CHECK(ndr_pull_rap_printq_info(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0]));
2535                 }
2536                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
2537         }
2538         return NDR_ERR_SUCCESS;
2539 }
2540
2541 _PUBLIC_ void ndr_print_rap_NetPrintQEnum(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQEnum *r)
2542 {
2543         uint32_t cntr_info_0;
2544         ndr_print_struct(ndr, name, "rap_NetPrintQEnum");
2545         ndr->depth++;
2546         if (flags & NDR_SET_VALUES) {
2547                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2548         }
2549         if (flags & NDR_IN) {
2550                 ndr_print_struct(ndr, "in", "rap_NetPrintQEnum");
2551                 ndr->depth++;
2552                 ndr_print_uint16(ndr, "level", r->in.level);
2553                 ndr_print_uint16(ndr, "bufsize", r->in.bufsize);
2554                 ndr->depth--;
2555         }
2556         if (flags & NDR_OUT) {
2557                 ndr_print_struct(ndr, "out", "rap_NetPrintQEnum");
2558                 ndr->depth++;
2559                 ndr_print_uint16(ndr, "status", r->out.status);
2560                 ndr_print_uint16(ndr, "convert", r->out.convert);
2561                 ndr_print_uint16(ndr, "count", r->out.count);
2562                 ndr_print_uint16(ndr, "available", r->out.available);
2563                 ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->out.count);
2564                 ndr->depth++;
2565                 for (cntr_info_0=0;cntr_info_0<r->out.count;cntr_info_0++) {
2566                         char *idx_0=NULL;
2567                         if (asprintf(&idx_0, "[%d]", cntr_info_0) != -1) {
2568                                 ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level);
2569                                 ndr_print_rap_printq_info(ndr, "info", &r->out.info[cntr_info_0]);
2570                                 free(idx_0);
2571                         }
2572                 }
2573                 ndr->depth--;
2574                 ndr->depth--;
2575         }
2576         ndr->depth--;
2577 }
2578
2579 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintQGetInfo(struct ndr_push *ndr, int flags, const struct rap_NetPrintQGetInfo *r)
2580 {
2581         if (flags & NDR_IN) {
2582                 {
2583                         uint32_t _flags_save_string = ndr->flags;
2584                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2585                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->in.PrintQueueName));
2586                         ndr->flags = _flags_save_string;
2587                 }
2588                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
2589                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize));
2590         }
2591         if (flags & NDR_OUT) {
2592                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2593                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2594                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.available));
2595                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.info, r->in.level));
2596                 NDR_CHECK(ndr_push_rap_printq_info(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.info));
2597         }
2598         return NDR_ERR_SUCCESS;
2599 }
2600
2601 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintQGetInfo(struct ndr_pull *ndr, int flags, struct rap_NetPrintQGetInfo *r)
2602 {
2603         if (flags & NDR_IN) {
2604                 ZERO_STRUCT(r->out);
2605
2606                 {
2607                         uint32_t _flags_save_string = ndr->flags;
2608                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2609                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->in.PrintQueueName));
2610                         ndr->flags = _flags_save_string;
2611                 }
2612                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
2613                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize));
2614         }
2615         if (flags & NDR_OUT) {
2616                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2617                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2618                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.available));
2619                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.info, r->in.level));
2620                 NDR_CHECK(ndr_pull_rap_printq_info(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.info));
2621         }
2622         return NDR_ERR_SUCCESS;
2623 }
2624
2625 _PUBLIC_ void ndr_print_rap_NetPrintQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQGetInfo *r)
2626 {
2627         ndr_print_struct(ndr, name, "rap_NetPrintQGetInfo");
2628         ndr->depth++;
2629         if (flags & NDR_SET_VALUES) {
2630                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2631         }
2632         if (flags & NDR_IN) {
2633                 ndr_print_struct(ndr, "in", "rap_NetPrintQGetInfo");
2634                 ndr->depth++;
2635                 ndr_print_string(ndr, "PrintQueueName", r->in.PrintQueueName);
2636                 ndr_print_uint16(ndr, "level", r->in.level);
2637                 ndr_print_uint16(ndr, "bufsize", r->in.bufsize);
2638                 ndr->depth--;
2639         }
2640         if (flags & NDR_OUT) {
2641                 ndr_print_struct(ndr, "out", "rap_NetPrintQGetInfo");
2642                 ndr->depth++;
2643                 ndr_print_uint16(ndr, "status", r->out.status);
2644                 ndr_print_uint16(ndr, "convert", r->out.convert);
2645                 ndr_print_uint16(ndr, "available", r->out.available);
2646                 ndr_print_set_switch_value(ndr, &r->out.info, r->in.level);
2647                 ndr_print_rap_printq_info(ndr, "info", &r->out.info);
2648                 ndr->depth--;
2649         }
2650         ndr->depth--;
2651 }
2652
2653 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintJobPause(struct ndr_push *ndr, int flags, const struct rap_NetPrintJobPause *r)
2654 {
2655         if (flags & NDR_IN) {
2656                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.JobID));
2657         }
2658         if (flags & NDR_OUT) {
2659                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2660                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2661         }
2662         return NDR_ERR_SUCCESS;
2663 }
2664
2665 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintJobPause(struct ndr_pull *ndr, int flags, struct rap_NetPrintJobPause *r)
2666 {
2667         if (flags & NDR_IN) {
2668                 ZERO_STRUCT(r->out);
2669
2670                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.JobID));
2671         }
2672         if (flags & NDR_OUT) {
2673                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2674                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2675         }
2676         return NDR_ERR_SUCCESS;
2677 }
2678
2679 _PUBLIC_ void ndr_print_rap_NetPrintJobPause(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintJobPause *r)
2680 {
2681         ndr_print_struct(ndr, name, "rap_NetPrintJobPause");
2682         ndr->depth++;
2683         if (flags & NDR_SET_VALUES) {
2684                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2685         }
2686         if (flags & NDR_IN) {
2687                 ndr_print_struct(ndr, "in", "rap_NetPrintJobPause");
2688                 ndr->depth++;
2689                 ndr_print_uint16(ndr, "JobID", r->in.JobID);
2690                 ndr->depth--;
2691         }
2692         if (flags & NDR_OUT) {
2693                 ndr_print_struct(ndr, "out", "rap_NetPrintJobPause");
2694                 ndr->depth++;
2695                 ndr_print_uint16(ndr, "status", r->out.status);
2696                 ndr_print_uint16(ndr, "convert", r->out.convert);
2697                 ndr->depth--;
2698         }
2699         ndr->depth--;
2700 }
2701
2702 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintJobContinue(struct ndr_push *ndr, int flags, const struct rap_NetPrintJobContinue *r)
2703 {
2704         if (flags & NDR_IN) {
2705                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.JobID));
2706         }
2707         if (flags & NDR_OUT) {
2708                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2709                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2710         }
2711         return NDR_ERR_SUCCESS;
2712 }
2713
2714 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintJobContinue(struct ndr_pull *ndr, int flags, struct rap_NetPrintJobContinue *r)
2715 {
2716         if (flags & NDR_IN) {
2717                 ZERO_STRUCT(r->out);
2718
2719                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.JobID));
2720         }
2721         if (flags & NDR_OUT) {
2722                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2723                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2724         }
2725         return NDR_ERR_SUCCESS;
2726 }
2727
2728 _PUBLIC_ void ndr_print_rap_NetPrintJobContinue(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintJobContinue *r)
2729 {
2730         ndr_print_struct(ndr, name, "rap_NetPrintJobContinue");
2731         ndr->depth++;
2732         if (flags & NDR_SET_VALUES) {
2733                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2734         }
2735         if (flags & NDR_IN) {
2736                 ndr_print_struct(ndr, "in", "rap_NetPrintJobContinue");
2737                 ndr->depth++;
2738                 ndr_print_uint16(ndr, "JobID", r->in.JobID);
2739                 ndr->depth--;
2740         }
2741         if (flags & NDR_OUT) {
2742                 ndr_print_struct(ndr, "out", "rap_NetPrintJobContinue");
2743                 ndr->depth++;
2744                 ndr_print_uint16(ndr, "status", r->out.status);
2745                 ndr_print_uint16(ndr, "convert", r->out.convert);
2746                 ndr->depth--;
2747         }
2748         ndr->depth--;
2749 }
2750
2751 _PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintJobDelete(struct ndr_push *ndr, int flags, const struct rap_NetPrintJobDelete *r)
2752 {
2753         if (flags & NDR_IN) {
2754                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.JobID));
2755         }
2756         if (flags & NDR_OUT) {
2757                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status));
2758                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert));
2759         }
2760         return NDR_ERR_SUCCESS;
2761 }
2762
2763 _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintJobDelete(struct ndr_pull *ndr, int flags, struct rap_NetPrintJobDelete *r)
2764 {
2765         if (flags & NDR_IN) {
2766                 ZERO_STRUCT(r->out);
2767
2768                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.JobID));
2769         }
2770         if (flags & NDR_OUT) {
2771                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status));
2772                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert));
2773         }
2774         return NDR_ERR_SUCCESS;
2775 }
2776
2777 _PUBLIC_ void ndr_print_rap_NetPrintJobDelete(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintJobDelete *r)
2778 {
2779         ndr_print_struct(ndr, name, "rap_NetPrintJobDelete");
2780         ndr->depth++;
2781         if (flags & NDR_SET_VALUES) {
2782                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2783         }
2784         if (flags & NDR_IN) {
2785                 ndr_print_struct(ndr, "in", "rap_NetPrintJobDelete");
2786                 ndr->depth++;
2787                 ndr_print_uint16(ndr, "JobID", r->in.JobID);
2788                 ndr->depth--;
2789         }
2790         if (flags & NDR_OUT) {
2791                 ndr_print_struct(ndr, "out", "rap_NetPrintJobDelete");
2792                 ndr->depth++;
2793                 ndr_print_uint16(ndr, "status", r->out.status);
2794                 ndr_print_uint16(ndr, "convert", r->out.convert);
2795                 ndr->depth--;
2796         }
2797         ndr->depth--;
2798 }