Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include <Python.h>
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_krb5ccache.h"
12 :
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 432 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 432 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 297 : case 4:
38 297 : return UINT32_MAX;
39 54 : case 2:
40 54 : return UINT16_MAX;
41 81 : case 1:
42 81 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 54 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 54 : switch (var_size) {
51 0 : case 8:
52 0 : return INT64_MAX;
53 54 : case 4:
54 54 : return INT32_MAX;
55 0 : case 2:
56 0 : return INT16_MAX;
57 0 : case 1:
58 0 : return INT8_MAX;
59 : }
60 :
61 0 : return 0;
62 : }
63 :
64 : static PyTypeObject PRINCIPAL_Type;
65 : static PyTypeObject KEYBLOCK_Type;
66 : static PyTypeObject ADDRESS_Type;
67 : static PyTypeObject ADDRESSES_Type;
68 : static PyTypeObject AUTHDATUM_Type;
69 : static PyTypeObject AUTHDATA_Type;
70 : static PyTypeObject CREDENTIAL_Type;
71 : static PyTypeObject DELTATIME_TAG_Type;
72 : static PyTypeObject FIELD_Type;
73 : static PyTypeObject V4TAG_Type;
74 : static PyTypeObject V4TAGS_Type;
75 : static PyTypeObject V4HEADER_Type;
76 : static PyTypeObject OPTIONAL_HEADER_Type;
77 : static PyTypeObject CCACHE_Type;
78 : static PyTypeObject MULTIPLE_CREDENTIALS_Type;
79 : static PyTypeObject krb5ccache_InterfaceType;
80 :
81 : static PyTypeObject *BaseObject_Type;
82 : static PyTypeObject *ClientConnection_Type;
83 : static PyTypeObject *ndr_syntax_id_Type;
84 :
85 0 : static PyObject *py_PRINCIPAL_get_name_type(PyObject *obj, void *closure)
86 : {
87 0 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(obj);
88 : PyObject *py_name_type;
89 0 : py_name_type = PyLong_FromUnsignedLongLong((uint32_t)object->name_type);
90 0 : return py_name_type;
91 : }
92 :
93 54 : static int py_PRINCIPAL_set_name_type(PyObject *py_obj, PyObject *value, void *closure)
94 : {
95 54 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(py_obj);
96 54 : if (value == NULL) {
97 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name_type");
98 0 : return -1;
99 : }
100 : {
101 54 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_type));
102 54 : if (PyLong_Check(value)) {
103 : unsigned long long test_var;
104 54 : test_var = PyLong_AsUnsignedLongLong(value);
105 54 : if (PyErr_Occurred() != NULL) {
106 0 : return -1;
107 : }
108 54 : if (test_var > uint_max) {
109 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
110 : PyLong_Type.tp_name, uint_max, test_var);
111 0 : return -1;
112 : }
113 54 : object->name_type = test_var;
114 : } else {
115 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
116 : PyLong_Type.tp_name);
117 0 : return -1;
118 : }
119 : }
120 54 : return 0;
121 : }
122 :
123 0 : static PyObject *py_PRINCIPAL_get_component_count(PyObject *obj, void *closure)
124 : {
125 0 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(obj);
126 : PyObject *py_component_count;
127 0 : py_component_count = PyLong_FromUnsignedLongLong((uint32_t)object->component_count);
128 0 : return py_component_count;
129 : }
130 :
131 54 : static int py_PRINCIPAL_set_component_count(PyObject *py_obj, PyObject *value, void *closure)
132 : {
133 54 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(py_obj);
134 54 : if (value == NULL) {
135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->component_count");
136 0 : return -1;
137 : }
138 : {
139 54 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->component_count));
140 54 : if (PyLong_Check(value)) {
141 : unsigned long long test_var;
142 54 : test_var = PyLong_AsUnsignedLongLong(value);
143 54 : if (PyErr_Occurred() != NULL) {
144 0 : return -1;
145 : }
146 54 : if (test_var > uint_max) {
147 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
148 : PyLong_Type.tp_name, uint_max, test_var);
149 0 : return -1;
150 : }
151 54 : object->component_count = test_var;
152 : } else {
153 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
154 : PyLong_Type.tp_name);
155 0 : return -1;
156 : }
157 : }
158 54 : return 0;
159 : }
160 :
161 0 : static PyObject *py_PRINCIPAL_get_realm(PyObject *obj, void *closure)
162 : {
163 0 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(obj);
164 : PyObject *py_realm;
165 0 : py_realm = PyString_FromStringOrNULL(object->realm);
166 0 : return py_realm;
167 : }
168 :
169 54 : static int py_PRINCIPAL_set_realm(PyObject *py_obj, PyObject *value, void *closure)
170 : {
171 54 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(py_obj);
172 54 : if (value == NULL) {
173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->realm");
174 0 : return -1;
175 : }
176 : {
177 : const char *test_str;
178 : const char *talloc_str;
179 54 : PyObject *unicode = NULL;
180 54 : if (PyUnicode_Check(value)) {
181 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
182 0 : if (unicode == NULL) {
183 0 : PyErr_NoMemory();
184 0 : return -1;
185 : }
186 0 : test_str = PyBytes_AS_STRING(unicode);
187 54 : } else if (PyBytes_Check(value)) {
188 54 : test_str = PyBytes_AS_STRING(value);
189 : } else {
190 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
191 0 : return -1;
192 : }
193 54 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
194 54 : if (unicode != NULL) {
195 0 : Py_DECREF(unicode);
196 : }
197 54 : if (talloc_str == NULL) {
198 0 : PyErr_NoMemory();
199 0 : return -1;
200 : }
201 54 : object->realm = talloc_str;
202 : }
203 54 : return 0;
204 : }
205 :
206 0 : static PyObject *py_PRINCIPAL_get_components(PyObject *obj, void *closure)
207 : {
208 0 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(obj);
209 : PyObject *py_components;
210 0 : py_components = PyList_New(object->component_count);
211 0 : if (py_components == NULL) {
212 0 : return NULL;
213 : }
214 : {
215 : int components_cntr_0;
216 0 : for (components_cntr_0 = 0; components_cntr_0 < (object->component_count); components_cntr_0++) {
217 : PyObject *py_components_0;
218 0 : py_components_0 = PyString_FromStringOrNULL(object->components[components_cntr_0]);
219 0 : PyList_SetItem(py_components, components_cntr_0, py_components_0);
220 : }
221 : }
222 0 : return py_components;
223 : }
224 :
225 54 : static int py_PRINCIPAL_set_components(PyObject *py_obj, PyObject *value, void *closure)
226 : {
227 54 : struct PRINCIPAL *object = (struct PRINCIPAL *)pytalloc_get_ptr(py_obj);
228 54 : if (value == NULL) {
229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->components");
230 0 : return -1;
231 : }
232 54 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
233 : {
234 : int components_cntr_0;
235 54 : object->components = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->components, PyList_GET_SIZE(value));
236 54 : if (!object->components) { return -1;; }
237 54 : talloc_set_name_const(object->components, "ARRAY: object->components");
238 135 : for (components_cntr_0 = 0; components_cntr_0 < PyList_GET_SIZE(value); components_cntr_0++) {
239 81 : if (PyList_GET_ITEM(value, components_cntr_0) == NULL) {
240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->components[components_cntr_0]");
241 0 : return -1;
242 : }
243 : {
244 : const char *test_str;
245 : const char *talloc_str;
246 81 : PyObject *unicode = NULL;
247 81 : if (PyUnicode_Check(PyList_GET_ITEM(value, components_cntr_0))) {
248 27 : unicode = PyUnicode_AsEncodedString(PyList_GET_ITEM(value, components_cntr_0), "utf-8", "ignore");
249 27 : if (unicode == NULL) {
250 0 : PyErr_NoMemory();
251 0 : return -1;
252 : }
253 27 : test_str = PyBytes_AS_STRING(unicode);
254 54 : } else if (PyBytes_Check(PyList_GET_ITEM(value, components_cntr_0))) {
255 54 : test_str = PyBytes_AS_STRING(PyList_GET_ITEM(value, components_cntr_0));
256 : } else {
257 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(PyList_GET_ITEM(value, components_cntr_0))->tp_name);
258 0 : return -1;
259 : }
260 81 : talloc_str = talloc_strdup(object->components, test_str);
261 81 : if (unicode != NULL) {
262 27 : Py_DECREF(unicode);
263 : }
264 81 : if (talloc_str == NULL) {
265 0 : PyErr_NoMemory();
266 0 : return -1;
267 : }
268 81 : object->components[components_cntr_0] = talloc_str;
269 : }
270 : }
271 : }
272 54 : return 0;
273 : }
274 :
275 : static PyGetSetDef py_PRINCIPAL_getsetters[] = {
276 : {
277 : .name = discard_const_p(char, "name_type"),
278 : .get = py_PRINCIPAL_get_name_type,
279 : .set = py_PRINCIPAL_set_name_type,
280 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
281 : },
282 : {
283 : .name = discard_const_p(char, "component_count"),
284 : .get = py_PRINCIPAL_get_component_count,
285 : .set = py_PRINCIPAL_set_component_count,
286 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
287 : },
288 : {
289 : .name = discard_const_p(char, "realm"),
290 : .get = py_PRINCIPAL_get_realm,
291 : .set = py_PRINCIPAL_set_realm,
292 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
293 : },
294 : {
295 : .name = discard_const_p(char, "components"),
296 : .get = py_PRINCIPAL_get_components,
297 : .set = py_PRINCIPAL_set_components,
298 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
299 : },
300 : { .name = NULL }
301 : };
302 :
303 54 : static PyObject *py_PRINCIPAL_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
304 : {
305 54 : return pytalloc_new(struct PRINCIPAL, type);
306 : }
307 :
308 :
309 : static PyTypeObject PRINCIPAL_Type = {
310 : PyVarObject_HEAD_INIT(NULL, 0)
311 : .tp_name = "krb5ccache.PRINCIPAL",
312 : .tp_getset = py_PRINCIPAL_getsetters,
313 : .tp_methods = NULL,
314 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
315 : .tp_new = py_PRINCIPAL_new,
316 : };
317 :
318 :
319 0 : static PyObject *py_KEYBLOCK_get_enctype(PyObject *obj, void *closure)
320 : {
321 0 : struct KEYBLOCK *object = (struct KEYBLOCK *)pytalloc_get_ptr(obj);
322 : PyObject *py_enctype;
323 0 : py_enctype = PyLong_FromLong((uint16_t)object->enctype);
324 0 : return py_enctype;
325 : }
326 :
327 27 : static int py_KEYBLOCK_set_enctype(PyObject *py_obj, PyObject *value, void *closure)
328 : {
329 27 : struct KEYBLOCK *object = (struct KEYBLOCK *)pytalloc_get_ptr(py_obj);
330 27 : if (value == NULL) {
331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->enctype");
332 0 : return -1;
333 : }
334 : {
335 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enctype));
336 27 : if (PyLong_Check(value)) {
337 : unsigned long long test_var;
338 27 : test_var = PyLong_AsUnsignedLongLong(value);
339 27 : if (PyErr_Occurred() != NULL) {
340 0 : return -1;
341 : }
342 27 : if (test_var > uint_max) {
343 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
344 : PyLong_Type.tp_name, uint_max, test_var);
345 0 : return -1;
346 : }
347 27 : object->enctype = test_var;
348 : } else {
349 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
350 : PyLong_Type.tp_name);
351 0 : return -1;
352 : }
353 : }
354 27 : return 0;
355 : }
356 :
357 0 : static PyObject *py_KEYBLOCK_get_data(PyObject *obj, void *closure)
358 : {
359 0 : struct KEYBLOCK *object = (struct KEYBLOCK *)pytalloc_get_ptr(obj);
360 : PyObject *py_data;
361 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
362 0 : return py_data;
363 : }
364 :
365 27 : static int py_KEYBLOCK_set_data(PyObject *py_obj, PyObject *value, void *closure)
366 : {
367 27 : struct KEYBLOCK *object = (struct KEYBLOCK *)pytalloc_get_ptr(py_obj);
368 27 : if (value == NULL) {
369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
370 0 : return -1;
371 : }
372 27 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
373 27 : return 0;
374 : }
375 :
376 : static PyGetSetDef py_KEYBLOCK_getsetters[] = {
377 : {
378 : .name = discard_const_p(char, "enctype"),
379 : .get = py_KEYBLOCK_get_enctype,
380 : .set = py_KEYBLOCK_set_enctype,
381 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
382 : },
383 : {
384 : .name = discard_const_p(char, "data"),
385 : .get = py_KEYBLOCK_get_data,
386 : .set = py_KEYBLOCK_set_data,
387 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
388 : },
389 : { .name = NULL }
390 : };
391 :
392 27 : static PyObject *py_KEYBLOCK_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
393 : {
394 27 : return pytalloc_new(struct KEYBLOCK, type);
395 : }
396 :
397 :
398 : static PyTypeObject KEYBLOCK_Type = {
399 : PyVarObject_HEAD_INIT(NULL, 0)
400 : .tp_name = "krb5ccache.KEYBLOCK",
401 : .tp_getset = py_KEYBLOCK_getsetters,
402 : .tp_methods = NULL,
403 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
404 : .tp_new = py_KEYBLOCK_new,
405 : };
406 :
407 :
408 0 : static PyObject *py_ADDRESS_get_addrtype(PyObject *obj, void *closure)
409 : {
410 0 : struct ADDRESS *object = (struct ADDRESS *)pytalloc_get_ptr(obj);
411 : PyObject *py_addrtype;
412 0 : py_addrtype = PyLong_FromLong((uint16_t)object->addrtype);
413 0 : return py_addrtype;
414 : }
415 :
416 0 : static int py_ADDRESS_set_addrtype(PyObject *py_obj, PyObject *value, void *closure)
417 : {
418 0 : struct ADDRESS *object = (struct ADDRESS *)pytalloc_get_ptr(py_obj);
419 0 : if (value == NULL) {
420 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addrtype");
421 0 : return -1;
422 : }
423 : {
424 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addrtype));
425 0 : if (PyLong_Check(value)) {
426 : unsigned long long test_var;
427 0 : test_var = PyLong_AsUnsignedLongLong(value);
428 0 : if (PyErr_Occurred() != NULL) {
429 0 : return -1;
430 : }
431 0 : if (test_var > uint_max) {
432 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
433 : PyLong_Type.tp_name, uint_max, test_var);
434 0 : return -1;
435 : }
436 0 : object->addrtype = test_var;
437 : } else {
438 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
439 : PyLong_Type.tp_name);
440 0 : return -1;
441 : }
442 : }
443 0 : return 0;
444 : }
445 :
446 0 : static PyObject *py_ADDRESS_get_data(PyObject *obj, void *closure)
447 : {
448 0 : struct ADDRESS *object = (struct ADDRESS *)pytalloc_get_ptr(obj);
449 : PyObject *py_data;
450 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
451 0 : return py_data;
452 : }
453 :
454 0 : static int py_ADDRESS_set_data(PyObject *py_obj, PyObject *value, void *closure)
455 : {
456 0 : struct ADDRESS *object = (struct ADDRESS *)pytalloc_get_ptr(py_obj);
457 0 : if (value == NULL) {
458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
459 0 : return -1;
460 : }
461 0 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
462 0 : return 0;
463 : }
464 :
465 : static PyGetSetDef py_ADDRESS_getsetters[] = {
466 : {
467 : .name = discard_const_p(char, "addrtype"),
468 : .get = py_ADDRESS_get_addrtype,
469 : .set = py_ADDRESS_set_addrtype,
470 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
471 : },
472 : {
473 : .name = discard_const_p(char, "data"),
474 : .get = py_ADDRESS_get_data,
475 : .set = py_ADDRESS_set_data,
476 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
477 : },
478 : { .name = NULL }
479 : };
480 :
481 0 : static PyObject *py_ADDRESS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
482 : {
483 0 : return pytalloc_new(struct ADDRESS, type);
484 : }
485 :
486 :
487 : static PyTypeObject ADDRESS_Type = {
488 : PyVarObject_HEAD_INIT(NULL, 0)
489 : .tp_name = "krb5ccache.ADDRESS",
490 : .tp_getset = py_ADDRESS_getsetters,
491 : .tp_methods = NULL,
492 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
493 : .tp_new = py_ADDRESS_new,
494 : };
495 :
496 :
497 0 : static PyObject *py_ADDRESSES_get_count(PyObject *obj, void *closure)
498 : {
499 0 : struct ADDRESSES *object = (struct ADDRESSES *)pytalloc_get_ptr(obj);
500 : PyObject *py_count;
501 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
502 0 : return py_count;
503 : }
504 :
505 27 : static int py_ADDRESSES_set_count(PyObject *py_obj, PyObject *value, void *closure)
506 : {
507 27 : struct ADDRESSES *object = (struct ADDRESSES *)pytalloc_get_ptr(py_obj);
508 27 : if (value == NULL) {
509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
510 0 : return -1;
511 : }
512 : {
513 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
514 27 : if (PyLong_Check(value)) {
515 : unsigned long long test_var;
516 27 : test_var = PyLong_AsUnsignedLongLong(value);
517 27 : if (PyErr_Occurred() != NULL) {
518 0 : return -1;
519 : }
520 27 : if (test_var > uint_max) {
521 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
522 : PyLong_Type.tp_name, uint_max, test_var);
523 0 : return -1;
524 : }
525 27 : object->count = test_var;
526 : } else {
527 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
528 : PyLong_Type.tp_name);
529 0 : return -1;
530 : }
531 : }
532 27 : return 0;
533 : }
534 :
535 0 : static PyObject *py_ADDRESSES_get_data(PyObject *obj, void *closure)
536 : {
537 0 : struct ADDRESSES *object = (struct ADDRESSES *)pytalloc_get_ptr(obj);
538 : PyObject *py_data;
539 0 : py_data = PyList_New(object->count);
540 0 : if (py_data == NULL) {
541 0 : return NULL;
542 : }
543 : {
544 : int data_cntr_0;
545 0 : for (data_cntr_0 = 0; data_cntr_0 < (object->count); data_cntr_0++) {
546 : PyObject *py_data_0;
547 0 : py_data_0 = pytalloc_reference_ex(&ADDRESS_Type, object->data, &object->data[data_cntr_0]);
548 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
549 : }
550 : }
551 0 : return py_data;
552 : }
553 :
554 27 : static int py_ADDRESSES_set_data(PyObject *py_obj, PyObject *value, void *closure)
555 : {
556 27 : struct ADDRESSES *object = (struct ADDRESSES *)pytalloc_get_ptr(py_obj);
557 27 : if (value == NULL) {
558 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
559 0 : return -1;
560 : }
561 27 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
562 : {
563 : int data_cntr_0;
564 27 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
565 27 : if (!object->data) { return -1;; }
566 27 : talloc_set_name_const(object->data, "ARRAY: object->data");
567 27 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
568 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
570 0 : return -1;
571 : }
572 0 : PY_CHECK_TYPE(&ADDRESS_Type, PyList_GET_ITEM(value, data_cntr_0), return -1;);
573 0 : if (talloc_reference(object->data, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, data_cntr_0))) == NULL) {
574 0 : PyErr_NoMemory();
575 0 : return -1;
576 : }
577 0 : object->data[data_cntr_0] = *(struct ADDRESS *)pytalloc_get_ptr(PyList_GET_ITEM(value, data_cntr_0));
578 : }
579 : }
580 27 : return 0;
581 : }
582 :
583 : static PyGetSetDef py_ADDRESSES_getsetters[] = {
584 : {
585 : .name = discard_const_p(char, "count"),
586 : .get = py_ADDRESSES_get_count,
587 : .set = py_ADDRESSES_set_count,
588 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
589 : },
590 : {
591 : .name = discard_const_p(char, "data"),
592 : .get = py_ADDRESSES_get_data,
593 : .set = py_ADDRESSES_set_data,
594 : .doc = discard_const_p(char, "PIDL-generated element of base type ADDRESS")
595 : },
596 : { .name = NULL }
597 : };
598 :
599 27 : static PyObject *py_ADDRESSES_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
600 : {
601 27 : return pytalloc_new(struct ADDRESSES, type);
602 : }
603 :
604 :
605 : static PyTypeObject ADDRESSES_Type = {
606 : PyVarObject_HEAD_INIT(NULL, 0)
607 : .tp_name = "krb5ccache.ADDRESSES",
608 : .tp_getset = py_ADDRESSES_getsetters,
609 : .tp_methods = NULL,
610 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
611 : .tp_new = py_ADDRESSES_new,
612 : };
613 :
614 :
615 0 : static PyObject *py_AUTHDATUM_get_ad_type(PyObject *obj, void *closure)
616 : {
617 0 : struct AUTHDATUM *object = (struct AUTHDATUM *)pytalloc_get_ptr(obj);
618 : PyObject *py_ad_type;
619 0 : py_ad_type = PyLong_FromLong((uint16_t)object->ad_type);
620 0 : return py_ad_type;
621 : }
622 :
623 0 : static int py_AUTHDATUM_set_ad_type(PyObject *py_obj, PyObject *value, void *closure)
624 : {
625 0 : struct AUTHDATUM *object = (struct AUTHDATUM *)pytalloc_get_ptr(py_obj);
626 0 : if (value == NULL) {
627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ad_type");
628 0 : return -1;
629 : }
630 : {
631 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ad_type));
632 0 : if (PyLong_Check(value)) {
633 : unsigned long long test_var;
634 0 : test_var = PyLong_AsUnsignedLongLong(value);
635 0 : if (PyErr_Occurred() != NULL) {
636 0 : return -1;
637 : }
638 0 : if (test_var > uint_max) {
639 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
640 : PyLong_Type.tp_name, uint_max, test_var);
641 0 : return -1;
642 : }
643 0 : object->ad_type = test_var;
644 : } else {
645 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
646 : PyLong_Type.tp_name);
647 0 : return -1;
648 : }
649 : }
650 0 : return 0;
651 : }
652 :
653 0 : static PyObject *py_AUTHDATUM_get_data(PyObject *obj, void *closure)
654 : {
655 0 : struct AUTHDATUM *object = (struct AUTHDATUM *)pytalloc_get_ptr(obj);
656 : PyObject *py_data;
657 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
658 0 : return py_data;
659 : }
660 :
661 0 : static int py_AUTHDATUM_set_data(PyObject *py_obj, PyObject *value, void *closure)
662 : {
663 0 : struct AUTHDATUM *object = (struct AUTHDATUM *)pytalloc_get_ptr(py_obj);
664 0 : if (value == NULL) {
665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
666 0 : return -1;
667 : }
668 0 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
669 0 : return 0;
670 : }
671 :
672 : static PyGetSetDef py_AUTHDATUM_getsetters[] = {
673 : {
674 : .name = discard_const_p(char, "ad_type"),
675 : .get = py_AUTHDATUM_get_ad_type,
676 : .set = py_AUTHDATUM_set_ad_type,
677 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
678 : },
679 : {
680 : .name = discard_const_p(char, "data"),
681 : .get = py_AUTHDATUM_get_data,
682 : .set = py_AUTHDATUM_set_data,
683 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
684 : },
685 : { .name = NULL }
686 : };
687 :
688 0 : static PyObject *py_AUTHDATUM_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
689 : {
690 0 : return pytalloc_new(struct AUTHDATUM, type);
691 : }
692 :
693 :
694 : static PyTypeObject AUTHDATUM_Type = {
695 : PyVarObject_HEAD_INIT(NULL, 0)
696 : .tp_name = "krb5ccache.AUTHDATUM",
697 : .tp_getset = py_AUTHDATUM_getsetters,
698 : .tp_methods = NULL,
699 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
700 : .tp_new = py_AUTHDATUM_new,
701 : };
702 :
703 :
704 0 : static PyObject *py_AUTHDATA_get_count(PyObject *obj, void *closure)
705 : {
706 0 : struct AUTHDATA *object = (struct AUTHDATA *)pytalloc_get_ptr(obj);
707 : PyObject *py_count;
708 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
709 0 : return py_count;
710 : }
711 :
712 27 : static int py_AUTHDATA_set_count(PyObject *py_obj, PyObject *value, void *closure)
713 : {
714 27 : struct AUTHDATA *object = (struct AUTHDATA *)pytalloc_get_ptr(py_obj);
715 27 : if (value == NULL) {
716 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
717 0 : return -1;
718 : }
719 : {
720 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
721 27 : if (PyLong_Check(value)) {
722 : unsigned long long test_var;
723 27 : test_var = PyLong_AsUnsignedLongLong(value);
724 27 : if (PyErr_Occurred() != NULL) {
725 0 : return -1;
726 : }
727 27 : if (test_var > uint_max) {
728 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
729 : PyLong_Type.tp_name, uint_max, test_var);
730 0 : return -1;
731 : }
732 27 : object->count = test_var;
733 : } else {
734 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
735 : PyLong_Type.tp_name);
736 0 : return -1;
737 : }
738 : }
739 27 : return 0;
740 : }
741 :
742 0 : static PyObject *py_AUTHDATA_get_data(PyObject *obj, void *closure)
743 : {
744 0 : struct AUTHDATA *object = (struct AUTHDATA *)pytalloc_get_ptr(obj);
745 : PyObject *py_data;
746 0 : py_data = PyList_New(object->count);
747 0 : if (py_data == NULL) {
748 0 : return NULL;
749 : }
750 : {
751 : int data_cntr_0;
752 0 : for (data_cntr_0 = 0; data_cntr_0 < (object->count); data_cntr_0++) {
753 : PyObject *py_data_0;
754 0 : py_data_0 = pytalloc_reference_ex(&AUTHDATUM_Type, object->data, &object->data[data_cntr_0]);
755 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
756 : }
757 : }
758 0 : return py_data;
759 : }
760 :
761 27 : static int py_AUTHDATA_set_data(PyObject *py_obj, PyObject *value, void *closure)
762 : {
763 27 : struct AUTHDATA *object = (struct AUTHDATA *)pytalloc_get_ptr(py_obj);
764 27 : if (value == NULL) {
765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
766 0 : return -1;
767 : }
768 27 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
769 : {
770 : int data_cntr_0;
771 27 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
772 27 : if (!object->data) { return -1;; }
773 27 : talloc_set_name_const(object->data, "ARRAY: object->data");
774 27 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
775 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
777 0 : return -1;
778 : }
779 0 : PY_CHECK_TYPE(&AUTHDATUM_Type, PyList_GET_ITEM(value, data_cntr_0), return -1;);
780 0 : if (talloc_reference(object->data, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, data_cntr_0))) == NULL) {
781 0 : PyErr_NoMemory();
782 0 : return -1;
783 : }
784 0 : object->data[data_cntr_0] = *(struct AUTHDATUM *)pytalloc_get_ptr(PyList_GET_ITEM(value, data_cntr_0));
785 : }
786 : }
787 27 : return 0;
788 : }
789 :
790 : static PyGetSetDef py_AUTHDATA_getsetters[] = {
791 : {
792 : .name = discard_const_p(char, "count"),
793 : .get = py_AUTHDATA_get_count,
794 : .set = py_AUTHDATA_set_count,
795 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
796 : },
797 : {
798 : .name = discard_const_p(char, "data"),
799 : .get = py_AUTHDATA_get_data,
800 : .set = py_AUTHDATA_set_data,
801 : .doc = discard_const_p(char, "PIDL-generated element of base type AUTHDATUM")
802 : },
803 : { .name = NULL }
804 : };
805 :
806 27 : static PyObject *py_AUTHDATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
807 : {
808 27 : return pytalloc_new(struct AUTHDATA, type);
809 : }
810 :
811 :
812 : static PyTypeObject AUTHDATA_Type = {
813 : PyVarObject_HEAD_INIT(NULL, 0)
814 : .tp_name = "krb5ccache.AUTHDATA",
815 : .tp_getset = py_AUTHDATA_getsetters,
816 : .tp_methods = NULL,
817 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
818 : .tp_new = py_AUTHDATA_new,
819 : };
820 :
821 :
822 0 : static PyObject *py_CREDENTIAL_get_client(PyObject *obj, void *closure)
823 : {
824 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
825 : PyObject *py_client;
826 0 : py_client = pytalloc_reference_ex(&PRINCIPAL_Type, pytalloc_get_mem_ctx(obj), &object->client);
827 0 : return py_client;
828 : }
829 :
830 27 : static int py_CREDENTIAL_set_client(PyObject *py_obj, PyObject *value, void *closure)
831 : {
832 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
833 27 : if (value == NULL) {
834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client");
835 0 : return -1;
836 : }
837 27 : PY_CHECK_TYPE(&PRINCIPAL_Type, value, return -1;);
838 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
839 0 : PyErr_NoMemory();
840 0 : return -1;
841 : }
842 27 : object->client = *(struct PRINCIPAL *)pytalloc_get_ptr(value);
843 27 : return 0;
844 : }
845 :
846 0 : static PyObject *py_CREDENTIAL_get_server(PyObject *obj, void *closure)
847 : {
848 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
849 : PyObject *py_server;
850 0 : py_server = pytalloc_reference_ex(&PRINCIPAL_Type, pytalloc_get_mem_ctx(obj), &object->server);
851 0 : return py_server;
852 : }
853 :
854 27 : static int py_CREDENTIAL_set_server(PyObject *py_obj, PyObject *value, void *closure)
855 : {
856 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
857 27 : if (value == NULL) {
858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server");
859 0 : return -1;
860 : }
861 27 : PY_CHECK_TYPE(&PRINCIPAL_Type, value, return -1;);
862 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
863 0 : PyErr_NoMemory();
864 0 : return -1;
865 : }
866 27 : object->server = *(struct PRINCIPAL *)pytalloc_get_ptr(value);
867 27 : return 0;
868 : }
869 :
870 0 : static PyObject *py_CREDENTIAL_get_keyblock(PyObject *obj, void *closure)
871 : {
872 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
873 : PyObject *py_keyblock;
874 0 : py_keyblock = pytalloc_reference_ex(&KEYBLOCK_Type, pytalloc_get_mem_ctx(obj), &object->keyblock);
875 0 : return py_keyblock;
876 : }
877 :
878 27 : static int py_CREDENTIAL_set_keyblock(PyObject *py_obj, PyObject *value, void *closure)
879 : {
880 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
881 27 : if (value == NULL) {
882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keyblock");
883 0 : return -1;
884 : }
885 27 : PY_CHECK_TYPE(&KEYBLOCK_Type, value, return -1;);
886 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
887 0 : PyErr_NoMemory();
888 0 : return -1;
889 : }
890 27 : object->keyblock = *(struct KEYBLOCK *)pytalloc_get_ptr(value);
891 27 : return 0;
892 : }
893 :
894 27 : static PyObject *py_CREDENTIAL_get_authtime(PyObject *obj, void *closure)
895 : {
896 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
897 : PyObject *py_authtime;
898 27 : py_authtime = PyLong_FromUnsignedLongLong((uint32_t)object->authtime);
899 27 : return py_authtime;
900 : }
901 :
902 27 : static int py_CREDENTIAL_set_authtime(PyObject *py_obj, PyObject *value, void *closure)
903 : {
904 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
905 27 : if (value == NULL) {
906 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->authtime");
907 0 : return -1;
908 : }
909 : {
910 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->authtime));
911 27 : if (PyLong_Check(value)) {
912 : unsigned long long test_var;
913 27 : test_var = PyLong_AsUnsignedLongLong(value);
914 27 : if (PyErr_Occurred() != NULL) {
915 0 : return -1;
916 : }
917 27 : if (test_var > uint_max) {
918 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
919 : PyLong_Type.tp_name, uint_max, test_var);
920 0 : return -1;
921 : }
922 27 : object->authtime = test_var;
923 : } else {
924 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
925 : PyLong_Type.tp_name);
926 0 : return -1;
927 : }
928 : }
929 27 : return 0;
930 : }
931 :
932 27 : static PyObject *py_CREDENTIAL_get_starttime(PyObject *obj, void *closure)
933 : {
934 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
935 : PyObject *py_starttime;
936 27 : py_starttime = PyLong_FromUnsignedLongLong((uint32_t)object->starttime);
937 27 : return py_starttime;
938 : }
939 :
940 27 : static int py_CREDENTIAL_set_starttime(PyObject *py_obj, PyObject *value, void *closure)
941 : {
942 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
943 27 : if (value == NULL) {
944 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->starttime");
945 0 : return -1;
946 : }
947 : {
948 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->starttime));
949 27 : if (PyLong_Check(value)) {
950 : unsigned long long test_var;
951 27 : test_var = PyLong_AsUnsignedLongLong(value);
952 27 : if (PyErr_Occurred() != NULL) {
953 0 : return -1;
954 : }
955 27 : if (test_var > uint_max) {
956 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
957 : PyLong_Type.tp_name, uint_max, test_var);
958 0 : return -1;
959 : }
960 27 : object->starttime = test_var;
961 : } else {
962 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
963 : PyLong_Type.tp_name);
964 0 : return -1;
965 : }
966 : }
967 27 : return 0;
968 : }
969 :
970 54 : static PyObject *py_CREDENTIAL_get_endtime(PyObject *obj, void *closure)
971 : {
972 54 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
973 : PyObject *py_endtime;
974 54 : py_endtime = PyLong_FromUnsignedLongLong((uint32_t)object->endtime);
975 54 : return py_endtime;
976 : }
977 :
978 27 : static int py_CREDENTIAL_set_endtime(PyObject *py_obj, PyObject *value, void *closure)
979 : {
980 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
981 27 : if (value == NULL) {
982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->endtime");
983 0 : return -1;
984 : }
985 : {
986 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->endtime));
987 27 : if (PyLong_Check(value)) {
988 : unsigned long long test_var;
989 27 : test_var = PyLong_AsUnsignedLongLong(value);
990 27 : if (PyErr_Occurred() != NULL) {
991 0 : return -1;
992 : }
993 27 : if (test_var > uint_max) {
994 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
995 : PyLong_Type.tp_name, uint_max, test_var);
996 0 : return -1;
997 : }
998 27 : object->endtime = test_var;
999 : } else {
1000 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1001 : PyLong_Type.tp_name);
1002 0 : return -1;
1003 : }
1004 : }
1005 27 : return 0;
1006 : }
1007 :
1008 0 : static PyObject *py_CREDENTIAL_get_renew_till(PyObject *obj, void *closure)
1009 : {
1010 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1011 : PyObject *py_renew_till;
1012 0 : py_renew_till = PyLong_FromUnsignedLongLong((uint32_t)object->renew_till);
1013 0 : return py_renew_till;
1014 : }
1015 :
1016 27 : static int py_CREDENTIAL_set_renew_till(PyObject *py_obj, PyObject *value, void *closure)
1017 : {
1018 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1019 27 : if (value == NULL) {
1020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->renew_till");
1021 0 : return -1;
1022 : }
1023 : {
1024 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->renew_till));
1025 27 : if (PyLong_Check(value)) {
1026 : unsigned long long test_var;
1027 27 : test_var = PyLong_AsUnsignedLongLong(value);
1028 27 : if (PyErr_Occurred() != NULL) {
1029 0 : return -1;
1030 : }
1031 27 : if (test_var > uint_max) {
1032 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1033 : PyLong_Type.tp_name, uint_max, test_var);
1034 0 : return -1;
1035 : }
1036 27 : object->renew_till = test_var;
1037 : } else {
1038 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1039 : PyLong_Type.tp_name);
1040 0 : return -1;
1041 : }
1042 : }
1043 27 : return 0;
1044 : }
1045 :
1046 0 : static PyObject *py_CREDENTIAL_get_is_skey(PyObject *obj, void *closure)
1047 : {
1048 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1049 : PyObject *py_is_skey;
1050 0 : py_is_skey = PyLong_FromLong((uint16_t)object->is_skey);
1051 0 : return py_is_skey;
1052 : }
1053 :
1054 27 : static int py_CREDENTIAL_set_is_skey(PyObject *py_obj, PyObject *value, void *closure)
1055 : {
1056 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1057 27 : if (value == NULL) {
1058 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->is_skey");
1059 0 : return -1;
1060 : }
1061 : {
1062 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->is_skey));
1063 27 : if (PyLong_Check(value)) {
1064 : unsigned long long test_var;
1065 27 : test_var = PyLong_AsUnsignedLongLong(value);
1066 27 : if (PyErr_Occurred() != NULL) {
1067 0 : return -1;
1068 : }
1069 27 : if (test_var > uint_max) {
1070 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1071 : PyLong_Type.tp_name, uint_max, test_var);
1072 0 : return -1;
1073 : }
1074 27 : object->is_skey = test_var;
1075 : } else {
1076 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1077 : PyLong_Type.tp_name);
1078 0 : return -1;
1079 : }
1080 : }
1081 27 : return 0;
1082 : }
1083 :
1084 0 : static PyObject *py_CREDENTIAL_get_ticket_flags(PyObject *obj, void *closure)
1085 : {
1086 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1087 : PyObject *py_ticket_flags;
1088 0 : py_ticket_flags = PyLong_FromUnsignedLongLong((uint32_t)object->ticket_flags);
1089 0 : return py_ticket_flags;
1090 : }
1091 :
1092 27 : static int py_CREDENTIAL_set_ticket_flags(PyObject *py_obj, PyObject *value, void *closure)
1093 : {
1094 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1095 27 : if (value == NULL) {
1096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ticket_flags");
1097 0 : return -1;
1098 : }
1099 : {
1100 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ticket_flags));
1101 27 : if (PyLong_Check(value)) {
1102 : unsigned long long test_var;
1103 27 : test_var = PyLong_AsUnsignedLongLong(value);
1104 27 : if (PyErr_Occurred() != NULL) {
1105 0 : return -1;
1106 : }
1107 27 : if (test_var > uint_max) {
1108 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1109 : PyLong_Type.tp_name, uint_max, test_var);
1110 0 : return -1;
1111 : }
1112 27 : object->ticket_flags = test_var;
1113 : } else {
1114 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1115 : PyLong_Type.tp_name);
1116 0 : return -1;
1117 : }
1118 : }
1119 27 : return 0;
1120 : }
1121 :
1122 0 : static PyObject *py_CREDENTIAL_get_addresses(PyObject *obj, void *closure)
1123 : {
1124 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1125 : PyObject *py_addresses;
1126 0 : py_addresses = pytalloc_reference_ex(&ADDRESSES_Type, pytalloc_get_mem_ctx(obj), &object->addresses);
1127 0 : return py_addresses;
1128 : }
1129 :
1130 27 : static int py_CREDENTIAL_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
1131 : {
1132 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1133 27 : if (value == NULL) {
1134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses");
1135 0 : return -1;
1136 : }
1137 27 : PY_CHECK_TYPE(&ADDRESSES_Type, value, return -1;);
1138 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1139 0 : PyErr_NoMemory();
1140 0 : return -1;
1141 : }
1142 27 : object->addresses = *(struct ADDRESSES *)pytalloc_get_ptr(value);
1143 27 : return 0;
1144 : }
1145 :
1146 0 : static PyObject *py_CREDENTIAL_get_authdata(PyObject *obj, void *closure)
1147 : {
1148 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1149 : PyObject *py_authdata;
1150 0 : py_authdata = pytalloc_reference_ex(&AUTHDATA_Type, pytalloc_get_mem_ctx(obj), &object->authdata);
1151 0 : return py_authdata;
1152 : }
1153 :
1154 27 : static int py_CREDENTIAL_set_authdata(PyObject *py_obj, PyObject *value, void *closure)
1155 : {
1156 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1157 27 : if (value == NULL) {
1158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->authdata");
1159 0 : return -1;
1160 : }
1161 27 : PY_CHECK_TYPE(&AUTHDATA_Type, value, return -1;);
1162 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1163 0 : PyErr_NoMemory();
1164 0 : return -1;
1165 : }
1166 27 : object->authdata = *(struct AUTHDATA *)pytalloc_get_ptr(value);
1167 27 : return 0;
1168 : }
1169 :
1170 0 : static PyObject *py_CREDENTIAL_get_ticket(PyObject *obj, void *closure)
1171 : {
1172 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1173 : PyObject *py_ticket;
1174 0 : py_ticket = PyBytes_FromStringAndSize((char *)(object->ticket).data, (object->ticket).length);
1175 0 : return py_ticket;
1176 : }
1177 :
1178 27 : static int py_CREDENTIAL_set_ticket(PyObject *py_obj, PyObject *value, void *closure)
1179 : {
1180 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1181 27 : if (value == NULL) {
1182 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ticket");
1183 0 : return -1;
1184 : }
1185 27 : object->ticket = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
1186 27 : return 0;
1187 : }
1188 :
1189 0 : static PyObject *py_CREDENTIAL_get_second_ticket(PyObject *obj, void *closure)
1190 : {
1191 0 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(obj);
1192 : PyObject *py_second_ticket;
1193 0 : py_second_ticket = PyBytes_FromStringAndSize((char *)(object->second_ticket).data, (object->second_ticket).length);
1194 0 : return py_second_ticket;
1195 : }
1196 :
1197 27 : static int py_CREDENTIAL_set_second_ticket(PyObject *py_obj, PyObject *value, void *closure)
1198 : {
1199 27 : struct CREDENTIAL *object = (struct CREDENTIAL *)pytalloc_get_ptr(py_obj);
1200 27 : if (value == NULL) {
1201 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->second_ticket");
1202 0 : return -1;
1203 : }
1204 27 : object->second_ticket = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
1205 27 : return 0;
1206 : }
1207 :
1208 : static PyGetSetDef py_CREDENTIAL_getsetters[] = {
1209 : {
1210 : .name = discard_const_p(char, "client"),
1211 : .get = py_CREDENTIAL_get_client,
1212 : .set = py_CREDENTIAL_set_client,
1213 : .doc = discard_const_p(char, "PIDL-generated element of base type PRINCIPAL")
1214 : },
1215 : {
1216 : .name = discard_const_p(char, "server"),
1217 : .get = py_CREDENTIAL_get_server,
1218 : .set = py_CREDENTIAL_set_server,
1219 : .doc = discard_const_p(char, "PIDL-generated element of base type PRINCIPAL")
1220 : },
1221 : {
1222 : .name = discard_const_p(char, "keyblock"),
1223 : .get = py_CREDENTIAL_get_keyblock,
1224 : .set = py_CREDENTIAL_set_keyblock,
1225 : .doc = discard_const_p(char, "PIDL-generated element of base type KEYBLOCK")
1226 : },
1227 : {
1228 : .name = discard_const_p(char, "authtime"),
1229 : .get = py_CREDENTIAL_get_authtime,
1230 : .set = py_CREDENTIAL_set_authtime,
1231 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1232 : },
1233 : {
1234 : .name = discard_const_p(char, "starttime"),
1235 : .get = py_CREDENTIAL_get_starttime,
1236 : .set = py_CREDENTIAL_set_starttime,
1237 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1238 : },
1239 : {
1240 : .name = discard_const_p(char, "endtime"),
1241 : .get = py_CREDENTIAL_get_endtime,
1242 : .set = py_CREDENTIAL_set_endtime,
1243 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1244 : },
1245 : {
1246 : .name = discard_const_p(char, "renew_till"),
1247 : .get = py_CREDENTIAL_get_renew_till,
1248 : .set = py_CREDENTIAL_set_renew_till,
1249 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1250 : },
1251 : {
1252 : .name = discard_const_p(char, "is_skey"),
1253 : .get = py_CREDENTIAL_get_is_skey,
1254 : .set = py_CREDENTIAL_set_is_skey,
1255 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1256 : },
1257 : {
1258 : .name = discard_const_p(char, "ticket_flags"),
1259 : .get = py_CREDENTIAL_get_ticket_flags,
1260 : .set = py_CREDENTIAL_set_ticket_flags,
1261 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1262 : },
1263 : {
1264 : .name = discard_const_p(char, "addresses"),
1265 : .get = py_CREDENTIAL_get_addresses,
1266 : .set = py_CREDENTIAL_set_addresses,
1267 : .doc = discard_const_p(char, "PIDL-generated element of base type ADDRESSES")
1268 : },
1269 : {
1270 : .name = discard_const_p(char, "authdata"),
1271 : .get = py_CREDENTIAL_get_authdata,
1272 : .set = py_CREDENTIAL_set_authdata,
1273 : .doc = discard_const_p(char, "PIDL-generated element of base type AUTHDATA")
1274 : },
1275 : {
1276 : .name = discard_const_p(char, "ticket"),
1277 : .get = py_CREDENTIAL_get_ticket,
1278 : .set = py_CREDENTIAL_set_ticket,
1279 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1280 : },
1281 : {
1282 : .name = discard_const_p(char, "second_ticket"),
1283 : .get = py_CREDENTIAL_get_second_ticket,
1284 : .set = py_CREDENTIAL_set_second_ticket,
1285 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1286 : },
1287 : { .name = NULL }
1288 : };
1289 :
1290 27 : static PyObject *py_CREDENTIAL_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1291 : {
1292 27 : return pytalloc_new(struct CREDENTIAL, type);
1293 : }
1294 :
1295 :
1296 : static PyTypeObject CREDENTIAL_Type = {
1297 : PyVarObject_HEAD_INIT(NULL, 0)
1298 : .tp_name = "krb5ccache.CREDENTIAL",
1299 : .tp_getset = py_CREDENTIAL_getsetters,
1300 : .tp_methods = NULL,
1301 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1302 : .tp_new = py_CREDENTIAL_new,
1303 : };
1304 :
1305 :
1306 0 : static PyObject *py_DELTATIME_TAG_get_kdc_sec_offset(PyObject *obj, void *closure)
1307 : {
1308 0 : struct DELTATIME_TAG *object = (struct DELTATIME_TAG *)pytalloc_get_ptr(obj);
1309 : PyObject *py_kdc_sec_offset;
1310 0 : py_kdc_sec_offset = PyLong_FromLong(object->kdc_sec_offset);
1311 0 : return py_kdc_sec_offset;
1312 : }
1313 :
1314 27 : static int py_DELTATIME_TAG_set_kdc_sec_offset(PyObject *py_obj, PyObject *value, void *closure)
1315 : {
1316 27 : struct DELTATIME_TAG *object = (struct DELTATIME_TAG *)pytalloc_get_ptr(py_obj);
1317 27 : if (value == NULL) {
1318 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->kdc_sec_offset");
1319 0 : return -1;
1320 : }
1321 : {
1322 27 : const long long int_max = ndr_sizeof2intmax(sizeof(object->kdc_sec_offset));
1323 27 : const long long int_min = -int_max - 1;
1324 27 : if (PyLong_Check(value)) {
1325 : long long test_var;
1326 27 : test_var = PyLong_AsLongLong(value);
1327 27 : if (PyErr_Occurred() != NULL) {
1328 0 : return -1;
1329 : }
1330 27 : if (test_var < int_min || test_var > int_max) {
1331 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
1332 : PyLong_Type.tp_name, int_min, int_max, test_var);
1333 0 : return -1;
1334 : }
1335 27 : object->kdc_sec_offset = test_var;
1336 : } else {
1337 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1338 : PyLong_Type.tp_name);
1339 0 : return -1;
1340 : }
1341 : }
1342 27 : return 0;
1343 : }
1344 :
1345 0 : static PyObject *py_DELTATIME_TAG_get_kdc_usec_offset(PyObject *obj, void *closure)
1346 : {
1347 0 : struct DELTATIME_TAG *object = (struct DELTATIME_TAG *)pytalloc_get_ptr(obj);
1348 : PyObject *py_kdc_usec_offset;
1349 0 : py_kdc_usec_offset = PyLong_FromLong(object->kdc_usec_offset);
1350 0 : return py_kdc_usec_offset;
1351 : }
1352 :
1353 27 : static int py_DELTATIME_TAG_set_kdc_usec_offset(PyObject *py_obj, PyObject *value, void *closure)
1354 : {
1355 27 : struct DELTATIME_TAG *object = (struct DELTATIME_TAG *)pytalloc_get_ptr(py_obj);
1356 27 : if (value == NULL) {
1357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->kdc_usec_offset");
1358 0 : return -1;
1359 : }
1360 : {
1361 27 : const long long int_max = ndr_sizeof2intmax(sizeof(object->kdc_usec_offset));
1362 27 : const long long int_min = -int_max - 1;
1363 27 : if (PyLong_Check(value)) {
1364 : long long test_var;
1365 27 : test_var = PyLong_AsLongLong(value);
1366 27 : if (PyErr_Occurred() != NULL) {
1367 0 : return -1;
1368 : }
1369 27 : if (test_var < int_min || test_var > int_max) {
1370 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
1371 : PyLong_Type.tp_name, int_min, int_max, test_var);
1372 0 : return -1;
1373 : }
1374 27 : object->kdc_usec_offset = test_var;
1375 : } else {
1376 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1377 : PyLong_Type.tp_name);
1378 0 : return -1;
1379 : }
1380 : }
1381 27 : return 0;
1382 : }
1383 :
1384 : static PyGetSetDef py_DELTATIME_TAG_getsetters[] = {
1385 : {
1386 : .name = discard_const_p(char, "kdc_sec_offset"),
1387 : .get = py_DELTATIME_TAG_get_kdc_sec_offset,
1388 : .set = py_DELTATIME_TAG_set_kdc_sec_offset,
1389 : .doc = discard_const_p(char, "PIDL-generated element of base type int32")
1390 : },
1391 : {
1392 : .name = discard_const_p(char, "kdc_usec_offset"),
1393 : .get = py_DELTATIME_TAG_get_kdc_usec_offset,
1394 : .set = py_DELTATIME_TAG_set_kdc_usec_offset,
1395 : .doc = discard_const_p(char, "PIDL-generated element of base type int32")
1396 : },
1397 : { .name = NULL }
1398 : };
1399 :
1400 27 : static PyObject *py_DELTATIME_TAG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1401 : {
1402 27 : return pytalloc_new(struct DELTATIME_TAG, type);
1403 : }
1404 :
1405 :
1406 : static PyTypeObject DELTATIME_TAG_Type = {
1407 : PyVarObject_HEAD_INIT(NULL, 0)
1408 : .tp_name = "krb5ccache.DELTATIME_TAG",
1409 : .tp_getset = py_DELTATIME_TAG_getsetters,
1410 : .tp_methods = NULL,
1411 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1412 : .tp_new = py_DELTATIME_TAG_new,
1413 : };
1414 :
1415 0 : static PyObject *py_import_FIELD(TALLOC_CTX *mem_ctx, int level, union FIELD *in)
1416 : {
1417 : PyObject *ret;
1418 :
1419 0 : switch (level) {
1420 0 : case 1:
1421 0 : ret = pytalloc_reference_ex(&DELTATIME_TAG_Type, mem_ctx, &in->deltatime_tag);
1422 0 : return ret;
1423 :
1424 : }
1425 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1426 0 : return NULL;
1427 : }
1428 :
1429 27 : static union FIELD *py_export_FIELD(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1430 : {
1431 27 : union FIELD *ret = talloc_zero(mem_ctx, union FIELD);
1432 27 : switch (level) {
1433 27 : case 1:
1434 27 : if (in == NULL) {
1435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->deltatime_tag");
1436 0 : talloc_free(ret); return NULL;
1437 : }
1438 27 : PY_CHECK_TYPE(&DELTATIME_TAG_Type, in, talloc_free(ret); return NULL;);
1439 27 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1440 0 : PyErr_NoMemory();
1441 0 : talloc_free(ret); return NULL;
1442 : }
1443 27 : ret->deltatime_tag = *(struct DELTATIME_TAG *)pytalloc_get_ptr(in);
1444 27 : break;
1445 :
1446 0 : default:
1447 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
1448 0 : talloc_free(ret);
1449 0 : ret = NULL;
1450 : }
1451 :
1452 27 : return ret;
1453 : }
1454 :
1455 0 : static PyObject *py_FIELD_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1456 : {
1457 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1458 0 : PyObject *mem_ctx_obj = NULL;
1459 0 : TALLOC_CTX *mem_ctx = NULL;
1460 0 : int level = 0;
1461 0 : PyObject *in_obj = NULL;
1462 0 : union FIELD *in = NULL;
1463 :
1464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1465 : discard_const_p(char *, kwnames),
1466 : &mem_ctx_obj,
1467 : &level,
1468 : &in_obj)) {
1469 0 : return NULL;
1470 : }
1471 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1472 0 : if (mem_ctx == NULL) {
1473 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1474 0 : return NULL;
1475 : }
1476 0 : in = (union FIELD *)pytalloc_get_ptr(in_obj);
1477 0 : if (in == NULL) {
1478 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union FIELD!");
1479 0 : return NULL;
1480 : }
1481 :
1482 0 : return py_import_FIELD(mem_ctx, level, in);
1483 : }
1484 :
1485 27 : static PyObject *py_FIELD_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1486 : {
1487 27 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1488 27 : PyObject *mem_ctx_obj = NULL;
1489 27 : TALLOC_CTX *mem_ctx = NULL;
1490 27 : int level = 0;
1491 27 : PyObject *in = NULL;
1492 27 : union FIELD *out = NULL;
1493 :
1494 27 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1495 : discard_const_p(char *, kwnames),
1496 : &mem_ctx_obj,
1497 : &level,
1498 : &in)) {
1499 0 : return NULL;
1500 : }
1501 27 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1502 27 : if (mem_ctx == NULL) {
1503 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1504 0 : return NULL;
1505 : }
1506 :
1507 27 : out = py_export_FIELD(mem_ctx, level, in);
1508 27 : if (out == NULL) {
1509 0 : return NULL;
1510 : }
1511 :
1512 27 : return pytalloc_GenericObject_reference(out);
1513 : }
1514 :
1515 : static PyMethodDef py_FIELD_methods[] = {
1516 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_FIELD_import),
1517 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1518 : "T.__import__(mem_ctx, level, in) => ret." },
1519 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_FIELD_export),
1520 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1521 : "T.__export__(mem_ctx, level, in) => ret." },
1522 : { NULL, NULL, 0, NULL }
1523 : };
1524 :
1525 0 : static PyObject *py_FIELD_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1526 : {
1527 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1528 0 : return NULL;
1529 : }
1530 :
1531 :
1532 : static PyTypeObject FIELD_Type = {
1533 : PyVarObject_HEAD_INIT(NULL, 0)
1534 : .tp_name = "krb5ccache.FIELD",
1535 : .tp_getset = NULL,
1536 : .tp_methods = py_FIELD_methods,
1537 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1538 : .tp_new = py_FIELD_new,
1539 : };
1540 :
1541 :
1542 0 : static PyObject *py_V4TAG_get_tag(PyObject *obj, void *closure)
1543 : {
1544 0 : struct V4TAG *object = (struct V4TAG *)pytalloc_get_ptr(obj);
1545 : PyObject *py_tag;
1546 0 : py_tag = PyLong_FromLong((uint16_t)object->tag);
1547 0 : return py_tag;
1548 : }
1549 :
1550 27 : static int py_V4TAG_set_tag(PyObject *py_obj, PyObject *value, void *closure)
1551 : {
1552 27 : struct V4TAG *object = (struct V4TAG *)pytalloc_get_ptr(py_obj);
1553 27 : if (value == NULL) {
1554 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tag");
1555 0 : return -1;
1556 : }
1557 : {
1558 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tag));
1559 27 : if (PyLong_Check(value)) {
1560 : unsigned long long test_var;
1561 27 : test_var = PyLong_AsUnsignedLongLong(value);
1562 27 : if (PyErr_Occurred() != NULL) {
1563 0 : return -1;
1564 : }
1565 27 : if (test_var > uint_max) {
1566 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1567 : PyLong_Type.tp_name, uint_max, test_var);
1568 0 : return -1;
1569 : }
1570 27 : object->tag = test_var;
1571 : } else {
1572 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1573 : PyLong_Type.tp_name);
1574 0 : return -1;
1575 : }
1576 : }
1577 27 : return 0;
1578 : }
1579 :
1580 0 : static PyObject *py_V4TAG_get_field(PyObject *obj, void *closure)
1581 : {
1582 0 : struct V4TAG *object = (struct V4TAG *)pytalloc_get_ptr(obj);
1583 : PyObject *py_field;
1584 0 : py_field = pyrpc_import_union(&FIELD_Type, pytalloc_get_mem_ctx(obj), object->tag, &object->field, "union FIELD");
1585 0 : if (py_field == NULL) {
1586 0 : return NULL;
1587 : }
1588 0 : return py_field;
1589 : }
1590 :
1591 27 : static int py_V4TAG_set_field(PyObject *py_obj, PyObject *value, void *closure)
1592 : {
1593 27 : struct V4TAG *object = (struct V4TAG *)pytalloc_get_ptr(py_obj);
1594 27 : if (value == NULL) {
1595 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->field");
1596 0 : return -1;
1597 : }
1598 : {
1599 : union FIELD *field_switch_1;
1600 27 : field_switch_1 = (union FIELD *)pyrpc_export_union(&FIELD_Type, pytalloc_get_mem_ctx(py_obj), object->tag, value, "union FIELD");
1601 27 : if (field_switch_1 == NULL) {
1602 0 : return -1;
1603 : }
1604 27 : object->field = *field_switch_1;
1605 : }
1606 27 : return 0;
1607 : }
1608 :
1609 : static PyGetSetDef py_V4TAG_getsetters[] = {
1610 : {
1611 : .name = discard_const_p(char, "tag"),
1612 : .get = py_V4TAG_get_tag,
1613 : .set = py_V4TAG_set_tag,
1614 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1615 : },
1616 : {
1617 : .name = discard_const_p(char, "field"),
1618 : .get = py_V4TAG_get_field,
1619 : .set = py_V4TAG_set_field,
1620 : .doc = discard_const_p(char, "PIDL-generated element of base type FIELD")
1621 : },
1622 : { .name = NULL }
1623 : };
1624 :
1625 27 : static PyObject *py_V4TAG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1626 : {
1627 27 : return pytalloc_new(struct V4TAG, type);
1628 : }
1629 :
1630 :
1631 : static PyTypeObject V4TAG_Type = {
1632 : PyVarObject_HEAD_INIT(NULL, 0)
1633 : .tp_name = "krb5ccache.V4TAG",
1634 : .tp_getset = py_V4TAG_getsetters,
1635 : .tp_methods = NULL,
1636 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1637 : .tp_new = py_V4TAG_new,
1638 : };
1639 :
1640 :
1641 0 : static PyObject *py_V4TAGS_get_tag(PyObject *obj, void *closure)
1642 : {
1643 0 : struct V4TAGS *object = (struct V4TAGS *)pytalloc_get_ptr(obj);
1644 : PyObject *py_tag;
1645 0 : py_tag = pytalloc_reference_ex(&V4TAG_Type, pytalloc_get_mem_ctx(obj), &object->tag);
1646 0 : return py_tag;
1647 : }
1648 :
1649 27 : static int py_V4TAGS_set_tag(PyObject *py_obj, PyObject *value, void *closure)
1650 : {
1651 27 : struct V4TAGS *object = (struct V4TAGS *)pytalloc_get_ptr(py_obj);
1652 27 : if (value == NULL) {
1653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tag");
1654 0 : return -1;
1655 : }
1656 27 : PY_CHECK_TYPE(&V4TAG_Type, value, return -1;);
1657 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1658 0 : PyErr_NoMemory();
1659 0 : return -1;
1660 : }
1661 27 : object->tag = *(struct V4TAG *)pytalloc_get_ptr(value);
1662 27 : return 0;
1663 : }
1664 :
1665 0 : static PyObject *py_V4TAGS_get_further_tags(PyObject *obj, void *closure)
1666 : {
1667 0 : struct V4TAGS *object = (struct V4TAGS *)pytalloc_get_ptr(obj);
1668 : PyObject *py_further_tags;
1669 0 : py_further_tags = PyBytes_FromStringAndSize((char *)(object->further_tags).data, (object->further_tags).length);
1670 0 : return py_further_tags;
1671 : }
1672 :
1673 27 : static int py_V4TAGS_set_further_tags(PyObject *py_obj, PyObject *value, void *closure)
1674 : {
1675 27 : struct V4TAGS *object = (struct V4TAGS *)pytalloc_get_ptr(py_obj);
1676 27 : if (value == NULL) {
1677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->further_tags");
1678 0 : return -1;
1679 : }
1680 27 : object->further_tags = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
1681 27 : return 0;
1682 : }
1683 :
1684 : static PyGetSetDef py_V4TAGS_getsetters[] = {
1685 : {
1686 : .name = discard_const_p(char, "tag"),
1687 : .get = py_V4TAGS_get_tag,
1688 : .set = py_V4TAGS_set_tag,
1689 : .doc = discard_const_p(char, "PIDL-generated element of base type V4TAG")
1690 : },
1691 : {
1692 : .name = discard_const_p(char, "further_tags"),
1693 : .get = py_V4TAGS_get_further_tags,
1694 : .set = py_V4TAGS_set_further_tags,
1695 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1696 : },
1697 : { .name = NULL }
1698 : };
1699 :
1700 27 : static PyObject *py_V4TAGS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1701 : {
1702 27 : return pytalloc_new(struct V4TAGS, type);
1703 : }
1704 :
1705 :
1706 : static PyTypeObject V4TAGS_Type = {
1707 : PyVarObject_HEAD_INIT(NULL, 0)
1708 : .tp_name = "krb5ccache.V4TAGS",
1709 : .tp_getset = py_V4TAGS_getsetters,
1710 : .tp_methods = NULL,
1711 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1712 : .tp_new = py_V4TAGS_new,
1713 : };
1714 :
1715 :
1716 0 : static PyObject *py_V4HEADER_get_v4tags(PyObject *obj, void *closure)
1717 : {
1718 0 : struct V4HEADER *object = (struct V4HEADER *)pytalloc_get_ptr(obj);
1719 : PyObject *py_v4tags;
1720 0 : py_v4tags = pytalloc_reference_ex(&V4TAGS_Type, pytalloc_get_mem_ctx(obj), &object->v4tags);
1721 0 : return py_v4tags;
1722 : }
1723 :
1724 27 : static int py_V4HEADER_set_v4tags(PyObject *py_obj, PyObject *value, void *closure)
1725 : {
1726 27 : struct V4HEADER *object = (struct V4HEADER *)pytalloc_get_ptr(py_obj);
1727 27 : if (value == NULL) {
1728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v4tags");
1729 0 : return -1;
1730 : }
1731 27 : PY_CHECK_TYPE(&V4TAGS_Type, value, return -1;);
1732 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1733 0 : PyErr_NoMemory();
1734 0 : return -1;
1735 : }
1736 27 : object->v4tags = *(struct V4TAGS *)pytalloc_get_ptr(value);
1737 27 : return 0;
1738 : }
1739 :
1740 : static PyGetSetDef py_V4HEADER_getsetters[] = {
1741 : {
1742 : .name = discard_const_p(char, "v4tags"),
1743 : .get = py_V4HEADER_get_v4tags,
1744 : .set = py_V4HEADER_set_v4tags,
1745 : .doc = discard_const_p(char, "PIDL-generated element of base type V4TAGS")
1746 : },
1747 : { .name = NULL }
1748 : };
1749 :
1750 27 : static PyObject *py_V4HEADER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1751 : {
1752 27 : return pytalloc_new(struct V4HEADER, type);
1753 : }
1754 :
1755 :
1756 : static PyTypeObject V4HEADER_Type = {
1757 : PyVarObject_HEAD_INIT(NULL, 0)
1758 : .tp_name = "krb5ccache.V4HEADER",
1759 : .tp_getset = py_V4HEADER_getsetters,
1760 : .tp_methods = NULL,
1761 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1762 : .tp_new = py_V4HEADER_new,
1763 : };
1764 :
1765 0 : static PyObject *py_import_OPTIONAL_HEADER(TALLOC_CTX *mem_ctx, int level, union OPTIONAL_HEADER *in)
1766 : {
1767 : PyObject *ret;
1768 :
1769 0 : switch (level) {
1770 0 : case 3:
1771 0 : ret = Py_None;
1772 0 : Py_INCREF(ret);
1773 0 : return ret;
1774 :
1775 0 : case 4:
1776 0 : ret = pytalloc_reference_ex(&V4HEADER_Type, mem_ctx, &in->v4header);
1777 0 : return ret;
1778 :
1779 : }
1780 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1781 0 : return NULL;
1782 : }
1783 :
1784 27 : static union OPTIONAL_HEADER *py_export_OPTIONAL_HEADER(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1785 : {
1786 27 : union OPTIONAL_HEADER *ret = talloc_zero(mem_ctx, union OPTIONAL_HEADER);
1787 27 : switch (level) {
1788 0 : case 3:
1789 0 : break;
1790 :
1791 27 : case 4:
1792 27 : if (in == NULL) {
1793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->v4header");
1794 0 : talloc_free(ret); return NULL;
1795 : }
1796 27 : PY_CHECK_TYPE(&V4HEADER_Type, in, talloc_free(ret); return NULL;);
1797 27 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1798 0 : PyErr_NoMemory();
1799 0 : talloc_free(ret); return NULL;
1800 : }
1801 27 : ret->v4header = *(struct V4HEADER *)pytalloc_get_ptr(in);
1802 27 : break;
1803 :
1804 0 : default:
1805 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
1806 0 : talloc_free(ret);
1807 0 : ret = NULL;
1808 : }
1809 :
1810 27 : return ret;
1811 : }
1812 :
1813 0 : static PyObject *py_OPTIONAL_HEADER_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1814 : {
1815 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1816 0 : PyObject *mem_ctx_obj = NULL;
1817 0 : TALLOC_CTX *mem_ctx = NULL;
1818 0 : int level = 0;
1819 0 : PyObject *in_obj = NULL;
1820 0 : union OPTIONAL_HEADER *in = NULL;
1821 :
1822 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1823 : discard_const_p(char *, kwnames),
1824 : &mem_ctx_obj,
1825 : &level,
1826 : &in_obj)) {
1827 0 : return NULL;
1828 : }
1829 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1830 0 : if (mem_ctx == NULL) {
1831 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1832 0 : return NULL;
1833 : }
1834 0 : in = (union OPTIONAL_HEADER *)pytalloc_get_ptr(in_obj);
1835 0 : if (in == NULL) {
1836 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union OPTIONAL_HEADER!");
1837 0 : return NULL;
1838 : }
1839 :
1840 0 : return py_import_OPTIONAL_HEADER(mem_ctx, level, in);
1841 : }
1842 :
1843 27 : static PyObject *py_OPTIONAL_HEADER_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1844 : {
1845 27 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1846 27 : PyObject *mem_ctx_obj = NULL;
1847 27 : TALLOC_CTX *mem_ctx = NULL;
1848 27 : int level = 0;
1849 27 : PyObject *in = NULL;
1850 27 : union OPTIONAL_HEADER *out = NULL;
1851 :
1852 27 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1853 : discard_const_p(char *, kwnames),
1854 : &mem_ctx_obj,
1855 : &level,
1856 : &in)) {
1857 0 : return NULL;
1858 : }
1859 27 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1860 27 : if (mem_ctx == NULL) {
1861 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1862 0 : return NULL;
1863 : }
1864 :
1865 27 : out = py_export_OPTIONAL_HEADER(mem_ctx, level, in);
1866 27 : if (out == NULL) {
1867 0 : return NULL;
1868 : }
1869 :
1870 27 : return pytalloc_GenericObject_reference(out);
1871 : }
1872 :
1873 : static PyMethodDef py_OPTIONAL_HEADER_methods[] = {
1874 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_OPTIONAL_HEADER_import),
1875 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1876 : "T.__import__(mem_ctx, level, in) => ret." },
1877 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_OPTIONAL_HEADER_export),
1878 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1879 : "T.__export__(mem_ctx, level, in) => ret." },
1880 : { NULL, NULL, 0, NULL }
1881 : };
1882 :
1883 0 : static PyObject *py_OPTIONAL_HEADER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1884 : {
1885 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1886 0 : return NULL;
1887 : }
1888 :
1889 :
1890 : static PyTypeObject OPTIONAL_HEADER_Type = {
1891 : PyVarObject_HEAD_INIT(NULL, 0)
1892 : .tp_name = "krb5ccache.OPTIONAL_HEADER",
1893 : .tp_getset = NULL,
1894 : .tp_methods = py_OPTIONAL_HEADER_methods,
1895 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1896 : .tp_new = py_OPTIONAL_HEADER_new,
1897 : };
1898 :
1899 :
1900 0 : static PyObject *py_CCACHE_get_pvno(PyObject *obj, void *closure)
1901 : {
1902 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(obj);
1903 : PyObject *py_pvno;
1904 0 : py_pvno = PyLong_FromLong((uint16_t)object->pvno);
1905 0 : return py_pvno;
1906 : }
1907 :
1908 27 : static int py_CCACHE_set_pvno(PyObject *py_obj, PyObject *value, void *closure)
1909 : {
1910 27 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
1911 27 : if (value == NULL) {
1912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pvno");
1913 0 : return -1;
1914 : }
1915 : {
1916 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pvno));
1917 27 : if (PyLong_Check(value)) {
1918 : unsigned long long test_var;
1919 27 : test_var = PyLong_AsUnsignedLongLong(value);
1920 27 : if (PyErr_Occurred() != NULL) {
1921 0 : return -1;
1922 : }
1923 27 : if (test_var > uint_max) {
1924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1925 : PyLong_Type.tp_name, uint_max, test_var);
1926 0 : return -1;
1927 : }
1928 27 : object->pvno = test_var;
1929 : } else {
1930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1931 : PyLong_Type.tp_name);
1932 0 : return -1;
1933 : }
1934 : }
1935 27 : return 0;
1936 : }
1937 :
1938 0 : static PyObject *py_CCACHE_get_version(PyObject *obj, void *closure)
1939 : {
1940 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(obj);
1941 : PyObject *py_version;
1942 0 : py_version = PyLong_FromLong((uint16_t)object->version);
1943 0 : return py_version;
1944 : }
1945 :
1946 27 : static int py_CCACHE_set_version(PyObject *py_obj, PyObject *value, void *closure)
1947 : {
1948 27 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
1949 27 : if (value == NULL) {
1950 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
1951 0 : return -1;
1952 : }
1953 : {
1954 27 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
1955 27 : if (PyLong_Check(value)) {
1956 : unsigned long long test_var;
1957 27 : test_var = PyLong_AsUnsignedLongLong(value);
1958 27 : if (PyErr_Occurred() != NULL) {
1959 0 : return -1;
1960 : }
1961 27 : if (test_var > uint_max) {
1962 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1963 : PyLong_Type.tp_name, uint_max, test_var);
1964 0 : return -1;
1965 : }
1966 27 : object->version = test_var;
1967 : } else {
1968 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1969 : PyLong_Type.tp_name);
1970 0 : return -1;
1971 : }
1972 : }
1973 27 : return 0;
1974 : }
1975 :
1976 0 : static PyObject *py_CCACHE_get_optional_header(PyObject *obj, void *closure)
1977 : {
1978 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(obj);
1979 : PyObject *py_optional_header;
1980 0 : py_optional_header = pyrpc_import_union(&OPTIONAL_HEADER_Type, pytalloc_get_mem_ctx(obj), object->version, &object->optional_header, "union OPTIONAL_HEADER");
1981 0 : if (py_optional_header == NULL) {
1982 0 : return NULL;
1983 : }
1984 0 : return py_optional_header;
1985 : }
1986 :
1987 27 : static int py_CCACHE_set_optional_header(PyObject *py_obj, PyObject *value, void *closure)
1988 : {
1989 27 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
1990 27 : if (value == NULL) {
1991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->optional_header");
1992 0 : return -1;
1993 : }
1994 : {
1995 : union OPTIONAL_HEADER *optional_header_switch_0;
1996 27 : optional_header_switch_0 = (union OPTIONAL_HEADER *)pyrpc_export_union(&OPTIONAL_HEADER_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union OPTIONAL_HEADER");
1997 27 : if (optional_header_switch_0 == NULL) {
1998 0 : return -1;
1999 : }
2000 27 : object->optional_header = *optional_header_switch_0;
2001 : }
2002 27 : return 0;
2003 : }
2004 :
2005 0 : static PyObject *py_CCACHE_get_principal(PyObject *obj, void *closure)
2006 : {
2007 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(obj);
2008 : PyObject *py_principal;
2009 0 : py_principal = pytalloc_reference_ex(&PRINCIPAL_Type, pytalloc_get_mem_ctx(obj), &object->principal);
2010 0 : return py_principal;
2011 : }
2012 :
2013 27 : static int py_CCACHE_set_principal(PyObject *py_obj, PyObject *value, void *closure)
2014 : {
2015 27 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
2016 27 : if (value == NULL) {
2017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principal");
2018 0 : return -1;
2019 : }
2020 27 : PY_CHECK_TYPE(&PRINCIPAL_Type, value, return -1;);
2021 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2022 0 : PyErr_NoMemory();
2023 0 : return -1;
2024 : }
2025 27 : object->principal = *(struct PRINCIPAL *)pytalloc_get_ptr(value);
2026 27 : return 0;
2027 : }
2028 :
2029 0 : static PyObject *py_CCACHE_get_cred(PyObject *obj, void *closure)
2030 : {
2031 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(obj);
2032 : PyObject *py_cred;
2033 0 : py_cred = pytalloc_reference_ex(&CREDENTIAL_Type, pytalloc_get_mem_ctx(obj), &object->cred);
2034 0 : return py_cred;
2035 : }
2036 :
2037 27 : static int py_CCACHE_set_cred(PyObject *py_obj, PyObject *value, void *closure)
2038 : {
2039 27 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
2040 27 : if (value == NULL) {
2041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cred");
2042 0 : return -1;
2043 : }
2044 27 : PY_CHECK_TYPE(&CREDENTIAL_Type, value, return -1;);
2045 27 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2046 0 : PyErr_NoMemory();
2047 0 : return -1;
2048 : }
2049 27 : object->cred = *(struct CREDENTIAL *)pytalloc_get_ptr(value);
2050 27 : return 0;
2051 : }
2052 :
2053 0 : static PyObject *py_CCACHE_get_further_creds(PyObject *obj, void *closure)
2054 : {
2055 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(obj);
2056 : PyObject *py_further_creds;
2057 0 : py_further_creds = PyBytes_FromStringAndSize((char *)(object->further_creds).data, (object->further_creds).length);
2058 0 : return py_further_creds;
2059 : }
2060 :
2061 0 : static int py_CCACHE_set_further_creds(PyObject *py_obj, PyObject *value, void *closure)
2062 : {
2063 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
2064 0 : if (value == NULL) {
2065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->further_creds");
2066 0 : return -1;
2067 : }
2068 0 : object->further_creds = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2069 0 : return 0;
2070 : }
2071 :
2072 : static PyGetSetDef py_CCACHE_getsetters[] = {
2073 : {
2074 : .name = discard_const_p(char, "pvno"),
2075 : .get = py_CCACHE_get_pvno,
2076 : .set = py_CCACHE_set_pvno,
2077 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2078 : },
2079 : {
2080 : .name = discard_const_p(char, "version"),
2081 : .get = py_CCACHE_get_version,
2082 : .set = py_CCACHE_set_version,
2083 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2084 : },
2085 : {
2086 : .name = discard_const_p(char, "optional_header"),
2087 : .get = py_CCACHE_get_optional_header,
2088 : .set = py_CCACHE_set_optional_header,
2089 : .doc = discard_const_p(char, "PIDL-generated element of base type OPTIONAL_HEADER")
2090 : },
2091 : {
2092 : .name = discard_const_p(char, "principal"),
2093 : .get = py_CCACHE_get_principal,
2094 : .set = py_CCACHE_set_principal,
2095 : .doc = discard_const_p(char, "PIDL-generated element of base type PRINCIPAL")
2096 : },
2097 : {
2098 : .name = discard_const_p(char, "cred"),
2099 : .get = py_CCACHE_get_cred,
2100 : .set = py_CCACHE_set_cred,
2101 : .doc = discard_const_p(char, "PIDL-generated element of base type CREDENTIAL")
2102 : },
2103 : {
2104 : .name = discard_const_p(char, "further_creds"),
2105 : .get = py_CCACHE_get_further_creds,
2106 : .set = py_CCACHE_set_further_creds,
2107 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2108 : },
2109 : { .name = NULL }
2110 : };
2111 :
2112 27 : static PyObject *py_CCACHE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2113 : {
2114 27 : return pytalloc_new(struct CCACHE, type);
2115 : }
2116 :
2117 27 : static PyObject *py_CCACHE_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2118 : {
2119 27 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
2120 27 : PyObject *ret = NULL;
2121 : DATA_BLOB blob;
2122 : enum ndr_err_code err;
2123 27 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2124 27 : if (tmp_ctx == NULL) {
2125 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2126 0 : return NULL;
2127 : }
2128 27 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_CCACHE);
2129 27 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2130 0 : TALLOC_FREE(tmp_ctx);
2131 0 : PyErr_SetNdrError(err);
2132 0 : return NULL;
2133 : }
2134 :
2135 27 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2136 27 : TALLOC_FREE(tmp_ctx);
2137 27 : return ret;
2138 : }
2139 :
2140 0 : static PyObject *py_CCACHE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2141 : {
2142 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
2143 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2144 0 : Py_ssize_t blob_length = 0;
2145 : enum ndr_err_code err;
2146 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2147 0 : PyObject *allow_remaining_obj = NULL;
2148 0 : bool allow_remaining = false;
2149 :
2150 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2151 : discard_const_p(char *, kwnames),
2152 : &blob.data, &blob_length,
2153 : &allow_remaining_obj)) {
2154 0 : return NULL;
2155 : }
2156 0 : blob.length = blob_length;
2157 :
2158 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2159 0 : allow_remaining = true;
2160 : }
2161 :
2162 0 : if (allow_remaining) {
2163 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_CCACHE);
2164 : } else {
2165 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_CCACHE);
2166 : }
2167 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2168 0 : PyErr_SetNdrError(err);
2169 0 : return NULL;
2170 : }
2171 :
2172 0 : Py_RETURN_NONE;
2173 : }
2174 :
2175 0 : static PyObject *py_CCACHE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2176 : {
2177 0 : struct CCACHE *object = (struct CCACHE *)pytalloc_get_ptr(py_obj);
2178 : PyObject *ret;
2179 : char *retstr;
2180 :
2181 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_CCACHE, "CCACHE", object);
2182 0 : ret = PyUnicode_FromString(retstr);
2183 0 : talloc_free(retstr);
2184 :
2185 0 : return ret;
2186 : }
2187 :
2188 : static PyMethodDef py_CCACHE_methods[] = {
2189 : { "__ndr_pack__", (PyCFunction)py_CCACHE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2190 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_CCACHE_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2191 : { "__ndr_print__", (PyCFunction)py_CCACHE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2192 : { NULL, NULL, 0, NULL }
2193 : };
2194 :
2195 :
2196 : static PyTypeObject CCACHE_Type = {
2197 : PyVarObject_HEAD_INIT(NULL, 0)
2198 : .tp_name = "krb5ccache.CCACHE",
2199 : .tp_getset = py_CCACHE_getsetters,
2200 : .tp_methods = py_CCACHE_methods,
2201 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2202 : .tp_new = py_CCACHE_new,
2203 : };
2204 :
2205 :
2206 0 : static PyObject *py_MULTIPLE_CREDENTIALS_get_cred(PyObject *obj, void *closure)
2207 : {
2208 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(obj);
2209 : PyObject *py_cred;
2210 0 : py_cred = pytalloc_reference_ex(&CREDENTIAL_Type, pytalloc_get_mem_ctx(obj), &object->cred);
2211 0 : return py_cred;
2212 : }
2213 :
2214 0 : static int py_MULTIPLE_CREDENTIALS_set_cred(PyObject *py_obj, PyObject *value, void *closure)
2215 : {
2216 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(py_obj);
2217 0 : if (value == NULL) {
2218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cred");
2219 0 : return -1;
2220 : }
2221 0 : PY_CHECK_TYPE(&CREDENTIAL_Type, value, return -1;);
2222 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2223 0 : PyErr_NoMemory();
2224 0 : return -1;
2225 : }
2226 0 : object->cred = *(struct CREDENTIAL *)pytalloc_get_ptr(value);
2227 0 : return 0;
2228 : }
2229 :
2230 0 : static PyObject *py_MULTIPLE_CREDENTIALS_get_further_creds(PyObject *obj, void *closure)
2231 : {
2232 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(obj);
2233 : PyObject *py_further_creds;
2234 0 : py_further_creds = PyBytes_FromStringAndSize((char *)(object->further_creds).data, (object->further_creds).length);
2235 0 : return py_further_creds;
2236 : }
2237 :
2238 0 : static int py_MULTIPLE_CREDENTIALS_set_further_creds(PyObject *py_obj, PyObject *value, void *closure)
2239 : {
2240 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(py_obj);
2241 0 : if (value == NULL) {
2242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->further_creds");
2243 0 : return -1;
2244 : }
2245 0 : object->further_creds = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2246 0 : return 0;
2247 : }
2248 :
2249 : static PyGetSetDef py_MULTIPLE_CREDENTIALS_getsetters[] = {
2250 : {
2251 : .name = discard_const_p(char, "cred"),
2252 : .get = py_MULTIPLE_CREDENTIALS_get_cred,
2253 : .set = py_MULTIPLE_CREDENTIALS_set_cred,
2254 : .doc = discard_const_p(char, "PIDL-generated element of base type CREDENTIAL")
2255 : },
2256 : {
2257 : .name = discard_const_p(char, "further_creds"),
2258 : .get = py_MULTIPLE_CREDENTIALS_get_further_creds,
2259 : .set = py_MULTIPLE_CREDENTIALS_set_further_creds,
2260 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2261 : },
2262 : { .name = NULL }
2263 : };
2264 :
2265 0 : static PyObject *py_MULTIPLE_CREDENTIALS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2266 : {
2267 0 : return pytalloc_new(struct MULTIPLE_CREDENTIALS, type);
2268 : }
2269 :
2270 0 : static PyObject *py_MULTIPLE_CREDENTIALS_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2271 : {
2272 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(py_obj);
2273 0 : PyObject *ret = NULL;
2274 : DATA_BLOB blob;
2275 : enum ndr_err_code err;
2276 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2277 0 : if (tmp_ctx == NULL) {
2278 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2279 0 : return NULL;
2280 : }
2281 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_MULTIPLE_CREDENTIALS);
2282 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2283 0 : TALLOC_FREE(tmp_ctx);
2284 0 : PyErr_SetNdrError(err);
2285 0 : return NULL;
2286 : }
2287 :
2288 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2289 0 : TALLOC_FREE(tmp_ctx);
2290 0 : return ret;
2291 : }
2292 :
2293 0 : static PyObject *py_MULTIPLE_CREDENTIALS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2294 : {
2295 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(py_obj);
2296 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2297 0 : Py_ssize_t blob_length = 0;
2298 : enum ndr_err_code err;
2299 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2300 0 : PyObject *allow_remaining_obj = NULL;
2301 0 : bool allow_remaining = false;
2302 :
2303 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2304 : discard_const_p(char *, kwnames),
2305 : &blob.data, &blob_length,
2306 : &allow_remaining_obj)) {
2307 0 : return NULL;
2308 : }
2309 0 : blob.length = blob_length;
2310 :
2311 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2312 0 : allow_remaining = true;
2313 : }
2314 :
2315 0 : if (allow_remaining) {
2316 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_MULTIPLE_CREDENTIALS);
2317 : } else {
2318 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_MULTIPLE_CREDENTIALS);
2319 : }
2320 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2321 0 : PyErr_SetNdrError(err);
2322 0 : return NULL;
2323 : }
2324 :
2325 0 : Py_RETURN_NONE;
2326 : }
2327 :
2328 0 : static PyObject *py_MULTIPLE_CREDENTIALS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2329 : {
2330 0 : struct MULTIPLE_CREDENTIALS *object = (struct MULTIPLE_CREDENTIALS *)pytalloc_get_ptr(py_obj);
2331 : PyObject *ret;
2332 : char *retstr;
2333 :
2334 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_MULTIPLE_CREDENTIALS, "MULTIPLE_CREDENTIALS", object);
2335 0 : ret = PyUnicode_FromString(retstr);
2336 0 : talloc_free(retstr);
2337 :
2338 0 : return ret;
2339 : }
2340 :
2341 : static PyMethodDef py_MULTIPLE_CREDENTIALS_methods[] = {
2342 : { "__ndr_pack__", (PyCFunction)py_MULTIPLE_CREDENTIALS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2343 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_MULTIPLE_CREDENTIALS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2344 : { "__ndr_print__", (PyCFunction)py_MULTIPLE_CREDENTIALS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2345 : { NULL, NULL, 0, NULL }
2346 : };
2347 :
2348 :
2349 : static PyTypeObject MULTIPLE_CREDENTIALS_Type = {
2350 : PyVarObject_HEAD_INIT(NULL, 0)
2351 : .tp_name = "krb5ccache.MULTIPLE_CREDENTIALS",
2352 : .tp_getset = py_MULTIPLE_CREDENTIALS_getsetters,
2353 : .tp_methods = py_MULTIPLE_CREDENTIALS_methods,
2354 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2355 : .tp_new = py_MULTIPLE_CREDENTIALS_new,
2356 : };
2357 :
2358 :
2359 : const struct PyNdrRpcMethodDef py_ndr_krb5ccache_methods[] = {
2360 : {0}
2361 : };
2362 :
2363 0 : static PyObject *interface_krb5ccache_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2364 : {
2365 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_krb5ccache);
2366 : }
2367 :
2368 : #define PY_DOC_KRB5CCACHE "KRB5 credentials cache"
2369 : static PyTypeObject krb5ccache_InterfaceType = {
2370 : PyVarObject_HEAD_INIT(NULL, 0)
2371 : .tp_name = "krb5ccache.krb5ccache",
2372 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
2373 : .tp_doc = "krb5ccache(binding, lp_ctx=None, credentials=None) -> connection\n"
2374 : "\n"
2375 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
2376 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
2377 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_KRB5CCACHE,
2378 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2379 : .tp_new = interface_krb5ccache_new,
2380 : };
2381 :
2382 0 : static PyObject *syntax_krb5ccache_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2383 : {
2384 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_krb5ccache.syntax_id);
2385 : }
2386 :
2387 : #define PY_DOC_KRB5CCACHE_SYNTAX "KRB5 credentials cache"
2388 : static PyTypeObject krb5ccache_SyntaxType = {
2389 : PyVarObject_HEAD_INIT(NULL, 0)
2390 : .tp_name = "krb5ccache.krb5ccache_abstract_syntax",
2391 : .tp_doc = "krb5ccache_abstract_syntax()\n"PY_DOC_KRB5CCACHE_SYNTAX,
2392 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2393 : .tp_new = syntax_krb5ccache_new,
2394 : };
2395 :
2396 : static PyMethodDef krb5ccache_methods[] = {
2397 : { NULL, NULL, 0, NULL }
2398 : };
2399 :
2400 : static struct PyModuleDef moduledef = {
2401 : PyModuleDef_HEAD_INIT,
2402 : .m_name = "krb5ccache",
2403 : .m_doc = "krb5ccache DCE/RPC",
2404 : .m_size = -1,
2405 : .m_methods = krb5ccache_methods,
2406 : };
2407 68 : MODULE_INIT_FUNC(krb5ccache)
2408 : {
2409 68 : PyObject *m = NULL;
2410 68 : PyObject *dep_talloc = NULL;
2411 68 : PyObject *dep_samba_dcerpc_base = NULL;
2412 68 : PyObject *dep_samba_dcerpc_misc = NULL;
2413 :
2414 68 : dep_talloc = PyImport_ImportModule("talloc");
2415 68 : if (dep_talloc == NULL)
2416 0 : goto out;
2417 :
2418 68 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
2419 68 : if (dep_samba_dcerpc_base == NULL)
2420 0 : goto out;
2421 :
2422 68 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
2423 68 : if (dep_samba_dcerpc_misc == NULL)
2424 0 : goto out;
2425 :
2426 68 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
2427 68 : if (BaseObject_Type == NULL)
2428 0 : goto out;
2429 :
2430 68 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
2431 68 : if (ClientConnection_Type == NULL)
2432 0 : goto out;
2433 :
2434 68 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
2435 68 : if (ndr_syntax_id_Type == NULL)
2436 0 : goto out;
2437 :
2438 68 : PRINCIPAL_Type.tp_base = BaseObject_Type;
2439 68 : PRINCIPAL_Type.tp_basicsize = pytalloc_BaseObject_size();
2440 :
2441 68 : KEYBLOCK_Type.tp_base = BaseObject_Type;
2442 68 : KEYBLOCK_Type.tp_basicsize = pytalloc_BaseObject_size();
2443 :
2444 68 : ADDRESS_Type.tp_base = BaseObject_Type;
2445 68 : ADDRESS_Type.tp_basicsize = pytalloc_BaseObject_size();
2446 :
2447 68 : ADDRESSES_Type.tp_base = BaseObject_Type;
2448 68 : ADDRESSES_Type.tp_basicsize = pytalloc_BaseObject_size();
2449 :
2450 68 : AUTHDATUM_Type.tp_base = BaseObject_Type;
2451 68 : AUTHDATUM_Type.tp_basicsize = pytalloc_BaseObject_size();
2452 :
2453 68 : AUTHDATA_Type.tp_base = BaseObject_Type;
2454 68 : AUTHDATA_Type.tp_basicsize = pytalloc_BaseObject_size();
2455 :
2456 68 : CREDENTIAL_Type.tp_base = BaseObject_Type;
2457 68 : CREDENTIAL_Type.tp_basicsize = pytalloc_BaseObject_size();
2458 :
2459 68 : DELTATIME_TAG_Type.tp_base = BaseObject_Type;
2460 68 : DELTATIME_TAG_Type.tp_basicsize = pytalloc_BaseObject_size();
2461 :
2462 68 : FIELD_Type.tp_base = BaseObject_Type;
2463 68 : FIELD_Type.tp_basicsize = pytalloc_BaseObject_size();
2464 :
2465 68 : V4TAG_Type.tp_base = BaseObject_Type;
2466 68 : V4TAG_Type.tp_basicsize = pytalloc_BaseObject_size();
2467 :
2468 68 : V4TAGS_Type.tp_base = BaseObject_Type;
2469 68 : V4TAGS_Type.tp_basicsize = pytalloc_BaseObject_size();
2470 :
2471 68 : V4HEADER_Type.tp_base = BaseObject_Type;
2472 68 : V4HEADER_Type.tp_basicsize = pytalloc_BaseObject_size();
2473 :
2474 68 : OPTIONAL_HEADER_Type.tp_base = BaseObject_Type;
2475 68 : OPTIONAL_HEADER_Type.tp_basicsize = pytalloc_BaseObject_size();
2476 :
2477 68 : CCACHE_Type.tp_base = BaseObject_Type;
2478 68 : CCACHE_Type.tp_basicsize = pytalloc_BaseObject_size();
2479 :
2480 68 : MULTIPLE_CREDENTIALS_Type.tp_base = BaseObject_Type;
2481 68 : MULTIPLE_CREDENTIALS_Type.tp_basicsize = pytalloc_BaseObject_size();
2482 :
2483 68 : krb5ccache_InterfaceType.tp_base = ClientConnection_Type;
2484 :
2485 68 : krb5ccache_SyntaxType.tp_base = ndr_syntax_id_Type;
2486 68 : krb5ccache_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
2487 :
2488 68 : if (PyType_Ready(&PRINCIPAL_Type) < 0)
2489 0 : goto out;
2490 68 : if (PyType_Ready(&KEYBLOCK_Type) < 0)
2491 0 : goto out;
2492 68 : if (PyType_Ready(&ADDRESS_Type) < 0)
2493 0 : goto out;
2494 68 : if (PyType_Ready(&ADDRESSES_Type) < 0)
2495 0 : goto out;
2496 68 : if (PyType_Ready(&AUTHDATUM_Type) < 0)
2497 0 : goto out;
2498 68 : if (PyType_Ready(&AUTHDATA_Type) < 0)
2499 0 : goto out;
2500 68 : if (PyType_Ready(&CREDENTIAL_Type) < 0)
2501 0 : goto out;
2502 68 : if (PyType_Ready(&DELTATIME_TAG_Type) < 0)
2503 0 : goto out;
2504 68 : if (PyType_Ready(&FIELD_Type) < 0)
2505 0 : goto out;
2506 68 : if (PyType_Ready(&V4TAG_Type) < 0)
2507 0 : goto out;
2508 68 : if (PyType_Ready(&V4TAGS_Type) < 0)
2509 0 : goto out;
2510 68 : if (PyType_Ready(&V4HEADER_Type) < 0)
2511 0 : goto out;
2512 68 : if (PyType_Ready(&OPTIONAL_HEADER_Type) < 0)
2513 0 : goto out;
2514 68 : if (PyType_Ready(&CCACHE_Type) < 0)
2515 0 : goto out;
2516 68 : if (PyType_Ready(&MULTIPLE_CREDENTIALS_Type) < 0)
2517 0 : goto out;
2518 68 : if (PyType_Ready(&krb5ccache_InterfaceType) < 0)
2519 0 : goto out;
2520 68 : if (PyType_Ready(&krb5ccache_SyntaxType) < 0)
2521 0 : goto out;
2522 68 : if (!PyInterface_AddNdrRpcMethods(&krb5ccache_InterfaceType, py_ndr_krb5ccache_methods))
2523 0 : return NULL;
2524 :
2525 : #ifdef PY_PRINCIPAL_PATCH
2526 : PY_PRINCIPAL_PATCH(&PRINCIPAL_Type);
2527 : #endif
2528 : #ifdef PY_KEYBLOCK_PATCH
2529 : PY_KEYBLOCK_PATCH(&KEYBLOCK_Type);
2530 : #endif
2531 : #ifdef PY_ADDRESS_PATCH
2532 : PY_ADDRESS_PATCH(&ADDRESS_Type);
2533 : #endif
2534 : #ifdef PY_ADDRESSES_PATCH
2535 : PY_ADDRESSES_PATCH(&ADDRESSES_Type);
2536 : #endif
2537 : #ifdef PY_AUTHDATUM_PATCH
2538 : PY_AUTHDATUM_PATCH(&AUTHDATUM_Type);
2539 : #endif
2540 : #ifdef PY_AUTHDATA_PATCH
2541 : PY_AUTHDATA_PATCH(&AUTHDATA_Type);
2542 : #endif
2543 : #ifdef PY_CREDENTIAL_PATCH
2544 : PY_CREDENTIAL_PATCH(&CREDENTIAL_Type);
2545 : #endif
2546 : #ifdef PY_DELTATIME_TAG_PATCH
2547 : PY_DELTATIME_TAG_PATCH(&DELTATIME_TAG_Type);
2548 : #endif
2549 : #ifdef PY_FIELD_PATCH
2550 : PY_FIELD_PATCH(&FIELD_Type);
2551 : #endif
2552 : #ifdef PY_V4TAG_PATCH
2553 : PY_V4TAG_PATCH(&V4TAG_Type);
2554 : #endif
2555 : #ifdef PY_V4TAGS_PATCH
2556 : PY_V4TAGS_PATCH(&V4TAGS_Type);
2557 : #endif
2558 : #ifdef PY_V4HEADER_PATCH
2559 : PY_V4HEADER_PATCH(&V4HEADER_Type);
2560 : #endif
2561 : #ifdef PY_OPTIONAL_HEADER_PATCH
2562 : PY_OPTIONAL_HEADER_PATCH(&OPTIONAL_HEADER_Type);
2563 : #endif
2564 : #ifdef PY_CCACHE_PATCH
2565 : PY_CCACHE_PATCH(&CCACHE_Type);
2566 : #endif
2567 : #ifdef PY_MULTIPLE_CREDENTIALS_PATCH
2568 : PY_MULTIPLE_CREDENTIALS_PATCH(&MULTIPLE_CREDENTIALS_Type);
2569 : #endif
2570 : #ifdef PY_KRB5CCACHE_PATCH
2571 : PY_KRB5CCACHE_PATCH(&krb5ccache_InterfaceType);
2572 : #endif
2573 : #ifdef PY_KRB5CCACHE_ABSTRACT_SYNTAX_PATCH
2574 : PY_KRB5CCACHE_ABSTRACT_SYNTAX_PATCH(&krb5ccache_SyntaxType);
2575 : #endif
2576 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
2577 : PY_ABSTRACT_SYNTAX_PATCH(&krb5ccache_SyntaxType);
2578 : #endif
2579 :
2580 68 : m = PyModule_Create(&moduledef);
2581 68 : if (m == NULL)
2582 0 : goto out;
2583 :
2584 68 : Py_INCREF((PyObject *)(void *)&PRINCIPAL_Type);
2585 68 : PyModule_AddObject(m, "PRINCIPAL", (PyObject *)(void *)&PRINCIPAL_Type);
2586 68 : Py_INCREF((PyObject *)(void *)&KEYBLOCK_Type);
2587 68 : PyModule_AddObject(m, "KEYBLOCK", (PyObject *)(void *)&KEYBLOCK_Type);
2588 68 : Py_INCREF((PyObject *)(void *)&ADDRESS_Type);
2589 68 : PyModule_AddObject(m, "ADDRESS", (PyObject *)(void *)&ADDRESS_Type);
2590 68 : Py_INCREF((PyObject *)(void *)&ADDRESSES_Type);
2591 68 : PyModule_AddObject(m, "ADDRESSES", (PyObject *)(void *)&ADDRESSES_Type);
2592 68 : Py_INCREF((PyObject *)(void *)&AUTHDATUM_Type);
2593 68 : PyModule_AddObject(m, "AUTHDATUM", (PyObject *)(void *)&AUTHDATUM_Type);
2594 68 : Py_INCREF((PyObject *)(void *)&AUTHDATA_Type);
2595 68 : PyModule_AddObject(m, "AUTHDATA", (PyObject *)(void *)&AUTHDATA_Type);
2596 68 : Py_INCREF((PyObject *)(void *)&CREDENTIAL_Type);
2597 68 : PyModule_AddObject(m, "CREDENTIAL", (PyObject *)(void *)&CREDENTIAL_Type);
2598 68 : Py_INCREF((PyObject *)(void *)&DELTATIME_TAG_Type);
2599 68 : PyModule_AddObject(m, "DELTATIME_TAG", (PyObject *)(void *)&DELTATIME_TAG_Type);
2600 68 : Py_INCREF((PyObject *)(void *)&FIELD_Type);
2601 68 : PyModule_AddObject(m, "FIELD", (PyObject *)(void *)&FIELD_Type);
2602 68 : Py_INCREF((PyObject *)(void *)&V4TAG_Type);
2603 68 : PyModule_AddObject(m, "V4TAG", (PyObject *)(void *)&V4TAG_Type);
2604 68 : Py_INCREF((PyObject *)(void *)&V4TAGS_Type);
2605 68 : PyModule_AddObject(m, "V4TAGS", (PyObject *)(void *)&V4TAGS_Type);
2606 68 : Py_INCREF((PyObject *)(void *)&V4HEADER_Type);
2607 68 : PyModule_AddObject(m, "V4HEADER", (PyObject *)(void *)&V4HEADER_Type);
2608 68 : Py_INCREF((PyObject *)(void *)&OPTIONAL_HEADER_Type);
2609 68 : PyModule_AddObject(m, "OPTIONAL_HEADER", (PyObject *)(void *)&OPTIONAL_HEADER_Type);
2610 68 : Py_INCREF((PyObject *)(void *)&CCACHE_Type);
2611 68 : PyModule_AddObject(m, "CCACHE", (PyObject *)(void *)&CCACHE_Type);
2612 68 : Py_INCREF((PyObject *)(void *)&MULTIPLE_CREDENTIALS_Type);
2613 68 : PyModule_AddObject(m, "MULTIPLE_CREDENTIALS", (PyObject *)(void *)&MULTIPLE_CREDENTIALS_Type);
2614 68 : Py_INCREF((PyObject *)(void *)&krb5ccache_InterfaceType);
2615 68 : PyModule_AddObject(m, "krb5ccache", (PyObject *)(void *)&krb5ccache_InterfaceType);
2616 68 : Py_INCREF((PyObject *)(void *)&krb5ccache_SyntaxType);
2617 68 : PyModule_AddObject(m, "krb5ccache_abstract_syntax", (PyObject *)(void *)&krb5ccache_SyntaxType);
2618 68 : Py_INCREF((PyObject *)(void *)&krb5ccache_SyntaxType);
2619 68 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&krb5ccache_SyntaxType);
2620 : #ifdef PY_MOD_KRB5CCACHE_PATCH
2621 : PY_MOD_KRB5CCACHE_PATCH(m);
2622 : #endif
2623 68 : out:
2624 68 : Py_XDECREF(dep_talloc);
2625 68 : Py_XDECREF(dep_samba_dcerpc_base);
2626 68 : Py_XDECREF(dep_samba_dcerpc_misc);
2627 68 : return m;
2628 :
2629 : }
|