Conditional install of the cifs.upcall man page
[Samba.git] / source / librpc / gen_ndr / ndr_krb5pac.c
blob6e06f90a688f05865889ad740ac5145c00182fff
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 default: {
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; }
333 if (ndr_flags & NDR_BUFFERS) {
334 int level = ndr_push_get_switch_value(ndr, r);
335 switch (level) {
336 case PAC_TYPE_LOGON_INFO:
337 NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr, NDR_BUFFERS, &r->logon_info));
338 break;
340 case PAC_TYPE_SRV_CHECKSUM:
341 break;
343 case PAC_TYPE_KDC_CHECKSUM:
344 break;
346 case PAC_TYPE_LOGON_NAME:
347 break;
349 default:
350 break;
354 return NDR_ERR_SUCCESS;
357 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r)
359 int level;
360 level = ndr_pull_get_switch_value(ndr, r);
361 if (ndr_flags & NDR_SCALARS) {
362 switch (level) {
363 case PAC_TYPE_LOGON_INFO: {
364 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr, NDR_SCALARS, &r->logon_info));
365 break; }
367 case PAC_TYPE_SRV_CHECKSUM: {
368 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum));
369 break; }
371 case PAC_TYPE_KDC_CHECKSUM: {
372 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum));
373 break; }
375 case PAC_TYPE_LOGON_NAME: {
376 NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name));
377 break; }
379 default: {
381 struct ndr_pull *_ndr_unknown;
382 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_unknown, 0, -1));
383 NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown));
384 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_unknown, 0, -1));
386 break; }
390 if (ndr_flags & NDR_BUFFERS) {
391 switch (level) {
392 case PAC_TYPE_LOGON_INFO:
393 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr, NDR_BUFFERS, &r->logon_info));
394 break;
396 case PAC_TYPE_SRV_CHECKSUM:
397 break;
399 case PAC_TYPE_KDC_CHECKSUM:
400 break;
402 case PAC_TYPE_LOGON_NAME:
403 break;
405 default:
406 break;
410 return NDR_ERR_SUCCESS;
413 _PUBLIC_ void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r)
415 int level;
416 level = ndr_print_get_switch_value(ndr, r);
417 ndr_print_union(ndr, name, level, "PAC_INFO");
418 switch (level) {
419 case PAC_TYPE_LOGON_INFO:
420 ndr_print_PAC_LOGON_INFO_CTR(ndr, "logon_info", &r->logon_info);
421 break;
423 case PAC_TYPE_SRV_CHECKSUM:
424 ndr_print_PAC_SIGNATURE_DATA(ndr, "srv_cksum", &r->srv_cksum);
425 break;
427 case PAC_TYPE_KDC_CHECKSUM:
428 ndr_print_PAC_SIGNATURE_DATA(ndr, "kdc_cksum", &r->kdc_cksum);
429 break;
431 case PAC_TYPE_LOGON_NAME:
432 ndr_print_PAC_LOGON_NAME(ndr, "logon_name", &r->logon_name);
433 break;
435 default:
436 ndr_print_DATA_BLOB_REM(ndr, "unknown", &r->unknown);
437 break;
442 _PUBLIC_ size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags)
444 return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_PAC_INFO);
447 _PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r)
449 uint32_t cntr_buffers_0;
450 if (ndr_flags & NDR_SCALARS) {
451 NDR_CHECK(ndr_push_align(ndr, 4));
452 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers));
453 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
454 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
455 NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
458 if (ndr_flags & NDR_BUFFERS) {
459 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
460 NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
463 return NDR_ERR_SUCCESS;
466 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r)
468 uint32_t cntr_buffers_0;
469 TALLOC_CTX *_mem_save_buffers_0;
470 if (ndr_flags & NDR_SCALARS) {
471 NDR_CHECK(ndr_pull_align(ndr, 4));
472 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers));
473 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
474 NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers);
475 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
476 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
477 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
478 NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
480 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
482 if (ndr_flags & NDR_BUFFERS) {
483 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
484 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
485 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
486 NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
488 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
490 return NDR_ERR_SUCCESS;
493 _PUBLIC_ void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r)
495 uint32_t cntr_buffers_0;
496 ndr_print_struct(ndr, name, "PAC_DATA");
497 ndr->depth++;
498 ndr_print_uint32(ndr, "num_buffers", r->num_buffers);
499 ndr_print_uint32(ndr, "version", r->version);
500 ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers);
501 ndr->depth++;
502 for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) {
503 char *idx_0=NULL;
504 if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) {
505 ndr_print_PAC_BUFFER(ndr, "buffers", &r->buffers[cntr_buffers_0]);
506 free(idx_0);
509 ndr->depth--;
510 ndr->depth--;
513 _PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r)
515 if (ndr_flags & NDR_SCALARS) {
516 NDR_CHECK(ndr_push_align(ndr, 4));
517 NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type));
518 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size));
520 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
521 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
522 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info));
523 ndr->flags = _flags_save_DATA_BLOB_REM;
525 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
527 if (ndr_flags & NDR_BUFFERS) {
529 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
530 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
531 if (r->info) {
532 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info));
534 struct ndr_push *_ndr_info;
535 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
536 NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info));
537 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
540 ndr->flags = _flags_save_DATA_BLOB_REM;
543 return NDR_ERR_SUCCESS;
546 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r)
548 uint32_t _ptr_info;
549 TALLOC_CTX *_mem_save_info_0;
550 if (ndr_flags & NDR_SCALARS) {
551 NDR_CHECK(ndr_pull_align(ndr, 4));
552 NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type));
553 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ndr_size));
555 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
556 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
557 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
558 if (_ptr_info) {
559 NDR_PULL_ALLOC(ndr, r->info);
560 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info));
561 } else {
562 r->info = NULL;
564 ndr->flags = _flags_save_DATA_BLOB_REM;
566 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
568 if (ndr_flags & NDR_BUFFERS) {
570 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
571 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
572 if (r->info) {
573 uint32_t _relative_save_offset;
574 _relative_save_offset = ndr->offset;
575 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info));
576 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
577 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
579 struct ndr_pull *_ndr_info;
580 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
581 NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info));
582 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
584 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
585 ndr->offset = _relative_save_offset;
587 ndr->flags = _flags_save_DATA_BLOB_REM;
590 return NDR_ERR_SUCCESS;
593 _PUBLIC_ void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r)
595 ndr_print_struct(ndr, name, "PAC_BUFFER_RAW");
596 ndr->depth++;
597 ndr_print_PAC_TYPE(ndr, "type", r->type);
598 ndr_print_uint32(ndr, "ndr_size", r->ndr_size);
599 ndr_print_ptr(ndr, "info", r->info);
600 ndr->depth++;
601 if (r->info) {
602 ndr_print_DATA_BLOB_REM(ndr, "info", r->info);
604 ndr->depth--;
605 ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
606 ndr->depth--;
609 _PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r)
611 uint32_t cntr_buffers_0;
612 if (ndr_flags & NDR_SCALARS) {
613 NDR_CHECK(ndr_push_align(ndr, 4));
614 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers));
615 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
616 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
617 NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
620 if (ndr_flags & NDR_BUFFERS) {
621 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
622 NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
625 return NDR_ERR_SUCCESS;
628 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r)
630 uint32_t cntr_buffers_0;
631 TALLOC_CTX *_mem_save_buffers_0;
632 if (ndr_flags & NDR_SCALARS) {
633 NDR_CHECK(ndr_pull_align(ndr, 4));
634 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers));
635 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
636 NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers);
637 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
638 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
639 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
640 NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
642 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
644 if (ndr_flags & NDR_BUFFERS) {
645 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
646 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
647 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
648 NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
650 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
652 return NDR_ERR_SUCCESS;
655 _PUBLIC_ void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r)
657 uint32_t cntr_buffers_0;
658 ndr_print_struct(ndr, name, "PAC_DATA_RAW");
659 ndr->depth++;
660 ndr_print_uint32(ndr, "num_buffers", r->num_buffers);
661 ndr_print_uint32(ndr, "version", r->version);
662 ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers);
663 ndr->depth++;
664 for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) {
665 char *idx_0=NULL;
666 if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) {
667 ndr_print_PAC_BUFFER_RAW(ndr, "buffers", &r->buffers[cntr_buffers_0]);
668 free(idx_0);
671 ndr->depth--;
672 ndr->depth--;
675 _PUBLIC_ enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r)
677 if (ndr_flags & NDR_SCALARS) {
678 NDR_CHECK(ndr_push_align(ndr, 4));
679 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
680 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
682 if (ndr_flags & NDR_BUFFERS) {
683 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
685 return NDR_ERR_SUCCESS;
688 _PUBLIC_ enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r)
690 if (ndr_flags & NDR_SCALARS) {
691 NDR_CHECK(ndr_pull_align(ndr, 4));
692 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
693 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
695 if (ndr_flags & NDR_BUFFERS) {
696 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
698 return NDR_ERR_SUCCESS;
701 _PUBLIC_ void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r)
703 ndr_print_struct(ndr, name, "netsamlogoncache_entry");
704 ndr->depth++;
705 ndr_print_time_t(ndr, "timestamp", r->timestamp);
706 ndr_print_netr_SamInfo3(ndr, "info3", &r->info3);
707 ndr->depth--;
710 static enum ndr_err_code ndr_push_decode_pac(struct ndr_push *ndr, int flags, const struct decode_pac *r)
712 if (flags & NDR_IN) {
713 NDR_CHECK(ndr_push_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
715 if (flags & NDR_OUT) {
717 return NDR_ERR_SUCCESS;
720 static enum ndr_err_code ndr_pull_decode_pac(struct ndr_pull *ndr, int flags, struct decode_pac *r)
722 if (flags & NDR_IN) {
723 NDR_CHECK(ndr_pull_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
725 if (flags & NDR_OUT) {
727 return NDR_ERR_SUCCESS;
730 _PUBLIC_ void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r)
732 ndr_print_struct(ndr, name, "decode_pac");
733 ndr->depth++;
734 if (flags & NDR_SET_VALUES) {
735 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
737 if (flags & NDR_IN) {
738 ndr_print_struct(ndr, "in", "decode_pac");
739 ndr->depth++;
740 ndr_print_PAC_DATA(ndr, "pac", &r->in.pac);
741 ndr->depth--;
743 if (flags & NDR_OUT) {
744 ndr_print_struct(ndr, "out", "decode_pac");
745 ndr->depth++;
746 ndr->depth--;
748 ndr->depth--;
751 static enum ndr_err_code ndr_push_decode_pac_raw(struct ndr_push *ndr, int flags, const struct decode_pac_raw *r)
753 if (flags & NDR_IN) {
754 NDR_CHECK(ndr_push_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
756 if (flags & NDR_OUT) {
758 return NDR_ERR_SUCCESS;
761 static enum ndr_err_code ndr_pull_decode_pac_raw(struct ndr_pull *ndr, int flags, struct decode_pac_raw *r)
763 if (flags & NDR_IN) {
764 NDR_CHECK(ndr_pull_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
766 if (flags & NDR_OUT) {
768 return NDR_ERR_SUCCESS;
771 _PUBLIC_ void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r)
773 ndr_print_struct(ndr, name, "decode_pac_raw");
774 ndr->depth++;
775 if (flags & NDR_SET_VALUES) {
776 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
778 if (flags & NDR_IN) {
779 ndr_print_struct(ndr, "in", "decode_pac_raw");
780 ndr->depth++;
781 ndr_print_PAC_DATA_RAW(ndr, "pac", &r->in.pac);
782 ndr->depth--;
784 if (flags & NDR_OUT) {
785 ndr_print_struct(ndr, "out", "decode_pac_raw");
786 ndr->depth++;
787 ndr->depth--;
789 ndr->depth--;
792 static enum ndr_err_code ndr_push_decode_login_info(struct ndr_push *ndr, int flags, const struct decode_login_info *r)
794 if (flags & NDR_IN) {
795 NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info));
797 if (flags & NDR_OUT) {
799 return NDR_ERR_SUCCESS;
802 static enum ndr_err_code ndr_pull_decode_login_info(struct ndr_pull *ndr, int flags, struct decode_login_info *r)
804 if (flags & NDR_IN) {
805 NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info));
807 if (flags & NDR_OUT) {
809 return NDR_ERR_SUCCESS;
812 _PUBLIC_ void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r)
814 ndr_print_struct(ndr, name, "decode_login_info");
815 ndr->depth++;
816 if (flags & NDR_SET_VALUES) {
817 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
819 if (flags & NDR_IN) {
820 ndr_print_struct(ndr, "in", "decode_login_info");
821 ndr->depth++;
822 ndr_print_PAC_LOGON_INFO(ndr, "logon_info", &r->in.logon_info);
823 ndr->depth--;
825 if (flags & NDR_OUT) {
826 ndr_print_struct(ndr, "out", "decode_login_info");
827 ndr->depth++;
828 ndr->depth--;
830 ndr->depth--;
833 static const struct ndr_interface_call krb5pac_calls[] = {
835 "decode_pac",
836 sizeof(struct decode_pac),
837 (ndr_push_flags_fn_t) ndr_push_decode_pac,
838 (ndr_pull_flags_fn_t) ndr_pull_decode_pac,
839 (ndr_print_function_t) ndr_print_decode_pac,
840 false,
843 "decode_pac_raw",
844 sizeof(struct decode_pac_raw),
845 (ndr_push_flags_fn_t) ndr_push_decode_pac_raw,
846 (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw,
847 (ndr_print_function_t) ndr_print_decode_pac_raw,
848 false,
851 "decode_login_info",
852 sizeof(struct decode_login_info),
853 (ndr_push_flags_fn_t) ndr_push_decode_login_info,
854 (ndr_pull_flags_fn_t) ndr_pull_decode_login_info,
855 (ndr_print_function_t) ndr_print_decode_login_info,
856 false,
858 { NULL, 0, NULL, NULL, NULL, false }
861 static const char * const krb5pac_endpoint_strings[] = {
862 "ncacn_np:[\\pipe\\krb5pac]",
865 static const struct ndr_interface_string_array krb5pac_endpoints = {
866 .count = 1,
867 .names = krb5pac_endpoint_strings
870 static const char * const krb5pac_authservice_strings[] = {
871 "host",
874 static const struct ndr_interface_string_array krb5pac_authservices = {
875 .count = 1,
876 .names = krb5pac_authservice_strings
880 const struct ndr_interface_table ndr_table_krb5pac = {
881 .name = "krb5pac",
882 .syntax_id = {
883 {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}},
884 NDR_KRB5PAC_VERSION
886 .helpstring = NDR_KRB5PAC_HELPSTRING,
887 .num_calls = 3,
888 .calls = krb5pac_calls,
889 .endpoints = &krb5pac_endpoints,
890 .authservices = &krb5pac_authservices