s3:configure: "test" only takes one "="
[Samba/gebeck_regimport.git] / librpc / gen_ndr / ndr_krb5pac.c
blob27025c0202f4a92823515ca74881eee094287046
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 _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)
166 if (ndr_flags & NDR_SCALARS) {
167 NDR_CHECK(ndr_push_align(ndr, 4));
168 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
170 if (ndr_flags & NDR_BUFFERS) {
171 if (r->info) {
172 NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
175 return NDR_ERR_SUCCESS;
178 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r)
180 uint32_t _ptr_info;
181 TALLOC_CTX *_mem_save_info_0;
182 if (ndr_flags & NDR_SCALARS) {
183 NDR_CHECK(ndr_pull_align(ndr, 4));
184 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
185 if (_ptr_info) {
186 NDR_PULL_ALLOC(ndr, r->info);
187 } else {
188 r->info = NULL;
191 if (ndr_flags & NDR_BUFFERS) {
192 if (r->info) {
193 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
194 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
195 NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
196 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
199 return NDR_ERR_SUCCESS;
202 _PUBLIC_ void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r)
204 ndr_print_struct(ndr, name, "PAC_LOGON_INFO_CTR");
205 ndr->depth++;
206 ndr_print_ptr(ndr, "info", r->info);
207 ndr->depth++;
208 if (r->info) {
209 ndr_print_PAC_LOGON_INFO(ndr, "info", r->info);
211 ndr->depth--;
212 ndr->depth--;
215 _PUBLIC_ enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r)
217 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
218 return NDR_ERR_SUCCESS;
221 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r)
223 uint32_t v;
224 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
225 *r = v;
226 return NDR_ERR_SUCCESS;
229 _PUBLIC_ void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r)
231 const char *val = NULL;
233 switch (r) {
234 case PAC_TYPE_LOGON_INFO: val = "PAC_TYPE_LOGON_INFO"; break;
235 case PAC_TYPE_SRV_CHECKSUM: val = "PAC_TYPE_SRV_CHECKSUM"; break;
236 case PAC_TYPE_KDC_CHECKSUM: val = "PAC_TYPE_KDC_CHECKSUM"; break;
237 case PAC_TYPE_LOGON_NAME: val = "PAC_TYPE_LOGON_NAME"; break;
238 case PAC_TYPE_CONSTRAINED_DELEGATION: val = "PAC_TYPE_CONSTRAINED_DELEGATION"; break;
239 case PAC_TYPE_UNKNOWN_12: val = "PAC_TYPE_UNKNOWN_12"; break;
241 ndr_print_enum(ndr, name, "ENUM", val, r);
244 static enum ndr_err_code ndr_push_DATA_BLOB_REM(struct ndr_push *ndr, int ndr_flags, const struct DATA_BLOB_REM *r)
246 if (ndr_flags & NDR_SCALARS) {
247 NDR_CHECK(ndr_push_align(ndr, 4));
249 uint32_t _flags_save_DATA_BLOB = ndr->flags;
250 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
251 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining));
252 ndr->flags = _flags_save_DATA_BLOB;
255 if (ndr_flags & NDR_BUFFERS) {
257 return NDR_ERR_SUCCESS;
260 static enum ndr_err_code ndr_pull_DATA_BLOB_REM(struct ndr_pull *ndr, int ndr_flags, struct DATA_BLOB_REM *r)
262 if (ndr_flags & NDR_SCALARS) {
263 NDR_CHECK(ndr_pull_align(ndr, 4));
265 uint32_t _flags_save_DATA_BLOB = ndr->flags;
266 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
267 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining));
268 ndr->flags = _flags_save_DATA_BLOB;
271 if (ndr_flags & NDR_BUFFERS) {
273 return NDR_ERR_SUCCESS;
276 _PUBLIC_ void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r)
278 ndr_print_struct(ndr, name, "DATA_BLOB_REM");
279 ndr->depth++;
280 ndr_print_DATA_BLOB(ndr, "remaining", r->remaining);
281 ndr->depth--;
284 _PUBLIC_ enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r)
286 if (ndr_flags & NDR_SCALARS) {
287 int level = ndr_push_get_switch_value(ndr, r);
288 switch (level) {
289 case PAC_TYPE_LOGON_INFO: {
291 struct ndr_push *_ndr_logon_info;
292 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_logon_info, 0xFFFFFC01, -1));
293 NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(_ndr_logon_info, NDR_SCALARS|NDR_BUFFERS, &r->logon_info));
294 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_logon_info, 0xFFFFFC01, -1));
296 break; }
298 case PAC_TYPE_SRV_CHECKSUM: {
299 NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum));
300 break; }
302 case PAC_TYPE_KDC_CHECKSUM: {
303 NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum));
304 break; }
306 case PAC_TYPE_LOGON_NAME: {
307 NDR_CHECK(ndr_push_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name));
308 break; }
310 default: {
312 struct ndr_push *_ndr_unknown;
313 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_unknown, 0, -1));
314 NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown));
315 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_unknown, 0, -1));
317 break; }
321 if (ndr_flags & NDR_BUFFERS) {
322 int level = ndr_push_get_switch_value(ndr, r);
323 switch (level) {
324 case PAC_TYPE_LOGON_INFO:
325 break;
327 case PAC_TYPE_SRV_CHECKSUM:
328 break;
330 case PAC_TYPE_KDC_CHECKSUM:
331 break;
333 case PAC_TYPE_LOGON_NAME:
334 break;
336 default:
337 break;
341 return NDR_ERR_SUCCESS;
344 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r)
346 int level;
347 level = ndr_pull_get_switch_value(ndr, r);
348 if (ndr_flags & NDR_SCALARS) {
349 switch (level) {
350 case PAC_TYPE_LOGON_INFO: {
352 struct ndr_pull *_ndr_logon_info;
353 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_logon_info, 0xFFFFFC01, -1));
354 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(_ndr_logon_info, NDR_SCALARS|NDR_BUFFERS, &r->logon_info));
355 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_logon_info, 0xFFFFFC01, -1));
357 break; }
359 case PAC_TYPE_SRV_CHECKSUM: {
360 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum));
361 break; }
363 case PAC_TYPE_KDC_CHECKSUM: {
364 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum));
365 break; }
367 case PAC_TYPE_LOGON_NAME: {
368 NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name));
369 break; }
371 default: {
373 struct ndr_pull *_ndr_unknown;
374 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_unknown, 0, -1));
375 NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown));
376 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_unknown, 0, -1));
378 break; }
382 if (ndr_flags & NDR_BUFFERS) {
383 switch (level) {
384 case PAC_TYPE_LOGON_INFO:
385 break;
387 case PAC_TYPE_SRV_CHECKSUM:
388 break;
390 case PAC_TYPE_KDC_CHECKSUM:
391 break;
393 case PAC_TYPE_LOGON_NAME:
394 break;
396 default:
397 break;
401 return NDR_ERR_SUCCESS;
404 _PUBLIC_ void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r)
406 int level;
407 level = ndr_print_get_switch_value(ndr, r);
408 ndr_print_union(ndr, name, level, "PAC_INFO");
409 switch (level) {
410 case PAC_TYPE_LOGON_INFO:
411 ndr_print_PAC_LOGON_INFO_CTR(ndr, "logon_info", &r->logon_info);
412 break;
414 case PAC_TYPE_SRV_CHECKSUM:
415 ndr_print_PAC_SIGNATURE_DATA(ndr, "srv_cksum", &r->srv_cksum);
416 break;
418 case PAC_TYPE_KDC_CHECKSUM:
419 ndr_print_PAC_SIGNATURE_DATA(ndr, "kdc_cksum", &r->kdc_cksum);
420 break;
422 case PAC_TYPE_LOGON_NAME:
423 ndr_print_PAC_LOGON_NAME(ndr, "logon_name", &r->logon_name);
424 break;
426 default:
427 ndr_print_DATA_BLOB_REM(ndr, "unknown", &r->unknown);
428 break;
433 _PUBLIC_ size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
435 return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_PAC_INFO, ic);
438 _PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r)
440 uint32_t cntr_buffers_0;
441 if (ndr_flags & NDR_SCALARS) {
442 NDR_CHECK(ndr_push_align(ndr, 4));
443 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers));
444 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
445 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
446 NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
449 if (ndr_flags & NDR_BUFFERS) {
450 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
451 NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
454 return NDR_ERR_SUCCESS;
457 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r)
459 uint32_t cntr_buffers_0;
460 TALLOC_CTX *_mem_save_buffers_0;
461 if (ndr_flags & NDR_SCALARS) {
462 NDR_CHECK(ndr_pull_align(ndr, 4));
463 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers));
464 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
465 NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers);
466 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
467 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
468 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
469 NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
471 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
473 if (ndr_flags & NDR_BUFFERS) {
474 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
475 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
476 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
477 NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
479 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
481 return NDR_ERR_SUCCESS;
484 _PUBLIC_ void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r)
486 uint32_t cntr_buffers_0;
487 ndr_print_struct(ndr, name, "PAC_DATA");
488 ndr->depth++;
489 ndr_print_uint32(ndr, "num_buffers", r->num_buffers);
490 ndr_print_uint32(ndr, "version", r->version);
491 ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers);
492 ndr->depth++;
493 for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) {
494 char *idx_0=NULL;
495 if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) {
496 ndr_print_PAC_BUFFER(ndr, "buffers", &r->buffers[cntr_buffers_0]);
497 free(idx_0);
500 ndr->depth--;
501 ndr->depth--;
504 _PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r)
506 if (ndr_flags & NDR_SCALARS) {
507 NDR_CHECK(ndr_push_align(ndr, 4));
508 NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type));
509 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size));
511 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
512 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
513 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info));
514 ndr->flags = _flags_save_DATA_BLOB_REM;
516 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
518 if (ndr_flags & NDR_BUFFERS) {
520 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
521 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
522 if (r->info) {
523 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info));
525 struct ndr_push *_ndr_info;
526 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
527 NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info));
528 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
531 ndr->flags = _flags_save_DATA_BLOB_REM;
534 return NDR_ERR_SUCCESS;
537 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r)
539 uint32_t _ptr_info;
540 TALLOC_CTX *_mem_save_info_0;
541 if (ndr_flags & NDR_SCALARS) {
542 NDR_CHECK(ndr_pull_align(ndr, 4));
543 NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type));
544 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ndr_size));
546 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
547 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
548 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
549 if (_ptr_info) {
550 NDR_PULL_ALLOC(ndr, r->info);
551 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info));
552 } else {
553 r->info = NULL;
555 ndr->flags = _flags_save_DATA_BLOB_REM;
557 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
559 if (ndr_flags & NDR_BUFFERS) {
561 uint32_t _flags_save_DATA_BLOB_REM = ndr->flags;
562 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
563 if (r->info) {
564 uint32_t _relative_save_offset;
565 _relative_save_offset = ndr->offset;
566 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info));
567 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
568 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
570 struct ndr_pull *_ndr_info;
571 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
572 NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info));
573 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8)));
575 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
576 ndr->offset = _relative_save_offset;
578 ndr->flags = _flags_save_DATA_BLOB_REM;
581 return NDR_ERR_SUCCESS;
584 _PUBLIC_ void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r)
586 ndr_print_struct(ndr, name, "PAC_BUFFER_RAW");
587 ndr->depth++;
588 ndr_print_PAC_TYPE(ndr, "type", r->type);
589 ndr_print_uint32(ndr, "ndr_size", r->ndr_size);
590 ndr_print_ptr(ndr, "info", r->info);
591 ndr->depth++;
592 if (r->info) {
593 ndr_print_DATA_BLOB_REM(ndr, "info", r->info);
595 ndr->depth--;
596 ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
597 ndr->depth--;
600 _PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r)
602 uint32_t cntr_buffers_0;
603 if (ndr_flags & NDR_SCALARS) {
604 NDR_CHECK(ndr_push_align(ndr, 4));
605 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers));
606 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
607 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
608 NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
611 if (ndr_flags & NDR_BUFFERS) {
612 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
613 NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
616 return NDR_ERR_SUCCESS;
619 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r)
621 uint32_t cntr_buffers_0;
622 TALLOC_CTX *_mem_save_buffers_0;
623 if (ndr_flags & NDR_SCALARS) {
624 NDR_CHECK(ndr_pull_align(ndr, 4));
625 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers));
626 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
627 NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers);
628 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
629 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
630 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
631 NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0]));
633 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
635 if (ndr_flags & NDR_BUFFERS) {
636 _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr);
637 NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0);
638 for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) {
639 NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0]));
641 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0);
643 return NDR_ERR_SUCCESS;
646 _PUBLIC_ void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r)
648 uint32_t cntr_buffers_0;
649 ndr_print_struct(ndr, name, "PAC_DATA_RAW");
650 ndr->depth++;
651 ndr_print_uint32(ndr, "num_buffers", r->num_buffers);
652 ndr_print_uint32(ndr, "version", r->version);
653 ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers);
654 ndr->depth++;
655 for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) {
656 char *idx_0=NULL;
657 if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) {
658 ndr_print_PAC_BUFFER_RAW(ndr, "buffers", &r->buffers[cntr_buffers_0]);
659 free(idx_0);
662 ndr->depth--;
663 ndr->depth--;
666 _PUBLIC_ enum ndr_err_code ndr_push_PAC_Validate(struct ndr_push *ndr, int ndr_flags, const struct PAC_Validate *r)
668 if (ndr_flags & NDR_SCALARS) {
669 NDR_CHECK(ndr_push_align(ndr, 4));
670 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NETLOGON_GENERIC_KRB5_PAC_VALIDATE));
671 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ChecksumLength));
672 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->SignatureType));
673 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SignatureLength));
675 uint32_t _flags_save_DATA_BLOB = ndr->flags;
676 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
677 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->ChecksumAndSignature));
678 ndr->flags = _flags_save_DATA_BLOB;
681 if (ndr_flags & NDR_BUFFERS) {
683 return NDR_ERR_SUCCESS;
686 _PUBLIC_ enum ndr_err_code ndr_pull_PAC_Validate(struct ndr_pull *ndr, int ndr_flags, struct PAC_Validate *r)
688 if (ndr_flags & NDR_SCALARS) {
689 NDR_CHECK(ndr_pull_align(ndr, 4));
690 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MessageType));
691 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ChecksumLength));
692 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->SignatureType));
693 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SignatureLength));
695 uint32_t _flags_save_DATA_BLOB = ndr->flags;
696 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
697 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->ChecksumAndSignature));
698 ndr->flags = _flags_save_DATA_BLOB;
701 if (ndr_flags & NDR_BUFFERS) {
703 return NDR_ERR_SUCCESS;
706 _PUBLIC_ void ndr_print_PAC_Validate(struct ndr_print *ndr, const char *name, const struct PAC_Validate *r)
708 ndr_print_struct(ndr, name, "PAC_Validate");
709 ndr->depth++;
710 ndr_print_uint32(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NETLOGON_GENERIC_KRB5_PAC_VALIDATE:r->MessageType);
711 ndr_print_uint32(ndr, "ChecksumLength", r->ChecksumLength);
712 ndr_print_int32(ndr, "SignatureType", r->SignatureType);
713 ndr_print_uint32(ndr, "SignatureLength", r->SignatureLength);
714 ndr_print_DATA_BLOB(ndr, "ChecksumAndSignature", r->ChecksumAndSignature);
715 ndr->depth--;
718 _PUBLIC_ enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r)
720 if (ndr_flags & NDR_SCALARS) {
721 NDR_CHECK(ndr_push_align(ndr, 4));
722 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
723 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
725 if (ndr_flags & NDR_BUFFERS) {
726 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
728 return NDR_ERR_SUCCESS;
731 _PUBLIC_ enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r)
733 if (ndr_flags & NDR_SCALARS) {
734 NDR_CHECK(ndr_pull_align(ndr, 4));
735 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
736 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3));
738 if (ndr_flags & NDR_BUFFERS) {
739 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3));
741 return NDR_ERR_SUCCESS;
744 _PUBLIC_ void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r)
746 ndr_print_struct(ndr, name, "netsamlogoncache_entry");
747 ndr->depth++;
748 ndr_print_time_t(ndr, "timestamp", r->timestamp);
749 ndr_print_netr_SamInfo3(ndr, "info3", &r->info3);
750 ndr->depth--;
753 static enum ndr_err_code ndr_push_decode_pac(struct ndr_push *ndr, int flags, const struct decode_pac *r)
755 if (flags & NDR_IN) {
756 NDR_CHECK(ndr_push_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
758 if (flags & NDR_OUT) {
760 return NDR_ERR_SUCCESS;
763 static enum ndr_err_code ndr_pull_decode_pac(struct ndr_pull *ndr, int flags, struct decode_pac *r)
765 if (flags & NDR_IN) {
766 NDR_CHECK(ndr_pull_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
768 if (flags & NDR_OUT) {
770 return NDR_ERR_SUCCESS;
773 _PUBLIC_ void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r)
775 ndr_print_struct(ndr, name, "decode_pac");
776 ndr->depth++;
777 if (flags & NDR_SET_VALUES) {
778 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
780 if (flags & NDR_IN) {
781 ndr_print_struct(ndr, "in", "decode_pac");
782 ndr->depth++;
783 ndr_print_PAC_DATA(ndr, "pac", &r->in.pac);
784 ndr->depth--;
786 if (flags & NDR_OUT) {
787 ndr_print_struct(ndr, "out", "decode_pac");
788 ndr->depth++;
789 ndr->depth--;
791 ndr->depth--;
794 static enum ndr_err_code ndr_push_decode_pac_raw(struct ndr_push *ndr, int flags, const struct decode_pac_raw *r)
796 if (flags & NDR_IN) {
797 NDR_CHECK(ndr_push_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
799 if (flags & NDR_OUT) {
801 return NDR_ERR_SUCCESS;
804 static enum ndr_err_code ndr_pull_decode_pac_raw(struct ndr_pull *ndr, int flags, struct decode_pac_raw *r)
806 if (flags & NDR_IN) {
807 NDR_CHECK(ndr_pull_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac));
809 if (flags & NDR_OUT) {
811 return NDR_ERR_SUCCESS;
814 _PUBLIC_ void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r)
816 ndr_print_struct(ndr, name, "decode_pac_raw");
817 ndr->depth++;
818 if (flags & NDR_SET_VALUES) {
819 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
821 if (flags & NDR_IN) {
822 ndr_print_struct(ndr, "in", "decode_pac_raw");
823 ndr->depth++;
824 ndr_print_PAC_DATA_RAW(ndr, "pac", &r->in.pac);
825 ndr->depth--;
827 if (flags & NDR_OUT) {
828 ndr_print_struct(ndr, "out", "decode_pac_raw");
829 ndr->depth++;
830 ndr->depth--;
832 ndr->depth--;
835 static enum ndr_err_code ndr_push_decode_login_info(struct ndr_push *ndr, int flags, const struct decode_login_info *r)
837 if (flags & NDR_IN) {
838 NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info));
840 if (flags & NDR_OUT) {
842 return NDR_ERR_SUCCESS;
845 static enum ndr_err_code ndr_pull_decode_login_info(struct ndr_pull *ndr, int flags, struct decode_login_info *r)
847 if (flags & NDR_IN) {
848 NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info));
850 if (flags & NDR_OUT) {
852 return NDR_ERR_SUCCESS;
855 _PUBLIC_ void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r)
857 ndr_print_struct(ndr, name, "decode_login_info");
858 ndr->depth++;
859 if (flags & NDR_SET_VALUES) {
860 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
862 if (flags & NDR_IN) {
863 ndr_print_struct(ndr, "in", "decode_login_info");
864 ndr->depth++;
865 ndr_print_PAC_LOGON_INFO(ndr, "logon_info", &r->in.logon_info);
866 ndr->depth--;
868 if (flags & NDR_OUT) {
869 ndr_print_struct(ndr, "out", "decode_login_info");
870 ndr->depth++;
871 ndr->depth--;
873 ndr->depth--;
876 static enum ndr_err_code ndr_push_decode_pac_validate(struct ndr_push *ndr, int flags, const struct decode_pac_validate *r)
878 if (flags & NDR_IN) {
879 NDR_CHECK(ndr_push_PAC_Validate(ndr, NDR_SCALARS, &r->in.pac_validate));
881 if (flags & NDR_OUT) {
883 return NDR_ERR_SUCCESS;
886 static enum ndr_err_code ndr_pull_decode_pac_validate(struct ndr_pull *ndr, int flags, struct decode_pac_validate *r)
888 if (flags & NDR_IN) {
889 NDR_CHECK(ndr_pull_PAC_Validate(ndr, NDR_SCALARS, &r->in.pac_validate));
891 if (flags & NDR_OUT) {
893 return NDR_ERR_SUCCESS;
896 _PUBLIC_ void ndr_print_decode_pac_validate(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_validate *r)
898 ndr_print_struct(ndr, name, "decode_pac_validate");
899 ndr->depth++;
900 if (flags & NDR_SET_VALUES) {
901 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
903 if (flags & NDR_IN) {
904 ndr_print_struct(ndr, "in", "decode_pac_validate");
905 ndr->depth++;
906 ndr_print_PAC_Validate(ndr, "pac_validate", &r->in.pac_validate);
907 ndr->depth--;
909 if (flags & NDR_OUT) {
910 ndr_print_struct(ndr, "out", "decode_pac_validate");
911 ndr->depth++;
912 ndr->depth--;
914 ndr->depth--;
917 static const struct ndr_interface_call krb5pac_calls[] = {
919 "decode_pac",
920 sizeof(struct decode_pac),
921 (ndr_push_flags_fn_t) ndr_push_decode_pac,
922 (ndr_pull_flags_fn_t) ndr_pull_decode_pac,
923 (ndr_print_function_t) ndr_print_decode_pac,
924 false,
927 "decode_pac_raw",
928 sizeof(struct decode_pac_raw),
929 (ndr_push_flags_fn_t) ndr_push_decode_pac_raw,
930 (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw,
931 (ndr_print_function_t) ndr_print_decode_pac_raw,
932 false,
935 "decode_login_info",
936 sizeof(struct decode_login_info),
937 (ndr_push_flags_fn_t) ndr_push_decode_login_info,
938 (ndr_pull_flags_fn_t) ndr_pull_decode_login_info,
939 (ndr_print_function_t) ndr_print_decode_login_info,
940 false,
943 "decode_pac_validate",
944 sizeof(struct decode_pac_validate),
945 (ndr_push_flags_fn_t) ndr_push_decode_pac_validate,
946 (ndr_pull_flags_fn_t) ndr_pull_decode_pac_validate,
947 (ndr_print_function_t) ndr_print_decode_pac_validate,
948 false,
950 { NULL, 0, NULL, NULL, NULL, false }
953 static const char * const krb5pac_endpoint_strings[] = {
954 "ncacn_np:[\\pipe\\krb5pac]",
957 static const struct ndr_interface_string_array krb5pac_endpoints = {
958 .count = 1,
959 .names = krb5pac_endpoint_strings
962 static const char * const krb5pac_authservice_strings[] = {
963 "host",
966 static const struct ndr_interface_string_array krb5pac_authservices = {
967 .count = 1,
968 .names = krb5pac_authservice_strings
972 const struct ndr_interface_table ndr_table_krb5pac = {
973 .name = "krb5pac",
974 .syntax_id = {
975 {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}},
976 NDR_KRB5PAC_VERSION
978 .helpstring = NDR_KRB5PAC_HELPSTRING,
979 .num_calls = 4,
980 .calls = krb5pac_calls,
981 .endpoints = &krb5pac_endpoints,
982 .authservices = &krb5pac_authservices