s3-utils: Use ads_do_search_retry in net ads search
[Samba.git] / librpc / gen_ndr / ndr_named_pipe_auth.c
blobb64a987d2dbdb30c80812f218b3227d16c21e768
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_named_pipe_auth.h"
6 #include "librpc/gen_ndr/ndr_netlogon.h"
7 static enum ndr_err_code ndr_push_named_pipe_auth_req_info2(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req_info2 *r)
9 if (ndr_flags & NDR_SCALARS) {
10 NDR_CHECK(ndr_push_align(ndr, 5));
11 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_name));
12 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_addr));
13 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->client_port));
14 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name));
15 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_addr));
16 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->server_port));
17 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam_info3));
18 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_key_length));
19 NDR_CHECK(ndr_push_unique_ptr(ndr, r->session_key));
20 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
22 if (ndr_flags & NDR_BUFFERS) {
23 if (r->client_name) {
24 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_name, CH_UTF8)));
25 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
26 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_name, CH_UTF8)));
27 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_name, ndr_charset_length(r->client_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
29 if (r->client_addr) {
30 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_addr, CH_DOS)));
31 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
32 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_addr, CH_DOS)));
33 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_addr, ndr_charset_length(r->client_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
35 if (r->server_name) {
36 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF8)));
37 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
38 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF8)));
39 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
41 if (r->server_addr) {
42 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_addr, CH_DOS)));
43 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
44 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_addr, CH_DOS)));
45 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_addr, ndr_charset_length(r->server_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
47 if (r->sam_info3) {
48 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam_info3));
50 if (r->session_key) {
51 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->session_key_length));
52 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->session_key, r->session_key_length));
55 return NDR_ERR_SUCCESS;
58 static enum ndr_err_code ndr_pull_named_pipe_auth_req_info2(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req_info2 *r)
60 uint32_t _ptr_client_name;
61 uint32_t size_client_name_1 = 0;
62 uint32_t length_client_name_1 = 0;
63 TALLOC_CTX *_mem_save_client_name_0;
64 uint32_t _ptr_client_addr;
65 uint32_t size_client_addr_1 = 0;
66 uint32_t length_client_addr_1 = 0;
67 TALLOC_CTX *_mem_save_client_addr_0;
68 uint32_t _ptr_server_name;
69 uint32_t size_server_name_1 = 0;
70 uint32_t length_server_name_1 = 0;
71 TALLOC_CTX *_mem_save_server_name_0;
72 uint32_t _ptr_server_addr;
73 uint32_t size_server_addr_1 = 0;
74 uint32_t length_server_addr_1 = 0;
75 TALLOC_CTX *_mem_save_server_addr_0;
76 uint32_t _ptr_sam_info3;
77 TALLOC_CTX *_mem_save_sam_info3_0;
78 uint32_t _ptr_session_key;
79 uint32_t size_session_key_1 = 0;
80 TALLOC_CTX *_mem_save_session_key_0;
81 if (ndr_flags & NDR_SCALARS) {
82 NDR_CHECK(ndr_pull_align(ndr, 5));
83 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_name));
84 if (_ptr_client_name) {
85 NDR_PULL_ALLOC(ndr, r->client_name);
86 } else {
87 r->client_name = NULL;
89 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_addr));
90 if (_ptr_client_addr) {
91 NDR_PULL_ALLOC(ndr, r->client_addr);
92 } else {
93 r->client_addr = NULL;
95 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->client_port));
96 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
97 if (_ptr_server_name) {
98 NDR_PULL_ALLOC(ndr, r->server_name);
99 } else {
100 r->server_name = NULL;
102 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_addr));
103 if (_ptr_server_addr) {
104 NDR_PULL_ALLOC(ndr, r->server_addr);
105 } else {
106 r->server_addr = NULL;
108 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->server_port));
109 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam_info3));
110 if (_ptr_sam_info3) {
111 NDR_PULL_ALLOC(ndr, r->sam_info3);
112 } else {
113 r->sam_info3 = NULL;
115 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_key_length));
116 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_session_key));
117 if (_ptr_session_key) {
118 NDR_PULL_ALLOC(ndr, r->session_key);
119 } else {
120 r->session_key = NULL;
122 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
124 if (ndr_flags & NDR_BUFFERS) {
125 if (r->client_name) {
126 _mem_save_client_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
127 NDR_PULL_SET_MEM_CTX(ndr, r->client_name, 0);
128 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_name));
129 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_name));
130 size_client_name_1 = ndr_get_array_size(ndr, &r->client_name);
131 length_client_name_1 = ndr_get_array_length(ndr, &r->client_name);
132 if (length_client_name_1 > size_client_name_1) {
133 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_name_1, length_client_name_1);
135 NDR_CHECK(ndr_check_string_terminator(ndr, length_client_name_1, sizeof(uint8_t)));
136 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_name, length_client_name_1, sizeof(uint8_t), CH_UTF8));
137 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_name_0, 0);
139 if (r->client_addr) {
140 _mem_save_client_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
141 NDR_PULL_SET_MEM_CTX(ndr, r->client_addr, 0);
142 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_addr));
143 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_addr));
144 size_client_addr_1 = ndr_get_array_size(ndr, &r->client_addr);
145 length_client_addr_1 = ndr_get_array_length(ndr, &r->client_addr);
146 if (length_client_addr_1 > size_client_addr_1) {
147 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_addr_1, length_client_addr_1);
149 NDR_CHECK(ndr_check_string_terminator(ndr, length_client_addr_1, sizeof(uint8_t)));
150 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_addr, length_client_addr_1, sizeof(uint8_t), CH_DOS));
151 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_addr_0, 0);
153 if (r->server_name) {
154 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
155 NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
156 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name));
157 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name));
158 size_server_name_1 = ndr_get_array_size(ndr, &r->server_name);
159 length_server_name_1 = ndr_get_array_length(ndr, &r->server_name);
160 if (length_server_name_1 > size_server_name_1) {
161 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
163 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint8_t)));
164 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, length_server_name_1, sizeof(uint8_t), CH_UTF8));
165 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
167 if (r->server_addr) {
168 _mem_save_server_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
169 NDR_PULL_SET_MEM_CTX(ndr, r->server_addr, 0);
170 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_addr));
171 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_addr));
172 size_server_addr_1 = ndr_get_array_size(ndr, &r->server_addr);
173 length_server_addr_1 = ndr_get_array_length(ndr, &r->server_addr);
174 if (length_server_addr_1 > size_server_addr_1) {
175 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_addr_1, length_server_addr_1);
177 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_addr_1, sizeof(uint8_t)));
178 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_addr, length_server_addr_1, sizeof(uint8_t), CH_DOS));
179 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_addr_0, 0);
181 if (r->sam_info3) {
182 _mem_save_sam_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
183 NDR_PULL_SET_MEM_CTX(ndr, r->sam_info3, 0);
184 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam_info3));
185 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_info3_0, 0);
187 if (r->session_key) {
188 _mem_save_session_key_0 = NDR_PULL_GET_MEM_CTX(ndr);
189 NDR_PULL_SET_MEM_CTX(ndr, r->session_key, 0);
190 NDR_CHECK(ndr_pull_array_size(ndr, &r->session_key));
191 size_session_key_1 = ndr_get_array_size(ndr, &r->session_key);
192 NDR_PULL_ALLOC_N(ndr, r->session_key, size_session_key_1);
193 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->session_key, size_session_key_1));
194 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_session_key_0, 0);
196 if (r->session_key) {
197 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->session_key, r->session_key_length));
200 return NDR_ERR_SUCCESS;
203 _PUBLIC_ void ndr_print_named_pipe_auth_req_info2(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req_info2 *r)
205 ndr_print_struct(ndr, name, "named_pipe_auth_req_info2");
206 ndr->depth++;
207 ndr_print_ptr(ndr, "client_name", r->client_name);
208 ndr->depth++;
209 if (r->client_name) {
210 ndr_print_string(ndr, "client_name", r->client_name);
212 ndr->depth--;
213 ndr_print_ptr(ndr, "client_addr", r->client_addr);
214 ndr->depth++;
215 if (r->client_addr) {
216 ndr_print_string(ndr, "client_addr", r->client_addr);
218 ndr->depth--;
219 ndr_print_uint16(ndr, "client_port", r->client_port);
220 ndr_print_ptr(ndr, "server_name", r->server_name);
221 ndr->depth++;
222 if (r->server_name) {
223 ndr_print_string(ndr, "server_name", r->server_name);
225 ndr->depth--;
226 ndr_print_ptr(ndr, "server_addr", r->server_addr);
227 ndr->depth++;
228 if (r->server_addr) {
229 ndr_print_string(ndr, "server_addr", r->server_addr);
231 ndr->depth--;
232 ndr_print_uint16(ndr, "server_port", r->server_port);
233 ndr_print_ptr(ndr, "sam_info3", r->sam_info3);
234 ndr->depth++;
235 if (r->sam_info3) {
236 ndr_print_netr_SamInfo3(ndr, "sam_info3", r->sam_info3);
238 ndr->depth--;
239 ndr_print_uint32(ndr, "session_key_length", r->session_key_length);
240 ndr_print_ptr(ndr, "session_key", r->session_key);
241 ndr->depth++;
242 if (r->session_key) {
243 ndr_print_array_uint8(ndr, "session_key", r->session_key, r->session_key_length);
245 ndr->depth--;
246 ndr->depth--;
249 static enum ndr_err_code ndr_push_named_pipe_auth_req_info3(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req_info3 *r)
251 if (ndr_flags & NDR_SCALARS) {
252 NDR_CHECK(ndr_push_align(ndr, 5));
253 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_name));
254 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_addr));
255 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->client_port));
256 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name));
257 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_addr));
258 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->server_port));
259 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam_info3));
260 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_key_length));
261 NDR_CHECK(ndr_push_unique_ptr(ndr, r->session_key));
262 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->gssapi_delegated_creds_length));
263 NDR_CHECK(ndr_push_unique_ptr(ndr, r->gssapi_delegated_creds));
264 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
266 if (ndr_flags & NDR_BUFFERS) {
267 if (r->client_name) {
268 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_name, CH_UTF8)));
269 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
270 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_name, CH_UTF8)));
271 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_name, ndr_charset_length(r->client_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
273 if (r->client_addr) {
274 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_addr, CH_DOS)));
275 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
276 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_addr, CH_DOS)));
277 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_addr, ndr_charset_length(r->client_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
279 if (r->server_name) {
280 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF8)));
281 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
282 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF8)));
283 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
285 if (r->server_addr) {
286 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_addr, CH_DOS)));
287 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
288 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_addr, CH_DOS)));
289 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_addr, ndr_charset_length(r->server_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
291 if (r->sam_info3) {
292 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam_info3));
294 if (r->session_key) {
295 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->session_key_length));
296 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->session_key, r->session_key_length));
298 if (r->gssapi_delegated_creds) {
299 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->gssapi_delegated_creds_length));
300 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->gssapi_delegated_creds, r->gssapi_delegated_creds_length));
303 return NDR_ERR_SUCCESS;
306 static enum ndr_err_code ndr_pull_named_pipe_auth_req_info3(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req_info3 *r)
308 uint32_t _ptr_client_name;
309 uint32_t size_client_name_1 = 0;
310 uint32_t length_client_name_1 = 0;
311 TALLOC_CTX *_mem_save_client_name_0;
312 uint32_t _ptr_client_addr;
313 uint32_t size_client_addr_1 = 0;
314 uint32_t length_client_addr_1 = 0;
315 TALLOC_CTX *_mem_save_client_addr_0;
316 uint32_t _ptr_server_name;
317 uint32_t size_server_name_1 = 0;
318 uint32_t length_server_name_1 = 0;
319 TALLOC_CTX *_mem_save_server_name_0;
320 uint32_t _ptr_server_addr;
321 uint32_t size_server_addr_1 = 0;
322 uint32_t length_server_addr_1 = 0;
323 TALLOC_CTX *_mem_save_server_addr_0;
324 uint32_t _ptr_sam_info3;
325 TALLOC_CTX *_mem_save_sam_info3_0;
326 uint32_t _ptr_session_key;
327 uint32_t size_session_key_1 = 0;
328 TALLOC_CTX *_mem_save_session_key_0;
329 uint32_t _ptr_gssapi_delegated_creds;
330 uint32_t size_gssapi_delegated_creds_1 = 0;
331 TALLOC_CTX *_mem_save_gssapi_delegated_creds_0;
332 if (ndr_flags & NDR_SCALARS) {
333 NDR_CHECK(ndr_pull_align(ndr, 5));
334 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_name));
335 if (_ptr_client_name) {
336 NDR_PULL_ALLOC(ndr, r->client_name);
337 } else {
338 r->client_name = NULL;
340 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_addr));
341 if (_ptr_client_addr) {
342 NDR_PULL_ALLOC(ndr, r->client_addr);
343 } else {
344 r->client_addr = NULL;
346 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->client_port));
347 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
348 if (_ptr_server_name) {
349 NDR_PULL_ALLOC(ndr, r->server_name);
350 } else {
351 r->server_name = NULL;
353 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_addr));
354 if (_ptr_server_addr) {
355 NDR_PULL_ALLOC(ndr, r->server_addr);
356 } else {
357 r->server_addr = NULL;
359 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->server_port));
360 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam_info3));
361 if (_ptr_sam_info3) {
362 NDR_PULL_ALLOC(ndr, r->sam_info3);
363 } else {
364 r->sam_info3 = NULL;
366 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_key_length));
367 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_session_key));
368 if (_ptr_session_key) {
369 NDR_PULL_ALLOC(ndr, r->session_key);
370 } else {
371 r->session_key = NULL;
373 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->gssapi_delegated_creds_length));
374 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_gssapi_delegated_creds));
375 if (_ptr_gssapi_delegated_creds) {
376 NDR_PULL_ALLOC(ndr, r->gssapi_delegated_creds);
377 } else {
378 r->gssapi_delegated_creds = NULL;
380 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
382 if (ndr_flags & NDR_BUFFERS) {
383 if (r->client_name) {
384 _mem_save_client_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
385 NDR_PULL_SET_MEM_CTX(ndr, r->client_name, 0);
386 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_name));
387 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_name));
388 size_client_name_1 = ndr_get_array_size(ndr, &r->client_name);
389 length_client_name_1 = ndr_get_array_length(ndr, &r->client_name);
390 if (length_client_name_1 > size_client_name_1) {
391 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_name_1, length_client_name_1);
393 NDR_CHECK(ndr_check_string_terminator(ndr, length_client_name_1, sizeof(uint8_t)));
394 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_name, length_client_name_1, sizeof(uint8_t), CH_UTF8));
395 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_name_0, 0);
397 if (r->client_addr) {
398 _mem_save_client_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
399 NDR_PULL_SET_MEM_CTX(ndr, r->client_addr, 0);
400 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_addr));
401 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_addr));
402 size_client_addr_1 = ndr_get_array_size(ndr, &r->client_addr);
403 length_client_addr_1 = ndr_get_array_length(ndr, &r->client_addr);
404 if (length_client_addr_1 > size_client_addr_1) {
405 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_addr_1, length_client_addr_1);
407 NDR_CHECK(ndr_check_string_terminator(ndr, length_client_addr_1, sizeof(uint8_t)));
408 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_addr, length_client_addr_1, sizeof(uint8_t), CH_DOS));
409 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_addr_0, 0);
411 if (r->server_name) {
412 _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
413 NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
414 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name));
415 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name));
416 size_server_name_1 = ndr_get_array_size(ndr, &r->server_name);
417 length_server_name_1 = ndr_get_array_length(ndr, &r->server_name);
418 if (length_server_name_1 > size_server_name_1) {
419 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_name_1, length_server_name_1);
421 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_name_1, sizeof(uint8_t)));
422 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, length_server_name_1, sizeof(uint8_t), CH_UTF8));
423 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
425 if (r->server_addr) {
426 _mem_save_server_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
427 NDR_PULL_SET_MEM_CTX(ndr, r->server_addr, 0);
428 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_addr));
429 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_addr));
430 size_server_addr_1 = ndr_get_array_size(ndr, &r->server_addr);
431 length_server_addr_1 = ndr_get_array_length(ndr, &r->server_addr);
432 if (length_server_addr_1 > size_server_addr_1) {
433 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_server_addr_1, length_server_addr_1);
435 NDR_CHECK(ndr_check_string_terminator(ndr, length_server_addr_1, sizeof(uint8_t)));
436 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_addr, length_server_addr_1, sizeof(uint8_t), CH_DOS));
437 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_addr_0, 0);
439 if (r->sam_info3) {
440 _mem_save_sam_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
441 NDR_PULL_SET_MEM_CTX(ndr, r->sam_info3, 0);
442 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam_info3));
443 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_info3_0, 0);
445 if (r->session_key) {
446 _mem_save_session_key_0 = NDR_PULL_GET_MEM_CTX(ndr);
447 NDR_PULL_SET_MEM_CTX(ndr, r->session_key, 0);
448 NDR_CHECK(ndr_pull_array_size(ndr, &r->session_key));
449 size_session_key_1 = ndr_get_array_size(ndr, &r->session_key);
450 NDR_PULL_ALLOC_N(ndr, r->session_key, size_session_key_1);
451 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->session_key, size_session_key_1));
452 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_session_key_0, 0);
454 if (r->gssapi_delegated_creds) {
455 _mem_save_gssapi_delegated_creds_0 = NDR_PULL_GET_MEM_CTX(ndr);
456 NDR_PULL_SET_MEM_CTX(ndr, r->gssapi_delegated_creds, 0);
457 NDR_CHECK(ndr_pull_array_size(ndr, &r->gssapi_delegated_creds));
458 size_gssapi_delegated_creds_1 = ndr_get_array_size(ndr, &r->gssapi_delegated_creds);
459 NDR_PULL_ALLOC_N(ndr, r->gssapi_delegated_creds, size_gssapi_delegated_creds_1);
460 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->gssapi_delegated_creds, size_gssapi_delegated_creds_1));
461 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gssapi_delegated_creds_0, 0);
463 if (r->session_key) {
464 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->session_key, r->session_key_length));
466 if (r->gssapi_delegated_creds) {
467 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->gssapi_delegated_creds, r->gssapi_delegated_creds_length));
470 return NDR_ERR_SUCCESS;
473 _PUBLIC_ void ndr_print_named_pipe_auth_req_info3(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req_info3 *r)
475 ndr_print_struct(ndr, name, "named_pipe_auth_req_info3");
476 ndr->depth++;
477 ndr_print_ptr(ndr, "client_name", r->client_name);
478 ndr->depth++;
479 if (r->client_name) {
480 ndr_print_string(ndr, "client_name", r->client_name);
482 ndr->depth--;
483 ndr_print_ptr(ndr, "client_addr", r->client_addr);
484 ndr->depth++;
485 if (r->client_addr) {
486 ndr_print_string(ndr, "client_addr", r->client_addr);
488 ndr->depth--;
489 ndr_print_uint16(ndr, "client_port", r->client_port);
490 ndr_print_ptr(ndr, "server_name", r->server_name);
491 ndr->depth++;
492 if (r->server_name) {
493 ndr_print_string(ndr, "server_name", r->server_name);
495 ndr->depth--;
496 ndr_print_ptr(ndr, "server_addr", r->server_addr);
497 ndr->depth++;
498 if (r->server_addr) {
499 ndr_print_string(ndr, "server_addr", r->server_addr);
501 ndr->depth--;
502 ndr_print_uint16(ndr, "server_port", r->server_port);
503 ndr_print_ptr(ndr, "sam_info3", r->sam_info3);
504 ndr->depth++;
505 if (r->sam_info3) {
506 ndr_print_netr_SamInfo3(ndr, "sam_info3", r->sam_info3);
508 ndr->depth--;
509 ndr_print_uint32(ndr, "session_key_length", r->session_key_length);
510 ndr_print_ptr(ndr, "session_key", r->session_key);
511 ndr->depth++;
512 if (r->session_key) {
513 ndr_print_array_uint8(ndr, "session_key", r->session_key, r->session_key_length);
515 ndr->depth--;
516 ndr_print_uint32(ndr, "gssapi_delegated_creds_length", r->gssapi_delegated_creds_length);
517 ndr_print_ptr(ndr, "gssapi_delegated_creds", r->gssapi_delegated_creds);
518 ndr->depth++;
519 if (r->gssapi_delegated_creds) {
520 ndr_print_array_uint8(ndr, "gssapi_delegated_creds", r->gssapi_delegated_creds, r->gssapi_delegated_creds_length);
522 ndr->depth--;
523 ndr->depth--;
526 static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_req_info *r)
528 if (ndr_flags & NDR_SCALARS) {
529 int level = ndr_push_get_switch_value(ndr, r);
530 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
531 NDR_CHECK(ndr_push_union_align(ndr, 5));
532 switch (level) {
533 case 0: {
534 break; }
536 case 1: {
537 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1));
538 break; }
540 case 2: {
541 NDR_CHECK(ndr_push_named_pipe_auth_req_info2(ndr, NDR_SCALARS, &r->info2));
542 break; }
544 case 3: {
545 NDR_CHECK(ndr_push_named_pipe_auth_req_info3(ndr, NDR_SCALARS, &r->info3));
546 break; }
548 default:
549 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
552 if (ndr_flags & NDR_BUFFERS) {
553 int level = ndr_push_get_switch_value(ndr, r);
554 switch (level) {
555 case 0:
556 break;
558 case 1:
559 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1));
560 break;
562 case 2:
563 NDR_CHECK(ndr_push_named_pipe_auth_req_info2(ndr, NDR_BUFFERS, &r->info2));
564 break;
566 case 3:
567 NDR_CHECK(ndr_push_named_pipe_auth_req_info3(ndr, NDR_BUFFERS, &r->info3));
568 break;
570 default:
571 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
574 return NDR_ERR_SUCCESS;
577 static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_req_info *r)
579 int level;
580 uint32_t _level;
581 level = ndr_pull_get_switch_value(ndr, r);
582 if (ndr_flags & NDR_SCALARS) {
583 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
584 if (_level != level) {
585 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
587 NDR_CHECK(ndr_pull_union_align(ndr, 5));
588 switch (level) {
589 case 0: {
590 break; }
592 case 1: {
593 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1));
594 break; }
596 case 2: {
597 NDR_CHECK(ndr_pull_named_pipe_auth_req_info2(ndr, NDR_SCALARS, &r->info2));
598 break; }
600 case 3: {
601 NDR_CHECK(ndr_pull_named_pipe_auth_req_info3(ndr, NDR_SCALARS, &r->info3));
602 break; }
604 default:
605 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
608 if (ndr_flags & NDR_BUFFERS) {
609 switch (level) {
610 case 0:
611 break;
613 case 1:
614 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1));
615 break;
617 case 2:
618 NDR_CHECK(ndr_pull_named_pipe_auth_req_info2(ndr, NDR_BUFFERS, &r->info2));
619 break;
621 case 3:
622 NDR_CHECK(ndr_pull_named_pipe_auth_req_info3(ndr, NDR_BUFFERS, &r->info3));
623 break;
625 default:
626 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
629 return NDR_ERR_SUCCESS;
632 _PUBLIC_ void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r)
634 int level;
635 level = ndr_print_get_switch_value(ndr, r);
636 ndr_print_union(ndr, name, level, "named_pipe_auth_req_info");
637 switch (level) {
638 case 0:
639 break;
641 case 1:
642 ndr_print_netr_SamInfo3(ndr, "info1", &r->info1);
643 break;
645 case 2:
646 ndr_print_named_pipe_auth_req_info2(ndr, "info2", &r->info2);
647 break;
649 case 3:
650 ndr_print_named_pipe_auth_req_info3(ndr, "info3", &r->info3);
651 break;
653 default:
654 ndr_print_bad_level(ndr, name, level);
658 _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req *r)
660 if (ndr_flags & NDR_SCALARS) {
661 NDR_CHECK(ndr_push_align(ndr, 5));
663 uint32_t _flags_save_uint32 = ndr->flags;
664 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
665 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_req(r, ndr->iconv_convenience, ndr->flags) - 4));
666 ndr->flags = _flags_save_uint32;
668 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
669 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
670 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
671 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
672 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
674 if (ndr_flags & NDR_BUFFERS) {
675 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
677 return NDR_ERR_SUCCESS;
680 _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req *r)
682 uint32_t size_magic_0 = 0;
683 if (ndr_flags & NDR_SCALARS) {
684 NDR_CHECK(ndr_pull_align(ndr, 5));
686 uint32_t _flags_save_uint32 = ndr->flags;
687 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
688 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
689 ndr->flags = _flags_save_uint32;
691 size_magic_0 = 4;
692 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, size_magic_0, sizeof(uint8_t), CH_DOS));
693 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
694 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
695 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
696 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
698 if (ndr_flags & NDR_BUFFERS) {
699 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
701 return NDR_ERR_SUCCESS;
704 _PUBLIC_ void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r)
706 ndr_print_struct(ndr, name, "named_pipe_auth_req");
707 ndr->depth++;
708 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_req(r, ndr->iconv_convenience, ndr->flags) - 4:r->length);
709 ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic);
710 ndr_print_uint32(ndr, "level", r->level);
711 ndr_print_set_switch_value(ndr, &r->info, r->level);
712 ndr_print_named_pipe_auth_req_info(ndr, "info", &r->info);
713 ndr->depth--;
716 _PUBLIC_ size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, struct smb_iconv_convenience *ic, int flags)
718 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req, ic);
721 static enum ndr_err_code ndr_push_named_pipe_auth_rep_info2(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep_info2 *r)
723 if (ndr_flags & NDR_SCALARS) {
724 NDR_CHECK(ndr_push_align(ndr, 8));
725 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->file_type));
726 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->device_state));
727 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->allocation_size));
728 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
730 if (ndr_flags & NDR_BUFFERS) {
732 return NDR_ERR_SUCCESS;
735 static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info2(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep_info2 *r)
737 if (ndr_flags & NDR_SCALARS) {
738 NDR_CHECK(ndr_pull_align(ndr, 8));
739 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->file_type));
740 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->device_state));
741 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->allocation_size));
742 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
744 if (ndr_flags & NDR_BUFFERS) {
746 return NDR_ERR_SUCCESS;
749 _PUBLIC_ void ndr_print_named_pipe_auth_rep_info2(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep_info2 *r)
751 ndr_print_struct(ndr, name, "named_pipe_auth_rep_info2");
752 ndr->depth++;
753 ndr_print_uint16(ndr, "file_type", r->file_type);
754 ndr_print_uint16(ndr, "device_state", r->device_state);
755 ndr_print_hyper(ndr, "allocation_size", r->allocation_size);
756 ndr->depth--;
759 static enum ndr_err_code ndr_push_named_pipe_auth_rep_info3(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep_info3 *r)
761 if (ndr_flags & NDR_SCALARS) {
762 NDR_CHECK(ndr_push_align(ndr, 8));
763 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->file_type));
764 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->device_state));
765 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->allocation_size));
766 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
768 if (ndr_flags & NDR_BUFFERS) {
770 return NDR_ERR_SUCCESS;
773 static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info3(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep_info3 *r)
775 if (ndr_flags & NDR_SCALARS) {
776 NDR_CHECK(ndr_pull_align(ndr, 8));
777 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->file_type));
778 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->device_state));
779 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->allocation_size));
780 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
782 if (ndr_flags & NDR_BUFFERS) {
784 return NDR_ERR_SUCCESS;
787 _PUBLIC_ void ndr_print_named_pipe_auth_rep_info3(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep_info3 *r)
789 ndr_print_struct(ndr, name, "named_pipe_auth_rep_info3");
790 ndr->depth++;
791 ndr_print_uint16(ndr, "file_type", r->file_type);
792 ndr_print_uint16(ndr, "device_state", r->device_state);
793 ndr_print_hyper(ndr, "allocation_size", r->allocation_size);
794 ndr->depth--;
797 static enum ndr_err_code ndr_push_named_pipe_auth_rep_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_rep_info *r)
799 if (ndr_flags & NDR_SCALARS) {
800 int level = ndr_push_get_switch_value(ndr, r);
801 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
802 NDR_CHECK(ndr_push_union_align(ndr, 8));
803 switch (level) {
804 case 0: {
805 break; }
807 case 1: {
808 break; }
810 case 2: {
811 NDR_CHECK(ndr_push_named_pipe_auth_rep_info2(ndr, NDR_SCALARS, &r->info2));
812 break; }
814 case 3: {
815 NDR_CHECK(ndr_push_named_pipe_auth_rep_info3(ndr, NDR_SCALARS, &r->info3));
816 break; }
818 default:
819 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
822 if (ndr_flags & NDR_BUFFERS) {
823 int level = ndr_push_get_switch_value(ndr, r);
824 switch (level) {
825 case 0:
826 break;
828 case 1:
829 break;
831 case 2:
832 break;
834 case 3:
835 break;
837 default:
838 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
841 return NDR_ERR_SUCCESS;
844 static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_rep_info *r)
846 int level;
847 uint32_t _level;
848 level = ndr_pull_get_switch_value(ndr, r);
849 if (ndr_flags & NDR_SCALARS) {
850 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
851 if (_level != level) {
852 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
854 NDR_CHECK(ndr_pull_union_align(ndr, 8));
855 switch (level) {
856 case 0: {
857 break; }
859 case 1: {
860 break; }
862 case 2: {
863 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info2(ndr, NDR_SCALARS, &r->info2));
864 break; }
866 case 3: {
867 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info3(ndr, NDR_SCALARS, &r->info3));
868 break; }
870 default:
871 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
874 if (ndr_flags & NDR_BUFFERS) {
875 switch (level) {
876 case 0:
877 break;
879 case 1:
880 break;
882 case 2:
883 break;
885 case 3:
886 break;
888 default:
889 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
892 return NDR_ERR_SUCCESS;
895 _PUBLIC_ void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r)
897 int level;
898 level = ndr_print_get_switch_value(ndr, r);
899 ndr_print_union(ndr, name, level, "named_pipe_auth_rep_info");
900 switch (level) {
901 case 0:
902 break;
904 case 1:
905 break;
907 case 2:
908 ndr_print_named_pipe_auth_rep_info2(ndr, "info2", &r->info2);
909 break;
911 case 3:
912 ndr_print_named_pipe_auth_rep_info3(ndr, "info3", &r->info3);
913 break;
915 default:
916 ndr_print_bad_level(ndr, name, level);
920 _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep *r)
922 if (ndr_flags & NDR_SCALARS) {
923 NDR_CHECK(ndr_push_align(ndr, 8));
925 uint32_t _flags_save_uint32 = ndr->flags;
926 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
927 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_rep(r, ndr->iconv_convenience, ndr->flags) - 4));
928 ndr->flags = _flags_save_uint32;
930 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
931 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
932 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
933 NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
934 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
935 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
937 if (ndr_flags & NDR_BUFFERS) {
938 NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info));
940 return NDR_ERR_SUCCESS;
943 _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep *r)
945 uint32_t size_magic_0 = 0;
946 if (ndr_flags & NDR_SCALARS) {
947 NDR_CHECK(ndr_pull_align(ndr, 8));
949 uint32_t _flags_save_uint32 = ndr->flags;
950 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
951 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
952 ndr->flags = _flags_save_uint32;
954 size_magic_0 = 4;
955 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, size_magic_0, sizeof(uint8_t), CH_DOS));
956 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
957 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
958 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
959 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
960 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
962 if (ndr_flags & NDR_BUFFERS) {
963 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info));
965 return NDR_ERR_SUCCESS;
968 _PUBLIC_ void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r)
970 ndr_print_struct(ndr, name, "named_pipe_auth_rep");
971 ndr->depth++;
972 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_rep(r, ndr->iconv_convenience, ndr->flags) - 4:r->length);
973 ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic);
974 ndr_print_uint32(ndr, "level", r->level);
975 ndr_print_set_switch_value(ndr, &r->info, r->level);
976 ndr_print_named_pipe_auth_rep_info(ndr, "info", &r->info);
977 ndr_print_NTSTATUS(ndr, "status", r->status);
978 ndr->depth--;
981 _PUBLIC_ size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, struct smb_iconv_convenience *ic, int flags)
983 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_rep, ic);