r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / ndr_initshutdown.c
blobaa35a8dd050c1eb03558f3928f5802d3f004f937
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_initshutdown.h"
6 NTSTATUS ndr_push_initshutdown_String_sub(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String_sub *r)
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)));
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;
18 if (ndr_flags & NDR_BUFFERS) {
20 return NT_STATUS_OK;
23 NTSTATUS ndr_pull_initshutdown_String_sub(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String_sub *r)
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));
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;
35 if (ndr_flags & NDR_BUFFERS) {
37 return NT_STATUS_OK;
40 _PUBLIC_ void ndr_print_initshutdown_String_sub(struct ndr_print *ndr, const char *name, const struct initshutdown_String_sub *r)
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--;
49 _PUBLIC_ NTSTATUS ndr_push_initshutdown_String(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String *r)
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));
57 if (ndr_flags & NDR_BUFFERS) {
58 if (r->name) {
59 NDR_CHECK(ndr_push_initshutdown_String_sub(ndr, NDR_SCALARS, r->name));
62 return NT_STATUS_OK;
65 _PUBLIC_ NTSTATUS ndr_pull_initshutdown_String(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String *r)
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;
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);
88 return NT_STATUS_OK;
91 _PUBLIC_ void ndr_print_initshutdown_String(struct ndr_print *ndr, const char *name, const struct initshutdown_String *r)
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);
102 ndr->depth--;
103 ndr->depth--;
106 NTSTATUS ndr_push_initshutdown_Init(struct ndr_push *ndr, int flags, const struct initshutdown_Init *r)
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));
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));
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));
121 if (flags & NDR_OUT) {
122 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
124 return NT_STATUS_OK;
127 NTSTATUS ndr_pull_initshutdown_Init(struct ndr_pull *ndr, int flags, struct initshutdown_Init *r)
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;
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);
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;
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);
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));
162 if (flags & NDR_OUT) {
163 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
165 return NT_STATUS_OK;
168 _PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r)
170 ndr_print_struct(ndr, name, "initshutdown_Init");
171 ndr->depth++;
172 if (flags & NDR_SET_VALUES) {
173 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
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);
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);
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--;
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--;
201 ndr->depth--;
204 NTSTATUS ndr_push_initshutdown_Abort(struct ndr_push *ndr, int flags, const struct initshutdown_Abort *r)
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));
212 if (flags & NDR_OUT) {
213 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
215 return NT_STATUS_OK;
218 NTSTATUS ndr_pull_initshutdown_Abort(struct ndr_pull *ndr, int flags, struct initshutdown_Abort *r)
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;
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);
236 if (flags & NDR_OUT) {
237 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
239 return NT_STATUS_OK;
242 _PUBLIC_ void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r)
244 ndr_print_struct(ndr, name, "initshutdown_Abort");
245 ndr->depth++;
246 if (flags & NDR_SET_VALUES) {
247 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
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);
257 ndr->depth--;
258 ndr->depth--;
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--;
266 ndr->depth--;
269 NTSTATUS ndr_push_initshutdown_InitEx(struct ndr_push *ndr, int flags, const struct initshutdown_InitEx *r)
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));
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));
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));
285 if (flags & NDR_OUT) {
286 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
288 return NT_STATUS_OK;
291 NTSTATUS ndr_pull_initshutdown_InitEx(struct ndr_pull *ndr, int flags, struct initshutdown_InitEx *r)
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;
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);
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;
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);
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));
327 if (flags & NDR_OUT) {
328 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
330 return NT_STATUS_OK;
333 _PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r)
335 ndr_print_struct(ndr, name, "initshutdown_InitEx");
336 ndr->depth++;
337 if (flags & NDR_SET_VALUES) {
338 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
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);
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);
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--;
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--;
367 ndr->depth--;
370 const struct dcerpc_interface_call initshutdown_calls[] = {
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,
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,
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,
395 { NULL, 0, NULL, NULL, NULL, False }
398 const char * const initshutdown_endpoint_strings[] = {
399 "ncacn_np:[\\pipe\\InitShutdown]",
402 const struct dcerpc_endpoint_list initshutdown_endpoints = {
403 .count = 1,
404 .names = initshutdown_endpoint_strings
407 const char * const initshutdown_authservice_strings[] = {
408 "host",
411 const struct dcerpc_authservice_list initshutdown_authservices = {
412 .count = 1,
413 .names = initshutdown_authservice_strings
417 const struct dcerpc_interface_table dcerpc_table_initshutdown = {
418 .name = "initshutdown",
419 .syntax_id = {
420 {0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}},
421 DCERPC_INITSHUTDOWN_VERSION
423 .helpstring = DCERPC_INITSHUTDOWN_HELPSTRING,
424 .num_calls = 3,
425 .calls = initshutdown_calls,
426 .endpoints = &initshutdown_endpoints,
427 .authservices = &initshutdown_authservices