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 5946 : static enum ndr_err_code ndr_push_DFS_HEADER_FLAG(struct ndr_push *ndr, ndr_flags_type ndr_flags, uint32_t r)
8 : {
9 5946 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
10 5944 : return NDR_ERR_SUCCESS;
11 : }
12 :
13 46 : static enum ndr_err_code ndr_pull_DFS_HEADER_FLAG(struct ndr_pull *ndr, ndr_flags_type ndr_flags, uint32_t *r)
14 : {
15 4 : uint32_t v;
16 46 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
17 46 : *r = v;
18 46 : return NDR_ERR_SUCCESS;
19 : }
20 :
21 4 : _PUBLIC_ void ndr_print_DFS_HEADER_FLAG(struct ndr_print *ndr, const char *name, uint32_t r)
22 : {
23 4 : ndr_print_uint32(ndr, name, r);
24 4 : ndr->depth++;
25 4 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_HEADER_FLAG_REFERAL_SVR", DFS_HEADER_FLAG_REFERAL_SVR, r);
26 4 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_HEADER_FLAG_STORAGE_SVR", DFS_HEADER_FLAG_STORAGE_SVR, r);
27 4 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_HEADER_FLAG_TARGET_BCK", DFS_HEADER_FLAG_TARGET_BCK, r);
28 4 : ndr->depth--;
29 4 : }
30 :
31 9952 : static enum ndr_err_code ndr_push_DFS_SERVER_TYPE(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum DFS_SERVER_TYPE r)
32 : {
33 9952 : NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
34 9950 : return NDR_ERR_SUCCESS;
35 : }
36 :
37 66 : static enum ndr_err_code ndr_pull_DFS_SERVER_TYPE(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum DFS_SERVER_TYPE *r)
38 : {
39 6 : uint16_t v;
40 66 : NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
41 66 : *r = v;
42 66 : return NDR_ERR_SUCCESS;
43 : }
44 :
45 6 : _PUBLIC_ void ndr_print_DFS_SERVER_TYPE(struct ndr_print *ndr, const char *name, enum DFS_SERVER_TYPE r)
46 : {
47 6 : const char *val = NULL;
48 :
49 6 : switch (r) {
50 6 : case DFS_SERVER_NON_ROOT: val = "DFS_SERVER_NON_ROOT"; break;
51 0 : case DFS_SERVER_ROOT: val = "DFS_SERVER_ROOT"; break;
52 : }
53 6 : ndr_print_enum(ndr, name, "ENUM", val, r);
54 6 : }
55 :
56 9952 : static enum ndr_err_code ndr_push_DFS_FLAGS_REFERRAL(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum DFS_FLAGS_REFERRAL r)
57 : {
58 9952 : NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
59 9950 : return NDR_ERR_SUCCESS;
60 : }
61 :
62 66 : static enum ndr_err_code ndr_pull_DFS_FLAGS_REFERRAL(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum DFS_FLAGS_REFERRAL *r)
63 : {
64 6 : uint16_t v;
65 66 : NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
66 66 : *r = v;
67 66 : return NDR_ERR_SUCCESS;
68 : }
69 :
70 6 : _PUBLIC_ void ndr_print_DFS_FLAGS_REFERRAL(struct ndr_print *ndr, const char *name, enum DFS_FLAGS_REFERRAL r)
71 : {
72 6 : const char *val = NULL;
73 :
74 6 : switch (r) {
75 6 : 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 6 : ndr_print_enum(ndr, name, "ENUM", val, r);
79 6 : }
80 :
81 0 : static enum ndr_err_code ndr_push_dfs_referral_v1(struct ndr_push *ndr, ndr_flags_type 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 : libndr_flags _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 : libndr_flags _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, ndr_flags_type ndr_flags, struct dfs_referral_v1 *r)
111 : {
112 0 : 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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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, ndr_flags_type 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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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, ndr_flags_type ndr_flags, struct dfs_referral_v2 *r)
234 : {
235 0 : uint16_t _ptr_DFS_path;
236 0 : TALLOC_CTX *_mem_save_DFS_path_0 = NULL;
237 0 : uint16_t _ptr_DFS_alt_path;
238 0 : TALLOC_CTX *_mem_save_DFS_alt_path_0 = NULL;
239 0 : 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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 0 : 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 : libndr_flags _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 0 : 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 : libndr_flags _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 0 : 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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 19792 : static enum ndr_err_code ndr_push_dfs_normal_referral(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct dfs_normal_referral *r)
393 : {
394 19792 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
395 19792 : if (ndr_flags & NDR_SCALARS) {
396 9896 : NDR_CHECK(ndr_push_align(ndr, 5));
397 : {
398 9896 : libndr_flags _flags_save_string = ndr->flags;
399 9896 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
400 9896 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DFS_path));
401 9896 : ndr->flags = _flags_save_string;
402 : }
403 : {
404 9896 : libndr_flags _flags_save_string = ndr->flags;
405 9896 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
406 9896 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->DFS_alt_path));
407 9896 : ndr->flags = _flags_save_string;
408 : }
409 : {
410 9896 : libndr_flags _flags_save_string = ndr->flags;
411 9896 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
412 9896 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->netw_address));
413 9896 : ndr->flags = _flags_save_string;
414 : }
415 9896 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
416 : }
417 19792 : if (ndr_flags & NDR_BUFFERS) {
418 : {
419 9896 : libndr_flags _flags_save_string = ndr->flags;
420 9896 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
421 9896 : if (r->DFS_path) {
422 9896 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DFS_path));
423 9896 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DFS_path));
424 : }
425 9896 : ndr->flags = _flags_save_string;
426 : }
427 : {
428 9896 : libndr_flags _flags_save_string = ndr->flags;
429 9896 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
430 9896 : if (r->DFS_alt_path) {
431 9896 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->DFS_alt_path));
432 9896 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->DFS_alt_path));
433 : }
434 9896 : ndr->flags = _flags_save_string;
435 : }
436 : {
437 9896 : libndr_flags _flags_save_string = ndr->flags;
438 9896 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
439 9896 : if (r->netw_address) {
440 9896 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->netw_address));
441 9896 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->netw_address));
442 : }
443 9896 : ndr->flags = _flags_save_string;
444 : }
445 : }
446 19792 : return NDR_ERR_SUCCESS;
447 : }
448 :
449 12 : static enum ndr_err_code ndr_pull_dfs_normal_referral(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct dfs_normal_referral *r)
450 : {
451 0 : uint16_t _ptr_DFS_path;
452 12 : TALLOC_CTX *_mem_save_DFS_path_0 = NULL;
453 0 : uint16_t _ptr_DFS_alt_path;
454 12 : TALLOC_CTX *_mem_save_DFS_alt_path_0 = NULL;
455 0 : uint16_t _ptr_netw_address;
456 12 : TALLOC_CTX *_mem_save_netw_address_0 = NULL;
457 12 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
458 12 : if (ndr_flags & NDR_SCALARS) {
459 6 : NDR_CHECK(ndr_pull_align(ndr, 5));
460 : {
461 6 : libndr_flags _flags_save_string = ndr->flags;
462 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
463 6 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DFS_path));
464 6 : if (_ptr_DFS_path) {
465 6 : NDR_PULL_ALLOC(ndr, r->DFS_path);
466 6 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DFS_path, _ptr_DFS_path));
467 : } else {
468 0 : r->DFS_path = NULL;
469 : }
470 6 : ndr->flags = _flags_save_string;
471 : }
472 : {
473 6 : libndr_flags _flags_save_string = ndr->flags;
474 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
475 6 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_DFS_alt_path));
476 6 : if (_ptr_DFS_alt_path) {
477 6 : NDR_PULL_ALLOC(ndr, r->DFS_alt_path);
478 6 : 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 6 : ndr->flags = _flags_save_string;
483 : }
484 : {
485 6 : libndr_flags _flags_save_string = ndr->flags;
486 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
487 6 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_netw_address));
488 6 : if (_ptr_netw_address) {
489 6 : NDR_PULL_ALLOC(ndr, r->netw_address);
490 6 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->netw_address, _ptr_netw_address));
491 : } else {
492 0 : r->netw_address = NULL;
493 : }
494 6 : ndr->flags = _flags_save_string;
495 : }
496 6 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
497 : }
498 12 : if (ndr_flags & NDR_BUFFERS) {
499 : {
500 6 : libndr_flags _flags_save_string = ndr->flags;
501 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
502 6 : if (r->DFS_path) {
503 0 : uint32_t _relative_save_offset;
504 6 : _relative_save_offset = ndr->offset;
505 6 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DFS_path));
506 6 : _mem_save_DFS_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
507 6 : NDR_PULL_SET_MEM_CTX(ndr, r->DFS_path, 0);
508 6 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DFS_path));
509 6 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DFS_path_0, 0);
510 6 : if (ndr->offset > ndr->relative_highest_offset) {
511 6 : ndr->relative_highest_offset = ndr->offset;
512 : }
513 6 : ndr->offset = _relative_save_offset;
514 : }
515 6 : ndr->flags = _flags_save_string;
516 : }
517 : {
518 6 : libndr_flags _flags_save_string = ndr->flags;
519 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
520 6 : if (r->DFS_alt_path) {
521 0 : uint32_t _relative_save_offset;
522 6 : _relative_save_offset = ndr->offset;
523 6 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DFS_alt_path));
524 6 : _mem_save_DFS_alt_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
525 6 : NDR_PULL_SET_MEM_CTX(ndr, r->DFS_alt_path, 0);
526 6 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->DFS_alt_path));
527 6 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DFS_alt_path_0, 0);
528 6 : if (ndr->offset > ndr->relative_highest_offset) {
529 6 : ndr->relative_highest_offset = ndr->offset;
530 : }
531 6 : ndr->offset = _relative_save_offset;
532 : }
533 6 : ndr->flags = _flags_save_string;
534 : }
535 : {
536 6 : libndr_flags _flags_save_string = ndr->flags;
537 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
538 6 : if (r->netw_address) {
539 0 : uint32_t _relative_save_offset;
540 6 : _relative_save_offset = ndr->offset;
541 6 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->netw_address));
542 6 : _mem_save_netw_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
543 6 : NDR_PULL_SET_MEM_CTX(ndr, r->netw_address, 0);
544 6 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->netw_address));
545 6 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netw_address_0, 0);
546 6 : if (ndr->offset > ndr->relative_highest_offset) {
547 6 : ndr->relative_highest_offset = ndr->offset;
548 : }
549 6 : ndr->offset = _relative_save_offset;
550 : }
551 6 : ndr->flags = _flags_save_string;
552 : }
553 : }
554 12 : 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 : libndr_flags _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 : libndr_flags _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 : libndr_flags _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 112 : static enum ndr_err_code ndr_push_dfs_domain_referral(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct dfs_domain_referral *r)
599 : {
600 112 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
601 112 : if (ndr_flags & NDR_SCALARS) {
602 56 : NDR_CHECK(ndr_push_align(ndr, 5));
603 : {
604 56 : libndr_flags _flags_save_string = ndr->flags;
605 56 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
606 56 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->special_name));
607 56 : ndr->flags = _flags_save_string;
608 : }
609 56 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nb_expanded_names));
610 : {
611 56 : libndr_flags _flags_save_string_array = ndr->flags;
612 56 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
613 56 : NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->expanded_names));
614 56 : ndr->flags = _flags_save_string_array;
615 : }
616 56 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
617 : }
618 112 : if (ndr_flags & NDR_BUFFERS) {
619 : {
620 56 : libndr_flags _flags_save_string = ndr->flags;
621 56 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
622 56 : if (r->special_name) {
623 56 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->special_name));
624 56 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->special_name));
625 : }
626 56 : ndr->flags = _flags_save_string;
627 : }
628 : {
629 56 : libndr_flags _flags_save_string_array = ndr->flags;
630 56 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
631 56 : if (r->expanded_names) {
632 20 : NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->expanded_names));
633 : {
634 2 : struct ndr_push *_ndr_expanded_names;
635 20 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_expanded_names, 0, -1));
636 20 : NDR_CHECK(ndr_push_string_array(_ndr_expanded_names, NDR_SCALARS, r->expanded_names));
637 20 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_expanded_names, 0, -1));
638 : }
639 : }
640 56 : ndr->flags = _flags_save_string_array;
641 : }
642 : }
643 108 : return NDR_ERR_SUCCESS;
644 : }
645 :
646 120 : static enum ndr_err_code ndr_pull_dfs_domain_referral(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct dfs_domain_referral *r)
647 : {
648 12 : uint16_t _ptr_special_name;
649 120 : TALLOC_CTX *_mem_save_special_name_0 = NULL;
650 12 : uint16_t _ptr_expanded_names;
651 120 : TALLOC_CTX *_mem_save_expanded_names_0 = NULL;
652 120 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
653 120 : if (ndr_flags & NDR_SCALARS) {
654 60 : NDR_CHECK(ndr_pull_align(ndr, 5));
655 : {
656 60 : libndr_flags _flags_save_string = ndr->flags;
657 60 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
658 60 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_special_name));
659 60 : if (_ptr_special_name) {
660 60 : NDR_PULL_ALLOC(ndr, r->special_name);
661 60 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->special_name, _ptr_special_name));
662 : } else {
663 0 : r->special_name = NULL;
664 : }
665 60 : ndr->flags = _flags_save_string;
666 : }
667 60 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nb_expanded_names));
668 : {
669 60 : libndr_flags _flags_save_string_array = ndr->flags;
670 60 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
671 60 : NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_expanded_names));
672 60 : if (_ptr_expanded_names) {
673 20 : NDR_PULL_ALLOC(ndr, r->expanded_names);
674 20 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->expanded_names, _ptr_expanded_names));
675 : } else {
676 40 : r->expanded_names = NULL;
677 : }
678 60 : ndr->flags = _flags_save_string_array;
679 : }
680 60 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
681 : }
682 120 : if (ndr_flags & NDR_BUFFERS) {
683 : {
684 60 : libndr_flags _flags_save_string = ndr->flags;
685 60 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
686 60 : if (r->special_name) {
687 6 : uint32_t _relative_save_offset;
688 60 : _relative_save_offset = ndr->offset;
689 60 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->special_name));
690 60 : _mem_save_special_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
691 60 : NDR_PULL_SET_MEM_CTX(ndr, r->special_name, 0);
692 60 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->special_name));
693 60 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_special_name_0, 0);
694 60 : if (ndr->offset > ndr->relative_highest_offset) {
695 60 : ndr->relative_highest_offset = ndr->offset;
696 : }
697 60 : ndr->offset = _relative_save_offset;
698 : }
699 60 : ndr->flags = _flags_save_string;
700 : }
701 : {
702 60 : libndr_flags _flags_save_string_array = ndr->flags;
703 60 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
704 60 : if (r->expanded_names) {
705 2 : uint32_t _relative_save_offset;
706 20 : _relative_save_offset = ndr->offset;
707 20 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->expanded_names));
708 20 : _mem_save_expanded_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
709 20 : NDR_PULL_SET_MEM_CTX(ndr, r->expanded_names, 0);
710 : {
711 2 : struct ndr_pull *_ndr_expanded_names;
712 20 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_expanded_names, 0, -1));
713 20 : NDR_CHECK(ndr_pull_string_array(_ndr_expanded_names, NDR_SCALARS, &r->expanded_names));
714 20 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_expanded_names, 0, -1));
715 : }
716 20 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_expanded_names_0, 0);
717 20 : if (ndr->offset > ndr->relative_highest_offset) {
718 20 : ndr->relative_highest_offset = ndr->offset;
719 : }
720 20 : ndr->offset = _relative_save_offset;
721 : }
722 60 : ndr->flags = _flags_save_string_array;
723 : }
724 : }
725 108 : return NDR_ERR_SUCCESS;
726 : }
727 :
728 6 : _PUBLIC_ void ndr_print_dfs_domain_referral(struct ndr_print *ndr, const char *name, const struct dfs_domain_referral *r)
729 : {
730 6 : ndr_print_struct(ndr, name, "dfs_domain_referral");
731 6 : if (r == NULL) { ndr_print_null(ndr); return; }
732 6 : ndr->depth++;
733 : {
734 6 : libndr_flags _flags_save_string = ndr->flags;
735 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
736 6 : ndr_print_ptr(ndr, "special_name", r->special_name);
737 6 : ndr->depth++;
738 6 : if (r->special_name) {
739 6 : ndr_print_string(ndr, "special_name", r->special_name);
740 : }
741 6 : ndr->depth--;
742 6 : ndr->flags = _flags_save_string;
743 : }
744 6 : ndr_print_uint16(ndr, "nb_expanded_names", r->nb_expanded_names);
745 : {
746 6 : libndr_flags _flags_save_string_array = ndr->flags;
747 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_STR_NULLTERM);
748 6 : ndr_print_ptr(ndr, "expanded_names", r->expanded_names);
749 6 : ndr->depth++;
750 6 : if (r->expanded_names) {
751 2 : ndr_print_string_array(ndr, "expanded_names", r->expanded_names);
752 : }
753 6 : ndr->depth--;
754 6 : ndr->flags = _flags_save_string_array;
755 : }
756 6 : ndr->depth--;
757 : }
758 :
759 19904 : static enum ndr_err_code ndr_push_dfs_referral(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union dfs_referral *r)
760 : {
761 4 : uint32_t level;
762 19904 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
763 19904 : if (ndr_flags & NDR_SCALARS) {
764 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
765 9952 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
766 9952 : NDR_CHECK(ndr_push_union_align(ndr, 5));
767 9952 : switch (level) {
768 9896 : case 0: {
769 9896 : NDR_CHECK(ndr_push_dfs_normal_referral(ndr, NDR_SCALARS, &r->r1));
770 9896 : break; }
771 :
772 56 : case 2: {
773 56 : NDR_CHECK(ndr_push_dfs_domain_referral(ndr, NDR_SCALARS, &r->r2));
774 54 : break; }
775 :
776 0 : default: {
777 0 : break; }
778 :
779 : }
780 : }
781 19904 : if (ndr_flags & NDR_BUFFERS) {
782 9952 : if (!(ndr_flags & NDR_SCALARS)) {
783 : /* We didn't get it above, and the token is not needed after this. */
784 9952 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
785 : }
786 9952 : switch (level) {
787 9896 : case 0:
788 9896 : NDR_CHECK(ndr_push_dfs_normal_referral(ndr, NDR_BUFFERS, &r->r1));
789 9896 : break;
790 :
791 56 : case 2:
792 56 : NDR_CHECK(ndr_push_dfs_domain_referral(ndr, NDR_BUFFERS, &r->r2));
793 54 : break;
794 :
795 0 : default:
796 0 : break;
797 :
798 : }
799 : }
800 19900 : return NDR_ERR_SUCCESS;
801 : }
802 :
803 132 : static enum ndr_err_code ndr_pull_dfs_referral(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union dfs_referral *r)
804 : {
805 12 : uint32_t level;
806 132 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
807 132 : if (ndr_flags & NDR_SCALARS) {
808 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
809 66 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
810 66 : NDR_CHECK(ndr_pull_union_align(ndr, 5));
811 66 : switch (level) {
812 6 : case 0: {
813 6 : NDR_CHECK(ndr_pull_dfs_normal_referral(ndr, NDR_SCALARS, &r->r1));
814 6 : break; }
815 :
816 60 : case 2: {
817 60 : NDR_CHECK(ndr_pull_dfs_domain_referral(ndr, NDR_SCALARS, &r->r2));
818 54 : break; }
819 :
820 0 : default: {
821 0 : break; }
822 :
823 : }
824 : }
825 132 : if (ndr_flags & NDR_BUFFERS) {
826 66 : if (!(ndr_flags & NDR_SCALARS)) {
827 : /* We didn't get it above, and the token is not needed after this. */
828 66 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
829 : }
830 66 : switch (level) {
831 6 : case 0:
832 6 : NDR_CHECK(ndr_pull_dfs_normal_referral(ndr, NDR_BUFFERS, &r->r1));
833 6 : break;
834 :
835 60 : case 2:
836 60 : NDR_CHECK(ndr_pull_dfs_domain_referral(ndr, NDR_BUFFERS, &r->r2));
837 54 : break;
838 :
839 0 : default:
840 0 : break;
841 :
842 : }
843 : }
844 120 : return NDR_ERR_SUCCESS;
845 : }
846 :
847 6 : _PUBLIC_ void ndr_print_dfs_referral(struct ndr_print *ndr, const char *name, const union dfs_referral *r)
848 : {
849 6 : uint32_t level;
850 6 : level = ndr_print_steal_switch_value(ndr, r);
851 6 : ndr_print_union(ndr, name, level, "dfs_referral");
852 6 : switch (level) {
853 0 : case 0:
854 0 : ndr_print_dfs_normal_referral(ndr, "r1", &r->r1);
855 0 : break;
856 :
857 6 : case 2:
858 6 : ndr_print_dfs_domain_referral(ndr, "r2", &r->r2);
859 6 : break;
860 :
861 0 : default:
862 0 : break;
863 :
864 : }
865 6 : }
866 :
867 19902 : static enum ndr_err_code ndr_push_dfs_padding(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union dfs_padding *r)
868 : {
869 2 : uint32_t level;
870 19902 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
871 19902 : if (ndr_flags & NDR_SCALARS) {
872 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
873 9952 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
874 9952 : NDR_CHECK(ndr_push_union_align(ndr, 1));
875 9952 : switch (level) {
876 9952 : case 16: {
877 9952 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->value, 16));
878 9950 : break; }
879 :
880 0 : default: {
881 0 : break; }
882 :
883 : }
884 : }
885 19900 : return NDR_ERR_SUCCESS;
886 : }
887 :
888 126 : static enum ndr_err_code ndr_pull_dfs_padding(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union dfs_padding *r)
889 : {
890 6 : uint32_t level;
891 126 : uint32_t size_value_0 = 0;
892 126 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
893 126 : if (ndr_flags & NDR_SCALARS) {
894 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
895 66 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
896 66 : NDR_CHECK(ndr_pull_union_align(ndr, 1));
897 66 : switch (level) {
898 62 : case 16: {
899 62 : size_value_0 = 16;
900 62 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->value, size_value_0));
901 60 : break; }
902 :
903 0 : default: {
904 0 : break; }
905 :
906 : }
907 : }
908 120 : return NDR_ERR_SUCCESS;
909 : }
910 :
911 6 : _PUBLIC_ void ndr_print_dfs_padding(struct ndr_print *ndr, const char *name, const union dfs_padding *r)
912 : {
913 6 : uint32_t level;
914 6 : level = ndr_print_steal_switch_value(ndr, r);
915 6 : ndr_print_union(ndr, name, level, "dfs_padding");
916 6 : switch (level) {
917 2 : case 16:
918 2 : ndr_print_array_uint8(ndr, "value", r->value, 16);
919 2 : break;
920 :
921 0 : default:
922 0 : break;
923 :
924 : }
925 6 : }
926 :
927 19904 : static enum ndr_err_code ndr_push_dfs_referral_v3(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct dfs_referral_v3 *r)
928 : {
929 : {
930 19904 : libndr_flags _flags_save_STRUCT = ndr->flags;
931 19904 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
932 19904 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
933 19904 : if (ndr_flags & NDR_SCALARS) {
934 9952 : NDR_CHECK(ndr_push_align(ndr, 5));
935 9952 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
936 9954 : NDR_CHECK(ndr_push_DFS_SERVER_TYPE(ndr, NDR_SCALARS, r->server_type));
937 9954 : NDR_CHECK(ndr_push_DFS_FLAGS_REFERRAL(ndr, NDR_SCALARS, r->entry_flags));
938 9952 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ttl));
939 9952 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
940 9952 : NDR_CHECK(ndr_push_dfs_referral(ndr, NDR_SCALARS, &r->referrals));
941 9952 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
942 9952 : NDR_CHECK(ndr_push_dfs_padding(ndr, NDR_SCALARS, &r->service_site_guid));
943 9952 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
944 : }
945 19904 : if (ndr_flags & NDR_BUFFERS) {
946 9952 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
947 9952 : NDR_CHECK(ndr_push_dfs_referral(ndr, NDR_BUFFERS, &r->referrals));
948 9952 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
949 9954 : NDR_CHECK(ndr_push_dfs_padding(ndr, NDR_BUFFERS, &r->service_site_guid));
950 : }
951 19904 : ndr->flags = _flags_save_STRUCT;
952 : }
953 19904 : return NDR_ERR_SUCCESS;
954 : }
955 :
956 132 : static enum ndr_err_code ndr_pull_dfs_referral_v3(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct dfs_referral_v3 *r)
957 : {
958 : {
959 132 : libndr_flags _flags_save_STRUCT = ndr->flags;
960 132 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
961 132 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
962 132 : if (ndr_flags & NDR_SCALARS) {
963 66 : NDR_CHECK(ndr_pull_align(ndr, 5));
964 66 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
965 72 : NDR_CHECK(ndr_pull_DFS_SERVER_TYPE(ndr, NDR_SCALARS, &r->server_type));
966 72 : NDR_CHECK(ndr_pull_DFS_FLAGS_REFERRAL(ndr, NDR_SCALARS, &r->entry_flags));
967 66 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl));
968 66 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
969 66 : NDR_CHECK(ndr_pull_dfs_referral(ndr, NDR_SCALARS, &r->referrals));
970 66 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
971 66 : NDR_CHECK(ndr_pull_dfs_padding(ndr, NDR_SCALARS, &r->service_site_guid));
972 66 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
973 : }
974 132 : if (ndr_flags & NDR_BUFFERS) {
975 66 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP));
976 66 : NDR_CHECK(ndr_pull_dfs_referral(ndr, NDR_BUFFERS, &r->referrals));
977 66 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->service_site_guid, r->size - 18));
978 72 : NDR_CHECK(ndr_pull_dfs_padding(ndr, NDR_BUFFERS, &r->service_site_guid));
979 : }
980 132 : ndr->flags = _flags_save_STRUCT;
981 : }
982 132 : return NDR_ERR_SUCCESS;
983 : }
984 :
985 6 : _PUBLIC_ void ndr_print_dfs_referral_v3(struct ndr_print *ndr, const char *name, const struct dfs_referral_v3 *r)
986 : {
987 6 : ndr_print_struct(ndr, name, "dfs_referral_v3");
988 6 : if (r == NULL) { ndr_print_null(ndr); return; }
989 : {
990 6 : libndr_flags _flags_save_STRUCT = ndr->flags;
991 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
992 6 : ndr->depth++;
993 6 : ndr_print_uint16(ndr, "size", r->size);
994 6 : ndr_print_DFS_SERVER_TYPE(ndr, "server_type", r->server_type);
995 6 : ndr_print_DFS_FLAGS_REFERRAL(ndr, "entry_flags", r->entry_flags);
996 6 : ndr_print_uint32(ndr, "ttl", r->ttl);
997 6 : ndr_print_set_switch_value(ndr, &r->referrals, r->entry_flags & DFS_FLAG_REFERRAL_DOMAIN_RESP);
998 6 : ndr_print_dfs_referral(ndr, "referrals", &r->referrals);
999 6 : ndr_print_set_switch_value(ndr, &r->service_site_guid, r->size - 18);
1000 6 : ndr_print_dfs_padding(ndr, "service_site_guid", &r->service_site_guid);
1001 6 : ndr->depth--;
1002 6 : ndr->flags = _flags_save_STRUCT;
1003 : }
1004 : }
1005 :
1006 19904 : static enum ndr_err_code ndr_push_dfs_referral_version(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union dfs_referral_version *r)
1007 : {
1008 4 : uint32_t level;
1009 19904 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1010 19904 : if (ndr_flags & NDR_SCALARS) {
1011 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1012 9952 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1013 9952 : NDR_CHECK(ndr_push_union_align(ndr, 5));
1014 9952 : 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 9949 : case 3: {
1024 9949 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_SCALARS, &r->v3));
1025 9947 : break; }
1026 :
1027 3 : case 4: {
1028 3 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_SCALARS, &r->v4));
1029 3 : break; }
1030 :
1031 0 : default: {
1032 0 : break; }
1033 :
1034 : }
1035 : }
1036 19904 : if (ndr_flags & NDR_BUFFERS) {
1037 9952 : if (!(ndr_flags & NDR_SCALARS)) {
1038 : /* We didn't get it above, and the token is not needed after this. */
1039 9952 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1040 : }
1041 9952 : 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 9949 : case 3:
1051 9949 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v3));
1052 9947 : break;
1053 :
1054 3 : case 4:
1055 3 : NDR_CHECK(ndr_push_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v4));
1056 3 : break;
1057 :
1058 0 : default:
1059 0 : break;
1060 :
1061 : }
1062 : }
1063 19900 : return NDR_ERR_SUCCESS;
1064 : }
1065 :
1066 132 : static enum ndr_err_code ndr_pull_dfs_referral_version(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union dfs_referral_version *r)
1067 : {
1068 12 : uint32_t level;
1069 132 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1070 132 : if (ndr_flags & NDR_SCALARS) {
1071 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1072 66 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1073 66 : NDR_CHECK(ndr_pull_union_align(ndr, 5));
1074 66 : 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 63 : case 3: {
1084 63 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_SCALARS, &r->v3));
1085 57 : break; }
1086 :
1087 3 : case 4: {
1088 3 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_SCALARS, &r->v4));
1089 3 : break; }
1090 :
1091 0 : default: {
1092 0 : break; }
1093 :
1094 : }
1095 : }
1096 132 : if (ndr_flags & NDR_BUFFERS) {
1097 66 : if (!(ndr_flags & NDR_SCALARS)) {
1098 : /* We didn't get it above, and the token is not needed after this. */
1099 66 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1100 : }
1101 66 : 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 63 : case 3:
1111 63 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v3));
1112 57 : break;
1113 :
1114 3 : case 4:
1115 3 : NDR_CHECK(ndr_pull_dfs_referral_v3(ndr, NDR_BUFFERS, &r->v4));
1116 3 : break;
1117 :
1118 0 : default:
1119 0 : break;
1120 :
1121 : }
1122 : }
1123 120 : return NDR_ERR_SUCCESS;
1124 : }
1125 :
1126 6 : _PUBLIC_ void ndr_print_dfs_referral_version(struct ndr_print *ndr, const char *name, const union dfs_referral_version *r)
1127 : {
1128 6 : uint32_t level;
1129 6 : level = ndr_print_steal_switch_value(ndr, r);
1130 6 : ndr_print_union(ndr, name, level, "dfs_referral_version");
1131 6 : 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 6 : case 3:
1141 6 : ndr_print_dfs_referral_v3(ndr, "v3", &r->v3);
1142 6 : 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 6 : }
1153 :
1154 19904 : static enum ndr_err_code ndr_push_dfs_referral_type(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct dfs_referral_type *r)
1155 : {
1156 19904 : uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
1157 : {
1158 19904 : libndr_flags _flags_save_STRUCT = ndr->flags;
1159 19904 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1160 19904 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1161 19904 : if (ndr_flags & NDR_SCALARS) {
1162 9952 : NDR_CHECK(ndr_push_align(ndr, 5));
1163 9952 : NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
1164 9952 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version));
1165 9952 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referral, r->version));
1166 9952 : NDR_CHECK(ndr_push_dfs_referral_version(ndr, NDR_SCALARS, &r->referral));
1167 9952 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1168 : }
1169 19904 : if (ndr_flags & NDR_BUFFERS) {
1170 9952 : NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
1171 9952 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->referral, r->version));
1172 9952 : NDR_CHECK(ndr_push_dfs_referral_version(ndr, NDR_BUFFERS, &r->referral));
1173 : }
1174 19904 : ndr->flags = _flags_save_STRUCT;
1175 : }
1176 19904 : ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
1177 19904 : return NDR_ERR_SUCCESS;
1178 : }
1179 :
1180 132 : static enum ndr_err_code ndr_pull_dfs_referral_type(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct dfs_referral_type *r)
1181 : {
1182 132 : uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
1183 : {
1184 132 : libndr_flags _flags_save_STRUCT = ndr->flags;
1185 132 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1186 132 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1187 132 : if (ndr_flags & NDR_SCALARS) {
1188 66 : NDR_CHECK(ndr_pull_align(ndr, 5));
1189 66 : NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
1190 66 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version));
1191 66 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referral, r->version));
1192 66 : NDR_CHECK(ndr_pull_dfs_referral_version(ndr, NDR_SCALARS, &r->referral));
1193 66 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1194 : }
1195 132 : if (ndr_flags & NDR_BUFFERS) {
1196 66 : NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
1197 66 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->referral, r->version));
1198 66 : NDR_CHECK(ndr_pull_dfs_referral_version(ndr, NDR_BUFFERS, &r->referral));
1199 : }
1200 132 : ndr->flags = _flags_save_STRUCT;
1201 : }
1202 132 : ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
1203 132 : return NDR_ERR_SUCCESS;
1204 : }
1205 :
1206 6 : _PUBLIC_ void ndr_print_dfs_referral_type(struct ndr_print *ndr, const char *name, const struct dfs_referral_type *r)
1207 : {
1208 6 : ndr_print_struct(ndr, name, "dfs_referral_type");
1209 6 : if (r == NULL) { ndr_print_null(ndr); return; }
1210 : {
1211 6 : libndr_flags _flags_save_STRUCT = ndr->flags;
1212 6 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1213 6 : ndr->depth++;
1214 6 : ndr_print_uint16(ndr, "version", r->version);
1215 6 : ndr_print_set_switch_value(ndr, &r->referral, r->version);
1216 6 : ndr_print_dfs_referral_version(ndr, "referral", &r->referral);
1217 6 : ndr->depth--;
1218 6 : ndr->flags = _flags_save_STRUCT;
1219 : }
1220 : }
1221 :
1222 5946 : _PUBLIC_ enum ndr_err_code ndr_push_dfs_referral_resp(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct dfs_referral_resp *r)
1223 : {
1224 2 : uint32_t cntr_referral_entries_0;
1225 5946 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1226 5946 : if (ndr_flags & NDR_SCALARS) {
1227 5946 : NDR_CHECK(ndr_push_align(ndr, 5));
1228 5946 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->path_consumed));
1229 5946 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nb_referrals));
1230 5948 : NDR_CHECK(ndr_push_DFS_HEADER_FLAG(ndr, NDR_SCALARS, r->header_flags));
1231 15898 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (r->nb_referrals); cntr_referral_entries_0++) {
1232 9952 : NDR_CHECK(ndr_push_dfs_referral_type(ndr, NDR_SCALARS, &r->referral_entries[cntr_referral_entries_0]));
1233 : }
1234 5946 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1235 : }
1236 5946 : if (ndr_flags & NDR_BUFFERS) {
1237 15898 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (r->nb_referrals); cntr_referral_entries_0++) {
1238 9952 : NDR_CHECK(ndr_push_dfs_referral_type(ndr, NDR_BUFFERS, &r->referral_entries[cntr_referral_entries_0]));
1239 : }
1240 : }
1241 5944 : return NDR_ERR_SUCCESS;
1242 : }
1243 :
1244 46 : _PUBLIC_ enum ndr_err_code ndr_pull_dfs_referral_resp(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct dfs_referral_resp *r)
1245 : {
1246 46 : uint32_t size_referral_entries_0 = 0;
1247 4 : uint32_t cntr_referral_entries_0;
1248 46 : TALLOC_CTX *_mem_save_referral_entries_0 = NULL;
1249 46 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1250 46 : if (ndr_flags & NDR_SCALARS) {
1251 46 : NDR_CHECK(ndr_pull_align(ndr, 5));
1252 46 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->path_consumed));
1253 46 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nb_referrals));
1254 50 : NDR_CHECK(ndr_pull_DFS_HEADER_FLAG(ndr, NDR_SCALARS, &r->header_flags));
1255 46 : size_referral_entries_0 = r->nb_referrals;
1256 46 : NDR_PULL_ALLOC_N(ndr, r->referral_entries, size_referral_entries_0);
1257 46 : _mem_save_referral_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
1258 46 : NDR_PULL_SET_MEM_CTX(ndr, r->referral_entries, 0);
1259 112 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (size_referral_entries_0); cntr_referral_entries_0++) {
1260 66 : NDR_CHECK(ndr_pull_dfs_referral_type(ndr, NDR_SCALARS, &r->referral_entries[cntr_referral_entries_0]));
1261 : }
1262 46 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_referral_entries_0, 0);
1263 46 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1264 : }
1265 46 : if (ndr_flags & NDR_BUFFERS) {
1266 46 : size_referral_entries_0 = r->nb_referrals;
1267 46 : _mem_save_referral_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
1268 46 : NDR_PULL_SET_MEM_CTX(ndr, r->referral_entries, 0);
1269 112 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (size_referral_entries_0); cntr_referral_entries_0++) {
1270 66 : NDR_CHECK(ndr_pull_dfs_referral_type(ndr, NDR_BUFFERS, &r->referral_entries[cntr_referral_entries_0]));
1271 : }
1272 46 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_referral_entries_0, 0);
1273 106 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (size_referral_entries_0); cntr_referral_entries_0++) {
1274 : }
1275 : }
1276 42 : return NDR_ERR_SUCCESS;
1277 : }
1278 :
1279 0 : static void ndr_print_flags_dfs_referral_resp(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct dfs_referral_resp *r)
1280 : {
1281 0 : ndr_print_dfs_referral_resp(ndr, name, r);
1282 0 : }
1283 :
1284 4 : _PUBLIC_ void ndr_print_dfs_referral_resp(struct ndr_print *ndr, const char *name, const struct dfs_referral_resp *r)
1285 : {
1286 4 : uint32_t cntr_referral_entries_0;
1287 4 : ndr_print_struct(ndr, name, "dfs_referral_resp");
1288 4 : if (r == NULL) { ndr_print_null(ndr); return; }
1289 4 : ndr->depth++;
1290 4 : ndr_print_uint16(ndr, "path_consumed", r->path_consumed);
1291 4 : ndr_print_uint16(ndr, "nb_referrals", r->nb_referrals);
1292 4 : ndr_print_DFS_HEADER_FLAG(ndr, "header_flags", r->header_flags);
1293 4 : ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "referral_entries", (uint32_t)(r->nb_referrals));
1294 4 : ndr->depth++;
1295 10 : for (cntr_referral_entries_0 = 0; cntr_referral_entries_0 < (r->nb_referrals); cntr_referral_entries_0++) {
1296 6 : ndr_print_dfs_referral_type(ndr, "referral_entries", &r->referral_entries[cntr_referral_entries_0]);
1297 : }
1298 4 : ndr->depth--;
1299 4 : ndr->depth--;
1300 : }
1301 :
1302 51 : _PUBLIC_ enum ndr_err_code ndr_push_dfs_GetDFSReferral_in(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct dfs_GetDFSReferral_in *r)
1303 : {
1304 51 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1305 51 : if (ndr_flags & NDR_SCALARS) {
1306 51 : NDR_CHECK(ndr_push_align(ndr, 4));
1307 51 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_referral_level));
1308 : {
1309 51 : libndr_flags _flags_save_string = ndr->flags;
1310 51 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
1311 51 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
1312 51 : ndr->flags = _flags_save_string;
1313 : }
1314 51 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1315 : }
1316 51 : if (ndr_flags & NDR_BUFFERS) {
1317 0 : }
1318 51 : return NDR_ERR_SUCCESS;
1319 : }
1320 :
1321 19 : _PUBLIC_ enum ndr_err_code ndr_pull_dfs_GetDFSReferral_in(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct dfs_GetDFSReferral_in *r)
1322 : {
1323 19 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1324 19 : if (ndr_flags & NDR_SCALARS) {
1325 19 : NDR_CHECK(ndr_pull_align(ndr, 4));
1326 19 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_referral_level));
1327 : {
1328 19 : libndr_flags _flags_save_string = ndr->flags;
1329 19 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
1330 19 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
1331 19 : ndr->flags = _flags_save_string;
1332 : }
1333 19 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1334 : }
1335 19 : if (ndr_flags & NDR_BUFFERS) {
1336 2 : }
1337 19 : return NDR_ERR_SUCCESS;
1338 : }
1339 :
1340 0 : static void ndr_print_flags_dfs_GetDFSReferral_in(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct dfs_GetDFSReferral_in *r)
1341 : {
1342 0 : ndr_print_dfs_GetDFSReferral_in(ndr, name, r);
1343 0 : }
1344 :
1345 2 : _PUBLIC_ void ndr_print_dfs_GetDFSReferral_in(struct ndr_print *ndr, const char *name, const struct dfs_GetDFSReferral_in *r)
1346 : {
1347 2 : ndr_print_struct(ndr, name, "dfs_GetDFSReferral_in");
1348 2 : if (r == NULL) { ndr_print_null(ndr); return; }
1349 2 : ndr->depth++;
1350 2 : ndr_print_uint16(ndr, "max_referral_level", r->max_referral_level);
1351 : {
1352 2 : libndr_flags _flags_save_string = ndr->flags;
1353 2 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
1354 2 : ndr_print_string(ndr, "servername", r->servername);
1355 2 : ndr->flags = _flags_save_string;
1356 : }
1357 2 : ndr->depth--;
1358 : }
1359 :
1360 0 : _PUBLIC_ enum ndr_err_code ndr_push_dfs_GetDFSReferral(struct ndr_push *ndr, ndr_flags_type 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, ndr_flags_type 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, ndr_flags_type 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 */
|