Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/librpc/gen_ndr/ndr_witness.h"
5 :
6 : #include "librpc/gen_ndr/ndr_misc.h"
7 0 : static enum ndr_err_code ndr_push_witness_version(struct ndr_push *ndr, int ndr_flags, enum witness_version r)
8 : {
9 0 : NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
10 0 : return NDR_ERR_SUCCESS;
11 : }
12 :
13 0 : static enum ndr_err_code ndr_pull_witness_version(struct ndr_pull *ndr, int ndr_flags, enum witness_version *r)
14 : {
15 : uint32_t v;
16 0 : NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
17 0 : *r = v;
18 0 : return NDR_ERR_SUCCESS;
19 : }
20 :
21 0 : _PUBLIC_ void ndr_print_witness_version(struct ndr_print *ndr, const char *name, enum witness_version r)
22 : {
23 0 : const char *val = NULL;
24 :
25 0 : switch (r) {
26 0 : case WITNESS_V1: val = "WITNESS_V1"; break;
27 0 : case WITNESS_V2: val = "WITNESS_V2"; break;
28 0 : case WITNESS_UNSPECIFIED_VERSION: val = "WITNESS_UNSPECIFIED_VERSION"; break;
29 : }
30 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
31 0 : }
32 :
33 0 : static enum ndr_err_code ndr_push_witness_interfaceInfo_state(struct ndr_push *ndr, int ndr_flags, enum witness_interfaceInfo_state r)
34 : {
35 0 : NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
36 0 : return NDR_ERR_SUCCESS;
37 : }
38 :
39 0 : static enum ndr_err_code ndr_pull_witness_interfaceInfo_state(struct ndr_pull *ndr, int ndr_flags, enum witness_interfaceInfo_state *r)
40 : {
41 : uint16_t v;
42 0 : NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
43 0 : *r = v;
44 0 : return NDR_ERR_SUCCESS;
45 : }
46 :
47 0 : _PUBLIC_ void ndr_print_witness_interfaceInfo_state(struct ndr_print *ndr, const char *name, enum witness_interfaceInfo_state r)
48 : {
49 0 : const char *val = NULL;
50 :
51 0 : switch (r) {
52 0 : case WITNESS_STATE_UNKNOWN: val = "WITNESS_STATE_UNKNOWN"; break;
53 0 : case WITNESS_STATE_AVAILABLE: val = "WITNESS_STATE_AVAILABLE"; break;
54 0 : case WITNESS_STATE_UNAVAILABLE: val = "WITNESS_STATE_UNAVAILABLE"; break;
55 : }
56 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
57 0 : }
58 :
59 0 : static enum ndr_err_code ndr_push_witness_interfaceInfo_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
60 : {
61 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
62 0 : return NDR_ERR_SUCCESS;
63 : }
64 :
65 0 : static enum ndr_err_code ndr_pull_witness_interfaceInfo_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
66 : {
67 : uint32_t v;
68 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
69 0 : *r = v;
70 0 : return NDR_ERR_SUCCESS;
71 : }
72 :
73 0 : _PUBLIC_ void ndr_print_witness_interfaceInfo_flags(struct ndr_print *ndr, const char *name, uint32_t r)
74 : {
75 0 : ndr_print_uint32(ndr, name, r);
76 0 : ndr->depth++;
77 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_INFO_IPv4_VALID", WITNESS_INFO_IPv4_VALID, r);
78 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_INFO_IPv6_VALID", WITNESS_INFO_IPv6_VALID, r);
79 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_INFO_WITNESS_IF", WITNESS_INFO_WITNESS_IF, r);
80 0 : ndr->depth--;
81 0 : }
82 :
83 0 : static enum ndr_err_code ndr_push_witness_interfaceInfo(struct ndr_push *ndr, int ndr_flags, const struct witness_interfaceInfo *r)
84 : {
85 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
86 0 : if (ndr_flags & NDR_SCALARS) {
87 0 : NDR_CHECK(ndr_push_align(ndr, 4));
88 0 : NDR_CHECK(ndr_push_charset_to_null(ndr, NDR_SCALARS, r->group_name, 260, sizeof(uint16_t), CH_UTF16));
89 0 : NDR_CHECK(ndr_push_witness_version(ndr, NDR_SCALARS, r->version));
90 0 : NDR_CHECK(ndr_push_witness_interfaceInfo_state(ndr, NDR_SCALARS, r->state));
91 : {
92 0 : uint32_t _flags_save_ipv4address = ndr->flags;
93 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
94 0 : NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipv4));
95 0 : ndr->flags = _flags_save_ipv4address;
96 : }
97 : {
98 0 : uint32_t _flags_save_ipv6address = ndr->flags;
99 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
100 0 : NDR_CHECK(ndr_push_ipv6address(ndr, NDR_SCALARS, r->ipv6));
101 0 : ndr->flags = _flags_save_ipv6address;
102 : }
103 0 : NDR_CHECK(ndr_push_witness_interfaceInfo_flags(ndr, NDR_SCALARS, r->flags));
104 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
105 : }
106 0 : if (ndr_flags & NDR_BUFFERS) {
107 : }
108 0 : return NDR_ERR_SUCCESS;
109 : }
110 :
111 0 : static enum ndr_err_code ndr_pull_witness_interfaceInfo(struct ndr_pull *ndr, int ndr_flags, struct witness_interfaceInfo *r)
112 : {
113 0 : uint32_t size_group_name_0 = 0;
114 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
115 0 : if (ndr_flags & NDR_SCALARS) {
116 0 : NDR_CHECK(ndr_pull_align(ndr, 4));
117 0 : size_group_name_0 = 260;
118 0 : NDR_CHECK(ndr_pull_charset_to_null(ndr, NDR_SCALARS, &r->group_name, size_group_name_0, sizeof(uint16_t), CH_UTF16));
119 0 : NDR_CHECK(ndr_pull_witness_version(ndr, NDR_SCALARS, &r->version));
120 0 : NDR_CHECK(ndr_pull_witness_interfaceInfo_state(ndr, NDR_SCALARS, &r->state));
121 : {
122 0 : uint32_t _flags_save_ipv4address = ndr->flags;
123 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
124 0 : NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipv4));
125 0 : ndr->flags = _flags_save_ipv4address;
126 : }
127 : {
128 0 : uint32_t _flags_save_ipv6address = ndr->flags;
129 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
130 0 : NDR_CHECK(ndr_pull_ipv6address(ndr, NDR_SCALARS, &r->ipv6));
131 0 : ndr->flags = _flags_save_ipv6address;
132 : }
133 0 : NDR_CHECK(ndr_pull_witness_interfaceInfo_flags(ndr, NDR_SCALARS, &r->flags));
134 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
135 : }
136 0 : if (ndr_flags & NDR_BUFFERS) {
137 : }
138 0 : return NDR_ERR_SUCCESS;
139 : }
140 :
141 0 : _PUBLIC_ void ndr_print_witness_interfaceInfo(struct ndr_print *ndr, const char *name, const struct witness_interfaceInfo *r)
142 : {
143 0 : ndr_print_struct(ndr, name, "witness_interfaceInfo");
144 0 : if (r == NULL) { ndr_print_null(ndr); return; }
145 0 : ndr->depth++;
146 0 : ndr_print_string(ndr, "group_name", r->group_name);
147 0 : ndr_print_witness_version(ndr, "version", r->version);
148 0 : ndr_print_witness_interfaceInfo_state(ndr, "state", r->state);
149 : {
150 0 : uint32_t _flags_save_ipv4address = ndr->flags;
151 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
152 0 : ndr_print_ipv4address(ndr, "ipv4", r->ipv4);
153 0 : ndr->flags = _flags_save_ipv4address;
154 : }
155 : {
156 0 : uint32_t _flags_save_ipv6address = ndr->flags;
157 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
158 0 : ndr_print_ipv6address(ndr, "ipv6", r->ipv6);
159 0 : ndr->flags = _flags_save_ipv6address;
160 : }
161 0 : ndr_print_witness_interfaceInfo_flags(ndr, "flags", r->flags);
162 0 : ndr->depth--;
163 : }
164 :
165 0 : static enum ndr_err_code ndr_push_witness_interfaceList(struct ndr_push *ndr, int ndr_flags, const struct witness_interfaceList *r)
166 : {
167 : uint32_t cntr_interfaces_1;
168 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
169 0 : if (ndr_flags & NDR_SCALARS) {
170 0 : NDR_CHECK(ndr_push_align(ndr, 5));
171 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_interfaces));
172 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->interfaces));
173 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
174 : }
175 0 : if (ndr_flags & NDR_BUFFERS) {
176 0 : if (r->interfaces) {
177 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_interfaces));
178 0 : for (cntr_interfaces_1 = 0; cntr_interfaces_1 < (r->num_interfaces); cntr_interfaces_1++) {
179 0 : NDR_CHECK(ndr_push_witness_interfaceInfo(ndr, NDR_SCALARS, &r->interfaces[cntr_interfaces_1]));
180 : }
181 : }
182 : }
183 0 : return NDR_ERR_SUCCESS;
184 : }
185 :
186 0 : static enum ndr_err_code ndr_pull_witness_interfaceList(struct ndr_pull *ndr, int ndr_flags, struct witness_interfaceList *r)
187 : {
188 : uint32_t _ptr_interfaces;
189 0 : uint32_t size_interfaces_1 = 0;
190 : uint32_t cntr_interfaces_1;
191 0 : TALLOC_CTX *_mem_save_interfaces_0 = NULL;
192 0 : TALLOC_CTX *_mem_save_interfaces_1 = NULL;
193 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
194 0 : if (ndr_flags & NDR_SCALARS) {
195 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
196 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_interfaces));
197 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_interfaces));
198 0 : if (_ptr_interfaces) {
199 0 : NDR_PULL_ALLOC(ndr, r->interfaces);
200 : } else {
201 0 : r->interfaces = NULL;
202 : }
203 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
204 : }
205 0 : if (ndr_flags & NDR_BUFFERS) {
206 0 : if (r->interfaces) {
207 0 : _mem_save_interfaces_0 = NDR_PULL_GET_MEM_CTX(ndr);
208 0 : NDR_PULL_SET_MEM_CTX(ndr, r->interfaces, 0);
209 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->interfaces));
210 0 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->interfaces, &size_interfaces_1));
211 0 : NDR_PULL_ALLOC_N(ndr, r->interfaces, size_interfaces_1);
212 0 : _mem_save_interfaces_1 = NDR_PULL_GET_MEM_CTX(ndr);
213 0 : NDR_PULL_SET_MEM_CTX(ndr, r->interfaces, 0);
214 0 : for (cntr_interfaces_1 = 0; cntr_interfaces_1 < (size_interfaces_1); cntr_interfaces_1++) {
215 0 : NDR_CHECK(ndr_pull_witness_interfaceInfo(ndr, NDR_SCALARS, &r->interfaces[cntr_interfaces_1]));
216 : }
217 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interfaces_1, 0);
218 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interfaces_0, 0);
219 : }
220 0 : if (r->interfaces) {
221 0 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->interfaces, r->num_interfaces));
222 : }
223 : }
224 0 : return NDR_ERR_SUCCESS;
225 : }
226 :
227 0 : _PUBLIC_ void ndr_print_witness_interfaceList(struct ndr_print *ndr, const char *name, const struct witness_interfaceList *r)
228 : {
229 : uint32_t cntr_interfaces_1;
230 0 : ndr_print_struct(ndr, name, "witness_interfaceList");
231 0 : if (r == NULL) { ndr_print_null(ndr); return; }
232 0 : ndr->depth++;
233 0 : ndr_print_uint32(ndr, "num_interfaces", r->num_interfaces);
234 0 : ndr_print_ptr(ndr, "interfaces", r->interfaces);
235 0 : ndr->depth++;
236 0 : if (r->interfaces) {
237 0 : ndr->print(ndr, "%s: ARRAY(%d)", "interfaces", (int)r->num_interfaces);
238 0 : ndr->depth++;
239 0 : for (cntr_interfaces_1 = 0; cntr_interfaces_1 < (r->num_interfaces); cntr_interfaces_1++) {
240 0 : ndr_print_witness_interfaceInfo(ndr, "interfaces", &r->interfaces[cntr_interfaces_1]);
241 : }
242 0 : ndr->depth--;
243 : }
244 0 : ndr->depth--;
245 0 : ndr->depth--;
246 : }
247 :
248 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_notifyResponse_type(struct ndr_push *ndr, int ndr_flags, enum witness_notifyResponse_type r)
249 : {
250 0 : NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
251 0 : return NDR_ERR_SUCCESS;
252 : }
253 :
254 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_notifyResponse_type(struct ndr_pull *ndr, int ndr_flags, enum witness_notifyResponse_type *r)
255 : {
256 : uint32_t v;
257 0 : NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
258 0 : *r = v;
259 0 : return NDR_ERR_SUCCESS;
260 : }
261 :
262 0 : _PUBLIC_ void ndr_print_witness_notifyResponse_type(struct ndr_print *ndr, const char *name, enum witness_notifyResponse_type r)
263 : {
264 0 : const char *val = NULL;
265 :
266 0 : switch (r) {
267 0 : case WITNESS_NOTIFY_RESOURCE_CHANGE: val = "WITNESS_NOTIFY_RESOURCE_CHANGE"; break;
268 0 : case WITNESS_NOTIFY_CLIENT_MOVE: val = "WITNESS_NOTIFY_CLIENT_MOVE"; break;
269 0 : case WITNESS_NOTIFY_SHARE_MOVE: val = "WITNESS_NOTIFY_SHARE_MOVE"; break;
270 0 : case WITNESS_NOTIFY_IP_CHANGE: val = "WITNESS_NOTIFY_IP_CHANGE"; break;
271 : }
272 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
273 0 : }
274 :
275 0 : static enum ndr_err_code ndr_push_witness_ResourceChange_type(struct ndr_push *ndr, int ndr_flags, enum witness_ResourceChange_type r)
276 : {
277 0 : NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
278 0 : return NDR_ERR_SUCCESS;
279 : }
280 :
281 0 : static enum ndr_err_code ndr_pull_witness_ResourceChange_type(struct ndr_pull *ndr, int ndr_flags, enum witness_ResourceChange_type *r)
282 : {
283 : uint32_t v;
284 0 : NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
285 0 : *r = v;
286 0 : return NDR_ERR_SUCCESS;
287 : }
288 :
289 0 : _PUBLIC_ void ndr_print_witness_ResourceChange_type(struct ndr_print *ndr, const char *name, enum witness_ResourceChange_type r)
290 : {
291 0 : const char *val = NULL;
292 :
293 0 : switch (r) {
294 0 : case WITNESS_RESOURCE_STATE_UNKNOWN: val = "WITNESS_RESOURCE_STATE_UNKNOWN"; break;
295 0 : case WITNESS_RESOURCE_STATE_AVAILABLE: val = "WITNESS_RESOURCE_STATE_AVAILABLE"; break;
296 0 : case WITNESS_RESOURCE_STATE_UNAVAILABLE: val = "WITNESS_RESOURCE_STATE_UNAVAILABLE"; break;
297 : }
298 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
299 0 : }
300 :
301 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_ResourceChange(struct ndr_push *ndr, int ndr_flags, const struct witness_ResourceChange *r)
302 : {
303 : {
304 0 : uint32_t _flags_save_STRUCT = ndr->flags;
305 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
306 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
307 0 : if (ndr_flags & NDR_SCALARS) {
308 0 : NDR_CHECK(ndr_push_align(ndr, 4));
309 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_witness_ResourceChange(r, ndr->flags)));
310 0 : NDR_CHECK(ndr_push_witness_ResourceChange_type(ndr, NDR_SCALARS, r->type));
311 : {
312 0 : uint32_t _flags_save_string = ndr->flags;
313 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
314 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
315 0 : ndr->flags = _flags_save_string;
316 : }
317 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
318 : }
319 0 : if (ndr_flags & NDR_BUFFERS) {
320 : }
321 0 : ndr->flags = _flags_save_STRUCT;
322 : }
323 0 : return NDR_ERR_SUCCESS;
324 : }
325 :
326 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_ResourceChange(struct ndr_pull *ndr, int ndr_flags, struct witness_ResourceChange *r)
327 : {
328 : {
329 0 : uint32_t _flags_save_STRUCT = ndr->flags;
330 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
331 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
332 0 : if (ndr_flags & NDR_SCALARS) {
333 0 : NDR_CHECK(ndr_pull_align(ndr, 4));
334 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
335 0 : NDR_CHECK(ndr_pull_witness_ResourceChange_type(ndr, NDR_SCALARS, &r->type));
336 : {
337 0 : uint32_t _flags_save_string = ndr->flags;
338 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
339 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
340 0 : ndr->flags = _flags_save_string;
341 : }
342 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
343 : }
344 0 : if (ndr_flags & NDR_BUFFERS) {
345 : }
346 0 : ndr->flags = _flags_save_STRUCT;
347 : }
348 0 : return NDR_ERR_SUCCESS;
349 : }
350 :
351 0 : static void ndr_print_flags_witness_ResourceChange(struct ndr_print *ndr, const char *name, int unused, const struct witness_ResourceChange *r)
352 : {
353 0 : ndr_print_witness_ResourceChange(ndr, name, r);
354 0 : }
355 :
356 0 : _PUBLIC_ void ndr_print_witness_ResourceChange(struct ndr_print *ndr, const char *name, const struct witness_ResourceChange *r)
357 : {
358 0 : ndr_print_struct(ndr, name, "witness_ResourceChange");
359 0 : if (r == NULL) { ndr_print_null(ndr); return; }
360 : {
361 0 : uint32_t _flags_save_STRUCT = ndr->flags;
362 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
363 0 : ndr->depth++;
364 0 : ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_witness_ResourceChange(r, ndr->flags):r->length);
365 0 : ndr_print_witness_ResourceChange_type(ndr, "type", r->type);
366 : {
367 0 : uint32_t _flags_save_string = ndr->flags;
368 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
369 0 : ndr_print_string(ndr, "name", r->name);
370 0 : ndr->flags = _flags_save_string;
371 : }
372 0 : ndr->depth--;
373 0 : ndr->flags = _flags_save_STRUCT;
374 : }
375 : }
376 :
377 0 : _PUBLIC_ size_t ndr_size_witness_ResourceChange(const struct witness_ResourceChange *r, int flags)
378 : {
379 0 : flags |= LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN;
380 0 : return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_witness_ResourceChange);
381 : }
382 :
383 0 : static enum ndr_err_code ndr_push_witness_IPaddrInfo_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
384 : {
385 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
386 0 : return NDR_ERR_SUCCESS;
387 : }
388 :
389 0 : static enum ndr_err_code ndr_pull_witness_IPaddrInfo_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
390 : {
391 : uint32_t v;
392 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
393 0 : *r = v;
394 0 : return NDR_ERR_SUCCESS;
395 : }
396 :
397 0 : _PUBLIC_ void ndr_print_witness_IPaddrInfo_flags(struct ndr_print *ndr, const char *name, uint32_t r)
398 : {
399 0 : ndr_print_uint32(ndr, name, r);
400 0 : ndr->depth++;
401 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_V4", WITNESS_IPADDR_V4, r);
402 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_V6", WITNESS_IPADDR_V6, r);
403 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_ONLINE", WITNESS_IPADDR_ONLINE, r);
404 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_OFFLINE", WITNESS_IPADDR_OFFLINE, r);
405 0 : ndr->depth--;
406 0 : }
407 :
408 0 : static enum ndr_err_code ndr_push_witness_IPaddrInfo(struct ndr_push *ndr, int ndr_flags, const struct witness_IPaddrInfo *r)
409 : {
410 : {
411 0 : uint32_t _flags_save_STRUCT = ndr->flags;
412 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
413 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
414 0 : if (ndr_flags & NDR_SCALARS) {
415 0 : NDR_CHECK(ndr_push_align(ndr, 4));
416 0 : NDR_CHECK(ndr_push_witness_IPaddrInfo_flags(ndr, NDR_SCALARS, r->flags));
417 : {
418 0 : uint32_t _flags_save_ipv4address = ndr->flags;
419 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
420 0 : NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipv4));
421 0 : ndr->flags = _flags_save_ipv4address;
422 : }
423 : {
424 0 : uint32_t _flags_save_ipv6address = ndr->flags;
425 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
426 0 : NDR_CHECK(ndr_push_ipv6address(ndr, NDR_SCALARS, r->ipv6));
427 0 : ndr->flags = _flags_save_ipv6address;
428 : }
429 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
430 : }
431 0 : if (ndr_flags & NDR_BUFFERS) {
432 : }
433 0 : ndr->flags = _flags_save_STRUCT;
434 : }
435 0 : return NDR_ERR_SUCCESS;
436 : }
437 :
438 0 : static enum ndr_err_code ndr_pull_witness_IPaddrInfo(struct ndr_pull *ndr, int ndr_flags, struct witness_IPaddrInfo *r)
439 : {
440 : {
441 0 : uint32_t _flags_save_STRUCT = ndr->flags;
442 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
443 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
444 0 : if (ndr_flags & NDR_SCALARS) {
445 0 : NDR_CHECK(ndr_pull_align(ndr, 4));
446 0 : NDR_CHECK(ndr_pull_witness_IPaddrInfo_flags(ndr, NDR_SCALARS, &r->flags));
447 : {
448 0 : uint32_t _flags_save_ipv4address = ndr->flags;
449 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
450 0 : NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipv4));
451 0 : ndr->flags = _flags_save_ipv4address;
452 : }
453 : {
454 0 : uint32_t _flags_save_ipv6address = ndr->flags;
455 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
456 0 : NDR_CHECK(ndr_pull_ipv6address(ndr, NDR_SCALARS, &r->ipv6));
457 0 : ndr->flags = _flags_save_ipv6address;
458 : }
459 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
460 : }
461 0 : if (ndr_flags & NDR_BUFFERS) {
462 : }
463 0 : ndr->flags = _flags_save_STRUCT;
464 : }
465 0 : return NDR_ERR_SUCCESS;
466 : }
467 :
468 0 : _PUBLIC_ void ndr_print_witness_IPaddrInfo(struct ndr_print *ndr, const char *name, const struct witness_IPaddrInfo *r)
469 : {
470 0 : ndr_print_struct(ndr, name, "witness_IPaddrInfo");
471 0 : if (r == NULL) { ndr_print_null(ndr); return; }
472 : {
473 0 : uint32_t _flags_save_STRUCT = ndr->flags;
474 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
475 0 : ndr->depth++;
476 0 : ndr_print_witness_IPaddrInfo_flags(ndr, "flags", r->flags);
477 : {
478 0 : uint32_t _flags_save_ipv4address = ndr->flags;
479 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
480 0 : ndr_print_ipv4address(ndr, "ipv4", r->ipv4);
481 0 : ndr->flags = _flags_save_ipv4address;
482 : }
483 : {
484 0 : uint32_t _flags_save_ipv6address = ndr->flags;
485 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
486 0 : ndr_print_ipv6address(ndr, "ipv6", r->ipv6);
487 0 : ndr->flags = _flags_save_ipv6address;
488 : }
489 0 : ndr->depth--;
490 0 : ndr->flags = _flags_save_STRUCT;
491 : }
492 : }
493 :
494 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_IPaddrInfoList(struct ndr_push *ndr, int ndr_flags, const struct witness_IPaddrInfoList *r)
495 : {
496 : uint32_t cntr_addr_0;
497 : {
498 0 : uint32_t _flags_save_STRUCT = ndr->flags;
499 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
500 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
501 0 : if (ndr_flags & NDR_SCALARS) {
502 0 : NDR_CHECK(ndr_push_align(ndr, 4));
503 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_witness_IPaddrInfoList(r, ndr->flags)));
504 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
505 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num));
506 0 : for (cntr_addr_0 = 0; cntr_addr_0 < (r->num); cntr_addr_0++) {
507 0 : NDR_CHECK(ndr_push_witness_IPaddrInfo(ndr, NDR_SCALARS, &r->addr[cntr_addr_0]));
508 : }
509 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
510 : }
511 0 : if (ndr_flags & NDR_BUFFERS) {
512 : }
513 0 : ndr->flags = _flags_save_STRUCT;
514 : }
515 0 : return NDR_ERR_SUCCESS;
516 : }
517 :
518 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_IPaddrInfoList(struct ndr_pull *ndr, int ndr_flags, struct witness_IPaddrInfoList *r)
519 : {
520 0 : uint32_t size_addr_0 = 0;
521 : uint32_t cntr_addr_0;
522 0 : TALLOC_CTX *_mem_save_addr_0 = NULL;
523 : {
524 0 : uint32_t _flags_save_STRUCT = ndr->flags;
525 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
526 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
527 0 : if (ndr_flags & NDR_SCALARS) {
528 0 : NDR_CHECK(ndr_pull_align(ndr, 4));
529 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
530 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
531 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num));
532 0 : size_addr_0 = r->num;
533 0 : NDR_PULL_ALLOC_N(ndr, r->addr, size_addr_0);
534 0 : _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
535 0 : NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0);
536 0 : for (cntr_addr_0 = 0; cntr_addr_0 < (size_addr_0); cntr_addr_0++) {
537 0 : NDR_CHECK(ndr_pull_witness_IPaddrInfo(ndr, NDR_SCALARS, &r->addr[cntr_addr_0]));
538 : }
539 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0);
540 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
541 : }
542 0 : if (ndr_flags & NDR_BUFFERS) {
543 : }
544 0 : ndr->flags = _flags_save_STRUCT;
545 : }
546 0 : return NDR_ERR_SUCCESS;
547 : }
548 :
549 0 : static void ndr_print_flags_witness_IPaddrInfoList(struct ndr_print *ndr, const char *name, int unused, const struct witness_IPaddrInfoList *r)
550 : {
551 0 : ndr_print_witness_IPaddrInfoList(ndr, name, r);
552 0 : }
553 :
554 0 : _PUBLIC_ void ndr_print_witness_IPaddrInfoList(struct ndr_print *ndr, const char *name, const struct witness_IPaddrInfoList *r)
555 : {
556 : uint32_t cntr_addr_0;
557 0 : ndr_print_struct(ndr, name, "witness_IPaddrInfoList");
558 0 : if (r == NULL) { ndr_print_null(ndr); return; }
559 : {
560 0 : uint32_t _flags_save_STRUCT = ndr->flags;
561 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
562 0 : ndr->depth++;
563 0 : ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_witness_IPaddrInfoList(r, ndr->flags):r->length);
564 0 : ndr_print_uint32(ndr, "reserved", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved);
565 0 : ndr_print_uint32(ndr, "num", r->num);
566 0 : ndr->print(ndr, "%s: ARRAY(%d)", "addr", (int)r->num);
567 0 : ndr->depth++;
568 0 : for (cntr_addr_0 = 0; cntr_addr_0 < (r->num); cntr_addr_0++) {
569 0 : ndr_print_witness_IPaddrInfo(ndr, "addr", &r->addr[cntr_addr_0]);
570 : }
571 0 : ndr->depth--;
572 0 : ndr->depth--;
573 0 : ndr->flags = _flags_save_STRUCT;
574 : }
575 : }
576 :
577 0 : _PUBLIC_ size_t ndr_size_witness_IPaddrInfoList(const struct witness_IPaddrInfoList *r, int flags)
578 : {
579 0 : flags |= LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN;
580 0 : return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_witness_IPaddrInfoList);
581 : }
582 :
583 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_notifyResponse_message(struct ndr_push *ndr, int ndr_flags, const union witness_notifyResponse_message *r)
584 : {
585 : uint32_t level;
586 : {
587 0 : uint32_t _flags_save_UNION = ndr->flags;
588 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
589 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
590 0 : if (ndr_flags & NDR_SCALARS) {
591 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
592 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
593 0 : NDR_CHECK(ndr_push_union_align(ndr, 4));
594 0 : switch (level) {
595 0 : case WITNESS_NOTIFY_RESOURCE_CHANGE: {
596 0 : NDR_CHECK(ndr_push_witness_ResourceChange(ndr, NDR_SCALARS, &r->resource_change));
597 0 : break; }
598 :
599 0 : case WITNESS_NOTIFY_CLIENT_MOVE: {
600 0 : NDR_CHECK(ndr_push_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->client_move));
601 0 : break; }
602 :
603 0 : case WITNESS_NOTIFY_SHARE_MOVE: {
604 0 : NDR_CHECK(ndr_push_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->share_move));
605 0 : break; }
606 :
607 0 : case WITNESS_NOTIFY_IP_CHANGE: {
608 0 : NDR_CHECK(ndr_push_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->ip_change));
609 0 : break; }
610 :
611 0 : default: {
612 : {
613 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
614 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
615 0 : NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
616 0 : ndr->flags = _flags_save_DATA_BLOB;
617 : }
618 0 : break; }
619 :
620 : }
621 0 : }
622 0 : ndr->flags = _flags_save_UNION;
623 : }
624 0 : return NDR_ERR_SUCCESS;
625 : }
626 :
627 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_notifyResponse_message(struct ndr_pull *ndr, int ndr_flags, union witness_notifyResponse_message *r)
628 : {
629 : uint32_t level;
630 : {
631 0 : uint32_t _flags_save_UNION = ndr->flags;
632 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
633 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
634 0 : if (ndr_flags & NDR_SCALARS) {
635 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
636 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
637 0 : NDR_CHECK(ndr_pull_union_align(ndr, 4));
638 0 : switch (level) {
639 0 : case WITNESS_NOTIFY_RESOURCE_CHANGE: {
640 0 : NDR_CHECK(ndr_pull_witness_ResourceChange(ndr, NDR_SCALARS, &r->resource_change));
641 0 : break; }
642 :
643 0 : case WITNESS_NOTIFY_CLIENT_MOVE: {
644 0 : NDR_CHECK(ndr_pull_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->client_move));
645 0 : break; }
646 :
647 0 : case WITNESS_NOTIFY_SHARE_MOVE: {
648 0 : NDR_CHECK(ndr_pull_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->share_move));
649 0 : break; }
650 :
651 0 : case WITNESS_NOTIFY_IP_CHANGE: {
652 0 : NDR_CHECK(ndr_pull_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->ip_change));
653 0 : break; }
654 :
655 0 : default: {
656 : {
657 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
658 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
659 0 : NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
660 0 : ndr->flags = _flags_save_DATA_BLOB;
661 : }
662 0 : break; }
663 :
664 : }
665 0 : }
666 0 : ndr->flags = _flags_save_UNION;
667 : }
668 0 : return NDR_ERR_SUCCESS;
669 : }
670 :
671 0 : _PUBLIC_ void ndr_print_witness_notifyResponse_message(struct ndr_print *ndr, const char *name, const union witness_notifyResponse_message *r)
672 : {
673 : uint32_t level;
674 : {
675 0 : uint32_t _flags_save_UNION = ndr->flags;
676 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
677 0 : level = ndr_print_steal_switch_value(ndr, r);
678 0 : ndr_print_union(ndr, name, level, "witness_notifyResponse_message");
679 0 : switch (level) {
680 0 : case WITNESS_NOTIFY_RESOURCE_CHANGE:
681 0 : ndr_print_witness_ResourceChange(ndr, "resource_change", &r->resource_change);
682 0 : break;
683 :
684 0 : case WITNESS_NOTIFY_CLIENT_MOVE:
685 0 : ndr_print_witness_IPaddrInfoList(ndr, "client_move", &r->client_move);
686 0 : break;
687 :
688 0 : case WITNESS_NOTIFY_SHARE_MOVE:
689 0 : ndr_print_witness_IPaddrInfoList(ndr, "share_move", &r->share_move);
690 0 : break;
691 :
692 0 : case WITNESS_NOTIFY_IP_CHANGE:
693 0 : ndr_print_witness_IPaddrInfoList(ndr, "ip_change", &r->ip_change);
694 0 : break;
695 :
696 0 : default:
697 : {
698 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
699 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
700 0 : ndr_print_DATA_BLOB(ndr, "data", r->data);
701 0 : ndr->flags = _flags_save_DATA_BLOB;
702 : }
703 0 : break;
704 :
705 : }
706 0 : ndr->flags = _flags_save_UNION;
707 : }
708 0 : }
709 :
710 0 : static void ndr_print_flags_witness_notifyResponse(struct ndr_print *ndr, const char *name, int unused, const struct witness_notifyResponse *r)
711 : {
712 0 : ndr_print_witness_notifyResponse(ndr, name, r);
713 0 : }
714 :
715 0 : _PUBLIC_ void ndr_print_witness_notifyResponse(struct ndr_print *ndr, const char *name, const struct witness_notifyResponse *r)
716 : {
717 : uint32_t cntr_messages_1;
718 0 : ndr_print_struct(ndr, name, "witness_notifyResponse");
719 0 : if (r == NULL) { ndr_print_null(ndr); return; }
720 : {
721 0 : uint32_t _flags_save_STRUCT = ndr->flags;
722 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
723 0 : ndr->depth++;
724 0 : ndr_print_witness_notifyResponse_type(ndr, "type", r->type);
725 0 : ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_witness_notifyResponse(r, ndr->flags) - 20:r->length);
726 0 : ndr_print_uint32(ndr, "num", r->num);
727 : {
728 0 : uint32_t _flags_save_witness_notifyResponse_message = ndr->flags;
729 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
730 0 : ndr_print_ptr(ndr, "messages", r->messages);
731 0 : ndr->depth++;
732 0 : if (r->messages) {
733 0 : ndr->print(ndr, "%s: ARRAY(%d)", "messages", (int)r->num);
734 0 : ndr->depth++;
735 0 : for (cntr_messages_1 = 0; cntr_messages_1 < (r->num); cntr_messages_1++) {
736 0 : ndr_print_set_switch_value(ndr, &r->messages[cntr_messages_1], r->type);
737 0 : ndr_print_witness_notifyResponse_message(ndr, "messages", &r->messages[cntr_messages_1]);
738 : }
739 0 : ndr->depth--;
740 : }
741 0 : ndr->depth--;
742 0 : ndr->flags = _flags_save_witness_notifyResponse_message;
743 : }
744 0 : ndr->depth--;
745 0 : ndr->flags = _flags_save_STRUCT;
746 : }
747 : }
748 :
749 0 : _PUBLIC_ size_t ndr_size_witness_notifyResponse(const struct witness_notifyResponse *r, int flags)
750 : {
751 0 : flags |= LIBNDR_PRINT_ARRAY_HEX;
752 0 : return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_witness_notifyResponse);
753 : }
754 :
755 0 : static enum ndr_err_code ndr_push_witness_RegisterEx_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
756 : {
757 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
758 0 : return NDR_ERR_SUCCESS;
759 : }
760 :
761 0 : static enum ndr_err_code ndr_pull_witness_RegisterEx_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
762 : {
763 : uint32_t v;
764 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
765 0 : *r = v;
766 0 : return NDR_ERR_SUCCESS;
767 : }
768 :
769 0 : _PUBLIC_ void ndr_print_witness_RegisterEx_flags(struct ndr_print *ndr, const char *name, uint32_t r)
770 : {
771 0 : ndr_print_uint32(ndr, name, r);
772 0 : ndr->depth++;
773 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_REGISTER_NONE", WITNESS_REGISTER_NONE, r);
774 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_REGISTER_IP_NOTIFICATION", WITNESS_REGISTER_IP_NOTIFICATION, r);
775 0 : ndr->depth--;
776 0 : }
777 :
778 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_GetInterfaceList(struct ndr_push *ndr, int flags, const struct witness_GetInterfaceList *r)
779 : {
780 0 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
781 0 : if (flags & NDR_IN) {
782 : }
783 0 : if (flags & NDR_OUT) {
784 0 : if (r->out.interface_list == NULL) {
785 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
786 : }
787 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.interface_list));
788 0 : if (*r->out.interface_list) {
789 0 : NDR_CHECK(ndr_push_witness_interfaceList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.interface_list));
790 : }
791 0 : NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
792 : }
793 0 : return NDR_ERR_SUCCESS;
794 : }
795 :
796 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_GetInterfaceList(struct ndr_pull *ndr, int flags, struct witness_GetInterfaceList *r)
797 : {
798 : uint32_t _ptr_interface_list;
799 0 : TALLOC_CTX *_mem_save_interface_list_0 = NULL;
800 0 : TALLOC_CTX *_mem_save_interface_list_1 = NULL;
801 0 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
802 0 : if (flags & NDR_IN) {
803 0 : NDR_ZERO_STRUCT(r->out);
804 :
805 0 : NDR_PULL_ALLOC(ndr, r->out.interface_list);
806 0 : NDR_ZERO_STRUCTP(r->out.interface_list);
807 : }
808 0 : if (flags & NDR_OUT) {
809 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
810 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
811 0 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
812 0 : NDR_PULL_ALLOC(ndr, r->out.interface_list);
813 : }
814 0 : _mem_save_interface_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
815 0 : NDR_PULL_SET_MEM_CTX(ndr, r->out.interface_list, LIBNDR_FLAG_REF_ALLOC);
816 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_interface_list));
817 0 : if (_ptr_interface_list) {
818 0 : NDR_PULL_ALLOC(ndr, *r->out.interface_list);
819 : } else {
820 0 : *r->out.interface_list = NULL;
821 : }
822 0 : if (*r->out.interface_list) {
823 0 : _mem_save_interface_list_1 = NDR_PULL_GET_MEM_CTX(ndr);
824 0 : NDR_PULL_SET_MEM_CTX(ndr, *r->out.interface_list, 0);
825 0 : NDR_CHECK(ndr_pull_witness_interfaceList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.interface_list));
826 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interface_list_1, 0);
827 : }
828 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interface_list_0, LIBNDR_FLAG_REF_ALLOC);
829 0 : NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
830 : }
831 0 : return NDR_ERR_SUCCESS;
832 : }
833 :
834 0 : _PUBLIC_ void ndr_print_witness_GetInterfaceList(struct ndr_print *ndr, const char *name, int flags, const struct witness_GetInterfaceList *r)
835 : {
836 0 : ndr_print_struct(ndr, name, "witness_GetInterfaceList");
837 0 : if (r == NULL) { ndr_print_null(ndr); return; }
838 0 : ndr->depth++;
839 0 : if (flags & NDR_SET_VALUES) {
840 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
841 : }
842 0 : if (flags & NDR_IN) {
843 0 : ndr_print_struct(ndr, "in", "witness_GetInterfaceList");
844 0 : ndr->depth++;
845 0 : ndr->depth--;
846 : }
847 0 : if (flags & NDR_OUT) {
848 0 : ndr_print_struct(ndr, "out", "witness_GetInterfaceList");
849 0 : ndr->depth++;
850 0 : ndr_print_ptr(ndr, "interface_list", r->out.interface_list);
851 0 : ndr->depth++;
852 0 : ndr_print_ptr(ndr, "interface_list", *r->out.interface_list);
853 0 : ndr->depth++;
854 0 : if (*r->out.interface_list) {
855 0 : ndr_print_witness_interfaceList(ndr, "interface_list", *r->out.interface_list);
856 : }
857 0 : ndr->depth--;
858 0 : ndr->depth--;
859 0 : ndr_print_WERROR(ndr, "result", r->out.result);
860 0 : ndr->depth--;
861 : }
862 0 : ndr->depth--;
863 : }
864 :
865 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_Register(struct ndr_push *ndr, int flags, const struct witness_Register *r)
866 : {
867 0 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
868 0 : if (flags & NDR_IN) {
869 0 : NDR_CHECK(ndr_push_witness_version(ndr, NDR_SCALARS, r->in.version));
870 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.net_name));
871 0 : if (r->in.net_name) {
872 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
873 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
874 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
875 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.net_name, ndr_charset_length(r->in.net_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
876 : }
877 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ip_address));
878 0 : if (r->in.ip_address) {
879 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
880 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
881 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
882 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ip_address, ndr_charset_length(r->in.ip_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
883 : }
884 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_computer_name));
885 0 : if (r->in.client_computer_name) {
886 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
887 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
888 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
889 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_computer_name, ndr_charset_length(r->in.client_computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
890 : }
891 : }
892 0 : if (flags & NDR_OUT) {
893 0 : if (r->out.context_handle == NULL) {
894 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
895 : }
896 0 : NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
897 0 : NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
898 : }
899 0 : return NDR_ERR_SUCCESS;
900 : }
901 :
902 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_Register(struct ndr_pull *ndr, int flags, struct witness_Register *r)
903 : {
904 : uint32_t _ptr_net_name;
905 0 : uint32_t size_net_name_1 = 0;
906 0 : uint32_t length_net_name_1 = 0;
907 : uint32_t _ptr_ip_address;
908 0 : uint32_t size_ip_address_1 = 0;
909 0 : uint32_t length_ip_address_1 = 0;
910 : uint32_t _ptr_client_computer_name;
911 0 : uint32_t size_client_computer_name_1 = 0;
912 0 : uint32_t length_client_computer_name_1 = 0;
913 0 : TALLOC_CTX *_mem_save_context_handle_0 = NULL;
914 0 : TALLOC_CTX *_mem_save_net_name_0 = NULL;
915 0 : TALLOC_CTX *_mem_save_ip_address_0 = NULL;
916 0 : TALLOC_CTX *_mem_save_client_computer_name_0 = NULL;
917 0 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
918 0 : if (flags & NDR_IN) {
919 0 : NDR_ZERO_STRUCT(r->out);
920 :
921 0 : NDR_CHECK(ndr_pull_witness_version(ndr, NDR_SCALARS, &r->in.version));
922 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_name));
923 0 : if (_ptr_net_name) {
924 0 : NDR_PULL_ALLOC(ndr, r->in.net_name);
925 : } else {
926 0 : r->in.net_name = NULL;
927 : }
928 0 : if (r->in.net_name) {
929 0 : _mem_save_net_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
930 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.net_name, 0);
931 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.net_name));
932 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.net_name));
933 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.net_name, &size_net_name_1));
934 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.net_name, &length_net_name_1));
935 0 : if (length_net_name_1 > size_net_name_1) {
936 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_net_name_1, length_net_name_1);
937 : }
938 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_net_name_1, sizeof(uint16_t)));
939 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.net_name, length_net_name_1, sizeof(uint16_t), CH_UTF16));
940 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_name_0, 0);
941 : }
942 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ip_address));
943 0 : if (_ptr_ip_address) {
944 0 : NDR_PULL_ALLOC(ndr, r->in.ip_address);
945 : } else {
946 0 : r->in.ip_address = NULL;
947 : }
948 0 : if (r->in.ip_address) {
949 0 : _mem_save_ip_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
950 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.ip_address, 0);
951 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ip_address));
952 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ip_address));
953 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.ip_address, &size_ip_address_1));
954 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.ip_address, &length_ip_address_1));
955 0 : if (length_ip_address_1 > size_ip_address_1) {
956 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_ip_address_1, length_ip_address_1);
957 : }
958 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_ip_address_1, sizeof(uint16_t)));
959 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ip_address, length_ip_address_1, sizeof(uint16_t), CH_UTF16));
960 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ip_address_0, 0);
961 : }
962 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_computer_name));
963 0 : if (_ptr_client_computer_name) {
964 0 : NDR_PULL_ALLOC(ndr, r->in.client_computer_name);
965 : } else {
966 0 : r->in.client_computer_name = NULL;
967 : }
968 0 : if (r->in.client_computer_name) {
969 0 : _mem_save_client_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
970 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.client_computer_name, 0);
971 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_computer_name));
972 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_computer_name));
973 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.client_computer_name, &size_client_computer_name_1));
974 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.client_computer_name, &length_client_computer_name_1));
975 0 : if (length_client_computer_name_1 > size_client_computer_name_1) {
976 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_computer_name_1, length_client_computer_name_1);
977 : }
978 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_client_computer_name_1, sizeof(uint16_t)));
979 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_computer_name, length_client_computer_name_1, sizeof(uint16_t), CH_UTF16));
980 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_computer_name_0, 0);
981 : }
982 0 : NDR_PULL_ALLOC(ndr, r->out.context_handle);
983 0 : NDR_ZERO_STRUCTP(r->out.context_handle);
984 : }
985 0 : if (flags & NDR_OUT) {
986 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
987 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
988 0 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
989 0 : NDR_PULL_ALLOC(ndr, r->out.context_handle);
990 : }
991 0 : _mem_save_context_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
992 0 : NDR_PULL_SET_MEM_CTX(ndr, r->out.context_handle, LIBNDR_FLAG_REF_ALLOC);
993 0 : NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
994 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_context_handle_0, LIBNDR_FLAG_REF_ALLOC);
995 0 : NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
996 : }
997 0 : return NDR_ERR_SUCCESS;
998 : }
999 :
1000 0 : _PUBLIC_ void ndr_print_witness_Register(struct ndr_print *ndr, const char *name, int flags, const struct witness_Register *r)
1001 : {
1002 0 : ndr_print_struct(ndr, name, "witness_Register");
1003 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1004 0 : ndr->depth++;
1005 0 : if (flags & NDR_SET_VALUES) {
1006 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1007 : }
1008 0 : if (flags & NDR_IN) {
1009 0 : ndr_print_struct(ndr, "in", "witness_Register");
1010 0 : ndr->depth++;
1011 0 : ndr_print_witness_version(ndr, "version", r->in.version);
1012 0 : ndr_print_ptr(ndr, "net_name", r->in.net_name);
1013 0 : ndr->depth++;
1014 0 : if (r->in.net_name) {
1015 0 : ndr_print_string(ndr, "net_name", r->in.net_name);
1016 : }
1017 0 : ndr->depth--;
1018 0 : ndr_print_ptr(ndr, "ip_address", r->in.ip_address);
1019 0 : ndr->depth++;
1020 0 : if (r->in.ip_address) {
1021 0 : ndr_print_string(ndr, "ip_address", r->in.ip_address);
1022 : }
1023 0 : ndr->depth--;
1024 0 : ndr_print_ptr(ndr, "client_computer_name", r->in.client_computer_name);
1025 0 : ndr->depth++;
1026 0 : if (r->in.client_computer_name) {
1027 0 : ndr_print_string(ndr, "client_computer_name", r->in.client_computer_name);
1028 : }
1029 0 : ndr->depth--;
1030 0 : ndr->depth--;
1031 : }
1032 0 : if (flags & NDR_OUT) {
1033 0 : ndr_print_struct(ndr, "out", "witness_Register");
1034 0 : ndr->depth++;
1035 0 : ndr_print_ptr(ndr, "context_handle", r->out.context_handle);
1036 0 : ndr->depth++;
1037 0 : ndr_print_policy_handle(ndr, "context_handle", r->out.context_handle);
1038 0 : ndr->depth--;
1039 0 : ndr_print_WERROR(ndr, "result", r->out.result);
1040 0 : ndr->depth--;
1041 : }
1042 0 : ndr->depth--;
1043 : }
1044 :
1045 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_UnRegister(struct ndr_push *ndr, int flags, const struct witness_UnRegister *r)
1046 : {
1047 0 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1048 0 : if (flags & NDR_IN) {
1049 0 : NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
1050 : }
1051 0 : if (flags & NDR_OUT) {
1052 0 : NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1053 : }
1054 0 : return NDR_ERR_SUCCESS;
1055 : }
1056 :
1057 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_UnRegister(struct ndr_pull *ndr, int flags, struct witness_UnRegister *r)
1058 : {
1059 0 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1060 0 : if (flags & NDR_IN) {
1061 0 : NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
1062 : }
1063 0 : if (flags & NDR_OUT) {
1064 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1065 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1066 0 : NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1067 : }
1068 0 : return NDR_ERR_SUCCESS;
1069 : }
1070 :
1071 0 : _PUBLIC_ void ndr_print_witness_UnRegister(struct ndr_print *ndr, const char *name, int flags, const struct witness_UnRegister *r)
1072 : {
1073 0 : ndr_print_struct(ndr, name, "witness_UnRegister");
1074 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1075 0 : ndr->depth++;
1076 0 : if (flags & NDR_SET_VALUES) {
1077 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1078 : }
1079 0 : if (flags & NDR_IN) {
1080 0 : ndr_print_struct(ndr, "in", "witness_UnRegister");
1081 0 : ndr->depth++;
1082 0 : ndr_print_policy_handle(ndr, "context_handle", &r->in.context_handle);
1083 0 : ndr->depth--;
1084 : }
1085 0 : if (flags & NDR_OUT) {
1086 0 : ndr_print_struct(ndr, "out", "witness_UnRegister");
1087 0 : ndr->depth++;
1088 0 : ndr_print_WERROR(ndr, "result", r->out.result);
1089 0 : ndr->depth--;
1090 : }
1091 0 : ndr->depth--;
1092 : }
1093 :
1094 0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_AsyncNotify(struct ndr_push *ndr, int flags, const struct witness_AsyncNotify *r)
1095 : {
1096 0 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1097 0 : if (flags & NDR_IN) {
1098 0 : NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
1099 : }
1100 0 : if (flags & NDR_OUT) {
1101 0 : if (r->out.response == NULL) {
1102 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1103 : }
1104 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.response));
1105 0 : if (*r->out.response) {
1106 0 : NDR_CHECK(ndr_push_witness_notifyResponse(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.response));
1107 : }
1108 0 : NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1109 : }
1110 0 : return NDR_ERR_SUCCESS;
1111 : }
1112 :
1113 0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_AsyncNotify(struct ndr_pull *ndr, int flags, struct witness_AsyncNotify *r)
1114 : {
1115 : uint32_t _ptr_response;
1116 0 : TALLOC_CTX *_mem_save_response_0 = NULL;
1117 0 : TALLOC_CTX *_mem_save_response_1 = NULL;
1118 0 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1119 0 : if (flags & NDR_IN) {
1120 0 : NDR_ZERO_STRUCT(r->out);
1121 :
1122 0 : NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
1123 0 : NDR_PULL_ALLOC(ndr, r->out.response);
1124 0 : NDR_ZERO_STRUCTP(r->out.response);
1125 : }
1126 0 : if (flags & NDR_OUT) {
1127 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1128 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1129 0 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1130 0 : NDR_PULL_ALLOC(ndr, r->out.response);
1131 : }
1132 0 : _mem_save_response_0 = NDR_PULL_GET_MEM_CTX(ndr);
1133 0 : NDR_PULL_SET_MEM_CTX(ndr, r->out.response, LIBNDR_FLAG_REF_ALLOC);
1134 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_response));
1135 0 : if (_ptr_response) {
1136 0 : NDR_PULL_ALLOC(ndr, *r->out.response);
1137 : } else {
1138 0 : *r->out.response = NULL;
1139 : }
1140 0 : if (*r->out.response) {
1141 0 : _mem_save_response_1 = NDR_PULL_GET_MEM_CTX(ndr);
1142 0 : NDR_PULL_SET_MEM_CTX(ndr, *r->out.response, 0);
1143 0 : NDR_CHECK(ndr_pull_witness_notifyResponse(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.response));
1144 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_response_1, 0);
1145 : }
1146 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_response_0, LIBNDR_FLAG_REF_ALLOC);
1147 0 : NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1148 : }
1149 0 : return NDR_ERR_SUCCESS;
1150 : }
1151 :
1152 0 : _PUBLIC_ void ndr_print_witness_AsyncNotify(struct ndr_print *ndr, const char *name, int flags, const struct witness_AsyncNotify *r)
1153 : {
1154 0 : ndr_print_struct(ndr, name, "witness_AsyncNotify");
1155 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1156 0 : ndr->depth++;
1157 0 : if (flags & NDR_SET_VALUES) {
1158 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1159 : }
1160 0 : if (flags & NDR_IN) {
1161 0 : ndr_print_struct(ndr, "in", "witness_AsyncNotify");
1162 0 : ndr->depth++;
1163 0 : ndr_print_policy_handle(ndr, "context_handle", &r->in.context_handle);
1164 0 : ndr->depth--;
1165 : }
1166 0 : if (flags & NDR_OUT) {
1167 0 : ndr_print_struct(ndr, "out", "witness_AsyncNotify");
1168 0 : ndr->depth++;
1169 0 : ndr_print_ptr(ndr, "response", r->out.response);
1170 0 : ndr->depth++;
1171 0 : ndr_print_ptr(ndr, "response", *r->out.response);
1172 0 : ndr->depth++;
1173 0 : if (*r->out.response) {
1174 0 : ndr_print_witness_notifyResponse(ndr, "response", *r->out.response);
1175 : }
1176 0 : ndr->depth--;
1177 0 : ndr->depth--;
1178 0 : ndr_print_WERROR(ndr, "result", r->out.result);
1179 0 : ndr->depth--;
1180 : }
1181 0 : ndr->depth--;
1182 : }
1183 :
1184 0 : static enum ndr_err_code ndr_push_witness_RegisterEx(struct ndr_push *ndr, int flags, const struct witness_RegisterEx *r)
1185 : {
1186 0 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1187 0 : if (flags & NDR_IN) {
1188 0 : NDR_CHECK(ndr_push_witness_version(ndr, NDR_SCALARS, r->in.version));
1189 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.net_name));
1190 0 : if (r->in.net_name) {
1191 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
1192 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1193 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
1194 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.net_name, ndr_charset_length(r->in.net_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1195 : }
1196 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share_name));
1197 0 : if (r->in.share_name) {
1198 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_name, CH_UTF16)));
1199 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1200 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_name, CH_UTF16)));
1201 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1202 : }
1203 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ip_address));
1204 0 : if (r->in.ip_address) {
1205 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
1206 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1207 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
1208 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ip_address, ndr_charset_length(r->in.ip_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1209 : }
1210 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_computer_name));
1211 0 : if (r->in.client_computer_name) {
1212 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
1213 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1214 0 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
1215 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_computer_name, ndr_charset_length(r->in.client_computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1216 : }
1217 0 : NDR_CHECK(ndr_push_witness_RegisterEx_flags(ndr, NDR_SCALARS, r->in.flags));
1218 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
1219 : }
1220 0 : if (flags & NDR_OUT) {
1221 0 : if (r->out.context_handle == NULL) {
1222 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1223 : }
1224 0 : NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
1225 0 : NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1226 : }
1227 0 : return NDR_ERR_SUCCESS;
1228 : }
1229 :
1230 0 : static enum ndr_err_code ndr_pull_witness_RegisterEx(struct ndr_pull *ndr, int flags, struct witness_RegisterEx *r)
1231 : {
1232 : uint32_t _ptr_net_name;
1233 0 : uint32_t size_net_name_1 = 0;
1234 0 : uint32_t length_net_name_1 = 0;
1235 : uint32_t _ptr_share_name;
1236 0 : uint32_t size_share_name_1 = 0;
1237 0 : uint32_t length_share_name_1 = 0;
1238 : uint32_t _ptr_ip_address;
1239 0 : uint32_t size_ip_address_1 = 0;
1240 0 : uint32_t length_ip_address_1 = 0;
1241 : uint32_t _ptr_client_computer_name;
1242 0 : uint32_t size_client_computer_name_1 = 0;
1243 0 : uint32_t length_client_computer_name_1 = 0;
1244 0 : TALLOC_CTX *_mem_save_context_handle_0 = NULL;
1245 0 : TALLOC_CTX *_mem_save_net_name_0 = NULL;
1246 0 : TALLOC_CTX *_mem_save_share_name_0 = NULL;
1247 0 : TALLOC_CTX *_mem_save_ip_address_0 = NULL;
1248 0 : TALLOC_CTX *_mem_save_client_computer_name_0 = NULL;
1249 0 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1250 0 : if (flags & NDR_IN) {
1251 0 : NDR_ZERO_STRUCT(r->out);
1252 :
1253 0 : NDR_CHECK(ndr_pull_witness_version(ndr, NDR_SCALARS, &r->in.version));
1254 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_name));
1255 0 : if (_ptr_net_name) {
1256 0 : NDR_PULL_ALLOC(ndr, r->in.net_name);
1257 : } else {
1258 0 : r->in.net_name = NULL;
1259 : }
1260 0 : if (r->in.net_name) {
1261 0 : _mem_save_net_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1262 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.net_name, 0);
1263 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.net_name));
1264 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.net_name));
1265 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.net_name, &size_net_name_1));
1266 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.net_name, &length_net_name_1));
1267 0 : if (length_net_name_1 > size_net_name_1) {
1268 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_net_name_1, length_net_name_1);
1269 : }
1270 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_net_name_1, sizeof(uint16_t)));
1271 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.net_name, length_net_name_1, sizeof(uint16_t), CH_UTF16));
1272 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_name_0, 0);
1273 : }
1274 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share_name));
1275 0 : if (_ptr_share_name) {
1276 0 : NDR_PULL_ALLOC(ndr, r->in.share_name);
1277 : } else {
1278 0 : r->in.share_name = NULL;
1279 : }
1280 0 : if (r->in.share_name) {
1281 0 : _mem_save_share_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1282 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.share_name, 0);
1283 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name));
1284 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name));
1285 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.share_name, &size_share_name_1));
1286 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.share_name, &length_share_name_1));
1287 0 : if (length_share_name_1 > size_share_name_1) {
1288 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_share_name_1, length_share_name_1);
1289 : }
1290 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_share_name_1, sizeof(uint16_t)));
1291 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, length_share_name_1, sizeof(uint16_t), CH_UTF16));
1292 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_name_0, 0);
1293 : }
1294 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ip_address));
1295 0 : if (_ptr_ip_address) {
1296 0 : NDR_PULL_ALLOC(ndr, r->in.ip_address);
1297 : } else {
1298 0 : r->in.ip_address = NULL;
1299 : }
1300 0 : if (r->in.ip_address) {
1301 0 : _mem_save_ip_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
1302 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.ip_address, 0);
1303 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ip_address));
1304 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ip_address));
1305 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.ip_address, &size_ip_address_1));
1306 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.ip_address, &length_ip_address_1));
1307 0 : if (length_ip_address_1 > size_ip_address_1) {
1308 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_ip_address_1, length_ip_address_1);
1309 : }
1310 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_ip_address_1, sizeof(uint16_t)));
1311 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ip_address, length_ip_address_1, sizeof(uint16_t), CH_UTF16));
1312 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ip_address_0, 0);
1313 : }
1314 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_computer_name));
1315 0 : if (_ptr_client_computer_name) {
1316 0 : NDR_PULL_ALLOC(ndr, r->in.client_computer_name);
1317 : } else {
1318 0 : r->in.client_computer_name = NULL;
1319 : }
1320 0 : if (r->in.client_computer_name) {
1321 0 : _mem_save_client_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1322 0 : NDR_PULL_SET_MEM_CTX(ndr, r->in.client_computer_name, 0);
1323 0 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_computer_name));
1324 0 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_computer_name));
1325 0 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.client_computer_name, &size_client_computer_name_1));
1326 0 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.client_computer_name, &length_client_computer_name_1));
1327 0 : if (length_client_computer_name_1 > size_client_computer_name_1) {
1328 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_client_computer_name_1, length_client_computer_name_1);
1329 : }
1330 0 : NDR_CHECK(ndr_check_string_terminator(ndr, length_client_computer_name_1, sizeof(uint16_t)));
1331 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_computer_name, length_client_computer_name_1, sizeof(uint16_t), CH_UTF16));
1332 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_computer_name_0, 0);
1333 : }
1334 0 : NDR_CHECK(ndr_pull_witness_RegisterEx_flags(ndr, NDR_SCALARS, &r->in.flags));
1335 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
1336 0 : NDR_PULL_ALLOC(ndr, r->out.context_handle);
1337 0 : NDR_ZERO_STRUCTP(r->out.context_handle);
1338 : }
1339 0 : if (flags & NDR_OUT) {
1340 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1341 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1342 0 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1343 0 : NDR_PULL_ALLOC(ndr, r->out.context_handle);
1344 : }
1345 0 : _mem_save_context_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1346 0 : NDR_PULL_SET_MEM_CTX(ndr, r->out.context_handle, LIBNDR_FLAG_REF_ALLOC);
1347 0 : NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
1348 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_context_handle_0, LIBNDR_FLAG_REF_ALLOC);
1349 0 : NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1350 : }
1351 0 : return NDR_ERR_SUCCESS;
1352 : }
1353 :
1354 0 : _PUBLIC_ void ndr_print_witness_RegisterEx(struct ndr_print *ndr, const char *name, int flags, const struct witness_RegisterEx *r)
1355 : {
1356 0 : ndr_print_struct(ndr, name, "witness_RegisterEx");
1357 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1358 0 : ndr->depth++;
1359 0 : if (flags & NDR_SET_VALUES) {
1360 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1361 : }
1362 0 : if (flags & NDR_IN) {
1363 0 : ndr_print_struct(ndr, "in", "witness_RegisterEx");
1364 0 : ndr->depth++;
1365 0 : ndr_print_witness_version(ndr, "version", r->in.version);
1366 0 : ndr_print_ptr(ndr, "net_name", r->in.net_name);
1367 0 : ndr->depth++;
1368 0 : if (r->in.net_name) {
1369 0 : ndr_print_string(ndr, "net_name", r->in.net_name);
1370 : }
1371 0 : ndr->depth--;
1372 0 : ndr_print_ptr(ndr, "share_name", r->in.share_name);
1373 0 : ndr->depth++;
1374 0 : if (r->in.share_name) {
1375 0 : ndr_print_string(ndr, "share_name", r->in.share_name);
1376 : }
1377 0 : ndr->depth--;
1378 0 : ndr_print_ptr(ndr, "ip_address", r->in.ip_address);
1379 0 : ndr->depth++;
1380 0 : if (r->in.ip_address) {
1381 0 : ndr_print_string(ndr, "ip_address", r->in.ip_address);
1382 : }
1383 0 : ndr->depth--;
1384 0 : ndr_print_ptr(ndr, "client_computer_name", r->in.client_computer_name);
1385 0 : ndr->depth++;
1386 0 : if (r->in.client_computer_name) {
1387 0 : ndr_print_string(ndr, "client_computer_name", r->in.client_computer_name);
1388 : }
1389 0 : ndr->depth--;
1390 0 : ndr_print_witness_RegisterEx_flags(ndr, "flags", r->in.flags);
1391 0 : ndr_print_uint32(ndr, "timeout", r->in.timeout);
1392 0 : ndr->depth--;
1393 : }
1394 0 : if (flags & NDR_OUT) {
1395 0 : ndr_print_struct(ndr, "out", "witness_RegisterEx");
1396 0 : ndr->depth++;
1397 0 : ndr_print_ptr(ndr, "context_handle", r->out.context_handle);
1398 0 : ndr->depth++;
1399 0 : ndr_print_policy_handle(ndr, "context_handle", r->out.context_handle);
1400 0 : ndr->depth--;
1401 0 : ndr_print_WERROR(ndr, "result", r->out.result);
1402 0 : ndr->depth--;
1403 : }
1404 0 : ndr->depth--;
1405 : }
1406 :
1407 : #ifndef SKIP_NDR_TABLE_witness
1408 : static const struct ndr_interface_public_struct witness_public_structs[] = {
1409 : {
1410 : .name = "witness_ResourceChange",
1411 : .struct_size = sizeof(struct witness_ResourceChange ),
1412 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_ResourceChange,
1413 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_ResourceChange,
1414 : .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_ResourceChange,
1415 : },
1416 : {
1417 : .name = "witness_IPaddrInfoList",
1418 : .struct_size = sizeof(struct witness_IPaddrInfoList ),
1419 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_IPaddrInfoList,
1420 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_IPaddrInfoList,
1421 : .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_IPaddrInfoList,
1422 : },
1423 : {
1424 : .name = "witness_notifyResponse",
1425 : .struct_size = sizeof(struct witness_notifyResponse ),
1426 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_notifyResponse,
1427 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_notifyResponse,
1428 : .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_notifyResponse,
1429 : },
1430 : { .name = NULL }
1431 : };
1432 :
1433 : static const struct ndr_interface_call witness_calls[] = {
1434 : {
1435 : "witness_GetInterfaceList",
1436 : sizeof(struct witness_GetInterfaceList),
1437 : (ndr_push_flags_fn_t) ndr_push_witness_GetInterfaceList,
1438 : (ndr_pull_flags_fn_t) ndr_pull_witness_GetInterfaceList,
1439 : (ndr_print_function_t) ndr_print_witness_GetInterfaceList,
1440 : { 0, NULL },
1441 : { 0, NULL },
1442 : },
1443 : {
1444 : "witness_Register",
1445 : sizeof(struct witness_Register),
1446 : (ndr_push_flags_fn_t) ndr_push_witness_Register,
1447 : (ndr_pull_flags_fn_t) ndr_pull_witness_Register,
1448 : (ndr_print_function_t) ndr_print_witness_Register,
1449 : { 0, NULL },
1450 : { 0, NULL },
1451 : },
1452 : {
1453 : "witness_UnRegister",
1454 : sizeof(struct witness_UnRegister),
1455 : (ndr_push_flags_fn_t) ndr_push_witness_UnRegister,
1456 : (ndr_pull_flags_fn_t) ndr_pull_witness_UnRegister,
1457 : (ndr_print_function_t) ndr_print_witness_UnRegister,
1458 : { 0, NULL },
1459 : { 0, NULL },
1460 : },
1461 : {
1462 : "witness_AsyncNotify",
1463 : sizeof(struct witness_AsyncNotify),
1464 : (ndr_push_flags_fn_t) ndr_push_witness_AsyncNotify,
1465 : (ndr_pull_flags_fn_t) ndr_pull_witness_AsyncNotify,
1466 : (ndr_print_function_t) ndr_print_witness_AsyncNotify,
1467 : { 0, NULL },
1468 : { 0, NULL },
1469 : },
1470 : {
1471 : "witness_RegisterEx",
1472 : sizeof(struct witness_RegisterEx),
1473 : (ndr_push_flags_fn_t) ndr_push_witness_RegisterEx,
1474 : (ndr_pull_flags_fn_t) ndr_pull_witness_RegisterEx,
1475 : (ndr_print_function_t) ndr_print_witness_RegisterEx,
1476 : { 0, NULL },
1477 : { 0, NULL },
1478 : },
1479 : { .name = NULL }
1480 : };
1481 :
1482 : static const char * const witness_endpoint_strings[] = {
1483 : "ncacn_ip_tcp:",
1484 : };
1485 :
1486 : static const struct ndr_interface_string_array witness_endpoints = {
1487 : .count = 1,
1488 : .names = witness_endpoint_strings
1489 : };
1490 :
1491 : static const char * const witness_authservice_strings[] = {
1492 : "host",
1493 : };
1494 :
1495 : static const struct ndr_interface_string_array witness_authservices = {
1496 : .count = 1,
1497 : .names = witness_authservice_strings
1498 : };
1499 :
1500 :
1501 : const struct ndr_interface_table ndr_table_witness = {
1502 : .name = "witness",
1503 : .syntax_id = {
1504 : {0xccd8c074,0xd0e5,0x4a40,{0x92,0xb4},{0xd0,0x74,0xfa,0xa6,0xba,0x28}},
1505 : NDR_WITNESS_VERSION
1506 : },
1507 : .helpstring = NDR_WITNESS_HELPSTRING,
1508 : .num_calls = 5,
1509 : .calls = witness_calls,
1510 : .num_public_structs = 3,
1511 : .public_structs = witness_public_structs,
1512 : .endpoints = &witness_endpoints,
1513 : .authservices = &witness_authservices
1514 : };
1515 :
1516 : #endif /* SKIP_NDR_TABLE_witness */
|