Fix various build warnings
[ira/wip.git] / source3 / librpc / gen_ndr / ndr_initshutdown.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_initshutdown.h"
5
6 static enum ndr_err_code ndr_push_initshutdown_String_sub(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String_sub *r)
7 {
8         if (ndr_flags & NDR_SCALARS) {
9                 NDR_CHECK(ndr_push_align(ndr, 4));
10                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->name)));
11                 {
12                         uint32_t _flags_save_string = ndr->flags;
13                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM);
14                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
15                         ndr->flags = _flags_save_string;
16                 }
17         }
18         if (ndr_flags & NDR_BUFFERS) {
19         }
20         return NDR_ERR_SUCCESS;
21 }
22
23 static enum ndr_err_code ndr_pull_initshutdown_String_sub(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String_sub *r)
24 {
25         if (ndr_flags & NDR_SCALARS) {
26                 NDR_CHECK(ndr_pull_align(ndr, 4));
27                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->name_size));
28                 {
29                         uint32_t _flags_save_string = ndr->flags;
30                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM);
31                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
32                         ndr->flags = _flags_save_string;
33                 }
34         }
35         if (ndr_flags & NDR_BUFFERS) {
36         }
37         return NDR_ERR_SUCCESS;
38 }
39
40 _PUBLIC_ void ndr_print_initshutdown_String_sub(struct ndr_print *ndr, const char *name, const struct initshutdown_String_sub *r)
41 {
42         ndr_print_struct(ndr, name, "initshutdown_String_sub");
43         ndr->depth++;
44         ndr_print_uint32(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name):r->name_size);
45         ndr_print_string(ndr, "name", r->name);
46         ndr->depth--;
47 }
48
49 _PUBLIC_ enum ndr_err_code ndr_push_initshutdown_String(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String *r)
50 {
51         if (ndr_flags & NDR_SCALARS) {
52                 NDR_CHECK(ndr_push_align(ndr, 4));
53                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->name->name) * 2));
54                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name->name) * 2));
55                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
56         }
57         if (ndr_flags & NDR_BUFFERS) {
58                 if (r->name) {
59                         NDR_CHECK(ndr_push_initshutdown_String_sub(ndr, NDR_SCALARS, r->name));
60                 }
61         }
62         return NDR_ERR_SUCCESS;
63 }
64
65 _PUBLIC_ enum ndr_err_code ndr_pull_initshutdown_String(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String *r)
66 {
67         uint32_t _ptr_name;
68         TALLOC_CTX *_mem_save_name_0;
69         if (ndr_flags & NDR_SCALARS) {
70                 NDR_CHECK(ndr_pull_align(ndr, 4));
71                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len));
72                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_size));
73                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
74                 if (_ptr_name) {
75                         NDR_PULL_ALLOC(ndr, r->name);
76                 } else {
77                         r->name = NULL;
78                 }
79         }
80         if (ndr_flags & NDR_BUFFERS) {
81                 if (r->name) {
82                         _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
83                         NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
84                         NDR_CHECK(ndr_pull_initshutdown_String_sub(ndr, NDR_SCALARS, r->name));
85                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
86                 }
87         }
88         return NDR_ERR_SUCCESS;
89 }
90
91 _PUBLIC_ void ndr_print_initshutdown_String(struct ndr_print *ndr, const char *name, const struct initshutdown_String *r)
92 {
93         ndr_print_struct(ndr, name, "initshutdown_String");
94         ndr->depth++;
95         ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->name->name) * 2:r->name_len);
96         ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name->name) * 2:r->name_size);
97         ndr_print_ptr(ndr, "name", r->name);
98         ndr->depth++;
99         if (r->name) {
100                 ndr_print_initshutdown_String_sub(ndr, "name", r->name);
101         }
102         ndr->depth--;
103         ndr->depth--;
104 }
105
106 static enum ndr_err_code ndr_push_initshutdown_Init(struct ndr_push *ndr, int flags, const struct initshutdown_Init *r)
107 {
108         if (flags & NDR_IN) {
109                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname));
110                 if (r->in.hostname) {
111                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname));
112                 }
113                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
114                 if (r->in.message) {
115                         NDR_CHECK(ndr_push_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
116                 }
117                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
118                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
119                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.reboot));
120         }
121         if (flags & NDR_OUT) {
122                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
123         }
124         return NDR_ERR_SUCCESS;
125 }
126
127 static enum ndr_err_code ndr_pull_initshutdown_Init(struct ndr_pull *ndr, int flags, struct initshutdown_Init *r)
128 {
129         uint32_t _ptr_hostname;
130         uint32_t _ptr_message;
131         TALLOC_CTX *_mem_save_hostname_0;
132         TALLOC_CTX *_mem_save_message_0;
133         if (flags & NDR_IN) {
134                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname));
135                 if (_ptr_hostname) {
136                         NDR_PULL_ALLOC(ndr, r->in.hostname);
137                 } else {
138                         r->in.hostname = NULL;
139                 }
140                 if (r->in.hostname) {
141                         _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr);
142                         NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0);
143                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname));
144                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0);
145                 }
146                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message));
147                 if (_ptr_message) {
148                         NDR_PULL_ALLOC(ndr, r->in.message);
149                 } else {
150                         r->in.message = NULL;
151                 }
152                 if (r->in.message) {
153                         _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
154                         NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
155                         NDR_CHECK(ndr_pull_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
156                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
157                 }
158                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
159                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps));
160                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.reboot));
161         }
162         if (flags & NDR_OUT) {
163                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
164         }
165         return NDR_ERR_SUCCESS;
166 }
167
168 _PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r)
169 {
170         ndr_print_struct(ndr, name, "initshutdown_Init");
171         ndr->depth++;
172         if (flags & NDR_SET_VALUES) {
173                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
174         }
175         if (flags & NDR_IN) {
176                 ndr_print_struct(ndr, "in", "initshutdown_Init");
177                 ndr->depth++;
178                 ndr_print_ptr(ndr, "hostname", r->in.hostname);
179                 ndr->depth++;
180                 if (r->in.hostname) {
181                         ndr_print_uint16(ndr, "hostname", *r->in.hostname);
182                 }
183                 ndr->depth--;
184                 ndr_print_ptr(ndr, "message", r->in.message);
185                 ndr->depth++;
186                 if (r->in.message) {
187                         ndr_print_initshutdown_String(ndr, "message", r->in.message);
188                 }
189                 ndr->depth--;
190                 ndr_print_uint32(ndr, "timeout", r->in.timeout);
191                 ndr_print_uint8(ndr, "force_apps", r->in.force_apps);
192                 ndr_print_uint8(ndr, "reboot", r->in.reboot);
193                 ndr->depth--;
194         }
195         if (flags & NDR_OUT) {
196                 ndr_print_struct(ndr, "out", "initshutdown_Init");
197                 ndr->depth++;
198                 ndr_print_WERROR(ndr, "result", r->out.result);
199                 ndr->depth--;
200         }
201         ndr->depth--;
202 }
203
204 static enum ndr_err_code ndr_push_initshutdown_Abort(struct ndr_push *ndr, int flags, const struct initshutdown_Abort *r)
205 {
206         if (flags & NDR_IN) {
207                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server));
208                 if (r->in.server) {
209                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.server));
210                 }
211         }
212         if (flags & NDR_OUT) {
213                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
214         }
215         return NDR_ERR_SUCCESS;
216 }
217
218 static enum ndr_err_code ndr_pull_initshutdown_Abort(struct ndr_pull *ndr, int flags, struct initshutdown_Abort *r)
219 {
220         uint32_t _ptr_server;
221         TALLOC_CTX *_mem_save_server_0;
222         if (flags & NDR_IN) {
223                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server));
224                 if (_ptr_server) {
225                         NDR_PULL_ALLOC(ndr, r->in.server);
226                 } else {
227                         r->in.server = NULL;
228                 }
229                 if (r->in.server) {
230                         _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
231                         NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0);
232                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.server));
233                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0);
234                 }
235         }
236         if (flags & NDR_OUT) {
237                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
238         }
239         return NDR_ERR_SUCCESS;
240 }
241
242 _PUBLIC_ void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r)
243 {
244         ndr_print_struct(ndr, name, "initshutdown_Abort");
245         ndr->depth++;
246         if (flags & NDR_SET_VALUES) {
247                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
248         }
249         if (flags & NDR_IN) {
250                 ndr_print_struct(ndr, "in", "initshutdown_Abort");
251                 ndr->depth++;
252                 ndr_print_ptr(ndr, "server", r->in.server);
253                 ndr->depth++;
254                 if (r->in.server) {
255                         ndr_print_uint16(ndr, "server", *r->in.server);
256                 }
257                 ndr->depth--;
258                 ndr->depth--;
259         }
260         if (flags & NDR_OUT) {
261                 ndr_print_struct(ndr, "out", "initshutdown_Abort");
262                 ndr->depth++;
263                 ndr_print_WERROR(ndr, "result", r->out.result);
264                 ndr->depth--;
265         }
266         ndr->depth--;
267 }
268
269 static enum ndr_err_code ndr_push_initshutdown_InitEx(struct ndr_push *ndr, int flags, const struct initshutdown_InitEx *r)
270 {
271         if (flags & NDR_IN) {
272                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname));
273                 if (r->in.hostname) {
274                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname));
275                 }
276                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
277                 if (r->in.message) {
278                         NDR_CHECK(ndr_push_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
279                 }
280                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
281                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
282                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.reboot));
283                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason));
284         }
285         if (flags & NDR_OUT) {
286                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
287         }
288         return NDR_ERR_SUCCESS;
289 }
290
291 static enum ndr_err_code ndr_pull_initshutdown_InitEx(struct ndr_pull *ndr, int flags, struct initshutdown_InitEx *r)
292 {
293         uint32_t _ptr_hostname;
294         uint32_t _ptr_message;
295         TALLOC_CTX *_mem_save_hostname_0;
296         TALLOC_CTX *_mem_save_message_0;
297         if (flags & NDR_IN) {
298                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname));
299                 if (_ptr_hostname) {
300                         NDR_PULL_ALLOC(ndr, r->in.hostname);
301                 } else {
302                         r->in.hostname = NULL;
303                 }
304                 if (r->in.hostname) {
305                         _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr);
306                         NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0);
307                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname));
308                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0);
309                 }
310                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message));
311                 if (_ptr_message) {
312                         NDR_PULL_ALLOC(ndr, r->in.message);
313                 } else {
314                         r->in.message = NULL;
315                 }
316                 if (r->in.message) {
317                         _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
318                         NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
319                         NDR_CHECK(ndr_pull_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
320                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
321                 }
322                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
323                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps));
324                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.reboot));
325                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason));
326         }
327         if (flags & NDR_OUT) {
328                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
329         }
330         return NDR_ERR_SUCCESS;
331 }
332
333 _PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r)
334 {
335         ndr_print_struct(ndr, name, "initshutdown_InitEx");
336         ndr->depth++;
337         if (flags & NDR_SET_VALUES) {
338                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
339         }
340         if (flags & NDR_IN) {
341                 ndr_print_struct(ndr, "in", "initshutdown_InitEx");
342                 ndr->depth++;
343                 ndr_print_ptr(ndr, "hostname", r->in.hostname);
344                 ndr->depth++;
345                 if (r->in.hostname) {
346                         ndr_print_uint16(ndr, "hostname", *r->in.hostname);
347                 }
348                 ndr->depth--;
349                 ndr_print_ptr(ndr, "message", r->in.message);
350                 ndr->depth++;
351                 if (r->in.message) {
352                         ndr_print_initshutdown_String(ndr, "message", r->in.message);
353                 }
354                 ndr->depth--;
355                 ndr_print_uint32(ndr, "timeout", r->in.timeout);
356                 ndr_print_uint8(ndr, "force_apps", r->in.force_apps);
357                 ndr_print_uint8(ndr, "reboot", r->in.reboot);
358                 ndr_print_uint32(ndr, "reason", r->in.reason);
359                 ndr->depth--;
360         }
361         if (flags & NDR_OUT) {
362                 ndr_print_struct(ndr, "out", "initshutdown_InitEx");
363                 ndr->depth++;
364                 ndr_print_WERROR(ndr, "result", r->out.result);
365                 ndr->depth--;
366         }
367         ndr->depth--;
368 }
369
370 static const struct ndr_interface_call initshutdown_calls[] = {
371         {
372                 "initshutdown_Init",
373                 sizeof(struct initshutdown_Init),
374                 (ndr_push_flags_fn_t) ndr_push_initshutdown_Init,
375                 (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Init,
376                 (ndr_print_function_t) ndr_print_initshutdown_Init,
377                 false,
378         },
379         {
380                 "initshutdown_Abort",
381                 sizeof(struct initshutdown_Abort),
382                 (ndr_push_flags_fn_t) ndr_push_initshutdown_Abort,
383                 (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Abort,
384                 (ndr_print_function_t) ndr_print_initshutdown_Abort,
385                 false,
386         },
387         {
388                 "initshutdown_InitEx",
389                 sizeof(struct initshutdown_InitEx),
390                 (ndr_push_flags_fn_t) ndr_push_initshutdown_InitEx,
391                 (ndr_pull_flags_fn_t) ndr_pull_initshutdown_InitEx,
392                 (ndr_print_function_t) ndr_print_initshutdown_InitEx,
393                 false,
394         },
395         { NULL, 0, NULL, NULL, NULL, false }
396 };
397
398 static const char * const initshutdown_endpoint_strings[] = {
399         "ncacn_np:[\\pipe\\InitShutdown]", 
400 };
401
402 static const struct ndr_interface_string_array initshutdown_endpoints = {
403         .count  = 1,
404         .names  = initshutdown_endpoint_strings
405 };
406
407 static const char * const initshutdown_authservice_strings[] = {
408         "host", 
409 };
410
411 static const struct ndr_interface_string_array initshutdown_authservices = {
412         .count  = 1,
413         .names  = initshutdown_authservice_strings
414 };
415
416
417 const struct ndr_interface_table ndr_table_initshutdown = {
418         .name           = "initshutdown",
419         .syntax_id      = {
420                 {0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}},
421                 NDR_INITSHUTDOWN_VERSION
422         },
423         .helpstring     = NDR_INITSHUTDOWN_HELPSTRING,
424         .num_calls      = 3,
425         .calls          = initshutdown_calls,
426         .endpoints      = &initshutdown_endpoints,
427         .authservices   = &initshutdown_authservices
428 };
429