1 /* parser auto-generated by pidl */
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");
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
);
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
);
96 ndr_print_uint32(ndr
, "type", r
->type
);
97 ndr_print_DATA_BLOB(ndr
, "signature", r
->signature
);
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
);
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");
153 ndr_print_netr_SamInfo3(ndr
, "info3", &r
->info3
);
154 ndr_print_ptr(ndr
, "res_group_dom_sid", r
->res_group_dom_sid
);
156 if (r
->res_group_dom_sid
) {
157 ndr_print_dom_sid2(ndr
, "res_group_dom_sid", r
->res_group_dom_sid
);
160 ndr_print_samr_RidWithAttributeArray(ndr
, "res_groups", &r
->res_groups
);
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
) {
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
)
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
));
199 NDR_PULL_ALLOC(ndr
, r
->info
);
204 if (ndr_flags
& NDR_BUFFERS
) {
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");
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
);
226 ndr_print_PAC_LOGON_INFO(ndr
, "info", r
->info
);
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
)
241 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &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
;
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");
297 ndr_print_DATA_BLOB(ndr
, "remaining", r
->remaining
);
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
);
306 case PAC_TYPE_LOGON_INFO
: {
307 NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr
, NDR_SCALARS
, &r
->logon_info
));
310 case PAC_TYPE_SRV_CHECKSUM
: {
311 NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr
, NDR_SCALARS
, &r
->srv_cksum
));
314 case PAC_TYPE_KDC_CHECKSUM
: {
315 NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr
, NDR_SCALARS
, &r
->kdc_cksum
));
318 case PAC_TYPE_LOGON_NAME
: {
319 NDR_CHECK(ndr_push_PAC_LOGON_NAME(ndr
, NDR_SCALARS
, &r
->logon_name
));
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));
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
);
338 case PAC_TYPE_LOGON_INFO
:
339 NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr
, NDR_BUFFERS
, &r
->logon_info
));
342 case PAC_TYPE_SRV_CHECKSUM
:
345 case PAC_TYPE_KDC_CHECKSUM
:
348 case PAC_TYPE_LOGON_NAME
:
351 case PAC_TYPE_UNKNOWN_12
:
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
)
364 level
= ndr_pull_get_switch_value(ndr
, r
);
365 if (ndr_flags
& NDR_SCALARS
) {
367 case PAC_TYPE_LOGON_INFO
: {
368 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr
, NDR_SCALARS
, &r
->logon_info
));
371 case PAC_TYPE_SRV_CHECKSUM
: {
372 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr
, NDR_SCALARS
, &r
->srv_cksum
));
375 case PAC_TYPE_KDC_CHECKSUM
: {
376 NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr
, NDR_SCALARS
, &r
->kdc_cksum
));
379 case PAC_TYPE_LOGON_NAME
: {
380 NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr
, NDR_SCALARS
, &r
->logon_name
));
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));
393 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
396 if (ndr_flags
& NDR_BUFFERS
) {
398 case PAC_TYPE_LOGON_INFO
:
399 NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr
, NDR_BUFFERS
, &r
->logon_info
));
402 case PAC_TYPE_SRV_CHECKSUM
:
405 case PAC_TYPE_KDC_CHECKSUM
:
408 case PAC_TYPE_LOGON_NAME
:
411 case PAC_TYPE_UNKNOWN_12
:
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
)
424 level
= ndr_print_get_switch_value(ndr
, r
);
425 ndr_print_union(ndr
, name
, level
, "PAC_INFO");
427 case PAC_TYPE_LOGON_INFO
:
428 ndr_print_PAC_LOGON_INFO_CTR(ndr
, "logon_info", &r
->logon_info
);
431 case PAC_TYPE_SRV_CHECKSUM
:
432 ndr_print_PAC_SIGNATURE_DATA(ndr
, "srv_cksum", &r
->srv_cksum
);
435 case PAC_TYPE_KDC_CHECKSUM
:
436 ndr_print_PAC_SIGNATURE_DATA(ndr
, "kdc_cksum", &r
->kdc_cksum
);
439 case PAC_TYPE_LOGON_NAME
:
440 ndr_print_PAC_LOGON_NAME(ndr
, "logon_name", &r
->logon_name
);
443 case PAC_TYPE_UNKNOWN_12
:
444 ndr_print_DATA_BLOB_REM(ndr
, "unknown", &r
->unknown
);
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");
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
);
512 for (cntr_buffers_0
=0;cntr_buffers_0
<r
->num_buffers
;cntr_buffers_0
++) {
514 if (asprintf(&idx_0
, "[%d]", cntr_buffers_0
) != -1) {
515 ndr_print_PAC_BUFFER(ndr
, "buffers", &r
->buffers
[cntr_buffers_0
]);
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
);
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
)
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
));
569 NDR_PULL_ALLOC(ndr
, r
->info
);
570 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->info
, _ptr_info
));
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
);
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");
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
);
612 ndr_print_DATA_BLOB_REM(ndr
, "info", r
->info
);
615 ndr_print_uint32(ndr
, "_pad", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?0:r
->_pad
);
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");
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
);
674 for (cntr_buffers_0
=0;cntr_buffers_0
<r
->num_buffers
;cntr_buffers_0
++) {
676 if (asprintf(&idx_0
, "[%d]", cntr_buffers_0
) != -1) {
677 ndr_print_PAC_BUFFER_RAW(ndr
, "buffers", &r
->buffers
[cntr_buffers_0
]);
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");
715 ndr_print_time_t(ndr
, "timestamp", r
->timestamp
);
716 ndr_print_netr_SamInfo3(ndr
, "info3", &r
->info3
);
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");
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");
750 ndr_print_PAC_DATA(ndr
, "pac", &r
->in
.pac
);
753 if (flags
& NDR_OUT
) {
754 ndr_print_struct(ndr
, "out", "decode_pac");
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");
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");
791 ndr_print_PAC_DATA_RAW(ndr
, "pac", &r
->in
.pac
);
794 if (flags
& NDR_OUT
) {
795 ndr_print_struct(ndr
, "out", "decode_pac_raw");
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");
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");
832 ndr_print_PAC_LOGON_INFO(ndr
, "logon_info", &r
->in
.logon_info
);
835 if (flags
& NDR_OUT
) {
836 ndr_print_struct(ndr
, "out", "decode_login_info");
843 static const struct ndr_interface_call krb5pac_calls
[] = {
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
,
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
,
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
,
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
= {
877 .names
= krb5pac_endpoint_strings
880 static const char * const krb5pac_authservice_strings
[] = {
884 static const struct ndr_interface_string_array krb5pac_authservices
= {
886 .names
= krb5pac_authservice_strings
890 const struct ndr_interface_table ndr_table_krb5pac
= {
893 {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}},
896 .helpstring
= NDR_KRB5PAC_HELPSTRING
,
898 .calls
= krb5pac_calls
,
899 .endpoints
= &krb5pac_endpoints
,
900 .authservices
= &krb5pac_authservices