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