Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/librpc/gen_ndr/ndr_dfsblobs.h"
5 :
6 : #include "librpc/gen_ndr/ndr_misc.h"
7 882 : static enum ndr_err_code ndr_push_DFS_HEADER_FLAG(struct ndr_push *ndr, int ndr_flags, uint32_t r)
8 : {
9 882 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
10 882 : return NDR_ERR_SUCCESS;
11 : }
12 :
13 14 : static enum ndr_err_code ndr_pull_DFS_HEADER_FLAG(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
14 : {
15 : uint32_t v;
16 14 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
17 14 : *r = v;
18 14 : return NDR_ERR_SUCCESS;
19 : }
20 :
21 0 : _PUBLIC_ void ndr_print_DFS_HEADER_FLAG(struct ndr_print *ndr, const char *name, uint32_t r)
22 : {
23 0 : ndr_print_uint32(ndr, name, r);
24 0 : ndr->depth++;
25 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_HEADER_FLAG_REFERAL_SVR", DFS_HEADER_FLAG_REFERAL_SVR, r);
26 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_HEADER_FLAG_STORAGE_SVR", DFS_HEADER_FLAG_STORAGE_SVR, r);
27 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_HEADER_FLAG_TARGET_BCK", DFS_HEADER_FLAG_TARGET_BCK, r);
28 0 : ndr->depth--;
29 0 : }
30 :
31 1696 : static enum ndr_err_code ndr_push_DFS_SERVER_TYPE(struct ndr_push *ndr, int ndr_flags, enum DFS_SERVER_TYPE r)
32 : {
33 1696 : NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
34 1696 : return NDR_ERR_SUCCESS;
35 : }
36 :
37 20 : static enum ndr_err_code ndr_pull_DFS_SERVER_TYPE(struct ndr_pull *ndr, int ndr_flags, enum DFS_SERVER_TYPE *r)
38 : {
39 : uint16_t v;
40 20 : NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
41 20 : *r = v;
42 20 : return NDR_ERR_SUCCESS;
43 : }
44 :
45 0 : _PUBLIC_ void ndr_print_DFS_SERVER_TYPE(struct ndr_print *ndr, const char *name, enum DFS_SERVER_TYPE r)
46 : {
47 0 : const char *val = NULL;
48 :
49 0 : switch (r) {
50 0 : case DFS_SERVER_NON_ROOT: val = "DFS_SERVER_NON_ROOT"; break;
51 0 : case DFS_SERVER_ROOT: val = "DFS_SERVER_ROOT"; break;
52 : }
53 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
54 0 : }
55 :
56 1696 : static enum ndr_err_code ndr_push_DFS_FLAGS_REFERRAL(struct ndr_push *ndr, int ndr_flags, enum DFS_FLAGS_REFERRAL r)
57 : {
58 1696 : NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
59 1696 : return NDR_ERR_SUCCESS;
60 : }
61 :
62 20 : static enum ndr_err_code ndr_pull_DFS_FLAGS_REFERRAL(struct ndr_pull *ndr, int ndr_flags, enum DFS_FLAGS_REFERRAL *r)
63 : {
64 : uint16_t v;
65 20 : NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
66 20 : *r = v;
67 20 : return NDR_ERR_SUCCESS;
68 : }
69 :
70 0 : _PUBLIC_ void ndr_print_DFS_FLAGS_REFERRAL(struct ndr_print *ndr, const char *name, enum DFS_FLAGS_REFERRAL r)
71 : {
72 0 : const char *val = NULL;
73 :
74 0 : switch (r) {
75 0 : case DFS_FLAG_REFERRAL_DOMAIN_RESP: val = "DFS_FLAG_REFERRAL_DOMAIN_RESP"; break;
76 0 : case DFS_FLAG_REFERRAL_FIRST_TARGET_SET: val = "DFS_FLAG_REFERRAL_FIRST_TARGET_SET"; break;
77 : }
78 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
79 0 : }
80 :
81 0 : static enum ndr_err_code ndr_push_dfs_referral_v1(struct ndr_push *ndr, int ndr_flags, const struct dfs_referral_v1 *r)
82 : {
83 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
84 0 : if (ndr_flags & NDR_SCALARS) {
85 0 : NDR_CHECK(ndr_push_align(ndr, 5));
86 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
87 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->server_type));
88 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->entry_flags));
89 : {
90 0 : uint32_t _flags_save_string = ndr->flags;
91 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
92 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->share_name));
93 0 : ndr->flags = _flags_save_string;
94 : }
95 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
96 : }
97 0 : if (ndr_flags & NDR_BUFFERS) {
98 : {
99 0 : uint32_t _flags_save_string = ndr->flags;
100 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
101 0 : if (r->share_name) {
102 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->share_name));
103 : }
104 0 : ndr->flags = _flags_save_string;
105 : }
106 : }
107 0 : return NDR_ERR_SUCCESS;
108 : }
109 :
110 0 : static enum ndr_err_code ndr_pull_dfs_referral_v1(struct ndr_pull *ndr, int ndr_flags, struct dfs_referral_v1 *r)
111 : {
112 : uint32_t _ptr_share_name;
113 0 : TALLOC_CTX *_mem_save_share_name_0 = NULL;
114 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
115 0 : if (ndr_flags & NDR_SCALARS) {
116 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
117 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
118 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->server_type));
119 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->entry_flags));
120 : {
121 0 : uint32_t _flags_save_string = ndr->flags;
122 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
123 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share_name));
124 0 : if (_ptr_share_name) {
125 0 : NDR_PULL_ALLOC(ndr, r->share_name);
126 : } else {
127 0 : r->share_name = NULL;
128 : }
129 0 : ndr->flags = _flags_save_string;
130 : }
131 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
132 : }
133 0 : if (ndr_flags & NDR_BUFFERS) {
134 : {
135 0 : uint32_t _flags_save_string = ndr->flags;
136 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
137 0 : if (r->share_name) {
138 0 : _mem_save_share_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
139 0 : NDR_PULL_SET_MEM_CTX(ndr, r->share_name, 0);
140 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->share_name));
141 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_name_0, 0);
142 : }
143 0 : ndr->flags = _flags_save_string;
144 : }
145 : }
146 0 : return NDR_ERR_SUCCESS;
147 : }
148 :
149 0 : _PUBLIC_ void ndr_print_dfs_referral_v1(struct ndr_print *ndr, const char *name, const struct dfs_referral_v1 *r)
150 : {
151 0 : ndr_print_struct(ndr, name, "dfs_referral_v1");
152 0 : if (r == NULL) { ndr_print_null(ndr); return; }
153 0 : ndr->depth++;
154 0 : ndr_print_uint16(ndr, "size", r->size);
155 0 : ndr_print_uint16(ndr, "server_type", r->server_type);
156 0 : ndr_print_uint16(ndr, "entry_flags", r->entry_flags);
157 : {
158 0 : uint32_t _flags_save_string = ndr->flags;
159 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
160 0 : ndr_print_ptr(ndr, "share_name", r->share_name);
161 0 : ndr->depth++;
162 0 : if (r->share_name) {
163 0 : ndr_print_string(ndr, "share_name", r->share_name);
164 : }
165 0 : ndr->depth--;
166 0 : ndr->flags = _flags_save_string;
167 : }
168 0 : ndr->depth--;
169 : }
170 :
171 0 : static enum ndr_err_code ndr_push_dfs_referral_v2(struct ndr_push *ndr, int ndr_flags, const struct dfs_referral_v2 *r)
172 : {
173 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
174 0 : if (ndr_flags & NDR_SCALARS) {
175 0 : NDR_CHECK(ndr_push_align(ndr, 5));
176 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
177 0 : NDR_CHECK(ndr_push_DFS_SERVER_TYPE(ndr, NDR_SCALARS, r->server_type));
178 0 : NDR_CHECK(ndr_push_DFS_FLAGS_REFERRAL(ndr, NDR_SCALARS, r->entry_flags));
179 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->proximity));
180 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ttl));
181 : {
182 0 : uint32_t _flags_save_string = ndr->flags;
183 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
184 0 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DFS_path));
185 0 : ndr->flags = _flags_save_string;
186 : }
187 : {
188 0 : uint32_t _flags_save_string = ndr->flags;
189 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
190 0 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DFS_alt_path));
191 0 : ndr->flags = _flags_save_string;
192 : }
193 : {
194 0 : uint32_t _flags_save_string = ndr->flags;
195 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
196 0 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->netw_address));
197 0 : ndr->flags = _flags_save_string;
198 : }
199 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
200 : }
201 0 : if (ndr_flags & NDR_BUFFERS) {
202 : {
203 0 : uint32_t _flags_save_string = ndr->flags;
204 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
205 0 : if (r->DFS_path) {
206 0 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DFS_path));
207 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DFS_path));
208 : }
209 0 : ndr->flags = _flags_save_string;
210 : }
211 : {
212 0 : uint32_t _flags_save_string = ndr->flags;
213 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
214 0 : if (r->DFS_alt_path) {
215 0 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DFS_alt_path));
216 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DFS_alt_path));
217 : }
218 0 : ndr->flags = _flags_save_string;
219 : }
220 : {
221 0 : uint32_t _flags_save_string = ndr->flags;
222 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
223 0 : if (r->netw_address) {
224 0 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->netw_address));
225 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->netw_address));
226 : }
227 0 : ndr->flags = _flags_save_string;
228 : }
229 : }
230 0 : return NDR_ERR_SUCCESS;
231 : }
232 :
233 0 : static enum ndr_err_code ndr_pull_dfs_referral_v2(struct ndr_pull *ndr, int ndr_flags, struct dfs_referral_v2 *r)
234 : {
235 : uint16_t _ptr_DFS_path;
236 0 : TALLOC_CTX *_mem_save_DFS_path_0 = NULL;
237 : uint16_t _ptr_DFS_alt_path;
238 0 : TALLOC_CTX *_mem_save_DFS_alt_path_0 = NULL;
239 : uint16_t _ptr_netw_address;
240 0 : TALLOC_CTX *_mem_save_netw_address_0 = NULL;
241 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
242 0 : if (ndr_flags & NDR_SCALARS) {
243 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
244 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
245 0 : NDR_CHECK(ndr_pull_DFS_SERVER_TYPE(ndr, NDR_SCALARS, &r->server_type));
246 0 : NDR_CHECK(ndr_pull_DFS_FLAGS_REFERRAL(ndr, NDR_SCALARS, &r->entry_flags));
247 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->proximity));
248 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl));
249 : {
250 0 : uint32_t _flags_save_string = ndr->flags;
251 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
252 0 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DFS_path));
253 0 : if (_ptr_DFS_path) {
254 0 : NDR_PULL_ALLOC(ndr, r->DFS_path);
255 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DFS_path, _ptr_DFS_path));
256 : } else {
257 0 : r->DFS_path = NULL;
258 : }
259 0 : ndr->flags = _flags_save_string;
260 : }
261 : {
262 0 : uint32_t _flags_save_string = ndr->flags;
263 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
264 0 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DFS_alt_path));
265 0 : if (_ptr_DFS_alt_path) {
266 0 : NDR_PULL_ALLOC(ndr, r->DFS_alt_path);
267 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DFS_alt_path, _ptr_DFS_alt_path));
268 : } else {
269 0 : r->DFS_alt_path = NULL;
270 : }
271 0 : ndr->flags = _flags_save_string;
272 : }
273 : {
274 0 : uint32_t _flags_save_string = ndr->flags;
275 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
276 0 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_netw_address));
277 0 : if (_ptr_netw_address) {
278 0 : NDR_PULL_ALLOC(ndr, r->netw_address);
279 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->netw_address, _ptr_netw_address));
280 : } else {
281 0 : r->netw_address = NULL;
282 : }
283 0 : ndr->flags = _flags_save_string;
284 : }
285 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
286 : }
287 0 : if (ndr_flags & NDR_BUFFERS) {
288 : {
289 0 : uint32_t _flags_save_string = ndr->flags;
290 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
291 0 : if (r->DFS_path) {
292 : uint32_t _relative_save_offset;
293 0 : _relative_save_offset = ndr->offset;
294 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DFS_path));
295 0 : _mem_save_DFS_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
296 0 : NDR_PULL_SET_MEM_CTX(ndr, r->DFS_path, 0);
297 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DFS_path));
298 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DFS_path_0, 0);
299 0 : if (ndr->offset > ndr->relative_highest_offset) {
300 0 : ndr->relative_highest_offset = ndr->offset;
301 : }
302 0 : ndr->offset = _relative_save_offset;
303 : }
304 0 : ndr->flags = _flags_save_string;
305 : }
306 : {
307 0 : uint32_t _flags_save_string = ndr->flags;
308 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
309 0 : if (r->DFS_alt_path) {
310 : uint32_t _relative_save_offset;
311 0 : _relative_save_offset = ndr->offset;
312 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DFS_alt_path));
313 0 : _mem_save_DFS_alt_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
314 0 : NDR_PULL_SET_MEM_CTX(ndr, r->DFS_alt_path, 0);
315 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DFS_alt_path));
316 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DFS_alt_path_0, 0);
317 0 : if (ndr->offset > ndr->relative_highest_offset) {
318 0 : ndr->relative_highest_offset = ndr->offset;
319 : }
320 0 : ndr->offset = _relative_save_offset;
321 : }
322 0 : ndr->flags = _flags_save_string;
323 : }
324 : {
325 0 : uint32_t _flags_save_string = ndr->flags;
326 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
327 0 : if (r->netw_address) {
328 : uint32_t _relative_save_offset;
329 0 : _relative_save_offset = ndr->offset;
330 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->netw_address));
331 0 : _mem_save_netw_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
332 0 : NDR_PULL_SET_MEM_CTX(ndr, r->netw_address, 0);
333 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->netw_address));
334 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netw_address_0, 0);
335 0 : if (ndr->offset > ndr->relative_highest_offset) {
336 0 : ndr->relative_highest_offset = ndr->offset;
337 : }
338 0 : ndr->offset = _relative_save_offset;
339 : }
340 0 : ndr->flags = _flags_save_string;
341 : }
342 : }
343 0 : return NDR_ERR_SUCCESS;
344 : }
345 :
346 0 : _PUBLIC_ void ndr_print_dfs_referral_v2(struct ndr_print *ndr, const char *name, const struct dfs_referral_v2 *r)
347 : {
348 0 : ndr_print_struct(ndr, name, "dfs_referral_v2");
349 0 : if (r == NULL) { ndr_print_null(ndr); return; }
350 0 : ndr->depth++;
351 0 : ndr_print_uint16(ndr, "size", r->size);
352 0 : ndr_print_DFS_SERVER_TYPE(ndr, "server_type", r->server_type);
353 0 : ndr_print_DFS_FLAGS_REFERRAL(ndr, "entry_flags", r->entry_flags);
354 0 : ndr_print_uint32(ndr, "proximity", r->proximity);
355 0 : ndr_print_uint32(ndr, "ttl", r->ttl);
356 : {
357 0 : uint32_t _flags_save_string = ndr->flags;
358 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
359 0 : ndr_print_ptr(ndr, "DFS_path", r->DFS_path);
360 0 : ndr->depth++;
361 0 : if (r->DFS_path) {
362 0 : ndr_print_string(ndr, "DFS_path", r->DFS_path);
363 : }
364 0 : ndr->depth--;
365 0 : ndr->flags = _flags_save_string;
366 : }
367 : {
368 0 : uint32_t _flags_save_string = ndr->flags;
369 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
370 0 : ndr_print_ptr(ndr, "DFS_alt_path", r->DFS_alt_path);
371 0 : ndr->depth++;
372 0 : if (r->DFS_alt_path) {
373 0 : ndr_print_string(ndr, "DFS_alt_path", r->DFS_alt_path);
374 : }
375 0 : ndr->depth--;
376 0 : ndr->flags = _flags_save_string;
377 : }
378 : {
379 0 : uint32_t _flags_save_string = ndr->flags;
380 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
381 0 : ndr_print_ptr(ndr, "netw_address", r->netw_address);
382 0 : ndr->depth++;
383 0 : if (r->netw_address) {
384 0 : ndr_print_string(ndr, "netw_address", r->netw_address);
385 : }
386 0 : ndr->depth--;
387 0 : ndr->flags = _flags_save_string;
388 : }
389 0 : ndr->depth--;
390 : }
391 :
392 3356 : static enum ndr_err_code ndr_push_dfs_normal_referral(struct ndr_push *ndr, int ndr_flags, const struct dfs_normal_referral *r)
393 : {
394 3356 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
395 3356 : if (ndr_flags & NDR_SCALARS) {
396 1678 : NDR_CHECK(ndr_push_align(ndr, 5));
397 : {
398 1678 : uint32_t _flags_save_string = ndr->flags;
399 1678 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
400 1678 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DFS_path));
401 1678 : ndr->flags = _flags_save_string;
402 : }
403 : {
404 1678 : uint32_t _flags_save_string = ndr->flags;
405 1678 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
406 1678 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DFS_alt_path));
407 1678 : ndr->flags = _flags_save_string;
408 : }
409 : {
410 1678 : uint32_t _flags_save_string = ndr->flags;
411 1678 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
412 1678 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->netw_address));
413 1678 : ndr->flags = _flags_save_string;
414 : }
415 1678 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
416 : }
417 3356 : if (ndr_flags & NDR_BUFFERS) {
418 : {
419 1678 : uint32_t _flags_save_string = ndr->flags;
420 1678 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
421 1678 : if (r->DFS_path) {
422 1678 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DFS_path));
423 1678 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DFS_path));
424 : }
425 1678 : ndr->flags = _flags_save_string;
426 : }
427 : {
428 1678 : uint32_t _flags_save_string = ndr->flags;
429 1678 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
430 1678 : if (r->DFS_alt_path) {
431 1678 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DFS_alt_path));
432 1678 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DFS_alt_path));
433 : }
434 1678 : ndr->flags = _flags_save_string;
435 : }
436 : {
437 1678 : uint32_t _flags_save_string = ndr->flags;
438 1678 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
439 1678 : if (r->netw_address) {
440 1678 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->netw_address));
441 1678 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->netw_address));
442 : }
443 1678 : ndr->flags = _flags_save_string;
444 : }
445 : }
446 3356 : return NDR_ERR_SUCCESS;
447 : }
448 :
449 4 : static enum ndr_err_code ndr_pull_dfs_normal_referral(struct ndr_pull *ndr, int ndr_flags, struct dfs_normal_referral *r)
450 : {
451 : uint16_t _ptr_DFS_path;
452 4 : TALLOC_CTX *_mem_save_DFS_path_0 = NULL;
453 : uint16_t _ptr_DFS_alt_path;
454 4 : TALLOC_CTX *_mem_save_DFS_alt_path_0 = NULL;
455 : uint16_t _ptr_netw_address;
456 4 : TALLOC_CTX *_mem_save_netw_address_0 = NULL;
457 4 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
458 4 : if (ndr_flags & NDR_SCALARS) {
459 2 : NDR_CHECK(ndr_pull_align(ndr, 5));
460 : {
461 2 : uint32_t _flags_save_string = ndr->flags;
462 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
463 2 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DFS_path));
464 2 : if (_ptr_DFS_path) {
465 2 : NDR_PULL_ALLOC(ndr, r->DFS_path);
466 2 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DFS_path, _ptr_DFS_path));
467 : } else {
468 0 : r->DFS_path = NULL;
469 : }
470 2 : ndr->flags = _flags_save_string;
471 : }
472 : {
473 2 : uint32_t _flags_save_string = ndr->flags;
474 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
475 2 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DFS_alt_path));
476 2 : if (_ptr_DFS_alt_path) {
477 2 : NDR_PULL_ALLOC(ndr, r->DFS_alt_path);
478 2 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DFS_alt_path, _ptr_DFS_alt_path));
479 : } else {
480 0 : r->DFS_alt_path = NULL;
481 : }
482 2 : ndr->flags = _flags_save_string;
483 : }
484 : {
485 2 : uint32_t _flags_save_string = ndr->flags;
486 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
487 2 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_netw_address));
488 2 : if (_ptr_netw_address) {
489 2 : NDR_PULL_ALLOC(ndr, r->netw_address);
490 2 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->netw_address, _ptr_netw_address));
491 : } else {
492 0 : r->netw_address = NULL;
493 : }
494 2 : ndr->flags = _flags_save_string;
495 : }
496 2 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
497 : }
498 4 : if (ndr_flags & NDR_BUFFERS) {
499 : {
500 2 : uint32_t _flags_save_string = ndr->flags;
501 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
502 2 : if (r->DFS_path) {
503 : uint32_t _relative_save_offset;
504 2 : _relative_save_offset = ndr->offset;
505 2 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DFS_path));
506 2 : _mem_save_DFS_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
507 2 : NDR_PULL_SET_MEM_CTX(ndr, r->DFS_path, 0);
508 2 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DFS_path));
509 2 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DFS_path_0, 0);
510 2 : if (ndr->offset > ndr->relative_highest_offset) {
511 2 : ndr->relative_highest_offset = ndr->offset;
512 : }
513 2 : ndr->offset = _relative_save_offset;
514 : }
515 2 : ndr->flags = _flags_save_string;
516 : }
517 : {
518 2 : uint32_t _flags_save_string = ndr->flags;
519 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
520 2 : if (r->DFS_alt_path) {
521 : uint32_t _relative_save_offset;
522 2 : _relative_save_offset = ndr->offset;
523 2 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DFS_alt_path));
524 2 : _mem_save_DFS_alt_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
525 2 : NDR_PULL_SET_MEM_CTX(ndr, r->DFS_alt_path, 0);
526 2 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DFS_alt_path));
527 2 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DFS_alt_path_0, 0);
528 2 : if (ndr->offset > ndr->relative_highest_offset) {
529 2 : ndr->relative_highest_offset = ndr->offset;
530 : }
531 2 : ndr->offset = _relative_save_offset;
532 : }
533 2 : ndr->flags = _flags_save_string;
534 : }
535 : {
536 2 : uint32_t _flags_save_string = ndr->flags;
537 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
538 2 : if (r->netw_address) {
539 : uint32_t _relative_save_offset;
540 2 : _relative_save_offset = ndr->offset;
541 2 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->netw_address));
542 2 : _mem_save_netw_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
543 2 : NDR_PULL_SET_MEM_CTX(ndr, r->netw_address, 0);
544 2 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->netw_address));
545 2 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netw_address_0, 0);
546 2 : if (ndr->offset > ndr->relative_highest_offset) {
547 2 : ndr->relative_highest_offset = ndr->offset;
548 : }
549 2 : ndr->offset = _relative_save_offset;
550 : }
551 2 : ndr->flags = _flags_save_string;
552 : }
553 : }
554 4 : return NDR_ERR_SUCCESS;
555 : }
556 :
557 0 : _PUBLIC_ void ndr_print_dfs_normal_referral(struct ndr_print *ndr, const char *name, const struct dfs_normal_referral *r)
558 : {
559 0 : ndr_print_struct(ndr, name, "dfs_normal_referral");
560 0 : if (r == NULL) { ndr_print_null(ndr); return; }
561 0 : ndr->depth++;
562 : {
563 0 : uint32_t _flags_save_string = ndr->flags;
564 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
565 0 : ndr_print_ptr(ndr, "DFS_path", r->DFS_path);
566 0 : ndr->depth++;
567 0 : if (r->DFS_path) {
568 0 : ndr_print_string(ndr, "DFS_path", r->DFS_path);
569 : }
570 0 : ndr->depth--;
571 0 : ndr->flags = _flags_save_string;
572 : }
573 : {
574 0 : uint32_t _flags_save_string = ndr->flags;
575 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
576 0 : ndr_print_ptr(ndr, "DFS_alt_path", r->DFS_alt_path);
577 0 : ndr->depth++;
578 0 : if (r->DFS_alt_path) {
579 0 : ndr_print_string(ndr, "DFS_alt_path", r->DFS_alt_path);
580 : }
581 0 : ndr->depth--;
582 0 : ndr->flags = _flags_save_string;
583 : }
584 : {
585 0 : uint32_t _flags_save_string = ndr->flags;
586 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
587 0 : ndr_print_ptr(ndr, "netw_address", r->netw_address);
588 0 : ndr->depth++;
589 0 : if (r->netw_address) {
590 0 : ndr_print_string(ndr, "netw_address", r->netw_address);
591 : }
592 0 : ndr->depth--;
593 0 : ndr->flags = _flags_save_string;
594 : }
595 0 : ndr->depth--;
596 : }
597 :
598 36 : static enum ndr_err_code ndr_push_dfs_domain_referral(struct ndr_push *ndr, int ndr_flags, const struct dfs_domain_referral *r)
599 : {
600 36 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
601 36 : if (ndr_flags & NDR_SCALARS) {
602 18 : NDR_CHECK(ndr_push_align(ndr, 5));
603 : {
604 18 : uint32_t _flags_save_string = ndr->flags;
605 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
606 18 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->special_name));
607 18 : ndr->flags = _flags_save_string;
608 : }
609 18 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nb_expanded_names));
610 : {
611 18 : uint32_t _flags_save_string_array = ndr->flags;
612 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
613 18 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->expanded_names));
614 18 : ndr->flags = _flags_save_string_array;
615 : }
616 18 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
617 : }
618 36 : if (ndr_flags & NDR_BUFFERS) {
619 : {
620 18 : uint32_t _flags_save_string = ndr->flags;
621 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
622 18 : if (r->special_name) {
623 18 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->special_name));
624 18 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->special_name));
625 : }
626 18 : ndr->flags = _flags_save_string;
627 : }
628 : {
629 18 : uint32_t _flags_save_string_array = ndr->flags;
630 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
631 18 : if (r->expanded_names) {
632 6 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->expanded_names));
633 : {
634 : struct ndr_push *_ndr_expanded_names;
635 6 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_expanded_names, 0, -1));
636 6 : NDR_CHECK(ndr_push_string_array(_ndr_expanded_names, NDR_SCALARS, r->expanded_names));
637 6 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_expanded_names, 0, -1));
638 : }
639 : }
640 18 : ndr->flags = _flags_save_string_array;
641 : }
642 : }
643 36 : return NDR_ERR_SUCCESS;
644 : }
645 :
646 36 : static enum ndr_err_code ndr_pull_dfs_domain_referral(struct ndr_pull *ndr, int ndr_flags, struct dfs_domain_referral *r)
647 : {
648 : uint16_t _ptr_special_name;
649 36 : TALLOC_CTX *_mem_save_special_name_0 = NULL;
650 : uint16_t _ptr_expanded_names;
651 36 : TALLOC_CTX *_mem_save_expanded_names_0 = NULL;
652 36 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
653 36 : if (ndr_flags & NDR_SCALARS) {
654 18 : NDR_CHECK(ndr_pull_align(ndr, 5));
655 : {
656 18 : uint32_t _flags_save_string = ndr->flags;
657 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
658 18 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_special_name));
659 18 : if (_ptr_special_name) {
660 18 : NDR_PULL_ALLOC(ndr, r->special_name);
661 18 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->special_name, _ptr_special_name));
662 : } else {
663 0 : r->special_name = NULL;
664 : }
665 18 : ndr->flags = _flags_save_string;
666 : }
667 18 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nb_expanded_names));
668 : {
669 18 : uint32_t _flags_save_string_array = ndr->flags;
670 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
671 18 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_expanded_names));
672 18 : if (_ptr_expanded_names) {
673 6 : NDR_PULL_ALLOC(ndr, r->expanded_names);
674 6 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->expanded_names, _ptr_expanded_names));
675 : } else {
676 12 : r->expanded_names = NULL;
677 : }
678 18 : ndr->flags = _flags_save_string_array;
679 : }
680 18 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
681 : }
682 36 : if (ndr_flags & NDR_BUFFERS) {
683 : {
684 18 : uint32_t _flags_save_string = ndr->flags;
685 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
686 18 : if (r->special_name) {
687 : uint32_t _relative_save_offset;
688 18 : _relative_save_offset = ndr->offset;
689 18 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->special_name));
690 18 : _mem_save_special_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
691 18 : NDR_PULL_SET_MEM_CTX(ndr, r->special_name, 0);
692 18 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->special_name));
693 18 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_special_name_0, 0);
694 18 : if (ndr->offset > ndr->relative_highest_offset) {
695 18 : ndr->relative_highest_offset = ndr->offset;
696 : }
697 18 : ndr->offset = _relative_save_offset;
698 : }
699 18 : ndr->flags = _flags_save_string;
700 : }
701 : {
702 18 : uint32_t _flags_save_string_array = ndr->flags;
703 18 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
704 18 : if (r->expanded_names) {
705 : uint32_t _relative_save_offset;
706 6 : _relative_save_offset = ndr->offset;
707 6 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->expanded_names));
708 6 : _mem_save_expanded_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
709 6 : NDR_PULL_SET_MEM_CTX(ndr, r->expanded_names, 0);
710 : {
711 : struct ndr_pull *_ndr_expanded_names;
712 6 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_expanded_names, 0, -1));
713 6 : NDR_CHECK(ndr_pull_string_array(_ndr_expanded_names, NDR_SCALARS, &r->expanded_names));
714 6 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_expanded_names, 0, -1));
715 : }
716 6 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_expanded_names_0, 0);
717 6 : if (ndr->offset > ndr->relative_highest_offset) {
718 6 : ndr->relative_highest_offset = ndr->offset;
719 : }
720 6 : ndr->offset = _relative_save_offset;
721 : }
722 18 : ndr->flags = _flags_save_string_array;
723 : }
724 : }
725 36 : return NDR_ERR_SUCCESS;
726 : }
727 :
728 0 : _PUBLIC_ void ndr_print_dfs_domain_referral(struct ndr_print *ndr, const char *name, const struct dfs_domain_referral *r)
729 : {
730 0 : ndr_print_struct(ndr, name, "dfs_domain_referral");
731 0 : if (r == NULL) { ndr_print_null(ndr); return; }
732 0 : ndr->depth++;
733 : {
734 0 : uint32_t _flags_save_string = ndr->flags;
735 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
736 0 : ndr_print_ptr(ndr, "special_name", r->special_name);
737 0 : ndr->depth++;
738 0 : if (r->special_name) {
739 0 : ndr_print_string(ndr, "special_name", r->special_name);
740 : }
741 0 : ndr->depth--;
742 0 : ndr->flags = _flags_save_string;
743 : }
744 0 : ndr_print_uint16(ndr, "nb_expanded_names", r->nb_expanded_names);
745 : {
746 0 : uint32_t _flags_save_string_array = ndr->flags;
747 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
748 0 : ndr_print_ptr(ndr, "expanded_names", r->expanded_names);
749 0 : ndr->depth++;
750 0 : if (r->expanded_names) {
751 0 : ndr_print_string_array(ndr, "expanded_names", r->expanded_names);
752 : }
753 0 : ndr->depth--;
754 0 : ndr->flags = _flags_save_string_array;
755 : }
756 0 : ndr->depth--;
757 : }
758 :
759 3392 : static enum ndr_err_code ndr_push_dfs_referral(struct ndr_push *ndr, int ndr_flags, const union dfs_referral *r)
760 : {
761 : uint32_t level;
762 3392 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
763 3392 : if (ndr_flags & NDR_SCALARS) {
764 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
765 1696 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
766 1696 : NDR_CHECK(ndr_push_union_align(ndr, 5));
767 1696 : switch (level) {
768 1678 : case 0: {
769 1678 : NDR_CHECK(ndr_push_dfs_normal_referral(ndr, NDR_SCALARS, &r->r1));
770 1678 : break; }
771 :
772 18 : case 2: {
773 18 : NDR_CHECK(ndr_push_dfs_domain_referral(ndr, NDR_SCALARS, &r->r2));
774 18 : break; }
775 :
776 0 : default: {
777 0 : break; }
778 :
779 : }
780 862 : }
781 3392 : if (ndr_flags & NDR_BUFFERS) {
782 1696 : if (!(ndr_flags & NDR_SCALARS)) {
783 : /* We didn't get it above, and the token is not needed after this. */
784 1696 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
785 : }
786 1696 : switch (level) {
787 1678 : case 0:
788 1678 : NDR_CHECK(ndr_push_dfs_normal_referral(ndr, NDR_BUFFERS, &r->r1));
789 1678 : break;
790 :
791 18 : case 2:
792 18 : NDR_CHECK(ndr_push_dfs_domain_referral(ndr, NDR_BUFFERS, &r->r2));
793 18 : break;
794 :
795 0 : default:
796 0 : break;
797 :
798 : }
799 862 : }
800 3392 : return NDR_ERR_SUCCESS;
801 : }
802 :
803 40 : static enum ndr_err_code ndr_pull_dfs_referral(struct ndr_pull *ndr, int ndr_flags, union dfs_referral *r)
804 : {
805 : uint32_t level;
806 40 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
807 40 : if (ndr_flags & NDR_SCALARS) {
808 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
809 20 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
810 20 : NDR_CHECK(ndr_pull_union_align(ndr, 5));
811 20 : switch (level) {
812 2 : case 0: {
813 2 : NDR_CHECK(ndr_pull_dfs_normal_referral(ndr, NDR_SCALARS, &r->r1));
814 2 : break; }
815 :
816 18 : case 2: {
817 18 : NDR_CHECK(ndr_pull_dfs_domain_referral(ndr, NDR_SCALARS, &r->r2));
818 18 : break; }
819 :
820 0 : default: {
821 0 : break; }
822 :
823 : }
824 20 : }
825 40 : if (ndr_flags & NDR_BUFFERS) {
826 20 : if (!(ndr_flags & NDR_SCALARS)) {
827 : /* We didn't get it above, and the token is not needed after this. */
828 20 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
829 : }
830 20 : switch (level) {
831 2 : case 0:
832 2 : NDR_CHECK(ndr_pull_dfs_normal_referral(ndr, NDR_BUFFERS, &r->r1));
833 2 : break;
834 :
835 18 : case 2:
836 18 : NDR_CHECK(ndr_pull_dfs_domain_referral(ndr, NDR_BUFFERS, &r->r2));
837 18 : break;
838 :
839 0 : default:
840 0 : break;
841 :
842 : }
843 20 : }
844 40 : return NDR_ERR_SUCCESS;
845 : }
846 :
847 0 : _PUBLIC_ void ndr_print_dfs_referral(struct ndr_print *ndr, const char *name, const union dfs_referral *r)
848 : {
849 : uint32_t level;
850 0 : level = ndr_print_steal_switch_value(ndr, r);
851 0 : ndr_print_union(ndr, name, level, "dfs_referral");
852 0 : switch (level) {
853 0 : case 0:
854 0 : ndr_print_dfs_normal_referral(ndr, "r1", &r->r1);
855 0 : break;
856 :
857 0 : case 2:
858 0 : ndr_print_dfs_domain_referral(ndr, "r2", &r->r2);
859 0 : break;
860 :
861 0 : default:
862 0 : break;
863 :
864 : }
865 0 : }
866 :
867 3392 : static enum ndr_err_code ndr_push_dfs_padding(struct ndr_push *ndr, int ndr_flags, const union dfs_padding *r)
868 : {
869 : uint32_t level;
870 3392 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
871 3392 : if (ndr_flags & NDR_SCALARS) {
872 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
873 1696 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
874 1696 : NDR_CHECK(ndr_push_union_align(ndr, 1));
875 1696 : switch (level) {
876 1696 : case 16: {
877 1696 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->value, 16));
878 1696 : break; }
879 :
880 0 : default: {
881 0 : break; }
882 :
883 : }
884 862 : }
885 3392 : return NDR_ERR_SUCCESS;
886 : }
887 :
888 40 : static enum ndr_err_code ndr_pull_dfs_padding(struct ndr_pull *ndr, int ndr_flags, union dfs_padding *r)
889 : {
890 : uint32_t level;
891 40 : uint32_t size_value_0 = 0;
892 40 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
893 40 : if (ndr_flags & NDR_SCALARS) {
894 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
895 20 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
896 20 : NDR_CHECK(ndr_pull_union_align(ndr, 1));
897 20 : switch (level) {
898 20 : case 16: {
899 20 : size_value_0 = 16;
900 20 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->value, size_value_0));
901 20 : break; }
902 :
903 0 : default: {
904 0 : break; }
905 :
906 : }
907 20 : }
908 40 : return NDR_ERR_SUCCESS;
909 : }
910 :
911 0 : _PUBLIC_ void ndr_print_dfs_padding(struct ndr_print *ndr, const char *name, const union dfs_padding *r)
912 : {
913 : uint32_t level;
914 0 : level = ndr_print_steal_switch_value(ndr, r);
915 0 : ndr_print_union(ndr, name, level, "dfs_padding");
916 0 : switch (level) {
917 0 : case 16:
918 0 : ndr_print_array_uint8(ndr, "value", r->value, 16);
919 0 : break;
920 :
921 0 : default:
922 0 : break;
923 :
924 : }
925 0 : }
926 :
927 3392 : static enum ndr_err_code ndr_push_dfs_referral_v3(struct ndr_push *ndr, int ndr_flags, const struct dfs_referral_v3 *r)
928 : {
929 : {
930 3392 : uint32_t _flags_save_STRUCT = ndr->flags;
931 3392 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
932 3392 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
933 3392 : if (ndr_flags & NDR_SCALARS) {
934 1696 : NDR_CHECK(ndr_push_align(ndr, 5));
935 1696 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
936 1696 : NDR_CHECK(ndr_push_DFS_SERVER_TYPE(ndr, NDR_SCALARS, r->server_type));
937 1696 : NDR_CHECK(ndr_push_DFS_FLAGS_REFERRAL(ndr, NDR_SCALARS, r->entry_flags));
938 1696 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ttl));
939 1696 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
940 1696 : NDR_CHECK(ndr_push_dfs_referral(ndr, NDR_SCALARS, &r->referrals));
941 1696 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
942 1696 : NDR_CHECK(ndr_push_dfs_padding(ndr, NDR_SCALARS, &r->service_site_guid));
943 1696 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
944 : }
945 3392 : if (ndr_flags & NDR_BUFFERS) {
946 1696 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
947 1696 : NDR_CHECK(ndr_push_dfs_referral(ndr, NDR_BUFFERS, &r->referrals));
948 1696 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
949 1696 : NDR_CHECK(ndr_push_dfs_padding(ndr, NDR_BUFFERS, &r->service_site_guid));
950 : }
951 3392 : ndr->flags = _flags_save_STRUCT;
952 : }
953 3392 : return NDR_ERR_SUCCESS;
954 : }
955 :
956 40 : static enum ndr_err_code ndr_pull_dfs_referral_v3(struct ndr_pull *ndr, int ndr_flags, struct dfs_referral_v3 *r)
957 : {
958 : {
959 40 : uint32_t _flags_save_STRUCT = ndr->flags;
960 40 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
961 40 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
962 40 : if (ndr_flags & NDR_SCALARS) {
963 20 : NDR_CHECK(ndr_pull_align(ndr, 5));
964 20 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
965 20 : NDR_CHECK(ndr_pull_DFS_SERVER_TYPE(ndr, NDR_SCALARS, &r->server_type));
966 20 : NDR_CHECK(ndr_pull_DFS_FLAGS_REFERRAL(ndr, NDR_SCALARS, &r->entry_flags));
967 20 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl));
968 20 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
969 20 : NDR_CHECK(ndr_pull_dfs_referral(ndr, NDR_SCALARS, &r->referrals));
970 20 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
971 20 : NDR_CHECK(ndr_pull_dfs_padding(ndr, NDR_SCALARS, &r->service_site_guid));
972 20 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
973 : }
974 40 : if (ndr_flags & NDR_BUFFERS) {
975 20 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
976 20 : NDR_CHECK(ndr_pull_dfs_referral(ndr, NDR_BUFFERS, &r->referrals));
977 20 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
978 20 : NDR_CHECK(ndr_pull_dfs_padding(ndr, NDR_BUFFERS, &r->service_site_guid));
979 : }
980 40 : ndr->flags = _flags_save_STRUCT;
981 : }
982 40 : return NDR_ERR_SUCCESS;
983 : }
984 :
985 0 : _PUBLIC_ void ndr_print_dfs_referral_v3(struct ndr_print *ndr, const char *name, const struct dfs_referral_v3 *r)
986 : {
987 0 : ndr_print_struct(ndr, name, "dfs_referral_v3");
988 0 : if (r == NULL) { ndr_print_null(ndr); return; }
989 : {
990 0 : uint32_t _flags_save_STRUCT = ndr->flags;
991 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
992 0 : ndr->depth++;
993 0 : ndr_print_uint16(ndr, "size", r->size);
994 0 : ndr_print_DFS_SERVER_TYPE(ndr, "server_type", r->server_type);
995 0 : ndr_print_DFS_FLAGS_REFERRAL(ndr, "entry_flags", r->entry_flags);
996 0 : ndr_print_uint32(ndr, "ttl", r->ttl);
997 0 : ndr_print_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP);
998 0 : ndr_print_dfs_referral(ndr, "referrals", &r->referrals);
999 0 : ndr_print_set_switch_value(ndr, &r->service_site_guid, r->size - 18);
1000 0 : ndr_print_dfs_padding(ndr, "service_site_guid", &r->service_site_guid);
1001 0 : ndr->depth--;
1002 0 : ndr->flags = _flags_save_STRUCT;
1003 : }
1004 : }
1005 :
1006 3392 : static enum ndr_err_code ndr_push_dfs_referral_version(struct ndr_push *ndr, int ndr_flags, const union dfs_referral_version *r)
1007 : {
1008 : uint32_t level;
1009 3392 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1010 3392 : if (ndr_flags & NDR_SCALARS) {
1011 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1012 1696 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1013 1696 : NDR_CHECK(ndr_push_union_align(ndr, 5));
1014 1696 : switch (level) {
1015 0 : case 1: {
1016 0 : NDR_CHECK(ndr_push_dfs_referral_v1(ndr, NDR_SCALARS, &r->v1));
1017 0 : break; }
1018 :
1019 0 : case 2: {
1020 0 : NDR_CHECK(ndr_push_dfs_referral_v2(ndr, NDR_SCALARS, &r->v2));
1021 0 : break; }
1022 :
1023 1695 : case 3: {
1024 1695 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_SCALARS, &r->v3));
1025 1695 : break; }
1026 :
1027 1 : case 4: {
1028 1 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_SCALARS, &r->v4));
1029 1 : break; }
1030 :
1031 0 : default: {
1032 0 : break; }
1033 :
1034 : }
1035 862 : }
1036 3392 : if (ndr_flags & NDR_BUFFERS) {
1037 1696 : if (!(ndr_flags & NDR_SCALARS)) {
1038 : /* We didn't get it above, and the token is not needed after this. */
1039 1696 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1040 : }
1041 1696 : switch (level) {
1042 0 : case 1:
1043 0 : NDR_CHECK(ndr_push_dfs_referral_v1(ndr, NDR_BUFFERS, &r->v1));
1044 0 : break;
1045 :
1046 0 : case 2:
1047 0 : NDR_CHECK(ndr_push_dfs_referral_v2(ndr, NDR_BUFFERS, &r->v2));
1048 0 : break;
1049 :
1050 1695 : case 3:
1051 1695 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v3));
1052 1695 : break;
1053 :
1054 1 : case 4:
1055 1 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v4));
1056 1 : break;
1057 :
1058 0 : default:
1059 0 : break;
1060 :
1061 : }
1062 862 : }
1063 3392 : return NDR_ERR_SUCCESS;
1064 : }
1065 :
1066 40 : static enum ndr_err_code ndr_pull_dfs_referral_version(struct ndr_pull *ndr, int ndr_flags, union dfs_referral_version *r)
1067 : {
1068 : uint32_t level;
1069 40 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1070 40 : if (ndr_flags & NDR_SCALARS) {
1071 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1072 20 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1073 20 : NDR_CHECK(ndr_pull_union_align(ndr, 5));
1074 20 : switch (level) {
1075 0 : case 1: {
1076 0 : NDR_CHECK(ndr_pull_dfs_referral_v1(ndr, NDR_SCALARS, &r->v1));
1077 0 : break; }
1078 :
1079 0 : case 2: {
1080 0 : NDR_CHECK(ndr_pull_dfs_referral_v2(ndr, NDR_SCALARS, &r->v2));
1081 0 : break; }
1082 :
1083 19 : case 3: {
1084 19 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_SCALARS, &r->v3));
1085 19 : break; }
1086 :
1087 1 : case 4: {
1088 1 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_SCALARS, &r->v4));
1089 1 : break; }
1090 :
1091 0 : default: {
1092 0 : break; }
1093 :
1094 : }
1095 20 : }
1096 40 : if (ndr_flags & NDR_BUFFERS) {
1097 20 : if (!(ndr_flags & NDR_SCALARS)) {
1098 : /* We didn't get it above, and the token is not needed after this. */
1099 20 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1100 : }
1101 20 : switch (level) {
1102 0 : case 1:
1103 0 : NDR_CHECK(ndr_pull_dfs_referral_v1(ndr, NDR_BUFFERS, &r->v1));
1104 0 : break;
1105 :
1106 0 : case 2:
1107 0 : NDR_CHECK(ndr_pull_dfs_referral_v2(ndr, NDR_BUFFERS, &r->v2));
1108 0 : break;
1109 :
1110 19 : case 3:
1111 19 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v3));
1112 19 : break;
1113 :
1114 1 : case 4:
1115 1 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v4));
1116 1 : break;
1117 :
1118 0 : default:
1119 0 : break;
1120 :
1121 : }
1122 20 : }
1123 40 : return NDR_ERR_SUCCESS;
1124 : }
1125 :
1126 0 : _PUBLIC_ void ndr_print_dfs_referral_version(struct ndr_print *ndr, const char *name, const union dfs_referral_version *r)
1127 : {
1128 : uint32_t level;
1129 0 : level = ndr_print_steal_switch_value(ndr, r);
1130 0 : ndr_print_union(ndr, name, level, "dfs_referral_version");
1131 0 : switch (level) {
1132 0 : case 1:
1133 0 : ndr_print_dfs_referral_v1(ndr, "v1", &r->v1);
1134 0 : break;
1135 :
1136 0 : case 2:
1137 0 : ndr_print_dfs_referral_v2(ndr, "v2", &r->v2);
1138 0 : break;
1139 :
1140 0 : case 3:
1141 0 : ndr_print_dfs_referral_v3(ndr, "v3", &r->v3);
1142 0 : break;
1143 :
1144 0 : case 4:
1145 0 : ndr_print_dfs_referral_v3(ndr, "v4", &r->v4);
1146 0 : break;
1147 :
1148 0 : default:
1149 0 : break;
1150 :
1151 : }
1152 0 : }
1153 :
1154 3392 : static enum ndr_err_code ndr_push_dfs_referral_type(struct ndr_push *ndr, int ndr_flags, const struct dfs_referral_type *r)
1155 : {
1156 3392 : uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
1157 : {
1158 3392 : uint32_t _flags_save_STRUCT = ndr->flags;
1159 3392 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1160 3392 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1161 3392 : if (ndr_flags & NDR_SCALARS) {
1162 1696 : NDR_CHECK(ndr_push_align(ndr, 5));
1163 1696 : NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
1164 1696 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version));
1165 1696 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referral, r->version));
1166 1696 : NDR_CHECK(ndr_push_dfs_referral_version(ndr, NDR_SCALARS, &r->referral));
1167 1696 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1168 : }
1169 3392 : if (ndr_flags & NDR_BUFFERS) {
1170 1696 : NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
1171 1696 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referral, r->version));
1172 1696 : NDR_CHECK(ndr_push_dfs_referral_version(ndr, NDR_BUFFERS, &r->referral));
1173 : }
1174 3392 : ndr->flags = _flags_save_STRUCT;
1175 : }
1176 3392 : ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
1177 3392 : return NDR_ERR_SUCCESS;
1178 : }
1179 :
1180 40 : static enum ndr_err_code ndr_pull_dfs_referral_type(struct ndr_pull *ndr, int ndr_flags, struct dfs_referral_type *r)
1181 : {
1182 40 : uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
1183 : {
1184 40 : uint32_t _flags_save_STRUCT = ndr->flags;
1185 40 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1186 40 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1187 40 : if (ndr_flags & NDR_SCALARS) {
1188 20 : NDR_CHECK(ndr_pull_align(ndr, 5));
1189 20 : NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
1190 20 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version));
1191 20 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referral, r->version));
1192 20 : NDR_CHECK(ndr_pull_dfs_referral_version(ndr, NDR_SCALARS, &r->referral));
1193 20 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1194 : }
1195 40 : if (ndr_flags & NDR_BUFFERS) {
1196 20 : NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
1197 20 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referral, r->version));
1198 20 : NDR_CHECK(ndr_pull_dfs_referral_version(ndr, NDR_BUFFERS, &r->referral));
1199 : }
1200 40 : ndr->flags = _flags_save_STRUCT;
1201 : }
1202 40 : ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
1203 40 : return NDR_ERR_SUCCESS;
1204 : }
1205 :
1206 0 : _PUBLIC_ void ndr_print_dfs_referral_type(struct ndr_print *ndr, const char *name, const struct dfs_referral_type *r)
1207 : {
1208 0 : ndr_print_struct(ndr, name, "dfs_referral_type");
1209 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1210 : {
1211 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1212 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1213 0 : ndr->depth++;
1214 0 : ndr_print_uint16(ndr, "version", r->version);
1215 0 : ndr_print_set_switch_value(ndr, &r->referral, r->version);
1216 0 : ndr_print_dfs_referral_version(ndr, "referral", &r->referral);
1217 0 : ndr->depth--;
1218 0 : ndr->flags = _flags_save_STRUCT;
1219 : }
1220 : }
1221 :
1222 882 : _PUBLIC_ enum ndr_err_code ndr_push_dfs_referral_resp(struct ndr_push *ndr, int ndr_flags, const struct dfs_referral_resp *r)
1223 : {
1224 : uint32_t cntr_referral_entries_0;
1225 882 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1226 882 : if (ndr_flags & NDR_SCALARS) {
1227 882 : NDR_CHECK(ndr_push_align(ndr, 5));
1228 882 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->path_consumed));
1229 882 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nb_referrals));
1230 882 : NDR_CHECK(ndr_push_DFS_HEADER_FLAG(ndr, NDR_SCALARS, r->header_flags));
1231 2578 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (r->nb_referrals); cntr_referral_entries_0++) {
1232 1696 : NDR_CHECK(ndr_push_dfs_referral_type(ndr, NDR_SCALARS, &r->referral_entries[cntr_referral_entries_0]));
1233 : }
1234 882 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1235 : }
1236 882 : if (ndr_flags & NDR_BUFFERS) {
1237 2578 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (r->nb_referrals); cntr_referral_entries_0++) {
1238 1696 : NDR_CHECK(ndr_push_dfs_referral_type(ndr, NDR_BUFFERS, &r->referral_entries[cntr_referral_entries_0]));
1239 : }
1240 : }
1241 882 : return NDR_ERR_SUCCESS;
1242 : }
1243 :
1244 14 : _PUBLIC_ enum ndr_err_code ndr_pull_dfs_referral_resp(struct ndr_pull *ndr, int ndr_flags, struct dfs_referral_resp *r)
1245 : {
1246 14 : uint32_t size_referral_entries_0 = 0;
1247 : uint32_t cntr_referral_entries_0;
1248 14 : TALLOC_CTX *_mem_save_referral_entries_0 = NULL;
1249 14 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1250 14 : if (ndr_flags & NDR_SCALARS) {
1251 14 : NDR_CHECK(ndr_pull_align(ndr, 5));
1252 14 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->path_consumed));
1253 14 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nb_referrals));
1254 14 : NDR_CHECK(ndr_pull_DFS_HEADER_FLAG(ndr, NDR_SCALARS, &r->header_flags));
1255 14 : size_referral_entries_0 = r->nb_referrals;
1256 14 : NDR_PULL_ALLOC_N(ndr, r->referral_entries, size_referral_entries_0);
1257 14 : _mem_save_referral_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
1258 14 : NDR_PULL_SET_MEM_CTX(ndr, r->referral_entries, 0);
1259 34 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (size_referral_entries_0); cntr_referral_entries_0++) {
1260 20 : NDR_CHECK(ndr_pull_dfs_referral_type(ndr, NDR_SCALARS, &r->referral_entries[cntr_referral_entries_0]));
1261 : }
1262 14 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_referral_entries_0, 0);
1263 14 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1264 : }
1265 14 : if (ndr_flags & NDR_BUFFERS) {
1266 14 : size_referral_entries_0 = r->nb_referrals;
1267 14 : _mem_save_referral_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
1268 14 : NDR_PULL_SET_MEM_CTX(ndr, r->referral_entries, 0);
1269 34 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (size_referral_entries_0); cntr_referral_entries_0++) {
1270 20 : NDR_CHECK(ndr_pull_dfs_referral_type(ndr, NDR_BUFFERS, &r->referral_entries[cntr_referral_entries_0]));
1271 : }
1272 14 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_referral_entries_0, 0);
1273 14 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (size_referral_entries_0); cntr_referral_entries_0++) {
1274 : }
1275 : }
1276 14 : return NDR_ERR_SUCCESS;
1277 : }
1278 :
1279 0 : static void ndr_print_flags_dfs_referral_resp(struct ndr_print *ndr, const char *name, int unused, const struct dfs_referral_resp *r)
1280 : {
1281 0 : ndr_print_dfs_referral_resp(ndr, name, r);
1282 0 : }
1283 :
1284 0 : _PUBLIC_ void ndr_print_dfs_referral_resp(struct ndr_print *ndr, const char *name, const struct dfs_referral_resp *r)
1285 : {
1286 : uint32_t cntr_referral_entries_0;
1287 0 : ndr_print_struct(ndr, name, "dfs_referral_resp");
1288 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1289 0 : ndr->depth++;
1290 0 : ndr_print_uint16(ndr, "path_consumed", r->path_consumed);
1291 0 : ndr_print_uint16(ndr, "nb_referrals", r->nb_referrals);
1292 0 : ndr_print_DFS_HEADER_FLAG(ndr, "header_flags", r->header_flags);
1293 0 : ndr->print(ndr, "%s: ARRAY(%d)", "referral_entries", (int)r->nb_referrals);
1294 0 : ndr->depth++;
1295 0 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (r->nb_referrals); cntr_referral_entries_0++) {
1296 0 : ndr_print_dfs_referral_type(ndr, "referral_entries", &r->referral_entries[cntr_referral_entries_0]);
1297 : }
1298 0 : ndr->depth--;
1299 0 : ndr->depth--;
1300 : }
1301 :
1302 17 : _PUBLIC_ enum ndr_err_code ndr_push_dfs_GetDFSReferral_in(struct ndr_push *ndr, int ndr_flags, const struct dfs_GetDFSReferral_in *r)
1303 : {
1304 17 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1305 17 : if (ndr_flags & NDR_SCALARS) {
1306 17 : NDR_CHECK(ndr_push_align(ndr, 4));
1307 17 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_referral_level));
1308 : {
1309 17 : uint32_t _flags_save_string = ndr->flags;
1310 17 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
1311 17 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
1312 17 : ndr->flags = _flags_save_string;
1313 : }
1314 17 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1315 : }
1316 17 : if (ndr_flags & NDR_BUFFERS) {
1317 : }
1318 17 : return NDR_ERR_SUCCESS;
1319 : }
1320 :
1321 17 : _PUBLIC_ enum ndr_err_code ndr_pull_dfs_GetDFSReferral_in(struct ndr_pull *ndr, int ndr_flags, struct dfs_GetDFSReferral_in *r)
1322 : {
1323 17 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1324 17 : if (ndr_flags & NDR_SCALARS) {
1325 17 : NDR_CHECK(ndr_pull_align(ndr, 4));
1326 17 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_referral_level));
1327 : {
1328 17 : uint32_t _flags_save_string = ndr->flags;
1329 17 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
1330 17 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
1331 17 : ndr->flags = _flags_save_string;
1332 : }
1333 17 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1334 : }
1335 17 : if (ndr_flags & NDR_BUFFERS) {
1336 : }
1337 17 : return NDR_ERR_SUCCESS;
1338 : }
1339 :
1340 0 : static void ndr_print_flags_dfs_GetDFSReferral_in(struct ndr_print *ndr, const char *name, int unused, const struct dfs_GetDFSReferral_in *r)
1341 : {
1342 0 : ndr_print_dfs_GetDFSReferral_in(ndr, name, r);
1343 0 : }
1344 :
1345 0 : _PUBLIC_ void ndr_print_dfs_GetDFSReferral_in(struct ndr_print *ndr, const char *name, const struct dfs_GetDFSReferral_in *r)
1346 : {
1347 0 : ndr_print_struct(ndr, name, "dfs_GetDFSReferral_in");
1348 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1349 0 : ndr->depth++;
1350 0 : ndr_print_uint16(ndr, "max_referral_level", r->max_referral_level);
1351 : {
1352 0 : uint32_t _flags_save_string = ndr->flags;
1353 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
1354 0 : ndr_print_string(ndr, "servername", r->servername);
1355 0 : ndr->flags = _flags_save_string;
1356 : }
1357 0 : ndr->depth--;
1358 : }
1359 :
1360 0 : _PUBLIC_ enum ndr_err_code ndr_push_dfs_GetDFSReferral(struct ndr_push *ndr, int flags, const struct dfs_GetDFSReferral *r)
1361 : {
1362 0 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1363 0 : if (flags & NDR_IN) {
1364 0 : NDR_CHECK(ndr_push_dfs_GetDFSReferral_in(ndr, NDR_SCALARS, &r->in.req));
1365 : }
1366 0 : if (flags & NDR_OUT) {
1367 0 : if (r->out.resp == NULL) {
1368 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1369 : }
1370 0 : NDR_CHECK(ndr_push_dfs_referral_resp(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.resp));
1371 : }
1372 0 : return NDR_ERR_SUCCESS;
1373 : }
1374 :
1375 0 : _PUBLIC_ enum ndr_err_code ndr_pull_dfs_GetDFSReferral(struct ndr_pull *ndr, int flags, struct dfs_GetDFSReferral *r)
1376 : {
1377 0 : TALLOC_CTX *_mem_save_resp_0 = NULL;
1378 0 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1379 0 : if (flags & NDR_IN) {
1380 0 : NDR_ZERO_STRUCT(r->out);
1381 :
1382 0 : NDR_CHECK(ndr_pull_dfs_GetDFSReferral_in(ndr, NDR_SCALARS, &r->in.req));
1383 0 : NDR_PULL_ALLOC(ndr, r->out.resp);
1384 0 : NDR_ZERO_STRUCTP(r->out.resp);
1385 : }
1386 0 : if (flags & NDR_OUT) {
1387 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1388 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1389 0 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1390 0 : NDR_PULL_ALLOC(ndr, r->out.resp);
1391 : }
1392 0 : _mem_save_resp_0 = NDR_PULL_GET_MEM_CTX(ndr);
1393 0 : NDR_PULL_SET_MEM_CTX(ndr, r->out.resp, LIBNDR_FLAG_REF_ALLOC);
1394 0 : NDR_CHECK(ndr_pull_dfs_referral_resp(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.resp));
1395 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resp_0, LIBNDR_FLAG_REF_ALLOC);
1396 : }
1397 0 : return NDR_ERR_SUCCESS;
1398 : }
1399 :
1400 0 : _PUBLIC_ void ndr_print_dfs_GetDFSReferral(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetDFSReferral *r)
1401 : {
1402 0 : ndr_print_struct(ndr, name, "dfs_GetDFSReferral");
1403 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1404 0 : ndr->depth++;
1405 0 : if (flags & NDR_SET_VALUES) {
1406 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1407 : }
1408 0 : if (flags & NDR_IN) {
1409 0 : ndr_print_struct(ndr, "in", "dfs_GetDFSReferral");
1410 0 : ndr->depth++;
1411 0 : ndr_print_dfs_GetDFSReferral_in(ndr, "req", &r->in.req);
1412 0 : ndr->depth--;
1413 : }
1414 0 : if (flags & NDR_OUT) {
1415 0 : ndr_print_struct(ndr, "out", "dfs_GetDFSReferral");
1416 0 : ndr->depth++;
1417 0 : ndr_print_ptr(ndr, "resp", r->out.resp);
1418 0 : ndr->depth++;
1419 0 : ndr_print_dfs_referral_resp(ndr, "resp", r->out.resp);
1420 0 : ndr->depth--;
1421 0 : ndr->depth--;
1422 : }
1423 0 : ndr->depth--;
1424 : }
1425 :
1426 : #ifndef SKIP_NDR_TABLE_dfsblobs
1427 : static const struct ndr_interface_public_struct dfsblobs_public_structs[] = {
1428 : {
1429 : .name = "dfs_referral_resp",
1430 : .struct_size = sizeof(struct dfs_referral_resp ),
1431 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_dfs_referral_resp,
1432 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_dfs_referral_resp,
1433 : .ndr_print = (ndr_print_function_t) ndr_print_flags_dfs_referral_resp,
1434 : },
1435 : {
1436 : .name = "dfs_GetDFSReferral_in",
1437 : .struct_size = sizeof(struct dfs_GetDFSReferral_in ),
1438 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_dfs_GetDFSReferral_in,
1439 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_dfs_GetDFSReferral_in,
1440 : .ndr_print = (ndr_print_function_t) ndr_print_flags_dfs_GetDFSReferral_in,
1441 : },
1442 : { .name = NULL }
1443 : };
1444 :
1445 : static const struct ndr_interface_call dfsblobs_calls[] = {
1446 : {
1447 : "dfs_GetDFSReferral",
1448 : sizeof(struct dfs_GetDFSReferral),
1449 : (ndr_push_flags_fn_t) ndr_push_dfs_GetDFSReferral,
1450 : (ndr_pull_flags_fn_t) ndr_pull_dfs_GetDFSReferral,
1451 : (ndr_print_function_t) ndr_print_dfs_GetDFSReferral,
1452 : { 0, NULL },
1453 : { 0, NULL },
1454 : },
1455 : { .name = NULL }
1456 : };
1457 :
1458 : static const char * const dfsblobs_endpoint_strings[] = {
1459 : "ncacn_np:[\\pipe\\dfsblobs]",
1460 : };
1461 :
1462 : static const struct ndr_interface_string_array dfsblobs_endpoints = {
1463 : .count = 1,
1464 : .names = dfsblobs_endpoint_strings
1465 : };
1466 :
1467 : static const char * const dfsblobs_authservice_strings[] = {
1468 : "host",
1469 : };
1470 :
1471 : static const struct ndr_interface_string_array dfsblobs_authservices = {
1472 : .count = 1,
1473 : .names = dfsblobs_authservice_strings
1474 : };
1475 :
1476 :
1477 : const struct ndr_interface_table ndr_table_dfsblobs = {
1478 : .name = "dfsblobs",
1479 : .syntax_id = {
1480 : {0x12345778,0x1234,0xabcd,{0x00,0x01},{0x00,0x00,0x00,0x03}},
1481 : NDR_DFSBLOBS_VERSION
1482 : },
1483 : .helpstring = NDR_DFSBLOBS_HELPSTRING,
1484 : .num_calls = 1,
1485 : .calls = dfsblobs_calls,
1486 : .num_public_structs = 2,
1487 : .public_structs = dfsblobs_public_structs,
1488 : .endpoints = &dfsblobs_endpoints,
1489 : .authservices = &dfsblobs_authservices
1490 : };
1491 :
1492 : #endif /* SKIP_NDR_TABLE_dfsblobs */
|