re-run make idl after Jelmer's "poperly cast array lengths" pidl change.
[Samba.git] / source / librpc / gen_ndr / ndr_krb5pac.c
blob70d63aee91d0d3226b9a9210bd9db198f5f17df2
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_krb5pac.h"
6 #include "librpc/gen_ndr/ndr_security.h"
7 #include "librpc/gen_ndr/ndr_netlogon.h"
8 #include "librpc/gen_ndr/ndr_samr.h"
9 static enum ndr_err_code ndr_push_PAC_LOGON_NAME(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_NAME *r)
11 if (ndr_flags & NDR_SCALARS) {
12 NDR_CHECK(ndr_push_align(ndr, 4));
13 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->logon_time));
14 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->account_name)));
15 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, 2 * strlen_m(r->account_name), sizeof(uint8_t), CH_UTF16));
17 if (ndr_flags & NDR_BUFFERS) {
19 return NDR_ERR_SUCCESS;
22 static enum ndr_err_code ndr_pull_PAC_LOGON_NAME(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_NAME *r)
24 if (ndr_flags & NDR_SCALARS) {
25 NDR_CHECK(ndr_pull_align(ndr, 4));
26 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->logon_time));
27 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
28 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, r->size, sizeof(uint8_t), CH_UTF16));
30 if (ndr_flags & NDR_BUFFERS) {
32 return NDR_ERR_SUCCESS;
35 _PUBLIC_ void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r)
37 ndr_print_struct(ndr, name, "PAC_LOGON_NAME");
38 ndr->depth++;
39 ndr_print_NTTIME(ndr, "logon_time", r->logon_time);
40 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->account_name):r->size);
41 ndr_print_string(ndr, "account_name", r->account_name);
42 ndr->depth--;
45 _PUBLIC_ enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *r)
48 uint32_t _flags_save_STRUCT = ndr->flags;
49 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
50 if (ndr_flags & NDR_SCALARS) {
51 NDR_CHECK(ndr_push_align(ndr, 4));
52 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type));
54 uint32_t _flags_save_DATA_BLOB = ndr->flags;
55 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
56 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->signature));
57 ndr->flags = _flags_save_DATA_BLOB;
60 if (ndr_flags & NDR_BUFFERS) {
62 ndr->flags = _flags_save_STRUCT;
64 return NDR_ERR_SUCCESS;
67 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r)
70 uint32_t _flags_save_STRUCT = ndr->flags;
71 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
72 if (ndr_flags & NDR_SCALARS) {
73 NDR_CHECK(ndr_pull_align(ndr, 4));
74 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type));
76 uint32_t _flags_save_DATA_BLOB = ndr->flags;
77 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
78 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->signature));
79 ndr->flags = _flags_save_DATA_BLOB;
82 if (ndr_flags & NDR_BUFFERS) {
84 ndr->flags = _flags_save_STRUCT;
86 return NDR_ERR_SUCCESS;
89 _PUBLIC_ void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r)
91 ndr_print_struct(ndr, name, "PAC_SIGNATURE_DATA");
93 uint32_t _flags_save_STRUCT = ndr->flags;
94 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
95 ndr->depth++;
96 ndr_print_uint32(ndr, "type", r->type);
97 ndr_print_DATA_BLOB(ndr, "signature", r->signature);
98 ndr->depth--;
99 ndr->flags = _flags_save_STRUCT;
103 static enum ndr_err_code ndr_push_PAC_LOGON_INFO(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO *r)
105 if (ndr_flags & NDR_SCALARS) {
106 NDR_CHECK(ndr_push_align(ndr, 4));
107 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
108 NDR_CHECK(ndr_push_unique_ptr(ndr, r->res_group_dom_sid));
109 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups));
111 if (ndr_flags & NDR_BUFFERS) {
112 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
113 if (r->res_group_dom_sid) {
114 NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid));
116 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups));
118 return NDR_ERR_SUCCESS;
121 static enum ndr_err_code ndr_pull_PAC_LOGON_INFO(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO *r)
123 uint32_t _ptr_res_group_dom_sid;
124 TALLOC_CTX *_mem_save_res_group_dom_sid_0;
125 if (ndr_flags & NDR_SCALARS) {
126 NDR_CHECK(ndr_pull_align(ndr, 4));
127 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
128 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_res_group_dom_sid));
129 if (_ptr_res_group_dom_sid) {
130 NDR_PULL_ALLOC(ndr, r->res_group_dom_sid);
131 } else {
132 r->res_group_dom_sid = NULL;
134 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups));
136 if (ndr_flags & NDR_BUFFERS) {
137 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
138 if (r->res_group_dom_sid) {
139 _mem_save_res_group_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
140 NDR_PULL_SET_MEM_CTX(ndr, r->res_group_dom_sid, 0);
141 NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid));
142 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_group_dom_sid_0, 0);
144 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups));
146 return NDR_ERR_SUCCESS;
149 _PUBLIC_ void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r)
151 ndr_print_struct(ndr, name, "PAC_LOGON_INFO");
152 ndr->depth++;
153 ndr_print_netr_SamInfo3(ndr, "info3", &r->info3);
154 ndr_print_ptr(ndr, "res_group_dom_sid", r->res_group_dom_sid);
155 ndr->depth++;
156 if (r->res_group_dom_sid) {
157 ndr_print_dom_sid2(ndr, "res_group_dom_sid", r->res_group_dom_sid);
159 ndr->depth--;
160 ndr_print_samr_RidWithAttributeArray(ndr, "res_groups", &r->res_groups);
161 ndr->depth--;
164 static size_t ndr_size_PAC_LOGON_INFO(const struct PAC_LOGON_INFO *r, int flags)
166 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_PAC_LOGON_INFO);
169 _PUBLIC_ enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r)
171 if (ndr_flags & NDR_SCALARS) {
172 NDR_CHECK(ndr_push_align(ndr, 4));
173 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00081001));
174 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0xCCCCCCCC));
175 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NDR_ROUND(ndr_size_PAC_LOGON_INFO(r->info, ndr->flags) + 4, 8)));
176 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00000000));
177 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
179 if (ndr_flags & NDR_BUFFERS) {
180 if (r->info) {
181 NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
184 return NDR_ERR_SUCCESS;
187 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r)
189 uint32_t _ptr_info;
190 TALLOC_CTX *_mem_save_info_0;
191 if (ndr_flags & NDR_SCALARS) {
192 NDR_CHECK(ndr_pull_align(ndr, 4));
193 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
194 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
195 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
196 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
197 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
198 if (_ptr_info) {
199 NDR_PULL_ALLOC(ndr, r->info);
200 } else {
201 r->info = NULL;
204 if (ndr_flags & NDR_BUFFERS) {
205 if (r->info) {
206 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
207 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
208 NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
209 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
212 return NDR_ERR_SUCCESS;
215 _PUBLIC_ void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r)
217 ndr_print_struct(ndr, name, "PAC_LOGON_INFO_CTR");
218 ndr->depth++;
219 ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x00081001:r->unknown1);
220 ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0xCCCCCCCC:r->unknown2);
221 ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NDR_ROUND(ndr_size_PAC_LOGON_INFO(r->info, ndr->flags) + 4, 8):r->_ndr_size);
222 ndr_print_uint32(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x00000000:r->unknown3);
223 ndr_print_ptr(ndr, "info", r->info);
224 ndr->depth++;
225 if (r->info) {
226 ndr_print_PAC_LOGON_INFO(ndr, "info", r->info);
228 ndr->depth--;
229 ndr->depth--;
232 _PUBLIC_ enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r)
234 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
235 return NDR_ERR_SUCCESS;
238 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r)
240 uint32_t v;
241 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
242 *r = v;
243 return NDR_ERR_SUCCESS;
246 _PUBLIC_ void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r)
248 const char *val = NULL;
250 switch (r) {
251 case PAC_TYPE_LOGON_INFO: val = "PAC_TYPE_LOGON_INFO"; break;
252 case PAC_TYPE_SRV_CHECKSUM: val = "PAC_TYPE_SRV_CHECKSUM"; break;
253 case PAC_TYPE_KDC_CHECKSUM: val = "PAC_TYPE_KDC_CHECKSUM"; break;
254 case PAC_TYPE_LOGON_NAME: val = "PAC_TYPE_LOGON_NAME"; break;
255 case PAC_TYPE_CONSTRAINED_DELEGATION: val = "PAC_TYPE_CONSTRAINED_DELEGATION"; break;
256 case PAC_TYPE_UNKNOWN_12: val = "PAC_TYPE_UNKNOWN_12"; break;
258 ndr_print_enum(ndr, name, "ENUM", val, r);
261 static enum ndr_err_code ndr_push_DATA_BLOB_REM(struct ndr_push *ndr, int ndr_flags, const struct DATA_BLOB_REM *r)
263 if (ndr_flags & NDR_SCALARS) {
264 NDR_CHECK(ndr_push_align(ndr, 4));
266 uint32_t _flags_save_DATA_BLOB = ndr->flags;
267 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
268 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining));
269 ndr->flags = _flags_save_DATA_BLOB;
272 if (ndr_flags & NDR_BUFFERS) {
274 return NDR_ERR_SUCCESS;
277 static enum ndr_err_code ndr_pull_DATA_BLOB_REM(struct ndr_pull *ndr, int ndr_flags, struct DATA_BLOB_REM *r)
279 if (ndr_flags & NDR_SCALARS) {
280 NDR_CHECK(ndr_pull_align(ndr, 4));
282 uint32_t _flags_save_DATA_BLOB = ndr->flags;
283 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
284 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining));
285 ndr->flags = _flags_save_DATA_BLOB;
288 if (ndr_flags & NDR_BUFFERS) {
290 return NDR_ERR_SUCCESS;
293 _PUBLIC_ void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r)
295 ndr_print_struct(ndr, name, "DATA_BLOB_REM");
296 ndr->depth++;
297 ndr_print_DATA_BLOB(ndr, "remaining", r->remaining);
298 ndr->depth--;
301 _PUBLIC_ enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r)
303 if (ndr_flags & NDR_SCALARS) {
304 int level = ndr_push_get_switch_value(ndr, r);
305 switch (level) {
306 case PAC_TYPE_LOGON_INFO: {
307 NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr, NDR_SCALARS, &r->logon_info));
308 break; }
310 case PAC_TYPE_SRV_CHECKSUM: {
311 NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum));
312 break; }
314 case PAC_TYPE_KDC_CHECKSUM: {
315 NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum));
316 break; }
318 case PAC_TYPE_LOGON_NAME: {
319 NDR_CHECK(ndr_push_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name));
320 break; }
322 case PAC_TYPE_UNKNOWN_12: {
324 struct ndr_push *_ndr_unknown;
325 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_unknown, 0, -1));
326 NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown));
327 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_unknown, 0, -1));
329 break; }
331 default:
332 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
335 if (ndr_flags & NDR_BUFFERS) {
336 int level = ndr_push_get_switch_value(ndr, r);
337 switch (level) {
338 case PAC_TYPE_LOGON_INFO:
339 NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr, NDR_BUFFERS, &r->logon_info));
340 break;
342 case PAC_TYPE_SRV_CHECKSUM:
343 break;
345 case PAC_TYPE_KDC_CHECKSUM:
346 break;
348 case PAC_TYPE_LOGON_NAME:
349 break;
351 case PAC_TYPE_UNKNOWN_12:
352 break;
354 default:
355 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
358 return NDR_ERR_SUCCESS;
361 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r)
363 int level;
364 level = ndr_pull_get_switch_value(ndr, r);
365 if (ndr_flags & NDR_SCALARS) {
366 switch (level) {
367 case PAC_TYPE_LOGON_INFO: {
368 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr, NDR_SCALARS, &r->logon_info));
369 break; }
371 case PAC_TYPE_SRV_CHECKSUM: {
372 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum));
373 break; }
375 case PAC_TYPE_KDC_CHECKSUM: {
376 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum));
377 break; }
379 case PAC_TYPE_LOGON_NAME: {
380 NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name));
381 break; }
383 case PAC_TYPE_UNKNOWN_12: {
385 struct ndr_pull *_ndr_unknown;
386 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_unknown, 0, -1));
387 NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown));
388 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_unknown, 0, -1));
390 break; }
392 default:
393 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
396 if (ndr_flags & NDR_BUFFERS) {
397 switch (level) {
398 case PAC_TYPE_LOGON_INFO:
399 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr, NDR_BUFFERS, &r->logon_info));
400 break;
402 case PAC_TYPE_SRV_CHECKSUM:
403 break;
405 case PAC_TYPE_KDC_CHECKSUM:
406 break;
408 case PAC_TYPE_LOGON_NAME:
409 break;
411 case PAC_TYPE_UNKNOWN_12:
412 break;
414 default:
415 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
418 return NDR_ERR_SUCCESS;
421 _PUBLIC_ void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r)
423 int level;
424 level = ndr_print_get_switch_value(ndr, r);
425 ndr_print_union(ndr, name, level, "PAC_INFO");
426 switch (level) {
427 case PAC_TYPE_LOGON_INFO:
428 ndr_print_PAC_LOGON_INFO_CTR(ndr, "logon_info", &r->logon_info);
429 break;
431 case PAC_TYPE_SRV_CHECKSUM:
432 ndr_print_PAC_SIGNATURE_DATA(ndr, "srv_cksum", &r->srv_cksum);
433 break;
435 case PAC_TYPE_KDC_CHECKSUM:
436 ndr_print_PAC_SIGNATURE_DATA(ndr, "kdc_cksum", &r->kdc_cksum);
437 break;
439 case PAC_TYPE_LOGON_NAME:
440 ndr_print_PAC_LOGON_NAME(ndr, "logon_name", &r->logon_name);
441 break;
443 case PAC_TYPE_UNKNOWN_12:
444 ndr_print_DATA_BLOB_REM(ndr, "unknown", &r->unknown);
445 break;
447 default:
448 ndr_print_bad_level(ndr, name, level);
452 _PUBLIC_ size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags)
454 return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_PAC_INFO);
457 _PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r)
459 uint32_t cntr_buffers_0;
460 if (ndr_flags & NDR_SCALARS) {
461 NDR_CHECK(ndr_push_align(ndr, 4));
462 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers));
463 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
464 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
465 NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
468 if (ndr_flags & NDR_BUFFERS) {
469 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
470 NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
473 return NDR_ERR_SUCCESS;
476 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r)
478 uint32_t cntr_buffers_0;
479 TALLOC_CTX *_mem_save_buffers_0;
480 if (ndr_flags & NDR_SCALARS) {
481 NDR_CHECK(ndr_pull_align(ndr, 4));
482 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers));
483 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
484 NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers);
485 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
486 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
487 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
488 NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
490 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
492 if (ndr_flags & NDR_BUFFERS) {
493 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
494 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
495 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
496 NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
498 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
500 return NDR_ERR_SUCCESS;
503 _PUBLIC_ void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r)
505 uint32_t cntr_buffers_0;
506 ndr_print_struct(ndr, name, "PAC_DATA");
507 ndr->depth++;
508 ndr_print_uint32(ndr, "num_buffers", r->num_buffers);
509 ndr_print_uint32(ndr, "version", r->version);
510 ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers);
511 ndr->depth++;
512 for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) {
513 char *idx_0=NULL;
514 if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) {
515 ndr_print_PAC_BUFFER(ndr, "buffers", &r->buffers[cntr_buffers_0]);
516 free(idx_0);
519 ndr->depth--;
520 ndr->depth--;
523 _PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r)
525 if (ndr_flags & NDR_SCALARS) {
526 NDR_CHECK(ndr_push_align(ndr, 4));
527 NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type));
528 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size));
530 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
531 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
532 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info));
533 ndr->flags = _flags_save_DATA_BLOB_REM;
535 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
537 if (ndr_flags & NDR_BUFFERS) {
539 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
540 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
541 if (r->info) {
542 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info));
544 struct ndr_push *_ndr_info;
545 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
546 NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info));
547 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
550 ndr->flags = _flags_save_DATA_BLOB_REM;
553 return NDR_ERR_SUCCESS;
556 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r)
558 uint32_t _ptr_info;
559 TALLOC_CTX *_mem_save_info_0;
560 if (ndr_flags & NDR_SCALARS) {
561 NDR_CHECK(ndr_pull_align(ndr, 4));
562 NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type));
563 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ndr_size));
565 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
566 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
567 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
568 if (_ptr_info) {
569 NDR_PULL_ALLOC(ndr, r->info);
570 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info));
571 } else {
572 r->info = NULL;
574 ndr->flags = _flags_save_DATA_BLOB_REM;
576 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
578 if (ndr_flags & NDR_BUFFERS) {
580 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
581 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
582 if (r->info) {
583 uint32_t _relative_save_offset;
584 _relative_save_offset = ndr->offset;
585 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info));
586 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
587 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
589 struct ndr_pull *_ndr_info;
590 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
591 NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info));
592 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
594 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
595 ndr->offset = _relative_save_offset;
597 ndr->flags = _flags_save_DATA_BLOB_REM;
600 return NDR_ERR_SUCCESS;
603 _PUBLIC_ void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r)
605 ndr_print_struct(ndr, name, "PAC_BUFFER_RAW");
606 ndr->depth++;
607 ndr_print_PAC_TYPE(ndr, "type", r->type);
608 ndr_print_uint32(ndr, "ndr_size", r->ndr_size);
609 ndr_print_ptr(ndr, "info", r->info);
610 ndr->depth++;
611 if (r->info) {
612 ndr_print_DATA_BLOB_REM(ndr, "info", r->info);
614 ndr->depth--;
615 ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
616 ndr->depth--;
619 _PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r)
621 uint32_t cntr_buffers_0;
622 if (ndr_flags & NDR_SCALARS) {
623 NDR_CHECK(ndr_push_align(ndr, 4));
624 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers));
625 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
626 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
627 NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
630 if (ndr_flags & NDR_BUFFERS) {
631 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
632 NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
635 return NDR_ERR_SUCCESS;
638 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r)
640 uint32_t cntr_buffers_0;
641 TALLOC_CTX *_mem_save_buffers_0;
642 if (ndr_flags & NDR_SCALARS) {
643 NDR_CHECK(ndr_pull_align(ndr, 4));
644 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers));
645 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
646 NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers);
647 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
648 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
649 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
650 NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
652 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
654 if (ndr_flags & NDR_BUFFERS) {
655 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
656 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
657 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
658 NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
660 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
662 return NDR_ERR_SUCCESS;
665 _PUBLIC_ void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r)
667 uint32_t cntr_buffers_0;
668 ndr_print_struct(ndr, name, "PAC_DATA_RAW");
669 ndr->depth++;
670 ndr_print_uint32(ndr, "num_buffers", r->num_buffers);
671 ndr_print_uint32(ndr, "version", r->version);
672 ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers);
673 ndr->depth++;
674 for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) {
675 char *idx_0=NULL;
676 if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) {
677 ndr_print_PAC_BUFFER_RAW(ndr, "buffers", &r->buffers[cntr_buffers_0]);
678 free(idx_0);
681 ndr->depth--;
682 ndr->depth--;
685 _PUBLIC_ enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r)
687 if (ndr_flags & NDR_SCALARS) {
688 NDR_CHECK(ndr_push_align(ndr, 4));
689 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
690 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
692 if (ndr_flags & NDR_BUFFERS) {
693 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
695 return NDR_ERR_SUCCESS;
698 _PUBLIC_ enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r)
700 if (ndr_flags & NDR_SCALARS) {
701 NDR_CHECK(ndr_pull_align(ndr, 4));
702 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
703 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
705 if (ndr_flags & NDR_BUFFERS) {
706 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
708 return NDR_ERR_SUCCESS;
711 _PUBLIC_ void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r)
713 ndr_print_struct(ndr, name, "netsamlogoncache_entry");
714 ndr->depth++;
715 ndr_print_time_t(ndr, "timestamp", r->timestamp);
716 ndr_print_netr_SamInfo3(ndr, "info3", &r->info3);
717 ndr->depth--;
720 static enum ndr_err_code ndr_push_decode_pac(struct ndr_push *ndr, int flags, const struct decode_pac *r)
722 if (flags & NDR_IN) {
723 NDR_CHECK(ndr_push_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
725 if (flags & NDR_OUT) {
727 return NDR_ERR_SUCCESS;
730 static enum ndr_err_code ndr_pull_decode_pac(struct ndr_pull *ndr, int flags, struct decode_pac *r)
732 if (flags & NDR_IN) {
733 NDR_CHECK(ndr_pull_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
735 if (flags & NDR_OUT) {
737 return NDR_ERR_SUCCESS;
740 _PUBLIC_ void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r)
742 ndr_print_struct(ndr, name, "decode_pac");
743 ndr->depth++;
744 if (flags & NDR_SET_VALUES) {
745 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
747 if (flags & NDR_IN) {
748 ndr_print_struct(ndr, "in", "decode_pac");
749 ndr->depth++;
750 ndr_print_PAC_DATA(ndr, "pac", &r->in.pac);
751 ndr->depth--;
753 if (flags & NDR_OUT) {
754 ndr_print_struct(ndr, "out", "decode_pac");
755 ndr->depth++;
756 ndr->depth--;
758 ndr->depth--;
761 static enum ndr_err_code ndr_push_decode_pac_raw(struct ndr_push *ndr, int flags, const struct decode_pac_raw *r)
763 if (flags & NDR_IN) {
764 NDR_CHECK(ndr_push_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
766 if (flags & NDR_OUT) {
768 return NDR_ERR_SUCCESS;
771 static enum ndr_err_code ndr_pull_decode_pac_raw(struct ndr_pull *ndr, int flags, struct decode_pac_raw *r)
773 if (flags & NDR_IN) {
774 NDR_CHECK(ndr_pull_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
776 if (flags & NDR_OUT) {
778 return NDR_ERR_SUCCESS;
781 _PUBLIC_ void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r)
783 ndr_print_struct(ndr, name, "decode_pac_raw");
784 ndr->depth++;
785 if (flags & NDR_SET_VALUES) {
786 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
788 if (flags & NDR_IN) {
789 ndr_print_struct(ndr, "in", "decode_pac_raw");
790 ndr->depth++;
791 ndr_print_PAC_DATA_RAW(ndr, "pac", &r->in.pac);
792 ndr->depth--;
794 if (flags & NDR_OUT) {
795 ndr_print_struct(ndr, "out", "decode_pac_raw");
796 ndr->depth++;
797 ndr->depth--;
799 ndr->depth--;
802 static enum ndr_err_code ndr_push_decode_login_info(struct ndr_push *ndr, int flags, const struct decode_login_info *r)
804 if (flags & NDR_IN) {
805 NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info));
807 if (flags & NDR_OUT) {
809 return NDR_ERR_SUCCESS;
812 static enum ndr_err_code ndr_pull_decode_login_info(struct ndr_pull *ndr, int flags, struct decode_login_info *r)
814 if (flags & NDR_IN) {
815 NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info));
817 if (flags & NDR_OUT) {
819 return NDR_ERR_SUCCESS;
822 _PUBLIC_ void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r)
824 ndr_print_struct(ndr, name, "decode_login_info");
825 ndr->depth++;
826 if (flags & NDR_SET_VALUES) {
827 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
829 if (flags & NDR_IN) {
830 ndr_print_struct(ndr, "in", "decode_login_info");
831 ndr->depth++;
832 ndr_print_PAC_LOGON_INFO(ndr, "logon_info", &r->in.logon_info);
833 ndr->depth--;
835 if (flags & NDR_OUT) {
836 ndr_print_struct(ndr, "out", "decode_login_info");
837 ndr->depth++;
838 ndr->depth--;
840 ndr->depth--;
843 static const struct ndr_interface_call krb5pac_calls[] = {
845 "decode_pac",
846 sizeof(struct decode_pac),
847 (ndr_push_flags_fn_t) ndr_push_decode_pac,
848 (ndr_pull_flags_fn_t) ndr_pull_decode_pac,
849 (ndr_print_function_t) ndr_print_decode_pac,
850 false,
853 "decode_pac_raw",
854 sizeof(struct decode_pac_raw),
855 (ndr_push_flags_fn_t) ndr_push_decode_pac_raw,
856 (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw,
857 (ndr_print_function_t) ndr_print_decode_pac_raw,
858 false,
861 "decode_login_info",
862 sizeof(struct decode_login_info),
863 (ndr_push_flags_fn_t) ndr_push_decode_login_info,
864 (ndr_pull_flags_fn_t) ndr_pull_decode_login_info,
865 (ndr_print_function_t) ndr_print_decode_login_info,
866 false,
868 { NULL, 0, NULL, NULL, NULL, false }
871 static const char * const krb5pac_endpoint_strings[] = {
872 "ncacn_np:[\\pipe\\krb5pac]",
875 static const struct ndr_interface_string_array krb5pac_endpoints = {
876 .count = 1,
877 .names = krb5pac_endpoint_strings
880 static const char * const krb5pac_authservice_strings[] = {
881 "host",
884 static const struct ndr_interface_string_array krb5pac_authservices = {
885 .count = 1,
886 .names = krb5pac_authservice_strings
890 const struct ndr_interface_table ndr_table_krb5pac = {
891 .name = "krb5pac",
892 .syntax_id = {
893 {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}},
894 NDR_KRB5PAC_VERSION
896 .helpstring = NDR_KRB5PAC_HELPSTRING,
897 .num_calls = 3,
898 .calls = krb5pac_calls,
899 .endpoints = &krb5pac_endpoints,
900 .authservices = &krb5pac_authservices