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_drsblobs.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 102945 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 102945 : switch (var_size) {
35 169 : case 8:
36 169 : return UINT64_MAX;
37 25788 : case 4:
38 25788 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 76988 : case 1:
42 76988 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 : switch (var_size) {
51 : case 8:
52 : return INT64_MAX;
53 : case 4:
54 : return INT32_MAX;
55 : case 2:
56 : return INT16_MAX;
57 : case 1:
58 : return INT8_MAX;
59 : }
60 :
61 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/drsuapi.h"
65 : #include "librpc/gen_ndr/misc.h"
66 : #include "librpc/gen_ndr/samr.h"
67 : #include "librpc/gen_ndr/lsa.h"
68 : #include "librpc/gen_ndr/security.h"
69 : static PyTypeObject replPropertyMetaData1_Type;
70 : static PyTypeObject replPropertyMetaDataCtr1_Type;
71 : static PyTypeObject replPropertyMetaDataCtr_Type;
72 : static PyTypeObject replPropertyMetaDataBlob_Type;
73 : static PyTypeObject replUpToDateVectorCtr1_Type;
74 : static PyTypeObject replUpToDateVectorCtr2_Type;
75 : static PyTypeObject replUpToDateVectorCtr_Type;
76 : static PyTypeObject replUpToDateVectorBlob_Type;
77 : static PyTypeObject repsFromTo1OtherInfo_Type;
78 : static PyTypeObject repsFromTo1_Type;
79 : static PyTypeObject repsFromTo2OtherInfo_Type;
80 : static PyTypeObject repsFromTo2_Type;
81 : static PyTypeObject repsFromTo_Type;
82 : static PyTypeObject repsFromToBlob_Type;
83 : static PyTypeObject scheduleHeader_Type;
84 : static PyTypeObject scheduleSlots_Type;
85 : static PyTypeObject schedule_Type;
86 : static PyTypeObject partialAttributeSetCtr1_Type;
87 : static PyTypeObject partialAttributeSetCtr_Type;
88 : static PyTypeObject partialAttributeSetBlob_Type;
89 : static PyTypeObject schemaInfoBlob_Type;
90 : static PyTypeObject drsuapi_MSPrefixMap_Entry_Type;
91 : static PyTypeObject drsuapi_MSPrefixMap_Ctr_Type;
92 : static PyTypeObject prefixMapCtr_Type;
93 : static PyTypeObject prefixMapBlob_Type;
94 : static PyTypeObject ldapControlDirSyncExtra_Type;
95 : static PyTypeObject ldapControlDirSyncBlob_Type;
96 : static PyTypeObject ldapControlDirSyncCookie_Type;
97 : static PyTypeObject supplementalCredentialsPackage_Type;
98 : static PyTypeObject supplementalCredentialsSubBlob_Type;
99 : static PyTypeObject supplementalCredentialsBlob_Type;
100 : static PyTypeObject package_PackagesBlob_Type;
101 : static PyTypeObject package_PrimaryKerberosString_Type;
102 : static PyTypeObject package_PrimaryKerberosKey3_Type;
103 : static PyTypeObject package_PrimaryKerberosCtr3_Type;
104 : static PyTypeObject package_PrimaryKerberosKey4_Type;
105 : static PyTypeObject package_PrimaryKerberosCtr4_Type;
106 : static PyTypeObject package_PrimaryKerberosCtr_Type;
107 : static PyTypeObject package_PrimaryKerberosBlob_Type;
108 : static PyTypeObject package_PrimaryCLEARTEXTBlob_Type;
109 : static PyTypeObject package_PrimaryWDigestHash_Type;
110 : static PyTypeObject package_PrimaryWDigestBlob_Type;
111 : static PyTypeObject package_PrimarySambaGPGBlob_Type;
112 : static PyTypeObject package_PrimaryUserPasswordValue_Type;
113 : static PyTypeObject package_PrimaryUserPasswordBlob_Type;
114 : static PyTypeObject AuthInfoNone_Type;
115 : static PyTypeObject AuthInfoNT4Owf_Type;
116 : static PyTypeObject AuthInfoClear_Type;
117 : static PyTypeObject AuthInfoVersion_Type;
118 : static PyTypeObject AuthInfo_Type;
119 : static PyTypeObject AuthenticationInformation_Type;
120 : static PyTypeObject AuthenticationInformationArray_Type;
121 : static PyTypeObject trustAuthInOutBlob_Type;
122 : static PyTypeObject trustDomainPasswords_Type;
123 : static PyTypeObject DsCompressedChunk_Type;
124 : static PyTypeObject ExtendedErrorAString_Type;
125 : static PyTypeObject ExtendedErrorUString_Type;
126 : static PyTypeObject ExtendedErrorBlob_Type;
127 : static PyTypeObject ExtendedErrorComputerNameU_Type;
128 : static PyTypeObject ExtendedErrorComputerName_Type;
129 : static PyTypeObject ExtendedErrorParamU_Type;
130 : static PyTypeObject ExtendedErrorParam_Type;
131 : static PyTypeObject ExtendedErrorInfo_Type;
132 : static PyTypeObject ExtendedErrorInfoPtr_Type;
133 : static PyTypeObject ForestTrustString_Type;
134 : static PyTypeObject ForestTrustDataDomainInfo_Type;
135 : static PyTypeObject ForestTrustDataBinaryData_Type;
136 : static PyTypeObject ForestTrustData_Type;
137 : static PyTypeObject ForestTrustInfoRecord_Type;
138 : static PyTypeObject ForestTrustInfoRecordArmor_Type;
139 : static PyTypeObject ForestTrustInfo_Type;
140 : static PyTypeObject PlaintextSecret_Type;
141 : static PyTypeObject EncryptedSecretHeader_Type;
142 : static PyTypeObject EncryptedSecret_Type;
143 : static PyTypeObject drsblobs_InterfaceType;
144 :
145 : static PyTypeObject *GUID_Type;
146 : static PyTypeObject *BaseObject_Type;
147 : static PyTypeObject *drsuapi_DsReplicaCursor_Type;
148 : static PyTypeObject *drsuapi_DsReplicaCursor2_Type;
149 : static PyTypeObject *drsuapi_DsReplicaHighWaterMark_Type;
150 : static PyTypeObject *drsuapi_DsReplicaOIDMapping_Ctr_Type;
151 : static PyTypeObject *samr_Password_Type;
152 : static PyTypeObject *dom_sid_Type;
153 : static PyTypeObject *ClientConnection_Type;
154 : static PyTypeObject *ndr_syntax_id_Type;
155 :
156 28526213 : static PyObject *py_replPropertyMetaData1_get_attid(PyObject *obj, void *closure)
157 : {
158 28526213 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(obj);
159 : PyObject *py_attid;
160 28526213 : py_attid = PyLong_FromUnsignedLongLong((uint32_t)object->attid);
161 28526213 : return py_attid;
162 : }
163 :
164 18 : static int py_replPropertyMetaData1_set_attid(PyObject *py_obj, PyObject *value, void *closure)
165 : {
166 18 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
167 18 : if (value == NULL) {
168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attid");
169 0 : return -1;
170 : }
171 : {
172 18 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attid));
173 18 : if (PyLong_Check(value)) {
174 : unsigned long long test_var;
175 18 : test_var = PyLong_AsUnsignedLongLong(value);
176 18 : if (PyErr_Occurred() != NULL) {
177 0 : return -1;
178 : }
179 18 : if (test_var > uint_max) {
180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
181 : PyLong_Type.tp_name, uint_max, test_var);
182 0 : return -1;
183 : }
184 18 : object->attid = 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 18 : return 0;
192 : }
193 :
194 3611 : static PyObject *py_replPropertyMetaData1_get_version(PyObject *obj, void *closure)
195 : {
196 3611 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(obj);
197 : PyObject *py_version;
198 3611 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
199 3611 : return py_version;
200 : }
201 :
202 52 : static int py_replPropertyMetaData1_set_version(PyObject *py_obj, PyObject *value, void *closure)
203 : {
204 52 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
205 52 : if (value == NULL) {
206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
207 0 : return -1;
208 : }
209 : {
210 52 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
211 52 : if (PyLong_Check(value)) {
212 : unsigned long long test_var;
213 52 : test_var = PyLong_AsUnsignedLongLong(value);
214 52 : if (PyErr_Occurred() != NULL) {
215 0 : return -1;
216 : }
217 52 : if (test_var > uint_max) {
218 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
219 : PyLong_Type.tp_name, uint_max, test_var);
220 0 : return -1;
221 : }
222 52 : object->version = test_var;
223 : } else {
224 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
225 : PyLong_Type.tp_name);
226 0 : return -1;
227 : }
228 : }
229 52 : return 0;
230 : }
231 :
232 67664 : static PyObject *py_replPropertyMetaData1_get_originating_change_time(PyObject *obj, void *closure)
233 : {
234 67664 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(obj);
235 : PyObject *py_originating_change_time;
236 67664 : py_originating_change_time = PyLong_FromUnsignedLongLong(object->originating_change_time);
237 67664 : return py_originating_change_time;
238 : }
239 :
240 49 : static int py_replPropertyMetaData1_set_originating_change_time(PyObject *py_obj, PyObject *value, void *closure)
241 : {
242 49 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
243 49 : if (value == NULL) {
244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->originating_change_time");
245 0 : return -1;
246 : }
247 : {
248 49 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->originating_change_time));
249 49 : if (PyLong_Check(value)) {
250 : unsigned long long test_var;
251 49 : test_var = PyLong_AsUnsignedLongLong(value);
252 49 : if (PyErr_Occurred() != NULL) {
253 0 : return -1;
254 : }
255 49 : if (test_var > uint_max) {
256 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
257 : PyLong_Type.tp_name, uint_max, test_var);
258 0 : return -1;
259 : }
260 49 : object->originating_change_time = test_var;
261 : } else {
262 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
263 : PyLong_Type.tp_name);
264 0 : return -1;
265 : }
266 : }
267 49 : return 0;
268 : }
269 :
270 8909502 : static PyObject *py_replPropertyMetaData1_get_originating_invocation_id(PyObject *obj, void *closure)
271 : {
272 8909502 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(obj);
273 : PyObject *py_originating_invocation_id;
274 8909502 : py_originating_invocation_id = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->originating_invocation_id);
275 8909502 : return py_originating_invocation_id;
276 : }
277 :
278 49 : static int py_replPropertyMetaData1_set_originating_invocation_id(PyObject *py_obj, PyObject *value, void *closure)
279 : {
280 49 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
281 49 : if (value == NULL) {
282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->originating_invocation_id");
283 0 : return -1;
284 : }
285 49 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
286 49 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
287 0 : PyErr_NoMemory();
288 0 : return -1;
289 : }
290 49 : object->originating_invocation_id = *(struct GUID *)pytalloc_get_ptr(value);
291 49 : return 0;
292 : }
293 :
294 107240 : static PyObject *py_replPropertyMetaData1_get_originating_usn(PyObject *obj, void *closure)
295 : {
296 107240 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(obj);
297 : PyObject *py_originating_usn;
298 107240 : py_originating_usn = PyLong_FromUnsignedLongLong(object->originating_usn);
299 107240 : return py_originating_usn;
300 : }
301 :
302 50 : static int py_replPropertyMetaData1_set_originating_usn(PyObject *py_obj, PyObject *value, void *closure)
303 : {
304 50 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
305 50 : if (value == NULL) {
306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->originating_usn");
307 0 : return -1;
308 : }
309 : {
310 50 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->originating_usn));
311 50 : if (PyLong_Check(value)) {
312 : unsigned long long test_var;
313 50 : test_var = PyLong_AsUnsignedLongLong(value);
314 50 : if (PyErr_Occurred() != NULL) {
315 0 : return -1;
316 : }
317 50 : if (test_var > uint_max) {
318 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
319 : PyLong_Type.tp_name, uint_max, test_var);
320 0 : return -1;
321 : }
322 50 : object->originating_usn = test_var;
323 : } else {
324 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
325 : PyLong_Type.tp_name);
326 0 : return -1;
327 : }
328 : }
329 50 : return 0;
330 : }
331 :
332 936306 : static PyObject *py_replPropertyMetaData1_get_local_usn(PyObject *obj, void *closure)
333 : {
334 936306 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(obj);
335 : PyObject *py_local_usn;
336 936306 : py_local_usn = PyLong_FromUnsignedLongLong(object->local_usn);
337 936306 : return py_local_usn;
338 : }
339 :
340 51 : static int py_replPropertyMetaData1_set_local_usn(PyObject *py_obj, PyObject *value, void *closure)
341 : {
342 51 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
343 51 : if (value == NULL) {
344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->local_usn");
345 0 : return -1;
346 : }
347 : {
348 51 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->local_usn));
349 51 : if (PyLong_Check(value)) {
350 : unsigned long long test_var;
351 51 : test_var = PyLong_AsUnsignedLongLong(value);
352 51 : if (PyErr_Occurred() != NULL) {
353 0 : return -1;
354 : }
355 51 : if (test_var > uint_max) {
356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
357 : PyLong_Type.tp_name, uint_max, test_var);
358 0 : return -1;
359 : }
360 51 : object->local_usn = test_var;
361 : } else {
362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
363 : PyLong_Type.tp_name);
364 0 : return -1;
365 : }
366 : }
367 51 : return 0;
368 : }
369 :
370 : static PyGetSetDef py_replPropertyMetaData1_getsetters[] = {
371 : {
372 : .name = discard_const_p(char, "attid"),
373 : .get = py_replPropertyMetaData1_get_attid,
374 : .set = py_replPropertyMetaData1_set_attid,
375 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsAttributeId")
376 : },
377 : {
378 : .name = discard_const_p(char, "version"),
379 : .get = py_replPropertyMetaData1_get_version,
380 : .set = py_replPropertyMetaData1_set_version,
381 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
382 : },
383 : {
384 : .name = discard_const_p(char, "originating_change_time"),
385 : .get = py_replPropertyMetaData1_get_originating_change_time,
386 : .set = py_replPropertyMetaData1_set_originating_change_time,
387 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_1sec")
388 : },
389 : {
390 : .name = discard_const_p(char, "originating_invocation_id"),
391 : .get = py_replPropertyMetaData1_get_originating_invocation_id,
392 : .set = py_replPropertyMetaData1_set_originating_invocation_id,
393 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
394 : },
395 : {
396 : .name = discard_const_p(char, "originating_usn"),
397 : .get = py_replPropertyMetaData1_get_originating_usn,
398 : .set = py_replPropertyMetaData1_set_originating_usn,
399 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
400 : },
401 : {
402 : .name = discard_const_p(char, "local_usn"),
403 : .get = py_replPropertyMetaData1_get_local_usn,
404 : .set = py_replPropertyMetaData1_set_local_usn,
405 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
406 : },
407 : { .name = NULL }
408 : };
409 :
410 55 : static PyObject *py_replPropertyMetaData1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
411 : {
412 55 : return pytalloc_new(struct replPropertyMetaData1, type);
413 : }
414 :
415 0 : static PyObject *py_replPropertyMetaData1_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
416 : {
417 0 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
418 0 : PyObject *ret = NULL;
419 : DATA_BLOB blob;
420 : enum ndr_err_code err;
421 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
422 0 : if (tmp_ctx == NULL) {
423 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
424 0 : return NULL;
425 : }
426 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaData1);
427 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
428 0 : TALLOC_FREE(tmp_ctx);
429 0 : PyErr_SetNdrError(err);
430 0 : return NULL;
431 : }
432 :
433 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
434 0 : TALLOC_FREE(tmp_ctx);
435 0 : return ret;
436 : }
437 :
438 55 : static PyObject *py_replPropertyMetaData1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
439 : {
440 55 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
441 55 : DATA_BLOB blob = {.data = NULL, .length = 0};
442 55 : Py_ssize_t blob_length = 0;
443 : enum ndr_err_code err;
444 55 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
445 55 : PyObject *allow_remaining_obj = NULL;
446 55 : bool allow_remaining = false;
447 :
448 55 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
449 : discard_const_p(char *, kwnames),
450 : &blob.data, &blob_length,
451 : &allow_remaining_obj)) {
452 0 : return NULL;
453 : }
454 55 : blob.length = blob_length;
455 :
456 55 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
457 0 : allow_remaining = true;
458 : }
459 :
460 55 : if (allow_remaining) {
461 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaData1);
462 : } else {
463 55 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaData1);
464 : }
465 55 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
466 0 : PyErr_SetNdrError(err);
467 0 : return NULL;
468 : }
469 :
470 55 : Py_RETURN_NONE;
471 : }
472 :
473 0 : static PyObject *py_replPropertyMetaData1_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
474 : {
475 0 : struct replPropertyMetaData1 *object = (struct replPropertyMetaData1 *)pytalloc_get_ptr(py_obj);
476 : PyObject *ret;
477 : char *retstr;
478 :
479 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_replPropertyMetaData1, "replPropertyMetaData1", object);
480 0 : ret = PyUnicode_FromString(retstr);
481 0 : talloc_free(retstr);
482 :
483 0 : return ret;
484 : }
485 :
486 : static PyMethodDef py_replPropertyMetaData1_methods[] = {
487 : { "__ndr_pack__", (PyCFunction)py_replPropertyMetaData1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
488 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replPropertyMetaData1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
489 : { "__ndr_print__", (PyCFunction)py_replPropertyMetaData1_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
490 : { NULL, NULL, 0, NULL }
491 : };
492 :
493 :
494 : static PyTypeObject replPropertyMetaData1_Type = {
495 : PyVarObject_HEAD_INIT(NULL, 0)
496 : .tp_name = "drsblobs.replPropertyMetaData1",
497 : .tp_getset = py_replPropertyMetaData1_getsetters,
498 : .tp_methods = py_replPropertyMetaData1_methods,
499 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
500 : .tp_new = py_replPropertyMetaData1_new,
501 : };
502 :
503 :
504 126 : static PyObject *py_replPropertyMetaDataCtr1_get_count(PyObject *obj, void *closure)
505 : {
506 126 : struct replPropertyMetaDataCtr1 *object = (struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(obj);
507 : PyObject *py_count;
508 126 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
509 126 : return py_count;
510 : }
511 :
512 23549 : static int py_replPropertyMetaDataCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
513 : {
514 23549 : struct replPropertyMetaDataCtr1 *object = (struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(py_obj);
515 23549 : if (value == NULL) {
516 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
517 0 : return -1;
518 : }
519 : {
520 23549 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
521 23549 : if (PyLong_Check(value)) {
522 : unsigned long long test_var;
523 23549 : test_var = PyLong_AsUnsignedLongLong(value);
524 23549 : if (PyErr_Occurred() != NULL) {
525 0 : return -1;
526 : }
527 23549 : if (test_var > uint_max) {
528 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
529 : PyLong_Type.tp_name, uint_max, test_var);
530 0 : return -1;
531 : }
532 23549 : object->count = test_var;
533 : } else {
534 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
535 : PyLong_Type.tp_name);
536 0 : return -1;
537 : }
538 : }
539 23549 : return 0;
540 : }
541 :
542 0 : static PyObject *py_replPropertyMetaDataCtr1_get_reserved(PyObject *obj, void *closure)
543 : {
544 0 : struct replPropertyMetaDataCtr1 *object = (struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(obj);
545 : PyObject *py_reserved;
546 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
547 0 : return py_reserved;
548 : }
549 :
550 0 : static int py_replPropertyMetaDataCtr1_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
551 : {
552 0 : struct replPropertyMetaDataCtr1 *object = (struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(py_obj);
553 0 : if (value == NULL) {
554 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
555 0 : return -1;
556 : }
557 : {
558 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
559 0 : if (PyLong_Check(value)) {
560 : unsigned long long test_var;
561 0 : test_var = PyLong_AsUnsignedLongLong(value);
562 0 : if (PyErr_Occurred() != NULL) {
563 0 : return -1;
564 : }
565 0 : if (test_var > uint_max) {
566 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
567 : PyLong_Type.tp_name, uint_max, test_var);
568 0 : return -1;
569 : }
570 0 : object->reserved = test_var;
571 : } else {
572 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
573 : PyLong_Type.tp_name);
574 0 : return -1;
575 : }
576 : }
577 0 : return 0;
578 : }
579 :
580 1286825 : static PyObject *py_replPropertyMetaDataCtr1_get_array(PyObject *obj, void *closure)
581 : {
582 1286825 : struct replPropertyMetaDataCtr1 *object = (struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(obj);
583 : PyObject *py_array;
584 1286825 : py_array = PyList_New(object->count);
585 1286825 : if (py_array == NULL) {
586 0 : return NULL;
587 : }
588 : {
589 : int array_cntr_0;
590 21447720 : for (array_cntr_0 = 0; array_cntr_0 < (object->count); array_cntr_0++) {
591 : PyObject *py_array_0;
592 20160895 : py_array_0 = pytalloc_reference_ex(&replPropertyMetaData1_Type, object->array, &object->array[array_cntr_0]);
593 20160895 : PyList_SetItem(py_array, array_cntr_0, py_array_0);
594 : }
595 : }
596 1286825 : return py_array;
597 : }
598 :
599 47099 : static int py_replPropertyMetaDataCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
600 : {
601 47099 : struct replPropertyMetaDataCtr1 *object = (struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(py_obj);
602 47099 : if (value == NULL) {
603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
604 0 : return -1;
605 : }
606 47099 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
607 : {
608 : int array_cntr_0;
609 47099 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
610 47099 : if (!object->array) { return -1;; }
611 47099 : talloc_set_name_const(object->array, "ARRAY: object->array");
612 793863 : for (array_cntr_0 = 0; array_cntr_0 < PyList_GET_SIZE(value); array_cntr_0++) {
613 746764 : if (PyList_GET_ITEM(value, array_cntr_0) == NULL) {
614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_0]");
615 0 : return -1;
616 : }
617 746764 : PY_CHECK_TYPE(&replPropertyMetaData1_Type, PyList_GET_ITEM(value, array_cntr_0), return -1;);
618 746764 : if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_0))) == NULL) {
619 0 : PyErr_NoMemory();
620 0 : return -1;
621 : }
622 746764 : object->array[array_cntr_0] = *(struct replPropertyMetaData1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_0));
623 : }
624 : }
625 47099 : return 0;
626 : }
627 :
628 : static PyGetSetDef py_replPropertyMetaDataCtr1_getsetters[] = {
629 : {
630 : .name = discard_const_p(char, "count"),
631 : .get = py_replPropertyMetaDataCtr1_get_count,
632 : .set = py_replPropertyMetaDataCtr1_set_count,
633 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
634 : },
635 : {
636 : .name = discard_const_p(char, "reserved"),
637 : .get = py_replPropertyMetaDataCtr1_get_reserved,
638 : .set = py_replPropertyMetaDataCtr1_set_reserved,
639 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
640 : },
641 : {
642 : .name = discard_const_p(char, "array"),
643 : .get = py_replPropertyMetaDataCtr1_get_array,
644 : .set = py_replPropertyMetaDataCtr1_set_array,
645 : .doc = discard_const_p(char, "PIDL-generated element of base type replPropertyMetaData1")
646 : },
647 : { .name = NULL }
648 : };
649 :
650 0 : static PyObject *py_replPropertyMetaDataCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
651 : {
652 0 : return pytalloc_new(struct replPropertyMetaDataCtr1, type);
653 : }
654 :
655 :
656 : static PyTypeObject replPropertyMetaDataCtr1_Type = {
657 : PyVarObject_HEAD_INIT(NULL, 0)
658 : .tp_name = "drsblobs.replPropertyMetaDataCtr1",
659 : .tp_getset = py_replPropertyMetaDataCtr1_getsetters,
660 : .tp_methods = NULL,
661 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
662 : .tp_new = py_replPropertyMetaDataCtr1_new,
663 : };
664 :
665 1239860 : static PyObject *py_import_replPropertyMetaDataCtr(TALLOC_CTX *mem_ctx, int level, union replPropertyMetaDataCtr *in)
666 : {
667 : PyObject *ret;
668 :
669 1239860 : switch (level) {
670 1239860 : case 1:
671 1239860 : ret = pytalloc_reference_ex(&replPropertyMetaDataCtr1_Type, mem_ctx, &in->ctr1);
672 1239860 : return ret;
673 :
674 : }
675 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
676 0 : return NULL;
677 : }
678 :
679 0 : static union replPropertyMetaDataCtr *py_export_replPropertyMetaDataCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
680 : {
681 0 : union replPropertyMetaDataCtr *ret = talloc_zero(mem_ctx, union replPropertyMetaDataCtr);
682 0 : switch (level) {
683 0 : case 1:
684 0 : if (in == NULL) {
685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
686 0 : talloc_free(ret); return NULL;
687 : }
688 0 : PY_CHECK_TYPE(&replPropertyMetaDataCtr1_Type, in, talloc_free(ret); return NULL;);
689 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
690 0 : PyErr_NoMemory();
691 0 : talloc_free(ret); return NULL;
692 : }
693 0 : ret->ctr1 = *(struct replPropertyMetaDataCtr1 *)pytalloc_get_ptr(in);
694 0 : break;
695 :
696 0 : default:
697 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
698 0 : talloc_free(ret);
699 0 : ret = NULL;
700 : }
701 :
702 0 : return ret;
703 : }
704 :
705 1239860 : static PyObject *py_replPropertyMetaDataCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
706 : {
707 1239860 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
708 1239860 : PyObject *mem_ctx_obj = NULL;
709 1239860 : TALLOC_CTX *mem_ctx = NULL;
710 1239860 : int level = 0;
711 1239860 : PyObject *in_obj = NULL;
712 1239860 : union replPropertyMetaDataCtr *in = NULL;
713 :
714 1239860 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
715 : discard_const_p(char *, kwnames),
716 : &mem_ctx_obj,
717 : &level,
718 : &in_obj)) {
719 0 : return NULL;
720 : }
721 1239860 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
722 1239860 : if (mem_ctx == NULL) {
723 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
724 0 : return NULL;
725 : }
726 1239860 : in = (union replPropertyMetaDataCtr *)pytalloc_get_ptr(in_obj);
727 1239860 : if (in == NULL) {
728 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union replPropertyMetaDataCtr!");
729 0 : return NULL;
730 : }
731 :
732 1239860 : return py_import_replPropertyMetaDataCtr(mem_ctx, level, in);
733 : }
734 :
735 0 : static PyObject *py_replPropertyMetaDataCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
736 : {
737 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
738 0 : PyObject *mem_ctx_obj = NULL;
739 0 : TALLOC_CTX *mem_ctx = NULL;
740 0 : int level = 0;
741 0 : PyObject *in = NULL;
742 0 : union replPropertyMetaDataCtr *out = NULL;
743 :
744 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
745 : discard_const_p(char *, kwnames),
746 : &mem_ctx_obj,
747 : &level,
748 : &in)) {
749 0 : return NULL;
750 : }
751 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
752 0 : if (mem_ctx == NULL) {
753 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
754 0 : return NULL;
755 : }
756 :
757 0 : out = py_export_replPropertyMetaDataCtr(mem_ctx, level, in);
758 0 : if (out == NULL) {
759 0 : return NULL;
760 : }
761 :
762 0 : return pytalloc_GenericObject_reference(out);
763 : }
764 :
765 : static PyMethodDef py_replPropertyMetaDataCtr_methods[] = {
766 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replPropertyMetaDataCtr_import),
767 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
768 : "T.__import__(mem_ctx, level, in) => ret." },
769 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replPropertyMetaDataCtr_export),
770 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
771 : "T.__export__(mem_ctx, level, in) => ret." },
772 : { NULL, NULL, 0, NULL }
773 : };
774 :
775 0 : static PyObject *py_replPropertyMetaDataCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
776 : {
777 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
778 0 : return NULL;
779 : }
780 :
781 :
782 : static PyTypeObject replPropertyMetaDataCtr_Type = {
783 : PyVarObject_HEAD_INIT(NULL, 0)
784 : .tp_name = "drsblobs.replPropertyMetaDataCtr",
785 : .tp_getset = NULL,
786 : .tp_methods = py_replPropertyMetaDataCtr_methods,
787 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
788 : .tp_new = py_replPropertyMetaDataCtr_new,
789 : };
790 :
791 :
792 0 : static PyObject *py_replPropertyMetaDataBlob_get_version(PyObject *obj, void *closure)
793 : {
794 0 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(obj);
795 : PyObject *py_version;
796 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
797 0 : return py_version;
798 : }
799 :
800 0 : static int py_replPropertyMetaDataBlob_set_version(PyObject *py_obj, PyObject *value, void *closure)
801 : {
802 0 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(py_obj);
803 0 : if (value == NULL) {
804 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
805 0 : return -1;
806 : }
807 : {
808 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
809 0 : if (PyLong_Check(value)) {
810 : unsigned long long test_var;
811 0 : test_var = PyLong_AsUnsignedLongLong(value);
812 0 : if (PyErr_Occurred() != NULL) {
813 0 : return -1;
814 : }
815 0 : if (test_var > uint_max) {
816 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
817 : PyLong_Type.tp_name, uint_max, test_var);
818 0 : return -1;
819 : }
820 0 : object->version = test_var;
821 : } else {
822 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
823 : PyLong_Type.tp_name);
824 0 : return -1;
825 : }
826 : }
827 0 : return 0;
828 : }
829 :
830 0 : static PyObject *py_replPropertyMetaDataBlob_get_reserved(PyObject *obj, void *closure)
831 : {
832 0 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(obj);
833 : PyObject *py_reserved;
834 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
835 0 : return py_reserved;
836 : }
837 :
838 0 : static int py_replPropertyMetaDataBlob_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
839 : {
840 0 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(py_obj);
841 0 : if (value == NULL) {
842 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
843 0 : return -1;
844 : }
845 : {
846 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
847 0 : if (PyLong_Check(value)) {
848 : unsigned long long test_var;
849 0 : test_var = PyLong_AsUnsignedLongLong(value);
850 0 : if (PyErr_Occurred() != NULL) {
851 0 : return -1;
852 : }
853 0 : if (test_var > uint_max) {
854 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
855 : PyLong_Type.tp_name, uint_max, test_var);
856 0 : return -1;
857 : }
858 0 : object->reserved = test_var;
859 : } else {
860 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
861 : PyLong_Type.tp_name);
862 0 : return -1;
863 : }
864 : }
865 0 : return 0;
866 : }
867 :
868 1239860 : static PyObject *py_replPropertyMetaDataBlob_get_ctr(PyObject *obj, void *closure)
869 : {
870 1239860 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(obj);
871 : PyObject *py_ctr;
872 1239860 : py_ctr = pyrpc_import_union(&replPropertyMetaDataCtr_Type, pytalloc_get_mem_ctx(obj), object->version, &object->ctr, "union replPropertyMetaDataCtr");
873 1239860 : if (py_ctr == NULL) {
874 0 : return NULL;
875 : }
876 1239860 : return py_ctr;
877 : }
878 :
879 0 : static int py_replPropertyMetaDataBlob_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
880 : {
881 0 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(py_obj);
882 0 : if (value == NULL) {
883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
884 0 : return -1;
885 : }
886 : {
887 : union replPropertyMetaDataCtr *ctr_switch_0;
888 0 : ctr_switch_0 = (union replPropertyMetaDataCtr *)pyrpc_export_union(&replPropertyMetaDataCtr_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union replPropertyMetaDataCtr");
889 0 : if (ctr_switch_0 == NULL) {
890 0 : return -1;
891 : }
892 0 : object->ctr = *ctr_switch_0;
893 : }
894 0 : return 0;
895 : }
896 :
897 : static PyGetSetDef py_replPropertyMetaDataBlob_getsetters[] = {
898 : {
899 : .name = discard_const_p(char, "version"),
900 : .get = py_replPropertyMetaDataBlob_get_version,
901 : .set = py_replPropertyMetaDataBlob_set_version,
902 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
903 : },
904 : {
905 : .name = discard_const_p(char, "reserved"),
906 : .get = py_replPropertyMetaDataBlob_get_reserved,
907 : .set = py_replPropertyMetaDataBlob_set_reserved,
908 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
909 : },
910 : {
911 : .name = discard_const_p(char, "ctr"),
912 : .get = py_replPropertyMetaDataBlob_get_ctr,
913 : .set = py_replPropertyMetaDataBlob_set_ctr,
914 : .doc = discard_const_p(char, "PIDL-generated element of base type replPropertyMetaDataCtr")
915 : },
916 : { .name = NULL }
917 : };
918 :
919 1204573 : static PyObject *py_replPropertyMetaDataBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
920 : {
921 1204573 : return pytalloc_new(struct replPropertyMetaDataBlob, type);
922 : }
923 :
924 23569 : static PyObject *py_replPropertyMetaDataBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
925 : {
926 23569 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(py_obj);
927 23569 : PyObject *ret = NULL;
928 : DATA_BLOB blob;
929 : enum ndr_err_code err;
930 23569 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
931 23569 : if (tmp_ctx == NULL) {
932 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
933 0 : return NULL;
934 : }
935 23569 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob);
936 23569 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
937 0 : TALLOC_FREE(tmp_ctx);
938 0 : PyErr_SetNdrError(err);
939 0 : return NULL;
940 : }
941 :
942 23569 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
943 23569 : TALLOC_FREE(tmp_ctx);
944 23569 : return ret;
945 : }
946 :
947 1204573 : static PyObject *py_replPropertyMetaDataBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
948 : {
949 1204573 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(py_obj);
950 1204573 : DATA_BLOB blob = {.data = NULL, .length = 0};
951 1204573 : Py_ssize_t blob_length = 0;
952 : enum ndr_err_code err;
953 1204573 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
954 1204573 : PyObject *allow_remaining_obj = NULL;
955 1204573 : bool allow_remaining = false;
956 :
957 1204573 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
958 : discard_const_p(char *, kwnames),
959 : &blob.data, &blob_length,
960 : &allow_remaining_obj)) {
961 0 : return NULL;
962 : }
963 1204573 : blob.length = blob_length;
964 :
965 1204573 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
966 0 : allow_remaining = true;
967 : }
968 :
969 1204573 : if (allow_remaining) {
970 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob);
971 : } else {
972 1204573 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob);
973 : }
974 1204573 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
975 0 : PyErr_SetNdrError(err);
976 0 : return NULL;
977 : }
978 :
979 1204573 : Py_RETURN_NONE;
980 : }
981 :
982 288 : static PyObject *py_replPropertyMetaDataBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
983 : {
984 288 : struct replPropertyMetaDataBlob *object = (struct replPropertyMetaDataBlob *)pytalloc_get_ptr(py_obj);
985 : PyObject *ret;
986 : char *retstr;
987 :
988 288 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_replPropertyMetaDataBlob, "replPropertyMetaDataBlob", object);
989 288 : ret = PyUnicode_FromString(retstr);
990 288 : talloc_free(retstr);
991 :
992 288 : return ret;
993 : }
994 :
995 : static PyMethodDef py_replPropertyMetaDataBlob_methods[] = {
996 : { "__ndr_pack__", (PyCFunction)py_replPropertyMetaDataBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
997 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replPropertyMetaDataBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
998 : { "__ndr_print__", (PyCFunction)py_replPropertyMetaDataBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
999 : { NULL, NULL, 0, NULL }
1000 : };
1001 :
1002 :
1003 : static PyTypeObject replPropertyMetaDataBlob_Type = {
1004 : PyVarObject_HEAD_INIT(NULL, 0)
1005 : .tp_name = "drsblobs.replPropertyMetaDataBlob",
1006 : .tp_getset = py_replPropertyMetaDataBlob_getsetters,
1007 : .tp_methods = py_replPropertyMetaDataBlob_methods,
1008 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1009 : .tp_new = py_replPropertyMetaDataBlob_new,
1010 : };
1011 :
1012 :
1013 0 : static PyObject *py_replUpToDateVectorCtr1_get_count(PyObject *obj, void *closure)
1014 : {
1015 0 : struct replUpToDateVectorCtr1 *object = (struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(obj);
1016 : PyObject *py_count;
1017 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
1018 0 : return py_count;
1019 : }
1020 :
1021 0 : static int py_replUpToDateVectorCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
1022 : {
1023 0 : struct replUpToDateVectorCtr1 *object = (struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(py_obj);
1024 0 : if (value == NULL) {
1025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
1026 0 : return -1;
1027 : }
1028 : {
1029 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
1030 0 : if (PyLong_Check(value)) {
1031 : unsigned long long test_var;
1032 0 : test_var = PyLong_AsUnsignedLongLong(value);
1033 0 : if (PyErr_Occurred() != NULL) {
1034 0 : return -1;
1035 : }
1036 0 : if (test_var > uint_max) {
1037 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1038 : PyLong_Type.tp_name, uint_max, test_var);
1039 0 : return -1;
1040 : }
1041 0 : object->count = test_var;
1042 : } else {
1043 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1044 : PyLong_Type.tp_name);
1045 0 : return -1;
1046 : }
1047 : }
1048 0 : return 0;
1049 : }
1050 :
1051 0 : static PyObject *py_replUpToDateVectorCtr1_get_reserved(PyObject *obj, void *closure)
1052 : {
1053 0 : struct replUpToDateVectorCtr1 *object = (struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(obj);
1054 : PyObject *py_reserved;
1055 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
1056 0 : return py_reserved;
1057 : }
1058 :
1059 0 : static int py_replUpToDateVectorCtr1_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
1060 : {
1061 0 : struct replUpToDateVectorCtr1 *object = (struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(py_obj);
1062 0 : if (value == NULL) {
1063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
1064 0 : return -1;
1065 : }
1066 : {
1067 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
1068 0 : if (PyLong_Check(value)) {
1069 : unsigned long long test_var;
1070 0 : test_var = PyLong_AsUnsignedLongLong(value);
1071 0 : if (PyErr_Occurred() != NULL) {
1072 0 : return -1;
1073 : }
1074 0 : if (test_var > uint_max) {
1075 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1076 : PyLong_Type.tp_name, uint_max, test_var);
1077 0 : return -1;
1078 : }
1079 0 : object->reserved = test_var;
1080 : } else {
1081 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1082 : PyLong_Type.tp_name);
1083 0 : return -1;
1084 : }
1085 : }
1086 0 : return 0;
1087 : }
1088 :
1089 0 : static PyObject *py_replUpToDateVectorCtr1_get_cursors(PyObject *obj, void *closure)
1090 : {
1091 0 : struct replUpToDateVectorCtr1 *object = (struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(obj);
1092 : PyObject *py_cursors;
1093 0 : py_cursors = PyList_New(object->count);
1094 0 : if (py_cursors == NULL) {
1095 0 : return NULL;
1096 : }
1097 : {
1098 : int cursors_cntr_0;
1099 0 : for (cursors_cntr_0 = 0; cursors_cntr_0 < (object->count); cursors_cntr_0++) {
1100 : PyObject *py_cursors_0;
1101 0 : py_cursors_0 = pytalloc_reference_ex(drsuapi_DsReplicaCursor_Type, object->cursors, &object->cursors[cursors_cntr_0]);
1102 0 : PyList_SetItem(py_cursors, cursors_cntr_0, py_cursors_0);
1103 : }
1104 : }
1105 0 : return py_cursors;
1106 : }
1107 :
1108 0 : static int py_replUpToDateVectorCtr1_set_cursors(PyObject *py_obj, PyObject *value, void *closure)
1109 : {
1110 0 : struct replUpToDateVectorCtr1 *object = (struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(py_obj);
1111 0 : if (value == NULL) {
1112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cursors");
1113 0 : return -1;
1114 : }
1115 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1116 : {
1117 : int cursors_cntr_0;
1118 0 : object->cursors = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->cursors, PyList_GET_SIZE(value));
1119 0 : if (!object->cursors) { return -1;; }
1120 0 : talloc_set_name_const(object->cursors, "ARRAY: object->cursors");
1121 0 : for (cursors_cntr_0 = 0; cursors_cntr_0 < PyList_GET_SIZE(value); cursors_cntr_0++) {
1122 0 : if (PyList_GET_ITEM(value, cursors_cntr_0) == NULL) {
1123 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cursors[cursors_cntr_0]");
1124 0 : return -1;
1125 : }
1126 0 : PY_CHECK_TYPE(drsuapi_DsReplicaCursor_Type, PyList_GET_ITEM(value, cursors_cntr_0), return -1;);
1127 0 : if (talloc_reference(object->cursors, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, cursors_cntr_0))) == NULL) {
1128 0 : PyErr_NoMemory();
1129 0 : return -1;
1130 : }
1131 0 : object->cursors[cursors_cntr_0] = *(struct drsuapi_DsReplicaCursor *)pytalloc_get_ptr(PyList_GET_ITEM(value, cursors_cntr_0));
1132 : }
1133 : }
1134 0 : return 0;
1135 : }
1136 :
1137 : static PyGetSetDef py_replUpToDateVectorCtr1_getsetters[] = {
1138 : {
1139 : .name = discard_const_p(char, "count"),
1140 : .get = py_replUpToDateVectorCtr1_get_count,
1141 : .set = py_replUpToDateVectorCtr1_set_count,
1142 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1143 : },
1144 : {
1145 : .name = discard_const_p(char, "reserved"),
1146 : .get = py_replUpToDateVectorCtr1_get_reserved,
1147 : .set = py_replUpToDateVectorCtr1_set_reserved,
1148 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1149 : },
1150 : {
1151 : .name = discard_const_p(char, "cursors"),
1152 : .get = py_replUpToDateVectorCtr1_get_cursors,
1153 : .set = py_replUpToDateVectorCtr1_set_cursors,
1154 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsReplicaCursor")
1155 : },
1156 : { .name = NULL }
1157 : };
1158 :
1159 0 : static PyObject *py_replUpToDateVectorCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1160 : {
1161 0 : return pytalloc_new(struct replUpToDateVectorCtr1, type);
1162 : }
1163 :
1164 :
1165 : static PyTypeObject replUpToDateVectorCtr1_Type = {
1166 : PyVarObject_HEAD_INIT(NULL, 0)
1167 : .tp_name = "drsblobs.replUpToDateVectorCtr1",
1168 : .tp_getset = py_replUpToDateVectorCtr1_getsetters,
1169 : .tp_methods = NULL,
1170 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1171 : .tp_new = py_replUpToDateVectorCtr1_new,
1172 : };
1173 :
1174 :
1175 0 : static PyObject *py_replUpToDateVectorCtr2_get_count(PyObject *obj, void *closure)
1176 : {
1177 0 : struct replUpToDateVectorCtr2 *object = (struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(obj);
1178 : PyObject *py_count;
1179 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
1180 0 : return py_count;
1181 : }
1182 :
1183 35 : static int py_replUpToDateVectorCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure)
1184 : {
1185 35 : struct replUpToDateVectorCtr2 *object = (struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(py_obj);
1186 35 : if (value == NULL) {
1187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
1188 0 : return -1;
1189 : }
1190 : {
1191 35 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
1192 35 : if (PyLong_Check(value)) {
1193 : unsigned long long test_var;
1194 35 : test_var = PyLong_AsUnsignedLongLong(value);
1195 35 : if (PyErr_Occurred() != NULL) {
1196 0 : return -1;
1197 : }
1198 35 : if (test_var > uint_max) {
1199 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1200 : PyLong_Type.tp_name, uint_max, test_var);
1201 0 : return -1;
1202 : }
1203 35 : object->count = test_var;
1204 : } else {
1205 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1206 : PyLong_Type.tp_name);
1207 0 : return -1;
1208 : }
1209 : }
1210 35 : return 0;
1211 : }
1212 :
1213 0 : static PyObject *py_replUpToDateVectorCtr2_get_reserved(PyObject *obj, void *closure)
1214 : {
1215 0 : struct replUpToDateVectorCtr2 *object = (struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(obj);
1216 : PyObject *py_reserved;
1217 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
1218 0 : return py_reserved;
1219 : }
1220 :
1221 0 : static int py_replUpToDateVectorCtr2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
1222 : {
1223 0 : struct replUpToDateVectorCtr2 *object = (struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(py_obj);
1224 0 : if (value == NULL) {
1225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
1226 0 : return -1;
1227 : }
1228 : {
1229 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
1230 0 : if (PyLong_Check(value)) {
1231 : unsigned long long test_var;
1232 0 : test_var = PyLong_AsUnsignedLongLong(value);
1233 0 : if (PyErr_Occurred() != NULL) {
1234 0 : return -1;
1235 : }
1236 0 : if (test_var > uint_max) {
1237 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1238 : PyLong_Type.tp_name, uint_max, test_var);
1239 0 : return -1;
1240 : }
1241 0 : object->reserved = test_var;
1242 : } else {
1243 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1244 : PyLong_Type.tp_name);
1245 0 : return -1;
1246 : }
1247 : }
1248 0 : return 0;
1249 : }
1250 :
1251 42 : static PyObject *py_replUpToDateVectorCtr2_get_cursors(PyObject *obj, void *closure)
1252 : {
1253 42 : struct replUpToDateVectorCtr2 *object = (struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(obj);
1254 : PyObject *py_cursors;
1255 42 : py_cursors = PyList_New(object->count);
1256 42 : if (py_cursors == NULL) {
1257 0 : return NULL;
1258 : }
1259 : {
1260 : int cursors_cntr_0;
1261 84 : for (cursors_cntr_0 = 0; cursors_cntr_0 < (object->count); cursors_cntr_0++) {
1262 : PyObject *py_cursors_0;
1263 42 : py_cursors_0 = pytalloc_reference_ex(drsuapi_DsReplicaCursor2_Type, object->cursors, &object->cursors[cursors_cntr_0]);
1264 42 : PyList_SetItem(py_cursors, cursors_cntr_0, py_cursors_0);
1265 : }
1266 : }
1267 42 : return py_cursors;
1268 : }
1269 :
1270 35 : static int py_replUpToDateVectorCtr2_set_cursors(PyObject *py_obj, PyObject *value, void *closure)
1271 : {
1272 35 : struct replUpToDateVectorCtr2 *object = (struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(py_obj);
1273 35 : if (value == NULL) {
1274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cursors");
1275 0 : return -1;
1276 : }
1277 35 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1278 : {
1279 : int cursors_cntr_0;
1280 35 : object->cursors = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->cursors, PyList_GET_SIZE(value));
1281 35 : if (!object->cursors) { return -1;; }
1282 35 : talloc_set_name_const(object->cursors, "ARRAY: object->cursors");
1283 85 : for (cursors_cntr_0 = 0; cursors_cntr_0 < PyList_GET_SIZE(value); cursors_cntr_0++) {
1284 50 : if (PyList_GET_ITEM(value, cursors_cntr_0) == NULL) {
1285 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cursors[cursors_cntr_0]");
1286 0 : return -1;
1287 : }
1288 50 : PY_CHECK_TYPE(drsuapi_DsReplicaCursor2_Type, PyList_GET_ITEM(value, cursors_cntr_0), return -1;);
1289 50 : if (talloc_reference(object->cursors, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, cursors_cntr_0))) == NULL) {
1290 0 : PyErr_NoMemory();
1291 0 : return -1;
1292 : }
1293 50 : object->cursors[cursors_cntr_0] = *(struct drsuapi_DsReplicaCursor2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, cursors_cntr_0));
1294 : }
1295 : }
1296 35 : return 0;
1297 : }
1298 :
1299 : static PyGetSetDef py_replUpToDateVectorCtr2_getsetters[] = {
1300 : {
1301 : .name = discard_const_p(char, "count"),
1302 : .get = py_replUpToDateVectorCtr2_get_count,
1303 : .set = py_replUpToDateVectorCtr2_set_count,
1304 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1305 : },
1306 : {
1307 : .name = discard_const_p(char, "reserved"),
1308 : .get = py_replUpToDateVectorCtr2_get_reserved,
1309 : .set = py_replUpToDateVectorCtr2_set_reserved,
1310 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1311 : },
1312 : {
1313 : .name = discard_const_p(char, "cursors"),
1314 : .get = py_replUpToDateVectorCtr2_get_cursors,
1315 : .set = py_replUpToDateVectorCtr2_set_cursors,
1316 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsReplicaCursor2")
1317 : },
1318 : { .name = NULL }
1319 : };
1320 :
1321 0 : static PyObject *py_replUpToDateVectorCtr2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1322 : {
1323 0 : return pytalloc_new(struct replUpToDateVectorCtr2, type);
1324 : }
1325 :
1326 :
1327 : static PyTypeObject replUpToDateVectorCtr2_Type = {
1328 : PyVarObject_HEAD_INIT(NULL, 0)
1329 : .tp_name = "drsblobs.replUpToDateVectorCtr2",
1330 : .tp_getset = py_replUpToDateVectorCtr2_getsetters,
1331 : .tp_methods = NULL,
1332 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1333 : .tp_new = py_replUpToDateVectorCtr2_new,
1334 : };
1335 :
1336 112 : static PyObject *py_import_replUpToDateVectorCtr(TALLOC_CTX *mem_ctx, int level, union replUpToDateVectorCtr *in)
1337 : {
1338 : PyObject *ret;
1339 :
1340 112 : switch (level) {
1341 0 : case 1:
1342 0 : ret = pytalloc_reference_ex(&replUpToDateVectorCtr1_Type, mem_ctx, &in->ctr1);
1343 0 : return ret;
1344 :
1345 112 : case 2:
1346 112 : ret = pytalloc_reference_ex(&replUpToDateVectorCtr2_Type, mem_ctx, &in->ctr2);
1347 112 : return ret;
1348 :
1349 : }
1350 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1351 0 : return NULL;
1352 : }
1353 :
1354 0 : static union replUpToDateVectorCtr *py_export_replUpToDateVectorCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1355 : {
1356 0 : union replUpToDateVectorCtr *ret = talloc_zero(mem_ctx, union replUpToDateVectorCtr);
1357 0 : switch (level) {
1358 0 : case 1:
1359 0 : if (in == NULL) {
1360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
1361 0 : talloc_free(ret); return NULL;
1362 : }
1363 0 : PY_CHECK_TYPE(&replUpToDateVectorCtr1_Type, in, talloc_free(ret); return NULL;);
1364 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1365 0 : PyErr_NoMemory();
1366 0 : talloc_free(ret); return NULL;
1367 : }
1368 0 : ret->ctr1 = *(struct replUpToDateVectorCtr1 *)pytalloc_get_ptr(in);
1369 0 : break;
1370 :
1371 0 : case 2:
1372 0 : if (in == NULL) {
1373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr2");
1374 0 : talloc_free(ret); return NULL;
1375 : }
1376 0 : PY_CHECK_TYPE(&replUpToDateVectorCtr2_Type, in, talloc_free(ret); return NULL;);
1377 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1378 0 : PyErr_NoMemory();
1379 0 : talloc_free(ret); return NULL;
1380 : }
1381 0 : ret->ctr2 = *(struct replUpToDateVectorCtr2 *)pytalloc_get_ptr(in);
1382 0 : break;
1383 :
1384 0 : default:
1385 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
1386 0 : talloc_free(ret);
1387 0 : ret = NULL;
1388 : }
1389 :
1390 0 : return ret;
1391 : }
1392 :
1393 112 : static PyObject *py_replUpToDateVectorCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1394 : {
1395 112 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1396 112 : PyObject *mem_ctx_obj = NULL;
1397 112 : TALLOC_CTX *mem_ctx = NULL;
1398 112 : int level = 0;
1399 112 : PyObject *in_obj = NULL;
1400 112 : union replUpToDateVectorCtr *in = NULL;
1401 :
1402 112 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1403 : discard_const_p(char *, kwnames),
1404 : &mem_ctx_obj,
1405 : &level,
1406 : &in_obj)) {
1407 0 : return NULL;
1408 : }
1409 112 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1410 112 : if (mem_ctx == NULL) {
1411 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1412 0 : return NULL;
1413 : }
1414 112 : in = (union replUpToDateVectorCtr *)pytalloc_get_ptr(in_obj);
1415 112 : if (in == NULL) {
1416 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union replUpToDateVectorCtr!");
1417 0 : return NULL;
1418 : }
1419 :
1420 112 : return py_import_replUpToDateVectorCtr(mem_ctx, level, in);
1421 : }
1422 :
1423 0 : static PyObject *py_replUpToDateVectorCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1424 : {
1425 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1426 0 : PyObject *mem_ctx_obj = NULL;
1427 0 : TALLOC_CTX *mem_ctx = NULL;
1428 0 : int level = 0;
1429 0 : PyObject *in = NULL;
1430 0 : union replUpToDateVectorCtr *out = NULL;
1431 :
1432 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1433 : discard_const_p(char *, kwnames),
1434 : &mem_ctx_obj,
1435 : &level,
1436 : &in)) {
1437 0 : return NULL;
1438 : }
1439 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1440 0 : if (mem_ctx == NULL) {
1441 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1442 0 : return NULL;
1443 : }
1444 :
1445 0 : out = py_export_replUpToDateVectorCtr(mem_ctx, level, in);
1446 0 : if (out == NULL) {
1447 0 : return NULL;
1448 : }
1449 :
1450 0 : return pytalloc_GenericObject_reference(out);
1451 : }
1452 :
1453 : static PyMethodDef py_replUpToDateVectorCtr_methods[] = {
1454 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replUpToDateVectorCtr_import),
1455 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1456 : "T.__import__(mem_ctx, level, in) => ret." },
1457 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replUpToDateVectorCtr_export),
1458 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1459 : "T.__export__(mem_ctx, level, in) => ret." },
1460 : { NULL, NULL, 0, NULL }
1461 : };
1462 :
1463 0 : static PyObject *py_replUpToDateVectorCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1464 : {
1465 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1466 0 : return NULL;
1467 : }
1468 :
1469 :
1470 : static PyTypeObject replUpToDateVectorCtr_Type = {
1471 : PyVarObject_HEAD_INIT(NULL, 0)
1472 : .tp_name = "drsblobs.replUpToDateVectorCtr",
1473 : .tp_getset = NULL,
1474 : .tp_methods = py_replUpToDateVectorCtr_methods,
1475 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1476 : .tp_new = py_replUpToDateVectorCtr_new,
1477 : };
1478 :
1479 :
1480 42 : static PyObject *py_replUpToDateVectorBlob_get_version(PyObject *obj, void *closure)
1481 : {
1482 42 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(obj);
1483 : PyObject *py_version;
1484 42 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
1485 42 : return py_version;
1486 : }
1487 :
1488 35 : static int py_replUpToDateVectorBlob_set_version(PyObject *py_obj, PyObject *value, void *closure)
1489 : {
1490 35 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(py_obj);
1491 35 : if (value == NULL) {
1492 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
1493 0 : return -1;
1494 : }
1495 : {
1496 35 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
1497 35 : if (PyLong_Check(value)) {
1498 : unsigned long long test_var;
1499 35 : test_var = PyLong_AsUnsignedLongLong(value);
1500 35 : if (PyErr_Occurred() != NULL) {
1501 0 : return -1;
1502 : }
1503 35 : if (test_var > uint_max) {
1504 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1505 : PyLong_Type.tp_name, uint_max, test_var);
1506 0 : return -1;
1507 : }
1508 35 : object->version = test_var;
1509 : } else {
1510 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1511 : PyLong_Type.tp_name);
1512 0 : return -1;
1513 : }
1514 : }
1515 35 : return 0;
1516 : }
1517 :
1518 0 : static PyObject *py_replUpToDateVectorBlob_get_reserved(PyObject *obj, void *closure)
1519 : {
1520 0 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(obj);
1521 : PyObject *py_reserved;
1522 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
1523 0 : return py_reserved;
1524 : }
1525 :
1526 0 : static int py_replUpToDateVectorBlob_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
1527 : {
1528 0 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(py_obj);
1529 0 : if (value == NULL) {
1530 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
1531 0 : return -1;
1532 : }
1533 : {
1534 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
1535 0 : if (PyLong_Check(value)) {
1536 : unsigned long long test_var;
1537 0 : test_var = PyLong_AsUnsignedLongLong(value);
1538 0 : if (PyErr_Occurred() != NULL) {
1539 0 : return -1;
1540 : }
1541 0 : if (test_var > uint_max) {
1542 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1543 : PyLong_Type.tp_name, uint_max, test_var);
1544 0 : return -1;
1545 : }
1546 0 : object->reserved = test_var;
1547 : } else {
1548 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1549 : PyLong_Type.tp_name);
1550 0 : return -1;
1551 : }
1552 : }
1553 0 : return 0;
1554 : }
1555 :
1556 112 : static PyObject *py_replUpToDateVectorBlob_get_ctr(PyObject *obj, void *closure)
1557 : {
1558 112 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(obj);
1559 : PyObject *py_ctr;
1560 112 : py_ctr = pyrpc_import_union(&replUpToDateVectorCtr_Type, pytalloc_get_mem_ctx(obj), object->version, &object->ctr, "union replUpToDateVectorCtr");
1561 112 : if (py_ctr == NULL) {
1562 0 : return NULL;
1563 : }
1564 112 : return py_ctr;
1565 : }
1566 :
1567 0 : static int py_replUpToDateVectorBlob_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
1568 : {
1569 0 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(py_obj);
1570 0 : if (value == NULL) {
1571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
1572 0 : return -1;
1573 : }
1574 : {
1575 : union replUpToDateVectorCtr *ctr_switch_0;
1576 0 : ctr_switch_0 = (union replUpToDateVectorCtr *)pyrpc_export_union(&replUpToDateVectorCtr_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union replUpToDateVectorCtr");
1577 0 : if (ctr_switch_0 == NULL) {
1578 0 : return -1;
1579 : }
1580 0 : object->ctr = *ctr_switch_0;
1581 : }
1582 0 : return 0;
1583 : }
1584 :
1585 : static PyGetSetDef py_replUpToDateVectorBlob_getsetters[] = {
1586 : {
1587 : .name = discard_const_p(char, "version"),
1588 : .get = py_replUpToDateVectorBlob_get_version,
1589 : .set = py_replUpToDateVectorBlob_set_version,
1590 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1591 : },
1592 : {
1593 : .name = discard_const_p(char, "reserved"),
1594 : .get = py_replUpToDateVectorBlob_get_reserved,
1595 : .set = py_replUpToDateVectorBlob_set_reserved,
1596 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1597 : },
1598 : {
1599 : .name = discard_const_p(char, "ctr"),
1600 : .get = py_replUpToDateVectorBlob_get_ctr,
1601 : .set = py_replUpToDateVectorBlob_set_ctr,
1602 : .doc = discard_const_p(char, "PIDL-generated element of base type replUpToDateVectorCtr")
1603 : },
1604 : { .name = NULL }
1605 : };
1606 :
1607 77 : static PyObject *py_replUpToDateVectorBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1608 : {
1609 77 : return pytalloc_new(struct replUpToDateVectorBlob, type);
1610 : }
1611 :
1612 35 : static PyObject *py_replUpToDateVectorBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1613 : {
1614 35 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(py_obj);
1615 35 : PyObject *ret = NULL;
1616 : DATA_BLOB blob;
1617 : enum ndr_err_code err;
1618 35 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1619 35 : if (tmp_ctx == NULL) {
1620 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1621 0 : return NULL;
1622 : }
1623 35 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_replUpToDateVectorBlob);
1624 35 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1625 0 : TALLOC_FREE(tmp_ctx);
1626 0 : PyErr_SetNdrError(err);
1627 0 : return NULL;
1628 : }
1629 :
1630 35 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1631 35 : TALLOC_FREE(tmp_ctx);
1632 35 : return ret;
1633 : }
1634 :
1635 42 : static PyObject *py_replUpToDateVectorBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1636 : {
1637 42 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(py_obj);
1638 42 : DATA_BLOB blob = {.data = NULL, .length = 0};
1639 42 : Py_ssize_t blob_length = 0;
1640 : enum ndr_err_code err;
1641 42 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1642 42 : PyObject *allow_remaining_obj = NULL;
1643 42 : bool allow_remaining = false;
1644 :
1645 42 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1646 : discard_const_p(char *, kwnames),
1647 : &blob.data, &blob_length,
1648 : &allow_remaining_obj)) {
1649 0 : return NULL;
1650 : }
1651 42 : blob.length = blob_length;
1652 :
1653 42 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1654 0 : allow_remaining = true;
1655 : }
1656 :
1657 42 : if (allow_remaining) {
1658 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob);
1659 : } else {
1660 42 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob);
1661 : }
1662 42 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1663 0 : PyErr_SetNdrError(err);
1664 0 : return NULL;
1665 : }
1666 :
1667 42 : Py_RETURN_NONE;
1668 : }
1669 :
1670 0 : static PyObject *py_replUpToDateVectorBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1671 : {
1672 0 : struct replUpToDateVectorBlob *object = (struct replUpToDateVectorBlob *)pytalloc_get_ptr(py_obj);
1673 : PyObject *ret;
1674 : char *retstr;
1675 :
1676 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_replUpToDateVectorBlob, "replUpToDateVectorBlob", object);
1677 0 : ret = PyUnicode_FromString(retstr);
1678 0 : talloc_free(retstr);
1679 :
1680 0 : return ret;
1681 : }
1682 :
1683 : static PyMethodDef py_replUpToDateVectorBlob_methods[] = {
1684 : { "__ndr_pack__", (PyCFunction)py_replUpToDateVectorBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1685 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_replUpToDateVectorBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1686 : { "__ndr_print__", (PyCFunction)py_replUpToDateVectorBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1687 : { NULL, NULL, 0, NULL }
1688 : };
1689 :
1690 :
1691 : static PyTypeObject replUpToDateVectorBlob_Type = {
1692 : PyVarObject_HEAD_INIT(NULL, 0)
1693 : .tp_name = "drsblobs.replUpToDateVectorBlob",
1694 : .tp_getset = py_replUpToDateVectorBlob_getsetters,
1695 : .tp_methods = py_replUpToDateVectorBlob_methods,
1696 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1697 : .tp_new = py_replUpToDateVectorBlob_new,
1698 : };
1699 :
1700 :
1701 0 : static PyObject *py_repsFromTo1OtherInfo_get___dns_name_size(PyObject *obj, void *closure)
1702 : {
1703 0 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(obj);
1704 : PyObject *py___dns_name_size;
1705 0 : py___dns_name_size = PyLong_FromUnsignedLongLong((uint32_t)object->__dns_name_size);
1706 0 : return py___dns_name_size;
1707 : }
1708 :
1709 0 : static int py_repsFromTo1OtherInfo_set___dns_name_size(PyObject *py_obj, PyObject *value, void *closure)
1710 : {
1711 0 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(py_obj);
1712 0 : if (value == NULL) {
1713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__dns_name_size");
1714 0 : return -1;
1715 : }
1716 : {
1717 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__dns_name_size));
1718 0 : if (PyLong_Check(value)) {
1719 : unsigned long long test_var;
1720 0 : test_var = PyLong_AsUnsignedLongLong(value);
1721 0 : if (PyErr_Occurred() != NULL) {
1722 0 : return -1;
1723 : }
1724 0 : if (test_var > uint_max) {
1725 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1726 : PyLong_Type.tp_name, uint_max, test_var);
1727 0 : return -1;
1728 : }
1729 0 : object->__dns_name_size = test_var;
1730 : } else {
1731 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1732 : PyLong_Type.tp_name);
1733 0 : return -1;
1734 : }
1735 : }
1736 0 : return 0;
1737 : }
1738 :
1739 946 : static PyObject *py_repsFromTo1OtherInfo_get_dns_name(PyObject *obj, void *closure)
1740 : {
1741 946 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(obj);
1742 : PyObject *py_dns_name;
1743 946 : if (object->dns_name == NULL) {
1744 0 : py_dns_name = Py_None;
1745 0 : Py_INCREF(py_dns_name);
1746 : } else {
1747 946 : py_dns_name = PyUnicode_Decode(object->dns_name, strlen(object->dns_name), "utf-8", "ignore");
1748 : }
1749 946 : return py_dns_name;
1750 : }
1751 :
1752 96 : static int py_repsFromTo1OtherInfo_set_dns_name(PyObject *py_obj, PyObject *value, void *closure)
1753 : {
1754 96 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(py_obj);
1755 96 : if (value == NULL) {
1756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_name");
1757 0 : return -1;
1758 : }
1759 : {
1760 : const char *test_str;
1761 : const char *talloc_str;
1762 96 : PyObject *unicode = NULL;
1763 96 : if (PyUnicode_Check(value)) {
1764 96 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1765 96 : if (unicode == NULL) {
1766 0 : PyErr_NoMemory();
1767 0 : return -1;
1768 : }
1769 96 : test_str = PyBytes_AS_STRING(unicode);
1770 0 : } else if (PyBytes_Check(value)) {
1771 0 : test_str = PyBytes_AS_STRING(value);
1772 : } else {
1773 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1774 0 : return -1;
1775 : }
1776 96 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1777 96 : if (unicode != NULL) {
1778 96 : Py_DECREF(unicode);
1779 : }
1780 96 : if (talloc_str == NULL) {
1781 0 : PyErr_NoMemory();
1782 0 : return -1;
1783 : }
1784 96 : object->dns_name = talloc_str;
1785 : }
1786 96 : return 0;
1787 : }
1788 :
1789 : static PyGetSetDef py_repsFromTo1OtherInfo_getsetters[] = {
1790 : {
1791 : .name = discard_const_p(char, "__dns_name_size"),
1792 : .get = py_repsFromTo1OtherInfo_get___dns_name_size,
1793 : .set = py_repsFromTo1OtherInfo_set___dns_name_size,
1794 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1795 : },
1796 : {
1797 : .name = discard_const_p(char, "dns_name"),
1798 : .get = py_repsFromTo1OtherInfo_get_dns_name,
1799 : .set = py_repsFromTo1OtherInfo_set_dns_name,
1800 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1801 : },
1802 : { .name = NULL }
1803 : };
1804 :
1805 96 : static PyObject *py_repsFromTo1OtherInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1806 : {
1807 96 : return pytalloc_new(struct repsFromTo1OtherInfo, type);
1808 : }
1809 :
1810 0 : static PyObject *py_repsFromTo1OtherInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1811 : {
1812 0 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(py_obj);
1813 0 : PyObject *ret = NULL;
1814 : DATA_BLOB blob;
1815 : enum ndr_err_code err;
1816 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1817 0 : if (tmp_ctx == NULL) {
1818 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1819 0 : return NULL;
1820 : }
1821 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_repsFromTo1OtherInfo);
1822 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1823 0 : TALLOC_FREE(tmp_ctx);
1824 0 : PyErr_SetNdrError(err);
1825 0 : return NULL;
1826 : }
1827 :
1828 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1829 0 : TALLOC_FREE(tmp_ctx);
1830 0 : return ret;
1831 : }
1832 :
1833 0 : static PyObject *py_repsFromTo1OtherInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1834 : {
1835 0 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(py_obj);
1836 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1837 0 : Py_ssize_t blob_length = 0;
1838 : enum ndr_err_code err;
1839 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1840 0 : PyObject *allow_remaining_obj = NULL;
1841 0 : bool allow_remaining = false;
1842 :
1843 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1844 : discard_const_p(char *, kwnames),
1845 : &blob.data, &blob_length,
1846 : &allow_remaining_obj)) {
1847 0 : return NULL;
1848 : }
1849 0 : blob.length = blob_length;
1850 :
1851 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1852 0 : allow_remaining = true;
1853 : }
1854 :
1855 0 : if (allow_remaining) {
1856 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo1OtherInfo);
1857 : } else {
1858 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo1OtherInfo);
1859 : }
1860 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1861 0 : PyErr_SetNdrError(err);
1862 0 : return NULL;
1863 : }
1864 :
1865 0 : Py_RETURN_NONE;
1866 : }
1867 :
1868 0 : static PyObject *py_repsFromTo1OtherInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1869 : {
1870 0 : struct repsFromTo1OtherInfo *object = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(py_obj);
1871 : PyObject *ret;
1872 : char *retstr;
1873 :
1874 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_repsFromTo1OtherInfo, "repsFromTo1OtherInfo", object);
1875 0 : ret = PyUnicode_FromString(retstr);
1876 0 : talloc_free(retstr);
1877 :
1878 0 : return ret;
1879 : }
1880 :
1881 : static PyMethodDef py_repsFromTo1OtherInfo_methods[] = {
1882 : { "__ndr_pack__", (PyCFunction)py_repsFromTo1OtherInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1883 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromTo1OtherInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1884 : { "__ndr_print__", (PyCFunction)py_repsFromTo1OtherInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1885 : { NULL, NULL, 0, NULL }
1886 : };
1887 :
1888 :
1889 : static PyTypeObject repsFromTo1OtherInfo_Type = {
1890 : PyVarObject_HEAD_INIT(NULL, 0)
1891 : .tp_name = "drsblobs.repsFromTo1OtherInfo",
1892 : .tp_getset = py_repsFromTo1OtherInfo_getsetters,
1893 : .tp_methods = py_repsFromTo1OtherInfo_methods,
1894 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1895 : .tp_new = py_repsFromTo1OtherInfo_new,
1896 : };
1897 :
1898 :
1899 0 : static PyObject *py_repsFromTo1_get_blobsize(PyObject *obj, void *closure)
1900 : {
1901 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
1902 : PyObject *py_blobsize;
1903 0 : py_blobsize = PyLong_FromUnsignedLongLong((uint32_t)object->blobsize);
1904 0 : return py_blobsize;
1905 : }
1906 :
1907 0 : static int py_repsFromTo1_set_blobsize(PyObject *py_obj, PyObject *value, void *closure)
1908 : {
1909 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
1910 0 : if (value == NULL) {
1911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blobsize");
1912 0 : return -1;
1913 : }
1914 : {
1915 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->blobsize));
1916 0 : if (PyLong_Check(value)) {
1917 : unsigned long long test_var;
1918 0 : test_var = PyLong_AsUnsignedLongLong(value);
1919 0 : if (PyErr_Occurred() != NULL) {
1920 0 : return -1;
1921 : }
1922 0 : if (test_var > uint_max) {
1923 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1924 : PyLong_Type.tp_name, uint_max, test_var);
1925 0 : return -1;
1926 : }
1927 0 : object->blobsize = test_var;
1928 : } else {
1929 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1930 : PyLong_Type.tp_name);
1931 0 : return -1;
1932 : }
1933 : }
1934 0 : return 0;
1935 : }
1936 :
1937 1007 : static PyObject *py_repsFromTo1_get_consecutive_sync_failures(PyObject *obj, void *closure)
1938 : {
1939 1007 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
1940 : PyObject *py_consecutive_sync_failures;
1941 1007 : py_consecutive_sync_failures = PyLong_FromUnsignedLongLong((uint32_t)object->consecutive_sync_failures);
1942 1007 : return py_consecutive_sync_failures;
1943 : }
1944 :
1945 0 : static int py_repsFromTo1_set_consecutive_sync_failures(PyObject *py_obj, PyObject *value, void *closure)
1946 : {
1947 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
1948 0 : if (value == NULL) {
1949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->consecutive_sync_failures");
1950 0 : return -1;
1951 : }
1952 : {
1953 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->consecutive_sync_failures));
1954 0 : if (PyLong_Check(value)) {
1955 : unsigned long long test_var;
1956 0 : test_var = PyLong_AsUnsignedLongLong(value);
1957 0 : if (PyErr_Occurred() != NULL) {
1958 0 : return -1;
1959 : }
1960 0 : if (test_var > uint_max) {
1961 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1962 : PyLong_Type.tp_name, uint_max, test_var);
1963 0 : return -1;
1964 : }
1965 0 : object->consecutive_sync_failures = test_var;
1966 : } else {
1967 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1968 : PyLong_Type.tp_name);
1969 0 : return -1;
1970 : }
1971 : }
1972 0 : return 0;
1973 : }
1974 :
1975 1007 : static PyObject *py_repsFromTo1_get_last_success(PyObject *obj, void *closure)
1976 : {
1977 1007 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
1978 : PyObject *py_last_success;
1979 1007 : py_last_success = PyLong_FromUnsignedLongLong(object->last_success);
1980 1007 : return py_last_success;
1981 : }
1982 :
1983 0 : static int py_repsFromTo1_set_last_success(PyObject *py_obj, PyObject *value, void *closure)
1984 : {
1985 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
1986 0 : if (value == NULL) {
1987 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_success");
1988 0 : return -1;
1989 : }
1990 : {
1991 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_success));
1992 0 : if (PyLong_Check(value)) {
1993 : unsigned long long test_var;
1994 0 : test_var = PyLong_AsUnsignedLongLong(value);
1995 0 : if (PyErr_Occurred() != NULL) {
1996 0 : return -1;
1997 : }
1998 0 : if (test_var > uint_max) {
1999 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2000 : PyLong_Type.tp_name, uint_max, test_var);
2001 0 : return -1;
2002 : }
2003 0 : object->last_success = test_var;
2004 : } else {
2005 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2006 : PyLong_Type.tp_name);
2007 0 : return -1;
2008 : }
2009 : }
2010 0 : return 0;
2011 : }
2012 :
2013 1007 : static PyObject *py_repsFromTo1_get_last_attempt(PyObject *obj, void *closure)
2014 : {
2015 1007 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2016 : PyObject *py_last_attempt;
2017 1007 : py_last_attempt = PyLong_FromUnsignedLongLong(object->last_attempt);
2018 1007 : return py_last_attempt;
2019 : }
2020 :
2021 0 : static int py_repsFromTo1_set_last_attempt(PyObject *py_obj, PyObject *value, void *closure)
2022 : {
2023 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2024 0 : if (value == NULL) {
2025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_attempt");
2026 0 : return -1;
2027 : }
2028 : {
2029 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_attempt));
2030 0 : if (PyLong_Check(value)) {
2031 : unsigned long long test_var;
2032 0 : test_var = PyLong_AsUnsignedLongLong(value);
2033 0 : if (PyErr_Occurred() != NULL) {
2034 0 : return -1;
2035 : }
2036 0 : if (test_var > uint_max) {
2037 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2038 : PyLong_Type.tp_name, uint_max, test_var);
2039 0 : return -1;
2040 : }
2041 0 : object->last_attempt = test_var;
2042 : } else {
2043 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2044 : PyLong_Type.tp_name);
2045 0 : return -1;
2046 : }
2047 : }
2048 0 : return 0;
2049 : }
2050 :
2051 0 : static PyObject *py_repsFromTo1_get_result_last_attempt(PyObject *obj, void *closure)
2052 : {
2053 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2054 : PyObject *py_result_last_attempt;
2055 0 : py_result_last_attempt = PyErr_FromWERROR(object->result_last_attempt);
2056 0 : return py_result_last_attempt;
2057 : }
2058 :
2059 1 : static int py_repsFromTo1_set_result_last_attempt(PyObject *py_obj, PyObject *value, void *closure)
2060 : {
2061 1 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2062 1 : if (value == NULL) {
2063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->result_last_attempt");
2064 0 : return -1;
2065 : }
2066 1 : object->result_last_attempt = W_ERROR(PyLong_AsLong(value));
2067 1 : return 0;
2068 : }
2069 :
2070 1988 : static PyObject *py_repsFromTo1_get_other_info(PyObject *obj, void *closure)
2071 : {
2072 1988 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2073 : PyObject *py_other_info;
2074 1988 : if (object->other_info == NULL) {
2075 0 : Py_RETURN_NONE;
2076 : }
2077 1988 : if (object->other_info == NULL) {
2078 0 : py_other_info = Py_None;
2079 0 : Py_INCREF(py_other_info);
2080 : } else {
2081 1988 : py_other_info = pytalloc_reference_ex(&repsFromTo1OtherInfo_Type, object->other_info, object->other_info);
2082 : }
2083 1988 : return py_other_info;
2084 : }
2085 :
2086 96 : static int py_repsFromTo1_set_other_info(PyObject *py_obj, PyObject *value, void *closure)
2087 : {
2088 96 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2089 96 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->other_info));
2090 96 : if (value == NULL) {
2091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->other_info");
2092 0 : return -1;
2093 : }
2094 96 : if (value == Py_None) {
2095 0 : object->other_info = NULL;
2096 : } else {
2097 96 : object->other_info = NULL;
2098 96 : PY_CHECK_TYPE(&repsFromTo1OtherInfo_Type, value, return -1;);
2099 96 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2100 0 : PyErr_NoMemory();
2101 0 : return -1;
2102 : }
2103 96 : object->other_info = (struct repsFromTo1OtherInfo *)pytalloc_get_ptr(value);
2104 : }
2105 96 : return 0;
2106 : }
2107 :
2108 0 : static PyObject *py_repsFromTo1_get_other_info_length(PyObject *obj, void *closure)
2109 : {
2110 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2111 : PyObject *py_other_info_length;
2112 0 : py_other_info_length = PyLong_FromUnsignedLongLong((uint32_t)object->other_info_length);
2113 0 : return py_other_info_length;
2114 : }
2115 :
2116 0 : static int py_repsFromTo1_set_other_info_length(PyObject *py_obj, PyObject *value, void *closure)
2117 : {
2118 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2119 0 : if (value == NULL) {
2120 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->other_info_length");
2121 0 : return -1;
2122 : }
2123 : {
2124 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->other_info_length));
2125 0 : if (PyLong_Check(value)) {
2126 : unsigned long long test_var;
2127 0 : test_var = PyLong_AsUnsignedLongLong(value);
2128 0 : if (PyErr_Occurred() != NULL) {
2129 0 : return -1;
2130 : }
2131 0 : if (test_var > uint_max) {
2132 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2133 : PyLong_Type.tp_name, uint_max, test_var);
2134 0 : return -1;
2135 : }
2136 0 : object->other_info_length = test_var;
2137 : } else {
2138 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2139 : PyLong_Type.tp_name);
2140 0 : return -1;
2141 : }
2142 : }
2143 0 : return 0;
2144 : }
2145 :
2146 3309 : static PyObject *py_repsFromTo1_get_replica_flags(PyObject *obj, void *closure)
2147 : {
2148 3309 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2149 : PyObject *py_replica_flags;
2150 3309 : py_replica_flags = PyLong_FromUnsignedLongLong((uint32_t)object->replica_flags);
2151 3309 : return py_replica_flags;
2152 : }
2153 :
2154 361 : static int py_repsFromTo1_set_replica_flags(PyObject *py_obj, PyObject *value, void *closure)
2155 : {
2156 361 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2157 361 : if (value == NULL) {
2158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->replica_flags");
2159 0 : return -1;
2160 : }
2161 : {
2162 361 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->replica_flags));
2163 361 : if (PyLong_Check(value)) {
2164 : unsigned long long test_var;
2165 361 : test_var = PyLong_AsUnsignedLongLong(value);
2166 361 : if (PyErr_Occurred() != NULL) {
2167 0 : return -1;
2168 : }
2169 361 : if (test_var > uint_max) {
2170 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2171 : PyLong_Type.tp_name, uint_max, test_var);
2172 0 : return -1;
2173 : }
2174 361 : object->replica_flags = test_var;
2175 : } else {
2176 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2177 : PyLong_Type.tp_name);
2178 0 : return -1;
2179 : }
2180 : }
2181 361 : return 0;
2182 : }
2183 :
2184 1479 : static PyObject *py_repsFromTo1_get_schedule(PyObject *obj, void *closure)
2185 : {
2186 1479 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2187 : PyObject *py_schedule;
2188 1479 : py_schedule = PyList_New(84);
2189 1479 : if (py_schedule == NULL) {
2190 0 : return NULL;
2191 : }
2192 : {
2193 : int schedule_cntr_0;
2194 125715 : for (schedule_cntr_0 = 0; schedule_cntr_0 < (84); schedule_cntr_0++) {
2195 : PyObject *py_schedule_0;
2196 124236 : py_schedule_0 = PyLong_FromLong((uint16_t)object->schedule[schedule_cntr_0]);
2197 124236 : PyList_SetItem(py_schedule, schedule_cntr_0, py_schedule_0);
2198 : }
2199 : }
2200 1479 : return py_schedule;
2201 : }
2202 :
2203 108 : static int py_repsFromTo1_set_schedule(PyObject *py_obj, PyObject *value, void *closure)
2204 : {
2205 108 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2206 108 : if (value == NULL) {
2207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->schedule");
2208 0 : return -1;
2209 : }
2210 108 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2211 : {
2212 : int schedule_cntr_0;
2213 108 : if (ARRAY_SIZE(object->schedule) != PyList_GET_SIZE(value)) {
2214 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->schedule), PyList_GET_SIZE(value));
2215 0 : return -1;
2216 : }
2217 9180 : for (schedule_cntr_0 = 0; schedule_cntr_0 < PyList_GET_SIZE(value); schedule_cntr_0++) {
2218 9072 : if (PyList_GET_ITEM(value, schedule_cntr_0) == NULL) {
2219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->schedule[schedule_cntr_0]");
2220 0 : return -1;
2221 : }
2222 : {
2223 9072 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->schedule[schedule_cntr_0]));
2224 9072 : if (PyLong_Check(PyList_GET_ITEM(value, schedule_cntr_0))) {
2225 : unsigned long long test_var;
2226 9072 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, schedule_cntr_0));
2227 9072 : if (PyErr_Occurred() != NULL) {
2228 0 : return -1;
2229 : }
2230 9072 : if (test_var > uint_max) {
2231 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2232 : PyLong_Type.tp_name, uint_max, test_var);
2233 0 : return -1;
2234 : }
2235 9072 : object->schedule[schedule_cntr_0] = test_var;
2236 : } else {
2237 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2238 : PyLong_Type.tp_name);
2239 0 : return -1;
2240 : }
2241 : }
2242 : }
2243 : }
2244 108 : return 0;
2245 : }
2246 :
2247 0 : static PyObject *py_repsFromTo1_get_reserved(PyObject *obj, void *closure)
2248 : {
2249 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2250 : PyObject *py_reserved;
2251 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
2252 0 : return py_reserved;
2253 : }
2254 :
2255 0 : static int py_repsFromTo1_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
2256 : {
2257 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2258 0 : if (value == NULL) {
2259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
2260 0 : return -1;
2261 : }
2262 : {
2263 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
2264 0 : if (PyLong_Check(value)) {
2265 : unsigned long long test_var;
2266 0 : test_var = PyLong_AsUnsignedLongLong(value);
2267 0 : if (PyErr_Occurred() != NULL) {
2268 0 : return -1;
2269 : }
2270 0 : if (test_var > uint_max) {
2271 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2272 : PyLong_Type.tp_name, uint_max, test_var);
2273 0 : return -1;
2274 : }
2275 0 : object->reserved = test_var;
2276 : } else {
2277 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2278 : PyLong_Type.tp_name);
2279 0 : return -1;
2280 : }
2281 : }
2282 0 : return 0;
2283 : }
2284 :
2285 73 : static PyObject *py_repsFromTo1_get_highwatermark(PyObject *obj, void *closure)
2286 : {
2287 73 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2288 : PyObject *py_highwatermark;
2289 73 : py_highwatermark = pytalloc_reference_ex(drsuapi_DsReplicaHighWaterMark_Type, pytalloc_get_mem_ctx(obj), &object->highwatermark);
2290 73 : return py_highwatermark;
2291 : }
2292 :
2293 0 : static int py_repsFromTo1_set_highwatermark(PyObject *py_obj, PyObject *value, void *closure)
2294 : {
2295 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2296 0 : if (value == NULL) {
2297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->highwatermark");
2298 0 : return -1;
2299 : }
2300 0 : PY_CHECK_TYPE(drsuapi_DsReplicaHighWaterMark_Type, value, return -1;);
2301 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2302 0 : PyErr_NoMemory();
2303 0 : return -1;
2304 : }
2305 0 : object->highwatermark = *(struct drsuapi_DsReplicaHighWaterMark *)pytalloc_get_ptr(value);
2306 0 : return 0;
2307 : }
2308 :
2309 2775 : static PyObject *py_repsFromTo1_get_source_dsa_obj_guid(PyObject *obj, void *closure)
2310 : {
2311 2775 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2312 : PyObject *py_source_dsa_obj_guid;
2313 2775 : py_source_dsa_obj_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->source_dsa_obj_guid);
2314 2775 : return py_source_dsa_obj_guid;
2315 : }
2316 :
2317 96 : static int py_repsFromTo1_set_source_dsa_obj_guid(PyObject *py_obj, PyObject *value, void *closure)
2318 : {
2319 96 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2320 96 : if (value == NULL) {
2321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_dsa_obj_guid");
2322 0 : return -1;
2323 : }
2324 96 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
2325 96 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2326 0 : PyErr_NoMemory();
2327 0 : return -1;
2328 : }
2329 96 : object->source_dsa_obj_guid = *(struct GUID *)pytalloc_get_ptr(value);
2330 96 : return 0;
2331 : }
2332 :
2333 1083 : static PyObject *py_repsFromTo1_get_source_dsa_invocation_id(PyObject *obj, void *closure)
2334 : {
2335 1083 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2336 : PyObject *py_source_dsa_invocation_id;
2337 1083 : py_source_dsa_invocation_id = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->source_dsa_invocation_id);
2338 1083 : return py_source_dsa_invocation_id;
2339 : }
2340 :
2341 0 : static int py_repsFromTo1_set_source_dsa_invocation_id(PyObject *py_obj, PyObject *value, void *closure)
2342 : {
2343 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2344 0 : if (value == NULL) {
2345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_dsa_invocation_id");
2346 0 : return -1;
2347 : }
2348 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
2349 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2350 0 : PyErr_NoMemory();
2351 0 : return -1;
2352 : }
2353 0 : object->source_dsa_invocation_id = *(struct GUID *)pytalloc_get_ptr(value);
2354 0 : return 0;
2355 : }
2356 :
2357 1007 : static PyObject *py_repsFromTo1_get_transport_guid(PyObject *obj, void *closure)
2358 : {
2359 1007 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(obj);
2360 : PyObject *py_transport_guid;
2361 1007 : py_transport_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->transport_guid);
2362 1007 : return py_transport_guid;
2363 : }
2364 :
2365 472 : static int py_repsFromTo1_set_transport_guid(PyObject *py_obj, PyObject *value, void *closure)
2366 : {
2367 472 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2368 472 : if (value == NULL) {
2369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transport_guid");
2370 0 : return -1;
2371 : }
2372 472 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
2373 472 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2374 0 : PyErr_NoMemory();
2375 0 : return -1;
2376 : }
2377 472 : object->transport_guid = *(struct GUID *)pytalloc_get_ptr(value);
2378 472 : return 0;
2379 : }
2380 :
2381 : static PyGetSetDef py_repsFromTo1_getsetters[] = {
2382 : {
2383 : .name = discard_const_p(char, "blobsize"),
2384 : .get = py_repsFromTo1_get_blobsize,
2385 : .set = py_repsFromTo1_set_blobsize,
2386 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2387 : },
2388 : {
2389 : .name = discard_const_p(char, "consecutive_sync_failures"),
2390 : .get = py_repsFromTo1_get_consecutive_sync_failures,
2391 : .set = py_repsFromTo1_set_consecutive_sync_failures,
2392 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2393 : },
2394 : {
2395 : .name = discard_const_p(char, "last_success"),
2396 : .get = py_repsFromTo1_get_last_success,
2397 : .set = py_repsFromTo1_set_last_success,
2398 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_1sec")
2399 : },
2400 : {
2401 : .name = discard_const_p(char, "last_attempt"),
2402 : .get = py_repsFromTo1_get_last_attempt,
2403 : .set = py_repsFromTo1_set_last_attempt,
2404 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_1sec")
2405 : },
2406 : {
2407 : .name = discard_const_p(char, "result_last_attempt"),
2408 : .get = py_repsFromTo1_get_result_last_attempt,
2409 : .set = py_repsFromTo1_set_result_last_attempt,
2410 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
2411 : },
2412 : {
2413 : .name = discard_const_p(char, "other_info"),
2414 : .get = py_repsFromTo1_get_other_info,
2415 : .set = py_repsFromTo1_set_other_info,
2416 : .doc = discard_const_p(char, "PIDL-generated element of base type repsFromTo1OtherInfo")
2417 : },
2418 : {
2419 : .name = discard_const_p(char, "other_info_length"),
2420 : .get = py_repsFromTo1_get_other_info_length,
2421 : .set = py_repsFromTo1_set_other_info_length,
2422 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2423 : },
2424 : {
2425 : .name = discard_const_p(char, "replica_flags"),
2426 : .get = py_repsFromTo1_get_replica_flags,
2427 : .set = py_repsFromTo1_set_replica_flags,
2428 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DrsOptions")
2429 : },
2430 : {
2431 : .name = discard_const_p(char, "schedule"),
2432 : .get = py_repsFromTo1_get_schedule,
2433 : .set = py_repsFromTo1_set_schedule,
2434 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2435 : },
2436 : {
2437 : .name = discard_const_p(char, "reserved"),
2438 : .get = py_repsFromTo1_get_reserved,
2439 : .set = py_repsFromTo1_set_reserved,
2440 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2441 : },
2442 : {
2443 : .name = discard_const_p(char, "highwatermark"),
2444 : .get = py_repsFromTo1_get_highwatermark,
2445 : .set = py_repsFromTo1_set_highwatermark,
2446 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsReplicaHighWaterMark")
2447 : },
2448 : {
2449 : .name = discard_const_p(char, "source_dsa_obj_guid"),
2450 : .get = py_repsFromTo1_get_source_dsa_obj_guid,
2451 : .set = py_repsFromTo1_set_source_dsa_obj_guid,
2452 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
2453 : },
2454 : {
2455 : .name = discard_const_p(char, "source_dsa_invocation_id"),
2456 : .get = py_repsFromTo1_get_source_dsa_invocation_id,
2457 : .set = py_repsFromTo1_set_source_dsa_invocation_id,
2458 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
2459 : },
2460 : {
2461 : .name = discard_const_p(char, "transport_guid"),
2462 : .get = py_repsFromTo1_get_transport_guid,
2463 : .set = py_repsFromTo1_set_transport_guid,
2464 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
2465 : },
2466 : { .name = NULL }
2467 : };
2468 :
2469 0 : static PyObject *py_repsFromTo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2470 : {
2471 0 : return pytalloc_new(struct repsFromTo1, type);
2472 : }
2473 :
2474 0 : static PyObject *py_repsFromTo1_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2475 : {
2476 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2477 0 : PyObject *ret = NULL;
2478 : DATA_BLOB blob;
2479 : enum ndr_err_code err;
2480 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2481 0 : if (tmp_ctx == NULL) {
2482 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2483 0 : return NULL;
2484 : }
2485 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_repsFromTo1);
2486 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2487 0 : TALLOC_FREE(tmp_ctx);
2488 0 : PyErr_SetNdrError(err);
2489 0 : return NULL;
2490 : }
2491 :
2492 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2493 0 : TALLOC_FREE(tmp_ctx);
2494 0 : return ret;
2495 : }
2496 :
2497 0 : static PyObject *py_repsFromTo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2498 : {
2499 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2500 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2501 0 : Py_ssize_t blob_length = 0;
2502 : enum ndr_err_code err;
2503 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2504 0 : PyObject *allow_remaining_obj = NULL;
2505 0 : bool allow_remaining = false;
2506 :
2507 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2508 : discard_const_p(char *, kwnames),
2509 : &blob.data, &blob_length,
2510 : &allow_remaining_obj)) {
2511 0 : return NULL;
2512 : }
2513 0 : blob.length = blob_length;
2514 :
2515 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2516 0 : allow_remaining = true;
2517 : }
2518 :
2519 0 : if (allow_remaining) {
2520 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo1);
2521 : } else {
2522 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo1);
2523 : }
2524 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2525 0 : PyErr_SetNdrError(err);
2526 0 : return NULL;
2527 : }
2528 :
2529 0 : Py_RETURN_NONE;
2530 : }
2531 :
2532 0 : static PyObject *py_repsFromTo1_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2533 : {
2534 0 : struct repsFromTo1 *object = (struct repsFromTo1 *)pytalloc_get_ptr(py_obj);
2535 : PyObject *ret;
2536 : char *retstr;
2537 :
2538 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_repsFromTo1, "repsFromTo1", object);
2539 0 : ret = PyUnicode_FromString(retstr);
2540 0 : talloc_free(retstr);
2541 :
2542 0 : return ret;
2543 : }
2544 :
2545 : static PyMethodDef py_repsFromTo1_methods[] = {
2546 : { "__ndr_pack__", (PyCFunction)py_repsFromTo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2547 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromTo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2548 : { "__ndr_print__", (PyCFunction)py_repsFromTo1_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2549 : { NULL, NULL, 0, NULL }
2550 : };
2551 :
2552 :
2553 : static PyTypeObject repsFromTo1_Type = {
2554 : PyVarObject_HEAD_INIT(NULL, 0)
2555 : .tp_name = "drsblobs.repsFromTo1",
2556 : .tp_getset = py_repsFromTo1_getsetters,
2557 : .tp_methods = py_repsFromTo1_methods,
2558 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2559 : .tp_new = py_repsFromTo1_new,
2560 : };
2561 :
2562 :
2563 0 : static PyObject *py_repsFromTo2OtherInfo_get___ndr_size(PyObject *obj, void *closure)
2564 : {
2565 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(obj);
2566 : PyObject *py___ndr_size;
2567 0 : py___ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->__ndr_size);
2568 0 : return py___ndr_size;
2569 : }
2570 :
2571 0 : static int py_repsFromTo2OtherInfo_set___ndr_size(PyObject *py_obj, PyObject *value, void *closure)
2572 : {
2573 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2574 0 : if (value == NULL) {
2575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__ndr_size");
2576 0 : return -1;
2577 : }
2578 : {
2579 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__ndr_size));
2580 0 : if (PyLong_Check(value)) {
2581 : unsigned long long test_var;
2582 0 : test_var = PyLong_AsUnsignedLongLong(value);
2583 0 : if (PyErr_Occurred() != NULL) {
2584 0 : return -1;
2585 : }
2586 0 : if (test_var > uint_max) {
2587 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2588 : PyLong_Type.tp_name, uint_max, test_var);
2589 0 : return -1;
2590 : }
2591 0 : object->__ndr_size = test_var;
2592 : } else {
2593 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2594 : PyLong_Type.tp_name);
2595 0 : return -1;
2596 : }
2597 : }
2598 0 : return 0;
2599 : }
2600 :
2601 0 : static PyObject *py_repsFromTo2OtherInfo_get_dns_name1(PyObject *obj, void *closure)
2602 : {
2603 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(obj);
2604 : PyObject *py_dns_name1;
2605 0 : if (object->dns_name1 == NULL) {
2606 0 : Py_RETURN_NONE;
2607 : }
2608 0 : if (object->dns_name1 == NULL) {
2609 0 : py_dns_name1 = Py_None;
2610 0 : Py_INCREF(py_dns_name1);
2611 : } else {
2612 0 : py_dns_name1 = PyString_FromStringOrNULL(object->dns_name1);
2613 : }
2614 0 : return py_dns_name1;
2615 : }
2616 :
2617 0 : static int py_repsFromTo2OtherInfo_set_dns_name1(PyObject *py_obj, PyObject *value, void *closure)
2618 : {
2619 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2620 0 : if (value == NULL) {
2621 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_name1");
2622 0 : return -1;
2623 : }
2624 0 : if (value == Py_None) {
2625 0 : object->dns_name1 = NULL;
2626 : } else {
2627 0 : object->dns_name1 = NULL;
2628 : {
2629 : const char *test_str;
2630 : const char *talloc_str;
2631 0 : PyObject *unicode = NULL;
2632 0 : if (PyUnicode_Check(value)) {
2633 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2634 0 : if (unicode == NULL) {
2635 0 : PyErr_NoMemory();
2636 0 : return -1;
2637 : }
2638 0 : test_str = PyBytes_AS_STRING(unicode);
2639 0 : } else if (PyBytes_Check(value)) {
2640 0 : test_str = PyBytes_AS_STRING(value);
2641 : } else {
2642 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2643 0 : return -1;
2644 : }
2645 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2646 0 : if (unicode != NULL) {
2647 0 : Py_DECREF(unicode);
2648 : }
2649 0 : if (talloc_str == NULL) {
2650 0 : PyErr_NoMemory();
2651 0 : return -1;
2652 : }
2653 0 : object->dns_name1 = talloc_str;
2654 : }
2655 : }
2656 0 : return 0;
2657 : }
2658 :
2659 0 : static PyObject *py_repsFromTo2OtherInfo_get_unknown1(PyObject *obj, void *closure)
2660 : {
2661 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(obj);
2662 : PyObject *py_unknown1;
2663 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1);
2664 0 : return py_unknown1;
2665 : }
2666 :
2667 0 : static int py_repsFromTo2OtherInfo_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
2668 : {
2669 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2670 0 : if (value == NULL) {
2671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
2672 0 : return -1;
2673 : }
2674 : {
2675 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
2676 0 : if (PyLong_Check(value)) {
2677 : unsigned long long test_var;
2678 0 : test_var = PyLong_AsUnsignedLongLong(value);
2679 0 : if (PyErr_Occurred() != NULL) {
2680 0 : return -1;
2681 : }
2682 0 : if (test_var > uint_max) {
2683 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2684 : PyLong_Type.tp_name, uint_max, test_var);
2685 0 : return -1;
2686 : }
2687 0 : object->unknown1 = test_var;
2688 : } else {
2689 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2690 : PyLong_Type.tp_name);
2691 0 : return -1;
2692 : }
2693 : }
2694 0 : return 0;
2695 : }
2696 :
2697 0 : static PyObject *py_repsFromTo2OtherInfo_get_dns_name2(PyObject *obj, void *closure)
2698 : {
2699 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(obj);
2700 : PyObject *py_dns_name2;
2701 0 : if (object->dns_name2 == NULL) {
2702 0 : Py_RETURN_NONE;
2703 : }
2704 0 : if (object->dns_name2 == NULL) {
2705 0 : py_dns_name2 = Py_None;
2706 0 : Py_INCREF(py_dns_name2);
2707 : } else {
2708 0 : py_dns_name2 = PyString_FromStringOrNULL(object->dns_name2);
2709 : }
2710 0 : return py_dns_name2;
2711 : }
2712 :
2713 0 : static int py_repsFromTo2OtherInfo_set_dns_name2(PyObject *py_obj, PyObject *value, void *closure)
2714 : {
2715 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2716 0 : if (value == NULL) {
2717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_name2");
2718 0 : return -1;
2719 : }
2720 0 : if (value == Py_None) {
2721 0 : object->dns_name2 = NULL;
2722 : } else {
2723 0 : object->dns_name2 = NULL;
2724 : {
2725 : const char *test_str;
2726 : const char *talloc_str;
2727 0 : PyObject *unicode = NULL;
2728 0 : if (PyUnicode_Check(value)) {
2729 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2730 0 : if (unicode == NULL) {
2731 0 : PyErr_NoMemory();
2732 0 : return -1;
2733 : }
2734 0 : test_str = PyBytes_AS_STRING(unicode);
2735 0 : } else if (PyBytes_Check(value)) {
2736 0 : test_str = PyBytes_AS_STRING(value);
2737 : } else {
2738 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2739 0 : return -1;
2740 : }
2741 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2742 0 : if (unicode != NULL) {
2743 0 : Py_DECREF(unicode);
2744 : }
2745 0 : if (talloc_str == NULL) {
2746 0 : PyErr_NoMemory();
2747 0 : return -1;
2748 : }
2749 0 : object->dns_name2 = talloc_str;
2750 : }
2751 : }
2752 0 : return 0;
2753 : }
2754 :
2755 0 : static PyObject *py_repsFromTo2OtherInfo_get_unknown2(PyObject *obj, void *closure)
2756 : {
2757 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(obj);
2758 : PyObject *py_unknown2;
2759 0 : py_unknown2 = PyLong_FromUnsignedLongLong(object->unknown2);
2760 0 : return py_unknown2;
2761 : }
2762 :
2763 0 : static int py_repsFromTo2OtherInfo_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
2764 : {
2765 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2766 0 : if (value == NULL) {
2767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
2768 0 : return -1;
2769 : }
2770 : {
2771 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2));
2772 0 : if (PyLong_Check(value)) {
2773 : unsigned long long test_var;
2774 0 : test_var = PyLong_AsUnsignedLongLong(value);
2775 0 : if (PyErr_Occurred() != NULL) {
2776 0 : return -1;
2777 : }
2778 0 : if (test_var > uint_max) {
2779 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2780 : PyLong_Type.tp_name, uint_max, test_var);
2781 0 : return -1;
2782 : }
2783 0 : object->unknown2 = test_var;
2784 : } else {
2785 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2786 : PyLong_Type.tp_name);
2787 0 : return -1;
2788 : }
2789 : }
2790 0 : return 0;
2791 : }
2792 :
2793 : static PyGetSetDef py_repsFromTo2OtherInfo_getsetters[] = {
2794 : {
2795 : .name = discard_const_p(char, "__ndr_size"),
2796 : .get = py_repsFromTo2OtherInfo_get___ndr_size,
2797 : .set = py_repsFromTo2OtherInfo_set___ndr_size,
2798 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2799 : },
2800 : {
2801 : .name = discard_const_p(char, "dns_name1"),
2802 : .get = py_repsFromTo2OtherInfo_get_dns_name1,
2803 : .set = py_repsFromTo2OtherInfo_set_dns_name1,
2804 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2805 : },
2806 : {
2807 : .name = discard_const_p(char, "unknown1"),
2808 : .get = py_repsFromTo2OtherInfo_get_unknown1,
2809 : .set = py_repsFromTo2OtherInfo_set_unknown1,
2810 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2811 : },
2812 : {
2813 : .name = discard_const_p(char, "dns_name2"),
2814 : .get = py_repsFromTo2OtherInfo_get_dns_name2,
2815 : .set = py_repsFromTo2OtherInfo_set_dns_name2,
2816 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2817 : },
2818 : {
2819 : .name = discard_const_p(char, "unknown2"),
2820 : .get = py_repsFromTo2OtherInfo_get_unknown2,
2821 : .set = py_repsFromTo2OtherInfo_set_unknown2,
2822 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2823 : },
2824 : { .name = NULL }
2825 : };
2826 :
2827 0 : static PyObject *py_repsFromTo2OtherInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2828 : {
2829 0 : return pytalloc_new(struct repsFromTo2OtherInfo, type);
2830 : }
2831 :
2832 0 : static PyObject *py_repsFromTo2OtherInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2833 : {
2834 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2835 0 : PyObject *ret = NULL;
2836 : DATA_BLOB blob;
2837 : enum ndr_err_code err;
2838 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2839 0 : if (tmp_ctx == NULL) {
2840 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2841 0 : return NULL;
2842 : }
2843 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_repsFromTo2OtherInfo);
2844 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2845 0 : TALLOC_FREE(tmp_ctx);
2846 0 : PyErr_SetNdrError(err);
2847 0 : return NULL;
2848 : }
2849 :
2850 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2851 0 : TALLOC_FREE(tmp_ctx);
2852 0 : return ret;
2853 : }
2854 :
2855 0 : static PyObject *py_repsFromTo2OtherInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2856 : {
2857 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2858 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2859 0 : Py_ssize_t blob_length = 0;
2860 : enum ndr_err_code err;
2861 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2862 0 : PyObject *allow_remaining_obj = NULL;
2863 0 : bool allow_remaining = false;
2864 :
2865 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2866 : discard_const_p(char *, kwnames),
2867 : &blob.data, &blob_length,
2868 : &allow_remaining_obj)) {
2869 0 : return NULL;
2870 : }
2871 0 : blob.length = blob_length;
2872 :
2873 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2874 0 : allow_remaining = true;
2875 : }
2876 :
2877 0 : if (allow_remaining) {
2878 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo2OtherInfo);
2879 : } else {
2880 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo2OtherInfo);
2881 : }
2882 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2883 0 : PyErr_SetNdrError(err);
2884 0 : return NULL;
2885 : }
2886 :
2887 0 : Py_RETURN_NONE;
2888 : }
2889 :
2890 0 : static PyObject *py_repsFromTo2OtherInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2891 : {
2892 0 : struct repsFromTo2OtherInfo *object = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(py_obj);
2893 : PyObject *ret;
2894 : char *retstr;
2895 :
2896 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_repsFromTo2OtherInfo, "repsFromTo2OtherInfo", object);
2897 0 : ret = PyUnicode_FromString(retstr);
2898 0 : talloc_free(retstr);
2899 :
2900 0 : return ret;
2901 : }
2902 :
2903 : static PyMethodDef py_repsFromTo2OtherInfo_methods[] = {
2904 : { "__ndr_pack__", (PyCFunction)py_repsFromTo2OtherInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2905 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromTo2OtherInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2906 : { "__ndr_print__", (PyCFunction)py_repsFromTo2OtherInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2907 : { NULL, NULL, 0, NULL }
2908 : };
2909 :
2910 :
2911 : static PyTypeObject repsFromTo2OtherInfo_Type = {
2912 : PyVarObject_HEAD_INIT(NULL, 0)
2913 : .tp_name = "drsblobs.repsFromTo2OtherInfo",
2914 : .tp_getset = py_repsFromTo2OtherInfo_getsetters,
2915 : .tp_methods = py_repsFromTo2OtherInfo_methods,
2916 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2917 : .tp_new = py_repsFromTo2OtherInfo_new,
2918 : };
2919 :
2920 :
2921 0 : static PyObject *py_repsFromTo2_get_blobsize(PyObject *obj, void *closure)
2922 : {
2923 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
2924 : PyObject *py_blobsize;
2925 0 : py_blobsize = PyLong_FromUnsignedLongLong((uint32_t)object->blobsize);
2926 0 : return py_blobsize;
2927 : }
2928 :
2929 0 : static int py_repsFromTo2_set_blobsize(PyObject *py_obj, PyObject *value, void *closure)
2930 : {
2931 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
2932 0 : if (value == NULL) {
2933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blobsize");
2934 0 : return -1;
2935 : }
2936 : {
2937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->blobsize));
2938 0 : if (PyLong_Check(value)) {
2939 : unsigned long long test_var;
2940 0 : test_var = PyLong_AsUnsignedLongLong(value);
2941 0 : if (PyErr_Occurred() != NULL) {
2942 0 : return -1;
2943 : }
2944 0 : if (test_var > uint_max) {
2945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2946 : PyLong_Type.tp_name, uint_max, test_var);
2947 0 : return -1;
2948 : }
2949 0 : object->blobsize = test_var;
2950 : } else {
2951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2952 : PyLong_Type.tp_name);
2953 0 : return -1;
2954 : }
2955 : }
2956 0 : return 0;
2957 : }
2958 :
2959 0 : static PyObject *py_repsFromTo2_get_consecutive_sync_failures(PyObject *obj, void *closure)
2960 : {
2961 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
2962 : PyObject *py_consecutive_sync_failures;
2963 0 : py_consecutive_sync_failures = PyLong_FromUnsignedLongLong((uint32_t)object->consecutive_sync_failures);
2964 0 : return py_consecutive_sync_failures;
2965 : }
2966 :
2967 0 : static int py_repsFromTo2_set_consecutive_sync_failures(PyObject *py_obj, PyObject *value, void *closure)
2968 : {
2969 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
2970 0 : if (value == NULL) {
2971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->consecutive_sync_failures");
2972 0 : return -1;
2973 : }
2974 : {
2975 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->consecutive_sync_failures));
2976 0 : if (PyLong_Check(value)) {
2977 : unsigned long long test_var;
2978 0 : test_var = PyLong_AsUnsignedLongLong(value);
2979 0 : if (PyErr_Occurred() != NULL) {
2980 0 : return -1;
2981 : }
2982 0 : if (test_var > uint_max) {
2983 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2984 : PyLong_Type.tp_name, uint_max, test_var);
2985 0 : return -1;
2986 : }
2987 0 : object->consecutive_sync_failures = test_var;
2988 : } else {
2989 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2990 : PyLong_Type.tp_name);
2991 0 : return -1;
2992 : }
2993 : }
2994 0 : return 0;
2995 : }
2996 :
2997 0 : static PyObject *py_repsFromTo2_get_last_success(PyObject *obj, void *closure)
2998 : {
2999 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3000 : PyObject *py_last_success;
3001 0 : py_last_success = PyLong_FromUnsignedLongLong(object->last_success);
3002 0 : return py_last_success;
3003 : }
3004 :
3005 0 : static int py_repsFromTo2_set_last_success(PyObject *py_obj, PyObject *value, void *closure)
3006 : {
3007 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3008 0 : if (value == NULL) {
3009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_success");
3010 0 : return -1;
3011 : }
3012 : {
3013 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_success));
3014 0 : if (PyLong_Check(value)) {
3015 : unsigned long long test_var;
3016 0 : test_var = PyLong_AsUnsignedLongLong(value);
3017 0 : if (PyErr_Occurred() != NULL) {
3018 0 : return -1;
3019 : }
3020 0 : if (test_var > uint_max) {
3021 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3022 : PyLong_Type.tp_name, uint_max, test_var);
3023 0 : return -1;
3024 : }
3025 0 : object->last_success = test_var;
3026 : } else {
3027 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3028 : PyLong_Type.tp_name);
3029 0 : return -1;
3030 : }
3031 : }
3032 0 : return 0;
3033 : }
3034 :
3035 0 : static PyObject *py_repsFromTo2_get_last_attempt(PyObject *obj, void *closure)
3036 : {
3037 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3038 : PyObject *py_last_attempt;
3039 0 : py_last_attempt = PyLong_FromUnsignedLongLong(object->last_attempt);
3040 0 : return py_last_attempt;
3041 : }
3042 :
3043 0 : static int py_repsFromTo2_set_last_attempt(PyObject *py_obj, PyObject *value, void *closure)
3044 : {
3045 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3046 0 : if (value == NULL) {
3047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_attempt");
3048 0 : return -1;
3049 : }
3050 : {
3051 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_attempt));
3052 0 : if (PyLong_Check(value)) {
3053 : unsigned long long test_var;
3054 0 : test_var = PyLong_AsUnsignedLongLong(value);
3055 0 : if (PyErr_Occurred() != NULL) {
3056 0 : return -1;
3057 : }
3058 0 : if (test_var > uint_max) {
3059 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3060 : PyLong_Type.tp_name, uint_max, test_var);
3061 0 : return -1;
3062 : }
3063 0 : object->last_attempt = test_var;
3064 : } else {
3065 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3066 : PyLong_Type.tp_name);
3067 0 : return -1;
3068 : }
3069 : }
3070 0 : return 0;
3071 : }
3072 :
3073 0 : static PyObject *py_repsFromTo2_get_result_last_attempt(PyObject *obj, void *closure)
3074 : {
3075 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3076 : PyObject *py_result_last_attempt;
3077 0 : py_result_last_attempt = PyErr_FromWERROR(object->result_last_attempt);
3078 0 : return py_result_last_attempt;
3079 : }
3080 :
3081 0 : static int py_repsFromTo2_set_result_last_attempt(PyObject *py_obj, PyObject *value, void *closure)
3082 : {
3083 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3084 0 : if (value == NULL) {
3085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->result_last_attempt");
3086 0 : return -1;
3087 : }
3088 0 : object->result_last_attempt = W_ERROR(PyLong_AsLong(value));
3089 0 : return 0;
3090 : }
3091 :
3092 0 : static PyObject *py_repsFromTo2_get_other_info(PyObject *obj, void *closure)
3093 : {
3094 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3095 : PyObject *py_other_info;
3096 0 : if (object->other_info == NULL) {
3097 0 : Py_RETURN_NONE;
3098 : }
3099 0 : if (object->other_info == NULL) {
3100 0 : py_other_info = Py_None;
3101 0 : Py_INCREF(py_other_info);
3102 : } else {
3103 0 : py_other_info = pytalloc_reference_ex(&repsFromTo2OtherInfo_Type, object->other_info, object->other_info);
3104 : }
3105 0 : return py_other_info;
3106 : }
3107 :
3108 0 : static int py_repsFromTo2_set_other_info(PyObject *py_obj, PyObject *value, void *closure)
3109 : {
3110 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3111 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->other_info));
3112 0 : if (value == NULL) {
3113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->other_info");
3114 0 : return -1;
3115 : }
3116 0 : if (value == Py_None) {
3117 0 : object->other_info = NULL;
3118 : } else {
3119 0 : object->other_info = NULL;
3120 0 : PY_CHECK_TYPE(&repsFromTo2OtherInfo_Type, value, return -1;);
3121 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3122 0 : PyErr_NoMemory();
3123 0 : return -1;
3124 : }
3125 0 : object->other_info = (struct repsFromTo2OtherInfo *)pytalloc_get_ptr(value);
3126 : }
3127 0 : return 0;
3128 : }
3129 :
3130 0 : static PyObject *py_repsFromTo2_get_other_info_length(PyObject *obj, void *closure)
3131 : {
3132 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3133 : PyObject *py_other_info_length;
3134 0 : py_other_info_length = PyLong_FromUnsignedLongLong((uint32_t)object->other_info_length);
3135 0 : return py_other_info_length;
3136 : }
3137 :
3138 0 : static int py_repsFromTo2_set_other_info_length(PyObject *py_obj, PyObject *value, void *closure)
3139 : {
3140 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3141 0 : if (value == NULL) {
3142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->other_info_length");
3143 0 : return -1;
3144 : }
3145 : {
3146 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->other_info_length));
3147 0 : if (PyLong_Check(value)) {
3148 : unsigned long long test_var;
3149 0 : test_var = PyLong_AsUnsignedLongLong(value);
3150 0 : if (PyErr_Occurred() != NULL) {
3151 0 : return -1;
3152 : }
3153 0 : if (test_var > uint_max) {
3154 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3155 : PyLong_Type.tp_name, uint_max, test_var);
3156 0 : return -1;
3157 : }
3158 0 : object->other_info_length = test_var;
3159 : } else {
3160 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3161 : PyLong_Type.tp_name);
3162 0 : return -1;
3163 : }
3164 : }
3165 0 : return 0;
3166 : }
3167 :
3168 0 : static PyObject *py_repsFromTo2_get_replica_flags(PyObject *obj, void *closure)
3169 : {
3170 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3171 : PyObject *py_replica_flags;
3172 0 : py_replica_flags = PyLong_FromUnsignedLongLong((uint32_t)object->replica_flags);
3173 0 : return py_replica_flags;
3174 : }
3175 :
3176 0 : static int py_repsFromTo2_set_replica_flags(PyObject *py_obj, PyObject *value, void *closure)
3177 : {
3178 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3179 0 : if (value == NULL) {
3180 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->replica_flags");
3181 0 : return -1;
3182 : }
3183 : {
3184 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->replica_flags));
3185 0 : if (PyLong_Check(value)) {
3186 : unsigned long long test_var;
3187 0 : test_var = PyLong_AsUnsignedLongLong(value);
3188 0 : if (PyErr_Occurred() != NULL) {
3189 0 : return -1;
3190 : }
3191 0 : if (test_var > uint_max) {
3192 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3193 : PyLong_Type.tp_name, uint_max, test_var);
3194 0 : return -1;
3195 : }
3196 0 : object->replica_flags = test_var;
3197 : } else {
3198 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3199 : PyLong_Type.tp_name);
3200 0 : return -1;
3201 : }
3202 : }
3203 0 : return 0;
3204 : }
3205 :
3206 0 : static PyObject *py_repsFromTo2_get_schedule(PyObject *obj, void *closure)
3207 : {
3208 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3209 : PyObject *py_schedule;
3210 0 : py_schedule = PyList_New(84);
3211 0 : if (py_schedule == NULL) {
3212 0 : return NULL;
3213 : }
3214 : {
3215 : int schedule_cntr_0;
3216 0 : for (schedule_cntr_0 = 0; schedule_cntr_0 < (84); schedule_cntr_0++) {
3217 : PyObject *py_schedule_0;
3218 0 : py_schedule_0 = PyLong_FromLong((uint16_t)object->schedule[schedule_cntr_0]);
3219 0 : PyList_SetItem(py_schedule, schedule_cntr_0, py_schedule_0);
3220 : }
3221 : }
3222 0 : return py_schedule;
3223 : }
3224 :
3225 0 : static int py_repsFromTo2_set_schedule(PyObject *py_obj, PyObject *value, void *closure)
3226 : {
3227 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3228 0 : if (value == NULL) {
3229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->schedule");
3230 0 : return -1;
3231 : }
3232 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3233 : {
3234 : int schedule_cntr_0;
3235 0 : if (ARRAY_SIZE(object->schedule) != PyList_GET_SIZE(value)) {
3236 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->schedule), PyList_GET_SIZE(value));
3237 0 : return -1;
3238 : }
3239 0 : for (schedule_cntr_0 = 0; schedule_cntr_0 < PyList_GET_SIZE(value); schedule_cntr_0++) {
3240 0 : if (PyList_GET_ITEM(value, schedule_cntr_0) == NULL) {
3241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->schedule[schedule_cntr_0]");
3242 0 : return -1;
3243 : }
3244 : {
3245 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->schedule[schedule_cntr_0]));
3246 0 : if (PyLong_Check(PyList_GET_ITEM(value, schedule_cntr_0))) {
3247 : unsigned long long test_var;
3248 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, schedule_cntr_0));
3249 0 : if (PyErr_Occurred() != NULL) {
3250 0 : return -1;
3251 : }
3252 0 : if (test_var > uint_max) {
3253 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3254 : PyLong_Type.tp_name, uint_max, test_var);
3255 0 : return -1;
3256 : }
3257 0 : object->schedule[schedule_cntr_0] = test_var;
3258 : } else {
3259 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3260 : PyLong_Type.tp_name);
3261 0 : return -1;
3262 : }
3263 : }
3264 : }
3265 : }
3266 0 : return 0;
3267 : }
3268 :
3269 0 : static PyObject *py_repsFromTo2_get_reserved(PyObject *obj, void *closure)
3270 : {
3271 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3272 : PyObject *py_reserved;
3273 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
3274 0 : return py_reserved;
3275 : }
3276 :
3277 0 : static int py_repsFromTo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3278 : {
3279 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3280 0 : if (value == NULL) {
3281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
3282 0 : return -1;
3283 : }
3284 : {
3285 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
3286 0 : if (PyLong_Check(value)) {
3287 : unsigned long long test_var;
3288 0 : test_var = PyLong_AsUnsignedLongLong(value);
3289 0 : if (PyErr_Occurred() != NULL) {
3290 0 : return -1;
3291 : }
3292 0 : if (test_var > uint_max) {
3293 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3294 : PyLong_Type.tp_name, uint_max, test_var);
3295 0 : return -1;
3296 : }
3297 0 : object->reserved = test_var;
3298 : } else {
3299 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3300 : PyLong_Type.tp_name);
3301 0 : return -1;
3302 : }
3303 : }
3304 0 : return 0;
3305 : }
3306 :
3307 0 : static PyObject *py_repsFromTo2_get_highwatermark(PyObject *obj, void *closure)
3308 : {
3309 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3310 : PyObject *py_highwatermark;
3311 0 : py_highwatermark = pytalloc_reference_ex(drsuapi_DsReplicaHighWaterMark_Type, pytalloc_get_mem_ctx(obj), &object->highwatermark);
3312 0 : return py_highwatermark;
3313 : }
3314 :
3315 0 : static int py_repsFromTo2_set_highwatermark(PyObject *py_obj, PyObject *value, void *closure)
3316 : {
3317 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3318 0 : if (value == NULL) {
3319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->highwatermark");
3320 0 : return -1;
3321 : }
3322 0 : PY_CHECK_TYPE(drsuapi_DsReplicaHighWaterMark_Type, value, return -1;);
3323 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3324 0 : PyErr_NoMemory();
3325 0 : return -1;
3326 : }
3327 0 : object->highwatermark = *(struct drsuapi_DsReplicaHighWaterMark *)pytalloc_get_ptr(value);
3328 0 : return 0;
3329 : }
3330 :
3331 0 : static PyObject *py_repsFromTo2_get_source_dsa_obj_guid(PyObject *obj, void *closure)
3332 : {
3333 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3334 : PyObject *py_source_dsa_obj_guid;
3335 0 : py_source_dsa_obj_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->source_dsa_obj_guid);
3336 0 : return py_source_dsa_obj_guid;
3337 : }
3338 :
3339 0 : static int py_repsFromTo2_set_source_dsa_obj_guid(PyObject *py_obj, PyObject *value, void *closure)
3340 : {
3341 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3342 0 : if (value == NULL) {
3343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_dsa_obj_guid");
3344 0 : return -1;
3345 : }
3346 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3347 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3348 0 : PyErr_NoMemory();
3349 0 : return -1;
3350 : }
3351 0 : object->source_dsa_obj_guid = *(struct GUID *)pytalloc_get_ptr(value);
3352 0 : return 0;
3353 : }
3354 :
3355 0 : static PyObject *py_repsFromTo2_get_source_dsa_invocation_id(PyObject *obj, void *closure)
3356 : {
3357 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3358 : PyObject *py_source_dsa_invocation_id;
3359 0 : py_source_dsa_invocation_id = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->source_dsa_invocation_id);
3360 0 : return py_source_dsa_invocation_id;
3361 : }
3362 :
3363 0 : static int py_repsFromTo2_set_source_dsa_invocation_id(PyObject *py_obj, PyObject *value, void *closure)
3364 : {
3365 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3366 0 : if (value == NULL) {
3367 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_dsa_invocation_id");
3368 0 : return -1;
3369 : }
3370 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3371 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3372 0 : PyErr_NoMemory();
3373 0 : return -1;
3374 : }
3375 0 : object->source_dsa_invocation_id = *(struct GUID *)pytalloc_get_ptr(value);
3376 0 : return 0;
3377 : }
3378 :
3379 0 : static PyObject *py_repsFromTo2_get_transport_guid(PyObject *obj, void *closure)
3380 : {
3381 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3382 : PyObject *py_transport_guid;
3383 0 : py_transport_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->transport_guid);
3384 0 : return py_transport_guid;
3385 : }
3386 :
3387 0 : static int py_repsFromTo2_set_transport_guid(PyObject *py_obj, PyObject *value, void *closure)
3388 : {
3389 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3390 0 : if (value == NULL) {
3391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transport_guid");
3392 0 : return -1;
3393 : }
3394 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3395 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3396 0 : PyErr_NoMemory();
3397 0 : return -1;
3398 : }
3399 0 : object->transport_guid = *(struct GUID *)pytalloc_get_ptr(value);
3400 0 : return 0;
3401 : }
3402 :
3403 0 : static PyObject *py_repsFromTo2_get_unknown1(PyObject *obj, void *closure)
3404 : {
3405 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(obj);
3406 : PyObject *py_unknown1;
3407 0 : py_unknown1 = PyLong_FromUnsignedLongLong(object->unknown1);
3408 0 : return py_unknown1;
3409 : }
3410 :
3411 0 : static int py_repsFromTo2_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
3412 : {
3413 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3414 0 : if (value == NULL) {
3415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
3416 0 : return -1;
3417 : }
3418 : {
3419 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
3420 0 : if (PyLong_Check(value)) {
3421 : unsigned long long test_var;
3422 0 : test_var = PyLong_AsUnsignedLongLong(value);
3423 0 : if (PyErr_Occurred() != NULL) {
3424 0 : return -1;
3425 : }
3426 0 : if (test_var > uint_max) {
3427 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3428 : PyLong_Type.tp_name, uint_max, test_var);
3429 0 : return -1;
3430 : }
3431 0 : object->unknown1 = test_var;
3432 : } else {
3433 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3434 : PyLong_Type.tp_name);
3435 0 : return -1;
3436 : }
3437 : }
3438 0 : return 0;
3439 : }
3440 :
3441 : static PyGetSetDef py_repsFromTo2_getsetters[] = {
3442 : {
3443 : .name = discard_const_p(char, "blobsize"),
3444 : .get = py_repsFromTo2_get_blobsize,
3445 : .set = py_repsFromTo2_set_blobsize,
3446 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3447 : },
3448 : {
3449 : .name = discard_const_p(char, "consecutive_sync_failures"),
3450 : .get = py_repsFromTo2_get_consecutive_sync_failures,
3451 : .set = py_repsFromTo2_set_consecutive_sync_failures,
3452 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3453 : },
3454 : {
3455 : .name = discard_const_p(char, "last_success"),
3456 : .get = py_repsFromTo2_get_last_success,
3457 : .set = py_repsFromTo2_set_last_success,
3458 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_1sec")
3459 : },
3460 : {
3461 : .name = discard_const_p(char, "last_attempt"),
3462 : .get = py_repsFromTo2_get_last_attempt,
3463 : .set = py_repsFromTo2_set_last_attempt,
3464 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_1sec")
3465 : },
3466 : {
3467 : .name = discard_const_p(char, "result_last_attempt"),
3468 : .get = py_repsFromTo2_get_result_last_attempt,
3469 : .set = py_repsFromTo2_set_result_last_attempt,
3470 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
3471 : },
3472 : {
3473 : .name = discard_const_p(char, "other_info"),
3474 : .get = py_repsFromTo2_get_other_info,
3475 : .set = py_repsFromTo2_set_other_info,
3476 : .doc = discard_const_p(char, "PIDL-generated element of base type repsFromTo2OtherInfo")
3477 : },
3478 : {
3479 : .name = discard_const_p(char, "other_info_length"),
3480 : .get = py_repsFromTo2_get_other_info_length,
3481 : .set = py_repsFromTo2_set_other_info_length,
3482 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3483 : },
3484 : {
3485 : .name = discard_const_p(char, "replica_flags"),
3486 : .get = py_repsFromTo2_get_replica_flags,
3487 : .set = py_repsFromTo2_set_replica_flags,
3488 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DrsOptions")
3489 : },
3490 : {
3491 : .name = discard_const_p(char, "schedule"),
3492 : .get = py_repsFromTo2_get_schedule,
3493 : .set = py_repsFromTo2_set_schedule,
3494 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3495 : },
3496 : {
3497 : .name = discard_const_p(char, "reserved"),
3498 : .get = py_repsFromTo2_get_reserved,
3499 : .set = py_repsFromTo2_set_reserved,
3500 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3501 : },
3502 : {
3503 : .name = discard_const_p(char, "highwatermark"),
3504 : .get = py_repsFromTo2_get_highwatermark,
3505 : .set = py_repsFromTo2_set_highwatermark,
3506 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsReplicaHighWaterMark")
3507 : },
3508 : {
3509 : .name = discard_const_p(char, "source_dsa_obj_guid"),
3510 : .get = py_repsFromTo2_get_source_dsa_obj_guid,
3511 : .set = py_repsFromTo2_set_source_dsa_obj_guid,
3512 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
3513 : },
3514 : {
3515 : .name = discard_const_p(char, "source_dsa_invocation_id"),
3516 : .get = py_repsFromTo2_get_source_dsa_invocation_id,
3517 : .set = py_repsFromTo2_set_source_dsa_invocation_id,
3518 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
3519 : },
3520 : {
3521 : .name = discard_const_p(char, "transport_guid"),
3522 : .get = py_repsFromTo2_get_transport_guid,
3523 : .set = py_repsFromTo2_set_transport_guid,
3524 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
3525 : },
3526 : {
3527 : .name = discard_const_p(char, "unknown1"),
3528 : .get = py_repsFromTo2_get_unknown1,
3529 : .set = py_repsFromTo2_set_unknown1,
3530 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3531 : },
3532 : { .name = NULL }
3533 : };
3534 :
3535 0 : static PyObject *py_repsFromTo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3536 : {
3537 0 : return pytalloc_new(struct repsFromTo2, type);
3538 : }
3539 :
3540 0 : static PyObject *py_repsFromTo2_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3541 : {
3542 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3543 0 : PyObject *ret = NULL;
3544 : DATA_BLOB blob;
3545 : enum ndr_err_code err;
3546 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3547 0 : if (tmp_ctx == NULL) {
3548 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3549 0 : return NULL;
3550 : }
3551 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_repsFromTo2);
3552 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3553 0 : TALLOC_FREE(tmp_ctx);
3554 0 : PyErr_SetNdrError(err);
3555 0 : return NULL;
3556 : }
3557 :
3558 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3559 0 : TALLOC_FREE(tmp_ctx);
3560 0 : return ret;
3561 : }
3562 :
3563 0 : static PyObject *py_repsFromTo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3564 : {
3565 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3566 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3567 0 : Py_ssize_t blob_length = 0;
3568 : enum ndr_err_code err;
3569 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3570 0 : PyObject *allow_remaining_obj = NULL;
3571 0 : bool allow_remaining = false;
3572 :
3573 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3574 : discard_const_p(char *, kwnames),
3575 : &blob.data, &blob_length,
3576 : &allow_remaining_obj)) {
3577 0 : return NULL;
3578 : }
3579 0 : blob.length = blob_length;
3580 :
3581 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3582 0 : allow_remaining = true;
3583 : }
3584 :
3585 0 : if (allow_remaining) {
3586 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo2);
3587 : } else {
3588 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromTo2);
3589 : }
3590 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3591 0 : PyErr_SetNdrError(err);
3592 0 : return NULL;
3593 : }
3594 :
3595 0 : Py_RETURN_NONE;
3596 : }
3597 :
3598 0 : static PyObject *py_repsFromTo2_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3599 : {
3600 0 : struct repsFromTo2 *object = (struct repsFromTo2 *)pytalloc_get_ptr(py_obj);
3601 : PyObject *ret;
3602 : char *retstr;
3603 :
3604 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_repsFromTo2, "repsFromTo2", object);
3605 0 : ret = PyUnicode_FromString(retstr);
3606 0 : talloc_free(retstr);
3607 :
3608 0 : return ret;
3609 : }
3610 :
3611 : static PyMethodDef py_repsFromTo2_methods[] = {
3612 : { "__ndr_pack__", (PyCFunction)py_repsFromTo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3613 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromTo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3614 : { "__ndr_print__", (PyCFunction)py_repsFromTo2_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3615 : { NULL, NULL, 0, NULL }
3616 : };
3617 :
3618 :
3619 : static PyTypeObject repsFromTo2_Type = {
3620 : PyVarObject_HEAD_INIT(NULL, 0)
3621 : .tp_name = "drsblobs.repsFromTo2",
3622 : .tp_getset = py_repsFromTo2_getsetters,
3623 : .tp_methods = py_repsFromTo2_methods,
3624 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3625 : .tp_new = py_repsFromTo2_new,
3626 : };
3627 :
3628 15869 : static PyObject *py_import_repsFromTo(TALLOC_CTX *mem_ctx, int level, union repsFromTo *in)
3629 : {
3630 : PyObject *ret;
3631 :
3632 15869 : switch (level) {
3633 15869 : case 1:
3634 15869 : ret = pytalloc_reference_ex(&repsFromTo1_Type, mem_ctx, &in->ctr1);
3635 15869 : return ret;
3636 :
3637 0 : case 2:
3638 0 : ret = pytalloc_reference_ex(&repsFromTo2_Type, mem_ctx, &in->ctr2);
3639 0 : return ret;
3640 :
3641 : }
3642 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
3643 0 : return NULL;
3644 : }
3645 :
3646 0 : static union repsFromTo *py_export_repsFromTo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
3647 : {
3648 0 : union repsFromTo *ret = talloc_zero(mem_ctx, union repsFromTo);
3649 0 : switch (level) {
3650 0 : case 1:
3651 0 : if (in == NULL) {
3652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
3653 0 : talloc_free(ret); return NULL;
3654 : }
3655 0 : PY_CHECK_TYPE(&repsFromTo1_Type, in, talloc_free(ret); return NULL;);
3656 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3657 0 : PyErr_NoMemory();
3658 0 : talloc_free(ret); return NULL;
3659 : }
3660 0 : ret->ctr1 = *(struct repsFromTo1 *)pytalloc_get_ptr(in);
3661 0 : break;
3662 :
3663 0 : case 2:
3664 0 : if (in == NULL) {
3665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr2");
3666 0 : talloc_free(ret); return NULL;
3667 : }
3668 0 : PY_CHECK_TYPE(&repsFromTo2_Type, in, talloc_free(ret); return NULL;);
3669 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3670 0 : PyErr_NoMemory();
3671 0 : talloc_free(ret); return NULL;
3672 : }
3673 0 : ret->ctr2 = *(struct repsFromTo2 *)pytalloc_get_ptr(in);
3674 0 : break;
3675 :
3676 0 : default:
3677 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
3678 0 : talloc_free(ret);
3679 0 : ret = NULL;
3680 : }
3681 :
3682 0 : return ret;
3683 : }
3684 :
3685 15869 : static PyObject *py_repsFromTo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3686 : {
3687 15869 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3688 15869 : PyObject *mem_ctx_obj = NULL;
3689 15869 : TALLOC_CTX *mem_ctx = NULL;
3690 15869 : int level = 0;
3691 15869 : PyObject *in_obj = NULL;
3692 15869 : union repsFromTo *in = NULL;
3693 :
3694 15869 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
3695 : discard_const_p(char *, kwnames),
3696 : &mem_ctx_obj,
3697 : &level,
3698 : &in_obj)) {
3699 0 : return NULL;
3700 : }
3701 15869 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3702 15869 : if (mem_ctx == NULL) {
3703 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3704 0 : return NULL;
3705 : }
3706 15869 : in = (union repsFromTo *)pytalloc_get_ptr(in_obj);
3707 15869 : if (in == NULL) {
3708 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union repsFromTo!");
3709 0 : return NULL;
3710 : }
3711 :
3712 15869 : return py_import_repsFromTo(mem_ctx, level, in);
3713 : }
3714 :
3715 0 : static PyObject *py_repsFromTo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3716 : {
3717 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3718 0 : PyObject *mem_ctx_obj = NULL;
3719 0 : TALLOC_CTX *mem_ctx = NULL;
3720 0 : int level = 0;
3721 0 : PyObject *in = NULL;
3722 0 : union repsFromTo *out = NULL;
3723 :
3724 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
3725 : discard_const_p(char *, kwnames),
3726 : &mem_ctx_obj,
3727 : &level,
3728 : &in)) {
3729 0 : return NULL;
3730 : }
3731 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3732 0 : if (mem_ctx == NULL) {
3733 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3734 0 : return NULL;
3735 : }
3736 :
3737 0 : out = py_export_repsFromTo(mem_ctx, level, in);
3738 0 : if (out == NULL) {
3739 0 : return NULL;
3740 : }
3741 :
3742 0 : return pytalloc_GenericObject_reference(out);
3743 : }
3744 :
3745 : static PyMethodDef py_repsFromTo_methods[] = {
3746 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromTo_import),
3747 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3748 : "T.__import__(mem_ctx, level, in) => ret." },
3749 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromTo_export),
3750 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3751 : "T.__export__(mem_ctx, level, in) => ret." },
3752 : { NULL, NULL, 0, NULL }
3753 : };
3754 :
3755 0 : static PyObject *py_repsFromTo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3756 : {
3757 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
3758 0 : return NULL;
3759 : }
3760 :
3761 :
3762 : static PyTypeObject repsFromTo_Type = {
3763 : PyVarObject_HEAD_INIT(NULL, 0)
3764 : .tp_name = "drsblobs.repsFromTo",
3765 : .tp_getset = NULL,
3766 : .tp_methods = py_repsFromTo_methods,
3767 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3768 : .tp_new = py_repsFromTo_new,
3769 : };
3770 :
3771 :
3772 2521 : static PyObject *py_repsFromToBlob_get_version(PyObject *obj, void *closure)
3773 : {
3774 2521 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(obj);
3775 : PyObject *py_version;
3776 2521 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
3777 2521 : return py_version;
3778 : }
3779 :
3780 96 : static int py_repsFromToBlob_set_version(PyObject *py_obj, PyObject *value, void *closure)
3781 : {
3782 96 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(py_obj);
3783 96 : if (value == NULL) {
3784 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
3785 0 : return -1;
3786 : }
3787 : {
3788 96 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
3789 96 : if (PyLong_Check(value)) {
3790 : unsigned long long test_var;
3791 96 : test_var = PyLong_AsUnsignedLongLong(value);
3792 96 : if (PyErr_Occurred() != NULL) {
3793 0 : return -1;
3794 : }
3795 96 : if (test_var > uint_max) {
3796 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3797 : PyLong_Type.tp_name, uint_max, test_var);
3798 0 : return -1;
3799 : }
3800 96 : object->version = test_var;
3801 : } else {
3802 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3803 : PyLong_Type.tp_name);
3804 0 : return -1;
3805 : }
3806 : }
3807 96 : return 0;
3808 : }
3809 :
3810 0 : static PyObject *py_repsFromToBlob_get_reserved(PyObject *obj, void *closure)
3811 : {
3812 0 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(obj);
3813 : PyObject *py_reserved;
3814 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
3815 0 : return py_reserved;
3816 : }
3817 :
3818 0 : static int py_repsFromToBlob_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3819 : {
3820 0 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(py_obj);
3821 0 : if (value == NULL) {
3822 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
3823 0 : return -1;
3824 : }
3825 : {
3826 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
3827 0 : if (PyLong_Check(value)) {
3828 : unsigned long long test_var;
3829 0 : test_var = PyLong_AsUnsignedLongLong(value);
3830 0 : if (PyErr_Occurred() != NULL) {
3831 0 : return -1;
3832 : }
3833 0 : if (test_var > uint_max) {
3834 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3835 : PyLong_Type.tp_name, uint_max, test_var);
3836 0 : return -1;
3837 : }
3838 0 : object->reserved = test_var;
3839 : } else {
3840 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3841 : PyLong_Type.tp_name);
3842 0 : return -1;
3843 : }
3844 : }
3845 0 : return 0;
3846 : }
3847 :
3848 15869 : static PyObject *py_repsFromToBlob_get_ctr(PyObject *obj, void *closure)
3849 : {
3850 15869 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(obj);
3851 : PyObject *py_ctr;
3852 15869 : py_ctr = pyrpc_import_union(&repsFromTo_Type, pytalloc_get_mem_ctx(obj), object->version, &object->ctr, "union repsFromTo");
3853 15869 : if (py_ctr == NULL) {
3854 0 : return NULL;
3855 : }
3856 15869 : return py_ctr;
3857 : }
3858 :
3859 0 : static int py_repsFromToBlob_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
3860 : {
3861 0 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(py_obj);
3862 0 : if (value == NULL) {
3863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
3864 0 : return -1;
3865 : }
3866 : {
3867 : union repsFromTo *ctr_switch_0;
3868 0 : ctr_switch_0 = (union repsFromTo *)pyrpc_export_union(&repsFromTo_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union repsFromTo");
3869 0 : if (ctr_switch_0 == NULL) {
3870 0 : return -1;
3871 : }
3872 0 : object->ctr = *ctr_switch_0;
3873 : }
3874 0 : return 0;
3875 : }
3876 :
3877 : static PyGetSetDef py_repsFromToBlob_getsetters[] = {
3878 : {
3879 : .name = discard_const_p(char, "version"),
3880 : .get = py_repsFromToBlob_get_version,
3881 : .set = py_repsFromToBlob_set_version,
3882 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3883 : },
3884 : {
3885 : .name = discard_const_p(char, "reserved"),
3886 : .get = py_repsFromToBlob_get_reserved,
3887 : .set = py_repsFromToBlob_set_reserved,
3888 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3889 : },
3890 : {
3891 : .name = discard_const_p(char, "ctr"),
3892 : .get = py_repsFromToBlob_get_ctr,
3893 : .set = py_repsFromToBlob_set_ctr,
3894 : .doc = discard_const_p(char, "PIDL-generated element of base type repsFromTo")
3895 : },
3896 : { .name = NULL }
3897 : };
3898 :
3899 1119 : static PyObject *py_repsFromToBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3900 : {
3901 1119 : return pytalloc_new(struct repsFromToBlob, type);
3902 : }
3903 :
3904 912 : static PyObject *py_repsFromToBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3905 : {
3906 912 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(py_obj);
3907 912 : PyObject *ret = NULL;
3908 : DATA_BLOB blob;
3909 : enum ndr_err_code err;
3910 912 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3911 912 : if (tmp_ctx == NULL) {
3912 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3913 0 : return NULL;
3914 : }
3915 912 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_repsFromToBlob);
3916 912 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3917 0 : TALLOC_FREE(tmp_ctx);
3918 0 : PyErr_SetNdrError(err);
3919 0 : return NULL;
3920 : }
3921 :
3922 912 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3923 912 : TALLOC_FREE(tmp_ctx);
3924 912 : return ret;
3925 : }
3926 :
3927 1023 : static PyObject *py_repsFromToBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3928 : {
3929 1023 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(py_obj);
3930 1023 : DATA_BLOB blob = {.data = NULL, .length = 0};
3931 1023 : Py_ssize_t blob_length = 0;
3932 : enum ndr_err_code err;
3933 1023 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3934 1023 : PyObject *allow_remaining_obj = NULL;
3935 1023 : bool allow_remaining = false;
3936 :
3937 1023 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3938 : discard_const_p(char *, kwnames),
3939 : &blob.data, &blob_length,
3940 : &allow_remaining_obj)) {
3941 0 : return NULL;
3942 : }
3943 1023 : blob.length = blob_length;
3944 :
3945 1023 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3946 1 : allow_remaining = true;
3947 : }
3948 :
3949 1023 : if (allow_remaining) {
3950 1 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob);
3951 : } else {
3952 1022 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob);
3953 : }
3954 1023 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3955 0 : PyErr_SetNdrError(err);
3956 0 : return NULL;
3957 : }
3958 :
3959 1023 : Py_RETURN_NONE;
3960 : }
3961 :
3962 0 : static PyObject *py_repsFromToBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3963 : {
3964 0 : struct repsFromToBlob *object = (struct repsFromToBlob *)pytalloc_get_ptr(py_obj);
3965 : PyObject *ret;
3966 : char *retstr;
3967 :
3968 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_repsFromToBlob, "repsFromToBlob", object);
3969 0 : ret = PyUnicode_FromString(retstr);
3970 0 : talloc_free(retstr);
3971 :
3972 0 : return ret;
3973 : }
3974 :
3975 : static PyMethodDef py_repsFromToBlob_methods[] = {
3976 : { "__ndr_pack__", (PyCFunction)py_repsFromToBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3977 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_repsFromToBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3978 : { "__ndr_print__", (PyCFunction)py_repsFromToBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3979 : { NULL, NULL, 0, NULL }
3980 : };
3981 :
3982 :
3983 : static PyTypeObject repsFromToBlob_Type = {
3984 : PyVarObject_HEAD_INIT(NULL, 0)
3985 : .tp_name = "drsblobs.repsFromToBlob",
3986 : .tp_getset = py_repsFromToBlob_getsetters,
3987 : .tp_methods = py_repsFromToBlob_methods,
3988 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3989 : .tp_new = py_repsFromToBlob_new,
3990 : };
3991 :
3992 :
3993 261 : static PyObject *py_scheduleHeader_get_type(PyObject *obj, void *closure)
3994 : {
3995 261 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(obj);
3996 : PyObject *py_type;
3997 261 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
3998 261 : return py_type;
3999 : }
4000 :
4001 310 : static int py_scheduleHeader_set_type(PyObject *py_obj, PyObject *value, void *closure)
4002 : {
4003 310 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(py_obj);
4004 310 : if (value == NULL) {
4005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
4006 0 : return -1;
4007 : }
4008 : {
4009 310 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
4010 310 : if (PyLong_Check(value)) {
4011 : unsigned long long test_var;
4012 310 : test_var = PyLong_AsUnsignedLongLong(value);
4013 310 : if (PyErr_Occurred() != NULL) {
4014 0 : return -1;
4015 : }
4016 310 : if (test_var > uint_max) {
4017 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4018 : PyLong_Type.tp_name, uint_max, test_var);
4019 0 : return -1;
4020 : }
4021 310 : object->type = test_var;
4022 : } else {
4023 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4024 : PyLong_Type.tp_name);
4025 0 : return -1;
4026 : }
4027 : }
4028 310 : return 0;
4029 : }
4030 :
4031 261 : static PyObject *py_scheduleHeader_get_offset(PyObject *obj, void *closure)
4032 : {
4033 261 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(obj);
4034 : PyObject *py_offset;
4035 261 : py_offset = PyLong_FromUnsignedLongLong((uint32_t)object->offset);
4036 261 : return py_offset;
4037 : }
4038 :
4039 310 : static int py_scheduleHeader_set_offset(PyObject *py_obj, PyObject *value, void *closure)
4040 : {
4041 310 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(py_obj);
4042 310 : if (value == NULL) {
4043 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->offset");
4044 0 : return -1;
4045 : }
4046 : {
4047 310 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->offset));
4048 310 : if (PyLong_Check(value)) {
4049 : unsigned long long test_var;
4050 310 : test_var = PyLong_AsUnsignedLongLong(value);
4051 310 : if (PyErr_Occurred() != NULL) {
4052 0 : return -1;
4053 : }
4054 310 : if (test_var > uint_max) {
4055 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4056 : PyLong_Type.tp_name, uint_max, test_var);
4057 0 : return -1;
4058 : }
4059 310 : object->offset = test_var;
4060 : } else {
4061 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4062 : PyLong_Type.tp_name);
4063 0 : return -1;
4064 : }
4065 : }
4066 310 : return 0;
4067 : }
4068 :
4069 : static PyGetSetDef py_scheduleHeader_getsetters[] = {
4070 : {
4071 : .name = discard_const_p(char, "type"),
4072 : .get = py_scheduleHeader_get_type,
4073 : .set = py_scheduleHeader_set_type,
4074 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4075 : },
4076 : {
4077 : .name = discard_const_p(char, "offset"),
4078 : .get = py_scheduleHeader_get_offset,
4079 : .set = py_scheduleHeader_set_offset,
4080 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4081 : },
4082 : { .name = NULL }
4083 : };
4084 :
4085 310 : static PyObject *py_scheduleHeader_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4086 : {
4087 310 : return pytalloc_new(struct scheduleHeader, type);
4088 : }
4089 :
4090 0 : static PyObject *py_scheduleHeader_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4091 : {
4092 0 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(py_obj);
4093 0 : PyObject *ret = NULL;
4094 : DATA_BLOB blob;
4095 : enum ndr_err_code err;
4096 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4097 0 : if (tmp_ctx == NULL) {
4098 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4099 0 : return NULL;
4100 : }
4101 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_scheduleHeader);
4102 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4103 0 : TALLOC_FREE(tmp_ctx);
4104 0 : PyErr_SetNdrError(err);
4105 0 : return NULL;
4106 : }
4107 :
4108 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4109 0 : TALLOC_FREE(tmp_ctx);
4110 0 : return ret;
4111 : }
4112 :
4113 0 : static PyObject *py_scheduleHeader_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4114 : {
4115 0 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(py_obj);
4116 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4117 0 : Py_ssize_t blob_length = 0;
4118 : enum ndr_err_code err;
4119 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4120 0 : PyObject *allow_remaining_obj = NULL;
4121 0 : bool allow_remaining = false;
4122 :
4123 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4124 : discard_const_p(char *, kwnames),
4125 : &blob.data, &blob_length,
4126 : &allow_remaining_obj)) {
4127 0 : return NULL;
4128 : }
4129 0 : blob.length = blob_length;
4130 :
4131 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4132 0 : allow_remaining = true;
4133 : }
4134 :
4135 0 : if (allow_remaining) {
4136 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_scheduleHeader);
4137 : } else {
4138 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_scheduleHeader);
4139 : }
4140 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4141 0 : PyErr_SetNdrError(err);
4142 0 : return NULL;
4143 : }
4144 :
4145 0 : Py_RETURN_NONE;
4146 : }
4147 :
4148 0 : static PyObject *py_scheduleHeader_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4149 : {
4150 0 : struct scheduleHeader *object = (struct scheduleHeader *)pytalloc_get_ptr(py_obj);
4151 : PyObject *ret;
4152 : char *retstr;
4153 :
4154 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_scheduleHeader, "scheduleHeader", object);
4155 0 : ret = PyUnicode_FromString(retstr);
4156 0 : talloc_free(retstr);
4157 :
4158 0 : return ret;
4159 : }
4160 :
4161 : static PyMethodDef py_scheduleHeader_methods[] = {
4162 : { "__ndr_pack__", (PyCFunction)py_scheduleHeader_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4163 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_scheduleHeader_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4164 : { "__ndr_print__", (PyCFunction)py_scheduleHeader_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4165 : { NULL, NULL, 0, NULL }
4166 : };
4167 :
4168 :
4169 : static PyTypeObject scheduleHeader_Type = {
4170 : PyVarObject_HEAD_INIT(NULL, 0)
4171 : .tp_name = "drsblobs.scheduleHeader",
4172 : .tp_getset = py_scheduleHeader_getsetters,
4173 : .tp_methods = py_scheduleHeader_methods,
4174 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4175 : .tp_new = py_scheduleHeader_new,
4176 : };
4177 :
4178 :
4179 1884 : static PyObject *py_scheduleSlots_get_slots(PyObject *obj, void *closure)
4180 : {
4181 1884 : struct scheduleSlots *object = (struct scheduleSlots *)pytalloc_get_ptr(obj);
4182 : PyObject *py_slots;
4183 1884 : py_slots = PyList_New(168);
4184 1884 : if (py_slots == NULL) {
4185 0 : return NULL;
4186 : }
4187 : {
4188 : int slots_cntr_0;
4189 318396 : for (slots_cntr_0 = 0; slots_cntr_0 < (168); slots_cntr_0++) {
4190 : PyObject *py_slots_0;
4191 316512 : py_slots_0 = PyLong_FromLong((uint16_t)object->slots[slots_cntr_0]);
4192 316512 : PyList_SetItem(py_slots, slots_cntr_0, py_slots_0);
4193 : }
4194 : }
4195 1884 : return py_slots;
4196 : }
4197 :
4198 310 : static int py_scheduleSlots_set_slots(PyObject *py_obj, PyObject *value, void *closure)
4199 : {
4200 310 : struct scheduleSlots *object = (struct scheduleSlots *)pytalloc_get_ptr(py_obj);
4201 310 : if (value == NULL) {
4202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->slots");
4203 0 : return -1;
4204 : }
4205 310 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4206 : {
4207 : int slots_cntr_0;
4208 310 : if (ARRAY_SIZE(object->slots) != PyList_GET_SIZE(value)) {
4209 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->slots), PyList_GET_SIZE(value));
4210 0 : return -1;
4211 : }
4212 52390 : for (slots_cntr_0 = 0; slots_cntr_0 < PyList_GET_SIZE(value); slots_cntr_0++) {
4213 52080 : if (PyList_GET_ITEM(value, slots_cntr_0) == NULL) {
4214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->slots[slots_cntr_0]");
4215 0 : return -1;
4216 : }
4217 : {
4218 52080 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->slots[slots_cntr_0]));
4219 52080 : if (PyLong_Check(PyList_GET_ITEM(value, slots_cntr_0))) {
4220 : unsigned long long test_var;
4221 52080 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, slots_cntr_0));
4222 52080 : if (PyErr_Occurred() != NULL) {
4223 0 : return -1;
4224 : }
4225 52080 : if (test_var > uint_max) {
4226 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4227 : PyLong_Type.tp_name, uint_max, test_var);
4228 0 : return -1;
4229 : }
4230 52080 : object->slots[slots_cntr_0] = test_var;
4231 : } else {
4232 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4233 : PyLong_Type.tp_name);
4234 0 : return -1;
4235 : }
4236 : }
4237 : }
4238 : }
4239 310 : return 0;
4240 : }
4241 :
4242 : static PyGetSetDef py_scheduleSlots_getsetters[] = {
4243 : {
4244 : .name = discard_const_p(char, "slots"),
4245 : .get = py_scheduleSlots_get_slots,
4246 : .set = py_scheduleSlots_set_slots,
4247 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4248 : },
4249 : { .name = NULL }
4250 : };
4251 :
4252 310 : static PyObject *py_scheduleSlots_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4253 : {
4254 310 : return pytalloc_new(struct scheduleSlots, type);
4255 : }
4256 :
4257 0 : static PyObject *py_scheduleSlots_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4258 : {
4259 0 : struct scheduleSlots *object = (struct scheduleSlots *)pytalloc_get_ptr(py_obj);
4260 0 : PyObject *ret = NULL;
4261 : DATA_BLOB blob;
4262 : enum ndr_err_code err;
4263 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4264 0 : if (tmp_ctx == NULL) {
4265 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4266 0 : return NULL;
4267 : }
4268 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_scheduleSlots);
4269 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4270 0 : TALLOC_FREE(tmp_ctx);
4271 0 : PyErr_SetNdrError(err);
4272 0 : return NULL;
4273 : }
4274 :
4275 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4276 0 : TALLOC_FREE(tmp_ctx);
4277 0 : return ret;
4278 : }
4279 :
4280 0 : static PyObject *py_scheduleSlots_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4281 : {
4282 0 : struct scheduleSlots *object = (struct scheduleSlots *)pytalloc_get_ptr(py_obj);
4283 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4284 0 : Py_ssize_t blob_length = 0;
4285 : enum ndr_err_code err;
4286 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4287 0 : PyObject *allow_remaining_obj = NULL;
4288 0 : bool allow_remaining = false;
4289 :
4290 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4291 : discard_const_p(char *, kwnames),
4292 : &blob.data, &blob_length,
4293 : &allow_remaining_obj)) {
4294 0 : return NULL;
4295 : }
4296 0 : blob.length = blob_length;
4297 :
4298 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4299 0 : allow_remaining = true;
4300 : }
4301 :
4302 0 : if (allow_remaining) {
4303 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_scheduleSlots);
4304 : } else {
4305 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_scheduleSlots);
4306 : }
4307 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4308 0 : PyErr_SetNdrError(err);
4309 0 : return NULL;
4310 : }
4311 :
4312 0 : Py_RETURN_NONE;
4313 : }
4314 :
4315 0 : static PyObject *py_scheduleSlots_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4316 : {
4317 0 : struct scheduleSlots *object = (struct scheduleSlots *)pytalloc_get_ptr(py_obj);
4318 : PyObject *ret;
4319 : char *retstr;
4320 :
4321 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_scheduleSlots, "scheduleSlots", object);
4322 0 : ret = PyUnicode_FromString(retstr);
4323 0 : talloc_free(retstr);
4324 :
4325 0 : return ret;
4326 : }
4327 :
4328 : static PyMethodDef py_scheduleSlots_methods[] = {
4329 : { "__ndr_pack__", (PyCFunction)py_scheduleSlots_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4330 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_scheduleSlots_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4331 : { "__ndr_print__", (PyCFunction)py_scheduleSlots_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4332 : { NULL, NULL, 0, NULL }
4333 : };
4334 :
4335 :
4336 : static PyTypeObject scheduleSlots_Type = {
4337 : PyVarObject_HEAD_INIT(NULL, 0)
4338 : .tp_name = "drsblobs.scheduleSlots",
4339 : .tp_getset = py_scheduleSlots_getsetters,
4340 : .tp_methods = py_scheduleSlots_methods,
4341 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4342 : .tp_new = py_scheduleSlots_new,
4343 : };
4344 :
4345 :
4346 262 : static PyObject *py_schedule_get_size(PyObject *obj, void *closure)
4347 : {
4348 262 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(obj);
4349 : PyObject *py_size;
4350 262 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
4351 262 : return py_size;
4352 : }
4353 :
4354 310 : static int py_schedule_set_size(PyObject *py_obj, PyObject *value, void *closure)
4355 : {
4356 310 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4357 310 : if (value == NULL) {
4358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
4359 0 : return -1;
4360 : }
4361 : {
4362 310 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
4363 310 : if (PyLong_Check(value)) {
4364 : unsigned long long test_var;
4365 310 : test_var = PyLong_AsUnsignedLongLong(value);
4366 310 : if (PyErr_Occurred() != NULL) {
4367 0 : return -1;
4368 : }
4369 310 : if (test_var > uint_max) {
4370 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4371 : PyLong_Type.tp_name, uint_max, test_var);
4372 0 : return -1;
4373 : }
4374 310 : object->size = test_var;
4375 : } else {
4376 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4377 : PyLong_Type.tp_name);
4378 0 : return -1;
4379 : }
4380 : }
4381 310 : return 0;
4382 : }
4383 :
4384 261 : static PyObject *py_schedule_get_bandwidth(PyObject *obj, void *closure)
4385 : {
4386 261 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(obj);
4387 : PyObject *py_bandwidth;
4388 261 : py_bandwidth = PyLong_FromUnsignedLongLong((uint32_t)object->bandwidth);
4389 261 : return py_bandwidth;
4390 : }
4391 :
4392 310 : static int py_schedule_set_bandwidth(PyObject *py_obj, PyObject *value, void *closure)
4393 : {
4394 310 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4395 310 : if (value == NULL) {
4396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bandwidth");
4397 0 : return -1;
4398 : }
4399 : {
4400 310 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bandwidth));
4401 310 : if (PyLong_Check(value)) {
4402 : unsigned long long test_var;
4403 310 : test_var = PyLong_AsUnsignedLongLong(value);
4404 310 : if (PyErr_Occurred() != NULL) {
4405 0 : return -1;
4406 : }
4407 310 : if (test_var > uint_max) {
4408 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4409 : PyLong_Type.tp_name, uint_max, test_var);
4410 0 : return -1;
4411 : }
4412 310 : object->bandwidth = test_var;
4413 : } else {
4414 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4415 : PyLong_Type.tp_name);
4416 0 : return -1;
4417 : }
4418 : }
4419 310 : return 0;
4420 : }
4421 :
4422 261 : static PyObject *py_schedule_get_numberOfSchedules(PyObject *obj, void *closure)
4423 : {
4424 261 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(obj);
4425 : PyObject *py_numberOfSchedules;
4426 261 : py_numberOfSchedules = PyLong_FromUnsignedLongLong((uint32_t)object->numberOfSchedules);
4427 261 : return py_numberOfSchedules;
4428 : }
4429 :
4430 310 : static int py_schedule_set_numberOfSchedules(PyObject *py_obj, PyObject *value, void *closure)
4431 : {
4432 310 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4433 310 : if (value == NULL) {
4434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->numberOfSchedules");
4435 0 : return -1;
4436 : }
4437 : {
4438 310 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numberOfSchedules));
4439 310 : if (PyLong_Check(value)) {
4440 : unsigned long long test_var;
4441 310 : test_var = PyLong_AsUnsignedLongLong(value);
4442 310 : if (PyErr_Occurred() != NULL) {
4443 0 : return -1;
4444 : }
4445 310 : if (test_var > uint_max) {
4446 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4447 : PyLong_Type.tp_name, uint_max, test_var);
4448 0 : return -1;
4449 : }
4450 310 : object->numberOfSchedules = test_var;
4451 : } else {
4452 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4453 : PyLong_Type.tp_name);
4454 0 : return -1;
4455 : }
4456 : }
4457 310 : return 0;
4458 : }
4459 :
4460 261 : static PyObject *py_schedule_get_headerArray(PyObject *obj, void *closure)
4461 : {
4462 261 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(obj);
4463 : PyObject *py_headerArray;
4464 261 : py_headerArray = PyList_New(object->numberOfSchedules);
4465 261 : if (py_headerArray == NULL) {
4466 0 : return NULL;
4467 : }
4468 : {
4469 : int headerArray_cntr_0;
4470 522 : for (headerArray_cntr_0 = 0; headerArray_cntr_0 < (object->numberOfSchedules); headerArray_cntr_0++) {
4471 : PyObject *py_headerArray_0;
4472 261 : py_headerArray_0 = pytalloc_reference_ex(&scheduleHeader_Type, object->headerArray, &object->headerArray[headerArray_cntr_0]);
4473 261 : PyList_SetItem(py_headerArray, headerArray_cntr_0, py_headerArray_0);
4474 : }
4475 : }
4476 261 : return py_headerArray;
4477 : }
4478 :
4479 310 : static int py_schedule_set_headerArray(PyObject *py_obj, PyObject *value, void *closure)
4480 : {
4481 310 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4482 310 : if (value == NULL) {
4483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->headerArray");
4484 0 : return -1;
4485 : }
4486 310 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4487 : {
4488 : int headerArray_cntr_0;
4489 310 : object->headerArray = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->headerArray, PyList_GET_SIZE(value));
4490 310 : if (!object->headerArray) { return -1;; }
4491 310 : talloc_set_name_const(object->headerArray, "ARRAY: object->headerArray");
4492 620 : for (headerArray_cntr_0 = 0; headerArray_cntr_0 < PyList_GET_SIZE(value); headerArray_cntr_0++) {
4493 310 : if (PyList_GET_ITEM(value, headerArray_cntr_0) == NULL) {
4494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->headerArray[headerArray_cntr_0]");
4495 0 : return -1;
4496 : }
4497 310 : PY_CHECK_TYPE(&scheduleHeader_Type, PyList_GET_ITEM(value, headerArray_cntr_0), return -1;);
4498 310 : if (talloc_reference(object->headerArray, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, headerArray_cntr_0))) == NULL) {
4499 0 : PyErr_NoMemory();
4500 0 : return -1;
4501 : }
4502 310 : object->headerArray[headerArray_cntr_0] = *(struct scheduleHeader *)pytalloc_get_ptr(PyList_GET_ITEM(value, headerArray_cntr_0));
4503 : }
4504 : }
4505 310 : return 0;
4506 : }
4507 :
4508 3506 : static PyObject *py_schedule_get_dataArray(PyObject *obj, void *closure)
4509 : {
4510 3506 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(obj);
4511 : PyObject *py_dataArray;
4512 3506 : py_dataArray = PyList_New(object->numberOfSchedules);
4513 3506 : if (py_dataArray == NULL) {
4514 0 : return NULL;
4515 : }
4516 : {
4517 : int dataArray_cntr_0;
4518 7012 : for (dataArray_cntr_0 = 0; dataArray_cntr_0 < (object->numberOfSchedules); dataArray_cntr_0++) {
4519 : PyObject *py_dataArray_0;
4520 3506 : py_dataArray_0 = pytalloc_reference_ex(&scheduleSlots_Type, object->dataArray, &object->dataArray[dataArray_cntr_0]);
4521 3506 : PyList_SetItem(py_dataArray, dataArray_cntr_0, py_dataArray_0);
4522 : }
4523 : }
4524 3506 : return py_dataArray;
4525 : }
4526 :
4527 310 : static int py_schedule_set_dataArray(PyObject *py_obj, PyObject *value, void *closure)
4528 : {
4529 310 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4530 310 : if (value == NULL) {
4531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dataArray");
4532 0 : return -1;
4533 : }
4534 310 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4535 : {
4536 : int dataArray_cntr_0;
4537 310 : object->dataArray = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->dataArray, PyList_GET_SIZE(value));
4538 310 : if (!object->dataArray) { return -1;; }
4539 310 : talloc_set_name_const(object->dataArray, "ARRAY: object->dataArray");
4540 620 : for (dataArray_cntr_0 = 0; dataArray_cntr_0 < PyList_GET_SIZE(value); dataArray_cntr_0++) {
4541 310 : if (PyList_GET_ITEM(value, dataArray_cntr_0) == NULL) {
4542 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dataArray[dataArray_cntr_0]");
4543 0 : return -1;
4544 : }
4545 310 : PY_CHECK_TYPE(&scheduleSlots_Type, PyList_GET_ITEM(value, dataArray_cntr_0), return -1;);
4546 310 : if (talloc_reference(object->dataArray, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, dataArray_cntr_0))) == NULL) {
4547 0 : PyErr_NoMemory();
4548 0 : return -1;
4549 : }
4550 310 : object->dataArray[dataArray_cntr_0] = *(struct scheduleSlots *)pytalloc_get_ptr(PyList_GET_ITEM(value, dataArray_cntr_0));
4551 : }
4552 : }
4553 310 : return 0;
4554 : }
4555 :
4556 : static PyGetSetDef py_schedule_getsetters[] = {
4557 : {
4558 : .name = discard_const_p(char, "size"),
4559 : .get = py_schedule_get_size,
4560 : .set = py_schedule_set_size,
4561 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4562 : },
4563 : {
4564 : .name = discard_const_p(char, "bandwidth"),
4565 : .get = py_schedule_get_bandwidth,
4566 : .set = py_schedule_set_bandwidth,
4567 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4568 : },
4569 : {
4570 : .name = discard_const_p(char, "numberOfSchedules"),
4571 : .get = py_schedule_get_numberOfSchedules,
4572 : .set = py_schedule_set_numberOfSchedules,
4573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4574 : },
4575 : {
4576 : .name = discard_const_p(char, "headerArray"),
4577 : .get = py_schedule_get_headerArray,
4578 : .set = py_schedule_set_headerArray,
4579 : .doc = discard_const_p(char, "PIDL-generated element of base type scheduleHeader")
4580 : },
4581 : {
4582 : .name = discard_const_p(char, "dataArray"),
4583 : .get = py_schedule_get_dataArray,
4584 : .set = py_schedule_set_dataArray,
4585 : .doc = discard_const_p(char, "PIDL-generated element of base type scheduleSlots")
4586 : },
4587 : { .name = NULL }
4588 : };
4589 :
4590 1650 : static PyObject *py_schedule_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4591 : {
4592 1650 : return pytalloc_new(struct schedule, type);
4593 : }
4594 :
4595 9 : static PyObject *py_schedule_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4596 : {
4597 9 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4598 9 : PyObject *ret = NULL;
4599 : DATA_BLOB blob;
4600 : enum ndr_err_code err;
4601 9 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4602 9 : if (tmp_ctx == NULL) {
4603 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4604 0 : return NULL;
4605 : }
4606 9 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_schedule);
4607 9 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4608 0 : TALLOC_FREE(tmp_ctx);
4609 0 : PyErr_SetNdrError(err);
4610 0 : return NULL;
4611 : }
4612 :
4613 9 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4614 9 : TALLOC_FREE(tmp_ctx);
4615 9 : return ret;
4616 : }
4617 :
4618 1340 : static PyObject *py_schedule_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4619 : {
4620 1340 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4621 1340 : DATA_BLOB blob = {.data = NULL, .length = 0};
4622 1340 : Py_ssize_t blob_length = 0;
4623 : enum ndr_err_code err;
4624 1340 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4625 1340 : PyObject *allow_remaining_obj = NULL;
4626 1340 : bool allow_remaining = false;
4627 :
4628 1340 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4629 : discard_const_p(char *, kwnames),
4630 : &blob.data, &blob_length,
4631 : &allow_remaining_obj)) {
4632 0 : return NULL;
4633 : }
4634 1340 : blob.length = blob_length;
4635 :
4636 1340 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4637 0 : allow_remaining = true;
4638 : }
4639 :
4640 1340 : if (allow_remaining) {
4641 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_schedule);
4642 : } else {
4643 1340 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_schedule);
4644 : }
4645 1340 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4646 0 : PyErr_SetNdrError(err);
4647 0 : return NULL;
4648 : }
4649 :
4650 1340 : Py_RETURN_NONE;
4651 : }
4652 :
4653 0 : static PyObject *py_schedule_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4654 : {
4655 0 : struct schedule *object = (struct schedule *)pytalloc_get_ptr(py_obj);
4656 : PyObject *ret;
4657 : char *retstr;
4658 :
4659 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_schedule, "schedule", object);
4660 0 : ret = PyUnicode_FromString(retstr);
4661 0 : talloc_free(retstr);
4662 :
4663 0 : return ret;
4664 : }
4665 :
4666 : static PyMethodDef py_schedule_methods[] = {
4667 : { "__ndr_pack__", (PyCFunction)py_schedule_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4668 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_schedule_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4669 : { "__ndr_print__", (PyCFunction)py_schedule_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4670 : { NULL, NULL, 0, NULL }
4671 : };
4672 :
4673 :
4674 : static PyTypeObject schedule_Type = {
4675 : PyVarObject_HEAD_INIT(NULL, 0)
4676 : .tp_name = "drsblobs.schedule",
4677 : .tp_getset = py_schedule_getsetters,
4678 : .tp_methods = py_schedule_methods,
4679 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4680 : .tp_new = py_schedule_new,
4681 : };
4682 :
4683 :
4684 0 : static PyObject *py_partialAttributeSetCtr1_get_count(PyObject *obj, void *closure)
4685 : {
4686 0 : struct partialAttributeSetCtr1 *object = (struct partialAttributeSetCtr1 *)pytalloc_get_ptr(obj);
4687 : PyObject *py_count;
4688 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
4689 0 : return py_count;
4690 : }
4691 :
4692 0 : static int py_partialAttributeSetCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
4693 : {
4694 0 : struct partialAttributeSetCtr1 *object = (struct partialAttributeSetCtr1 *)pytalloc_get_ptr(py_obj);
4695 0 : if (value == NULL) {
4696 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
4697 0 : return -1;
4698 : }
4699 : {
4700 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4701 0 : if (PyLong_Check(value)) {
4702 : unsigned long long test_var;
4703 0 : test_var = PyLong_AsUnsignedLongLong(value);
4704 0 : if (PyErr_Occurred() != NULL) {
4705 0 : return -1;
4706 : }
4707 0 : if (test_var > uint_max) {
4708 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4709 : PyLong_Type.tp_name, uint_max, test_var);
4710 0 : return -1;
4711 : }
4712 0 : object->count = test_var;
4713 : } else {
4714 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4715 : PyLong_Type.tp_name);
4716 0 : return -1;
4717 : }
4718 : }
4719 0 : return 0;
4720 : }
4721 :
4722 0 : static PyObject *py_partialAttributeSetCtr1_get_array(PyObject *obj, void *closure)
4723 : {
4724 0 : struct partialAttributeSetCtr1 *object = (struct partialAttributeSetCtr1 *)pytalloc_get_ptr(obj);
4725 : PyObject *py_array;
4726 0 : py_array = PyList_New(object->count);
4727 0 : if (py_array == NULL) {
4728 0 : return NULL;
4729 : }
4730 : {
4731 : int array_cntr_0;
4732 0 : for (array_cntr_0 = 0; array_cntr_0 < (object->count); array_cntr_0++) {
4733 : PyObject *py_array_0;
4734 0 : py_array_0 = PyLong_FromUnsignedLongLong((uint32_t)object->array[array_cntr_0]);
4735 0 : PyList_SetItem(py_array, array_cntr_0, py_array_0);
4736 : }
4737 : }
4738 0 : return py_array;
4739 : }
4740 :
4741 0 : static int py_partialAttributeSetCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
4742 : {
4743 0 : struct partialAttributeSetCtr1 *object = (struct partialAttributeSetCtr1 *)pytalloc_get_ptr(py_obj);
4744 0 : if (value == NULL) {
4745 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
4746 0 : return -1;
4747 : }
4748 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4749 : {
4750 : int array_cntr_0;
4751 0 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
4752 0 : if (!object->array) { return -1;; }
4753 0 : talloc_set_name_const(object->array, "ARRAY: object->array");
4754 0 : for (array_cntr_0 = 0; array_cntr_0 < PyList_GET_SIZE(value); array_cntr_0++) {
4755 0 : if (PyList_GET_ITEM(value, array_cntr_0) == NULL) {
4756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_0]");
4757 0 : return -1;
4758 : }
4759 : {
4760 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->array[array_cntr_0]));
4761 0 : if (PyLong_Check(PyList_GET_ITEM(value, array_cntr_0))) {
4762 : unsigned long long test_var;
4763 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, array_cntr_0));
4764 0 : if (PyErr_Occurred() != NULL) {
4765 0 : return -1;
4766 : }
4767 0 : if (test_var > uint_max) {
4768 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4769 : PyLong_Type.tp_name, uint_max, test_var);
4770 0 : return -1;
4771 : }
4772 0 : object->array[array_cntr_0] = test_var;
4773 : } else {
4774 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4775 : PyLong_Type.tp_name);
4776 0 : return -1;
4777 : }
4778 : }
4779 : }
4780 : }
4781 0 : return 0;
4782 : }
4783 :
4784 : static PyGetSetDef py_partialAttributeSetCtr1_getsetters[] = {
4785 : {
4786 : .name = discard_const_p(char, "count"),
4787 : .get = py_partialAttributeSetCtr1_get_count,
4788 : .set = py_partialAttributeSetCtr1_set_count,
4789 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4790 : },
4791 : {
4792 : .name = discard_const_p(char, "array"),
4793 : .get = py_partialAttributeSetCtr1_get_array,
4794 : .set = py_partialAttributeSetCtr1_set_array,
4795 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsAttributeId")
4796 : },
4797 : { .name = NULL }
4798 : };
4799 :
4800 0 : static PyObject *py_partialAttributeSetCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4801 : {
4802 0 : return pytalloc_new(struct partialAttributeSetCtr1, type);
4803 : }
4804 :
4805 :
4806 : static PyTypeObject partialAttributeSetCtr1_Type = {
4807 : PyVarObject_HEAD_INIT(NULL, 0)
4808 : .tp_name = "drsblobs.partialAttributeSetCtr1",
4809 : .tp_getset = py_partialAttributeSetCtr1_getsetters,
4810 : .tp_methods = NULL,
4811 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4812 : .tp_new = py_partialAttributeSetCtr1_new,
4813 : };
4814 :
4815 0 : static PyObject *py_import_partialAttributeSetCtr(TALLOC_CTX *mem_ctx, int level, union partialAttributeSetCtr *in)
4816 : {
4817 : PyObject *ret;
4818 :
4819 0 : switch (level) {
4820 0 : case 1:
4821 0 : ret = pytalloc_reference_ex(&partialAttributeSetCtr1_Type, mem_ctx, &in->ctr1);
4822 0 : return ret;
4823 :
4824 : }
4825 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4826 0 : return NULL;
4827 : }
4828 :
4829 0 : static union partialAttributeSetCtr *py_export_partialAttributeSetCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4830 : {
4831 0 : union partialAttributeSetCtr *ret = talloc_zero(mem_ctx, union partialAttributeSetCtr);
4832 0 : switch (level) {
4833 0 : case 1:
4834 0 : if (in == NULL) {
4835 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
4836 0 : talloc_free(ret); return NULL;
4837 : }
4838 0 : PY_CHECK_TYPE(&partialAttributeSetCtr1_Type, in, talloc_free(ret); return NULL;);
4839 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4840 0 : PyErr_NoMemory();
4841 0 : talloc_free(ret); return NULL;
4842 : }
4843 0 : ret->ctr1 = *(struct partialAttributeSetCtr1 *)pytalloc_get_ptr(in);
4844 0 : break;
4845 :
4846 0 : default:
4847 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4848 0 : talloc_free(ret);
4849 0 : ret = NULL;
4850 : }
4851 :
4852 0 : return ret;
4853 : }
4854 :
4855 0 : static PyObject *py_partialAttributeSetCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4856 : {
4857 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4858 0 : PyObject *mem_ctx_obj = NULL;
4859 0 : TALLOC_CTX *mem_ctx = NULL;
4860 0 : int level = 0;
4861 0 : PyObject *in_obj = NULL;
4862 0 : union partialAttributeSetCtr *in = NULL;
4863 :
4864 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4865 : discard_const_p(char *, kwnames),
4866 : &mem_ctx_obj,
4867 : &level,
4868 : &in_obj)) {
4869 0 : return NULL;
4870 : }
4871 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4872 0 : if (mem_ctx == NULL) {
4873 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4874 0 : return NULL;
4875 : }
4876 0 : in = (union partialAttributeSetCtr *)pytalloc_get_ptr(in_obj);
4877 0 : if (in == NULL) {
4878 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union partialAttributeSetCtr!");
4879 0 : return NULL;
4880 : }
4881 :
4882 0 : return py_import_partialAttributeSetCtr(mem_ctx, level, in);
4883 : }
4884 :
4885 0 : static PyObject *py_partialAttributeSetCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4886 : {
4887 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4888 0 : PyObject *mem_ctx_obj = NULL;
4889 0 : TALLOC_CTX *mem_ctx = NULL;
4890 0 : int level = 0;
4891 0 : PyObject *in = NULL;
4892 0 : union partialAttributeSetCtr *out = NULL;
4893 :
4894 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4895 : discard_const_p(char *, kwnames),
4896 : &mem_ctx_obj,
4897 : &level,
4898 : &in)) {
4899 0 : return NULL;
4900 : }
4901 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4902 0 : if (mem_ctx == NULL) {
4903 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4904 0 : return NULL;
4905 : }
4906 :
4907 0 : out = py_export_partialAttributeSetCtr(mem_ctx, level, in);
4908 0 : if (out == NULL) {
4909 0 : return NULL;
4910 : }
4911 :
4912 0 : return pytalloc_GenericObject_reference(out);
4913 : }
4914 :
4915 : static PyMethodDef py_partialAttributeSetCtr_methods[] = {
4916 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_partialAttributeSetCtr_import),
4917 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4918 : "T.__import__(mem_ctx, level, in) => ret." },
4919 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_partialAttributeSetCtr_export),
4920 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4921 : "T.__export__(mem_ctx, level, in) => ret." },
4922 : { NULL, NULL, 0, NULL }
4923 : };
4924 :
4925 0 : static PyObject *py_partialAttributeSetCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4926 : {
4927 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4928 0 : return NULL;
4929 : }
4930 :
4931 :
4932 : static PyTypeObject partialAttributeSetCtr_Type = {
4933 : PyVarObject_HEAD_INIT(NULL, 0)
4934 : .tp_name = "drsblobs.partialAttributeSetCtr",
4935 : .tp_getset = NULL,
4936 : .tp_methods = py_partialAttributeSetCtr_methods,
4937 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4938 : .tp_new = py_partialAttributeSetCtr_new,
4939 : };
4940 :
4941 :
4942 0 : static PyObject *py_partialAttributeSetBlob_get_version(PyObject *obj, void *closure)
4943 : {
4944 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(obj);
4945 : PyObject *py_version;
4946 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
4947 0 : return py_version;
4948 : }
4949 :
4950 0 : static int py_partialAttributeSetBlob_set_version(PyObject *py_obj, PyObject *value, void *closure)
4951 : {
4952 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(py_obj);
4953 0 : if (value == NULL) {
4954 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
4955 0 : return -1;
4956 : }
4957 : {
4958 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
4959 0 : if (PyLong_Check(value)) {
4960 : unsigned long long test_var;
4961 0 : test_var = PyLong_AsUnsignedLongLong(value);
4962 0 : if (PyErr_Occurred() != NULL) {
4963 0 : return -1;
4964 : }
4965 0 : if (test_var > uint_max) {
4966 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4967 : PyLong_Type.tp_name, uint_max, test_var);
4968 0 : return -1;
4969 : }
4970 0 : object->version = test_var;
4971 : } else {
4972 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4973 : PyLong_Type.tp_name);
4974 0 : return -1;
4975 : }
4976 : }
4977 0 : return 0;
4978 : }
4979 :
4980 0 : static PyObject *py_partialAttributeSetBlob_get_reserved(PyObject *obj, void *closure)
4981 : {
4982 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(obj);
4983 : PyObject *py_reserved;
4984 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
4985 0 : return py_reserved;
4986 : }
4987 :
4988 0 : static int py_partialAttributeSetBlob_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
4989 : {
4990 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(py_obj);
4991 0 : if (value == NULL) {
4992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
4993 0 : return -1;
4994 : }
4995 : {
4996 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
4997 0 : if (PyLong_Check(value)) {
4998 : unsigned long long test_var;
4999 0 : test_var = PyLong_AsUnsignedLongLong(value);
5000 0 : if (PyErr_Occurred() != NULL) {
5001 0 : return -1;
5002 : }
5003 0 : if (test_var > uint_max) {
5004 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5005 : PyLong_Type.tp_name, uint_max, test_var);
5006 0 : return -1;
5007 : }
5008 0 : object->reserved = test_var;
5009 : } else {
5010 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5011 : PyLong_Type.tp_name);
5012 0 : return -1;
5013 : }
5014 : }
5015 0 : return 0;
5016 : }
5017 :
5018 0 : static PyObject *py_partialAttributeSetBlob_get_ctr(PyObject *obj, void *closure)
5019 : {
5020 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(obj);
5021 : PyObject *py_ctr;
5022 0 : py_ctr = pyrpc_import_union(&partialAttributeSetCtr_Type, pytalloc_get_mem_ctx(obj), object->version, &object->ctr, "union partialAttributeSetCtr");
5023 0 : if (py_ctr == NULL) {
5024 0 : return NULL;
5025 : }
5026 0 : return py_ctr;
5027 : }
5028 :
5029 0 : static int py_partialAttributeSetBlob_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
5030 : {
5031 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(py_obj);
5032 0 : if (value == NULL) {
5033 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
5034 0 : return -1;
5035 : }
5036 : {
5037 : union partialAttributeSetCtr *ctr_switch_0;
5038 0 : ctr_switch_0 = (union partialAttributeSetCtr *)pyrpc_export_union(&partialAttributeSetCtr_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union partialAttributeSetCtr");
5039 0 : if (ctr_switch_0 == NULL) {
5040 0 : return -1;
5041 : }
5042 0 : object->ctr = *ctr_switch_0;
5043 : }
5044 0 : return 0;
5045 : }
5046 :
5047 : static PyGetSetDef py_partialAttributeSetBlob_getsetters[] = {
5048 : {
5049 : .name = discard_const_p(char, "version"),
5050 : .get = py_partialAttributeSetBlob_get_version,
5051 : .set = py_partialAttributeSetBlob_set_version,
5052 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5053 : },
5054 : {
5055 : .name = discard_const_p(char, "reserved"),
5056 : .get = py_partialAttributeSetBlob_get_reserved,
5057 : .set = py_partialAttributeSetBlob_set_reserved,
5058 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5059 : },
5060 : {
5061 : .name = discard_const_p(char, "ctr"),
5062 : .get = py_partialAttributeSetBlob_get_ctr,
5063 : .set = py_partialAttributeSetBlob_set_ctr,
5064 : .doc = discard_const_p(char, "PIDL-generated element of base type partialAttributeSetCtr")
5065 : },
5066 : { .name = NULL }
5067 : };
5068 :
5069 0 : static PyObject *py_partialAttributeSetBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5070 : {
5071 0 : return pytalloc_new(struct partialAttributeSetBlob, type);
5072 : }
5073 :
5074 0 : static PyObject *py_partialAttributeSetBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5075 : {
5076 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(py_obj);
5077 0 : PyObject *ret = NULL;
5078 : DATA_BLOB blob;
5079 : enum ndr_err_code err;
5080 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5081 0 : if (tmp_ctx == NULL) {
5082 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5083 0 : return NULL;
5084 : }
5085 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_partialAttributeSetBlob);
5086 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5087 0 : TALLOC_FREE(tmp_ctx);
5088 0 : PyErr_SetNdrError(err);
5089 0 : return NULL;
5090 : }
5091 :
5092 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5093 0 : TALLOC_FREE(tmp_ctx);
5094 0 : return ret;
5095 : }
5096 :
5097 0 : static PyObject *py_partialAttributeSetBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5098 : {
5099 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(py_obj);
5100 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5101 0 : Py_ssize_t blob_length = 0;
5102 : enum ndr_err_code err;
5103 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5104 0 : PyObject *allow_remaining_obj = NULL;
5105 0 : bool allow_remaining = false;
5106 :
5107 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5108 : discard_const_p(char *, kwnames),
5109 : &blob.data, &blob_length,
5110 : &allow_remaining_obj)) {
5111 0 : return NULL;
5112 : }
5113 0 : blob.length = blob_length;
5114 :
5115 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5116 0 : allow_remaining = true;
5117 : }
5118 :
5119 0 : if (allow_remaining) {
5120 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_partialAttributeSetBlob);
5121 : } else {
5122 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_partialAttributeSetBlob);
5123 : }
5124 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5125 0 : PyErr_SetNdrError(err);
5126 0 : return NULL;
5127 : }
5128 :
5129 0 : Py_RETURN_NONE;
5130 : }
5131 :
5132 0 : static PyObject *py_partialAttributeSetBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5133 : {
5134 0 : struct partialAttributeSetBlob *object = (struct partialAttributeSetBlob *)pytalloc_get_ptr(py_obj);
5135 : PyObject *ret;
5136 : char *retstr;
5137 :
5138 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_partialAttributeSetBlob, "partialAttributeSetBlob", object);
5139 0 : ret = PyUnicode_FromString(retstr);
5140 0 : talloc_free(retstr);
5141 :
5142 0 : return ret;
5143 : }
5144 :
5145 : static PyMethodDef py_partialAttributeSetBlob_methods[] = {
5146 : { "__ndr_pack__", (PyCFunction)py_partialAttributeSetBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5147 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_partialAttributeSetBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5148 : { "__ndr_print__", (PyCFunction)py_partialAttributeSetBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5149 : { NULL, NULL, 0, NULL }
5150 : };
5151 :
5152 :
5153 : static PyTypeObject partialAttributeSetBlob_Type = {
5154 : PyVarObject_HEAD_INIT(NULL, 0)
5155 : .tp_name = "drsblobs.partialAttributeSetBlob",
5156 : .tp_getset = py_partialAttributeSetBlob_getsetters,
5157 : .tp_methods = py_partialAttributeSetBlob_methods,
5158 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5159 : .tp_new = py_partialAttributeSetBlob_new,
5160 : };
5161 :
5162 :
5163 17 : static PyObject *py_schemaInfoBlob_get_marker(PyObject *obj, void *closure)
5164 : {
5165 17 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(obj);
5166 : PyObject *py_marker;
5167 17 : py_marker = PyLong_FromLong((uint16_t)object->marker);
5168 17 : return py_marker;
5169 : }
5170 :
5171 12 : static int py_schemaInfoBlob_set_marker(PyObject *py_obj, PyObject *value, void *closure)
5172 : {
5173 12 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(py_obj);
5174 12 : if (value == NULL) {
5175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->marker");
5176 0 : return -1;
5177 : }
5178 : {
5179 12 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->marker));
5180 12 : if (PyLong_Check(value)) {
5181 : unsigned long long test_var;
5182 12 : test_var = PyLong_AsUnsignedLongLong(value);
5183 12 : if (PyErr_Occurred() != NULL) {
5184 0 : return -1;
5185 : }
5186 12 : if (test_var > uint_max) {
5187 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5188 : PyLong_Type.tp_name, uint_max, test_var);
5189 0 : return -1;
5190 : }
5191 12 : object->marker = test_var;
5192 : } else {
5193 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5194 : PyLong_Type.tp_name);
5195 0 : return -1;
5196 : }
5197 : }
5198 12 : return 0;
5199 : }
5200 :
5201 24 : static PyObject *py_schemaInfoBlob_get_revision(PyObject *obj, void *closure)
5202 : {
5203 24 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(obj);
5204 : PyObject *py_revision;
5205 24 : py_revision = PyLong_FromUnsignedLongLong((uint32_t)object->revision);
5206 24 : return py_revision;
5207 : }
5208 :
5209 13 : static int py_schemaInfoBlob_set_revision(PyObject *py_obj, PyObject *value, void *closure)
5210 : {
5211 13 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(py_obj);
5212 13 : if (value == NULL) {
5213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->revision");
5214 0 : return -1;
5215 : }
5216 : {
5217 13 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
5218 13 : if (PyLong_Check(value)) {
5219 : unsigned long long test_var;
5220 13 : test_var = PyLong_AsUnsignedLongLong(value);
5221 13 : if (PyErr_Occurred() != NULL) {
5222 0 : return -1;
5223 : }
5224 13 : if (test_var > uint_max) {
5225 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5226 : PyLong_Type.tp_name, uint_max, test_var);
5227 0 : return -1;
5228 : }
5229 13 : object->revision = test_var;
5230 : } else {
5231 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5232 : PyLong_Type.tp_name);
5233 0 : return -1;
5234 : }
5235 : }
5236 13 : return 0;
5237 : }
5238 :
5239 36 : static PyObject *py_schemaInfoBlob_get_invocation_id(PyObject *obj, void *closure)
5240 : {
5241 36 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(obj);
5242 : PyObject *py_invocation_id;
5243 36 : py_invocation_id = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->invocation_id);
5244 36 : return py_invocation_id;
5245 : }
5246 :
5247 13 : static int py_schemaInfoBlob_set_invocation_id(PyObject *py_obj, PyObject *value, void *closure)
5248 : {
5249 13 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(py_obj);
5250 13 : if (value == NULL) {
5251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->invocation_id");
5252 0 : return -1;
5253 : }
5254 13 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
5255 13 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5256 0 : PyErr_NoMemory();
5257 0 : return -1;
5258 : }
5259 13 : object->invocation_id = *(struct GUID *)pytalloc_get_ptr(value);
5260 13 : return 0;
5261 : }
5262 :
5263 : static PyGetSetDef py_schemaInfoBlob_getsetters[] = {
5264 : {
5265 : .name = discard_const_p(char, "marker"),
5266 : .get = py_schemaInfoBlob_get_marker,
5267 : .set = py_schemaInfoBlob_set_marker,
5268 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5269 : },
5270 : {
5271 : .name = discard_const_p(char, "revision"),
5272 : .get = py_schemaInfoBlob_get_revision,
5273 : .set = py_schemaInfoBlob_set_revision,
5274 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5275 : },
5276 : {
5277 : .name = discard_const_p(char, "invocation_id"),
5278 : .get = py_schemaInfoBlob_get_invocation_id,
5279 : .set = py_schemaInfoBlob_set_invocation_id,
5280 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
5281 : },
5282 : { .name = NULL }
5283 : };
5284 :
5285 30 : static PyObject *py_schemaInfoBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5286 : {
5287 30 : return pytalloc_new(struct schemaInfoBlob, type);
5288 : }
5289 :
5290 12 : static PyObject *py_schemaInfoBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5291 : {
5292 12 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(py_obj);
5293 12 : PyObject *ret = NULL;
5294 : DATA_BLOB blob;
5295 : enum ndr_err_code err;
5296 12 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5297 12 : if (tmp_ctx == NULL) {
5298 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5299 0 : return NULL;
5300 : }
5301 12 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_schemaInfoBlob);
5302 12 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5303 0 : TALLOC_FREE(tmp_ctx);
5304 0 : PyErr_SetNdrError(err);
5305 0 : return NULL;
5306 : }
5307 :
5308 12 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5309 12 : TALLOC_FREE(tmp_ctx);
5310 12 : return ret;
5311 : }
5312 :
5313 17 : static PyObject *py_schemaInfoBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5314 : {
5315 17 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(py_obj);
5316 17 : DATA_BLOB blob = {.data = NULL, .length = 0};
5317 17 : Py_ssize_t blob_length = 0;
5318 : enum ndr_err_code err;
5319 17 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5320 17 : PyObject *allow_remaining_obj = NULL;
5321 17 : bool allow_remaining = false;
5322 :
5323 17 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5324 : discard_const_p(char *, kwnames),
5325 : &blob.data, &blob_length,
5326 : &allow_remaining_obj)) {
5327 0 : return NULL;
5328 : }
5329 17 : blob.length = blob_length;
5330 :
5331 17 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5332 0 : allow_remaining = true;
5333 : }
5334 :
5335 17 : if (allow_remaining) {
5336 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_schemaInfoBlob);
5337 : } else {
5338 17 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_schemaInfoBlob);
5339 : }
5340 17 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5341 0 : PyErr_SetNdrError(err);
5342 0 : return NULL;
5343 : }
5344 :
5345 17 : Py_RETURN_NONE;
5346 : }
5347 :
5348 0 : static PyObject *py_schemaInfoBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5349 : {
5350 0 : struct schemaInfoBlob *object = (struct schemaInfoBlob *)pytalloc_get_ptr(py_obj);
5351 : PyObject *ret;
5352 : char *retstr;
5353 :
5354 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_schemaInfoBlob, "schemaInfoBlob", object);
5355 0 : ret = PyUnicode_FromString(retstr);
5356 0 : talloc_free(retstr);
5357 :
5358 0 : return ret;
5359 : }
5360 :
5361 : static PyMethodDef py_schemaInfoBlob_methods[] = {
5362 : { "__ndr_pack__", (PyCFunction)py_schemaInfoBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5363 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_schemaInfoBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5364 : { "__ndr_print__", (PyCFunction)py_schemaInfoBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5365 : { NULL, NULL, 0, NULL }
5366 : };
5367 :
5368 :
5369 : static PyTypeObject schemaInfoBlob_Type = {
5370 : PyVarObject_HEAD_INIT(NULL, 0)
5371 : .tp_name = "drsblobs.schemaInfoBlob",
5372 : .tp_getset = py_schemaInfoBlob_getsetters,
5373 : .tp_methods = py_schemaInfoBlob_methods,
5374 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5375 : .tp_new = py_schemaInfoBlob_new,
5376 : };
5377 :
5378 :
5379 0 : static PyObject *py_drsuapi_MSPrefixMap_Entry_get_entryID(PyObject *obj, void *closure)
5380 : {
5381 0 : struct drsuapi_MSPrefixMap_Entry *object = (struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(obj);
5382 : PyObject *py_entryID;
5383 0 : py_entryID = PyLong_FromLong((uint16_t)object->entryID);
5384 0 : return py_entryID;
5385 : }
5386 :
5387 0 : static int py_drsuapi_MSPrefixMap_Entry_set_entryID(PyObject *py_obj, PyObject *value, void *closure)
5388 : {
5389 0 : struct drsuapi_MSPrefixMap_Entry *object = (struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(py_obj);
5390 0 : if (value == NULL) {
5391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entryID");
5392 0 : return -1;
5393 : }
5394 : {
5395 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entryID));
5396 0 : if (PyLong_Check(value)) {
5397 : unsigned long long test_var;
5398 0 : test_var = PyLong_AsUnsignedLongLong(value);
5399 0 : if (PyErr_Occurred() != NULL) {
5400 0 : return -1;
5401 : }
5402 0 : if (test_var > uint_max) {
5403 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5404 : PyLong_Type.tp_name, uint_max, test_var);
5405 0 : return -1;
5406 : }
5407 0 : object->entryID = test_var;
5408 : } else {
5409 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5410 : PyLong_Type.tp_name);
5411 0 : return -1;
5412 : }
5413 : }
5414 0 : return 0;
5415 : }
5416 :
5417 0 : static PyObject *py_drsuapi_MSPrefixMap_Entry_get_length(PyObject *obj, void *closure)
5418 : {
5419 0 : struct drsuapi_MSPrefixMap_Entry *object = (struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(obj);
5420 : PyObject *py_length;
5421 0 : py_length = PyLong_FromLong((uint16_t)object->length);
5422 0 : return py_length;
5423 : }
5424 :
5425 0 : static int py_drsuapi_MSPrefixMap_Entry_set_length(PyObject *py_obj, PyObject *value, void *closure)
5426 : {
5427 0 : struct drsuapi_MSPrefixMap_Entry *object = (struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(py_obj);
5428 0 : if (value == NULL) {
5429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
5430 0 : return -1;
5431 : }
5432 : {
5433 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
5434 0 : if (PyLong_Check(value)) {
5435 : unsigned long long test_var;
5436 0 : test_var = PyLong_AsUnsignedLongLong(value);
5437 0 : if (PyErr_Occurred() != NULL) {
5438 0 : return -1;
5439 : }
5440 0 : if (test_var > uint_max) {
5441 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5442 : PyLong_Type.tp_name, uint_max, test_var);
5443 0 : return -1;
5444 : }
5445 0 : object->length = test_var;
5446 : } else {
5447 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5448 : PyLong_Type.tp_name);
5449 0 : return -1;
5450 : }
5451 : }
5452 0 : return 0;
5453 : }
5454 :
5455 0 : static PyObject *py_drsuapi_MSPrefixMap_Entry_get_binary_oid(PyObject *obj, void *closure)
5456 : {
5457 0 : struct drsuapi_MSPrefixMap_Entry *object = (struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(obj);
5458 : PyObject *py_binary_oid;
5459 0 : py_binary_oid = PyList_New(object->length);
5460 0 : if (py_binary_oid == NULL) {
5461 0 : return NULL;
5462 : }
5463 : {
5464 : int binary_oid_cntr_0;
5465 0 : for (binary_oid_cntr_0 = 0; binary_oid_cntr_0 < (object->length); binary_oid_cntr_0++) {
5466 : PyObject *py_binary_oid_0;
5467 0 : py_binary_oid_0 = PyLong_FromLong((uint16_t)object->binary_oid[binary_oid_cntr_0]);
5468 0 : PyList_SetItem(py_binary_oid, binary_oid_cntr_0, py_binary_oid_0);
5469 : }
5470 : }
5471 0 : return py_binary_oid;
5472 : }
5473 :
5474 0 : static int py_drsuapi_MSPrefixMap_Entry_set_binary_oid(PyObject *py_obj, PyObject *value, void *closure)
5475 : {
5476 0 : struct drsuapi_MSPrefixMap_Entry *object = (struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(py_obj);
5477 0 : if (value == NULL) {
5478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->binary_oid");
5479 0 : return -1;
5480 : }
5481 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5482 : {
5483 : int binary_oid_cntr_0;
5484 0 : object->binary_oid = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->binary_oid, PyList_GET_SIZE(value));
5485 0 : if (!object->binary_oid) { return -1;; }
5486 0 : talloc_set_name_const(object->binary_oid, "ARRAY: object->binary_oid");
5487 0 : for (binary_oid_cntr_0 = 0; binary_oid_cntr_0 < PyList_GET_SIZE(value); binary_oid_cntr_0++) {
5488 0 : if (PyList_GET_ITEM(value, binary_oid_cntr_0) == NULL) {
5489 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->binary_oid[binary_oid_cntr_0]");
5490 0 : return -1;
5491 : }
5492 : {
5493 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->binary_oid[binary_oid_cntr_0]));
5494 0 : if (PyLong_Check(PyList_GET_ITEM(value, binary_oid_cntr_0))) {
5495 : unsigned long long test_var;
5496 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, binary_oid_cntr_0));
5497 0 : if (PyErr_Occurred() != NULL) {
5498 0 : return -1;
5499 : }
5500 0 : if (test_var > uint_max) {
5501 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5502 : PyLong_Type.tp_name, uint_max, test_var);
5503 0 : return -1;
5504 : }
5505 0 : object->binary_oid[binary_oid_cntr_0] = test_var;
5506 : } else {
5507 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5508 : PyLong_Type.tp_name);
5509 0 : return -1;
5510 : }
5511 : }
5512 : }
5513 : }
5514 0 : return 0;
5515 : }
5516 :
5517 : static PyGetSetDef py_drsuapi_MSPrefixMap_Entry_getsetters[] = {
5518 : {
5519 : .name = discard_const_p(char, "entryID"),
5520 : .get = py_drsuapi_MSPrefixMap_Entry_get_entryID,
5521 : .set = py_drsuapi_MSPrefixMap_Entry_set_entryID,
5522 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5523 : },
5524 : {
5525 : .name = discard_const_p(char, "length"),
5526 : .get = py_drsuapi_MSPrefixMap_Entry_get_length,
5527 : .set = py_drsuapi_MSPrefixMap_Entry_set_length,
5528 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5529 : },
5530 : {
5531 : .name = discard_const_p(char, "binary_oid"),
5532 : .get = py_drsuapi_MSPrefixMap_Entry_get_binary_oid,
5533 : .set = py_drsuapi_MSPrefixMap_Entry_set_binary_oid,
5534 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5535 : },
5536 : { .name = NULL }
5537 : };
5538 :
5539 0 : static PyObject *py_drsuapi_MSPrefixMap_Entry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5540 : {
5541 0 : return pytalloc_new(struct drsuapi_MSPrefixMap_Entry, type);
5542 : }
5543 :
5544 :
5545 : static PyTypeObject drsuapi_MSPrefixMap_Entry_Type = {
5546 : PyVarObject_HEAD_INIT(NULL, 0)
5547 : .tp_name = "drsblobs.drsuapi_MSPrefixMap_Entry",
5548 : .tp_getset = py_drsuapi_MSPrefixMap_Entry_getsetters,
5549 : .tp_methods = NULL,
5550 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5551 : .tp_new = py_drsuapi_MSPrefixMap_Entry_new,
5552 : };
5553 :
5554 :
5555 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_get_num_entries(PyObject *obj, void *closure)
5556 : {
5557 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(obj);
5558 : PyObject *py_num_entries;
5559 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)object->num_entries);
5560 0 : return py_num_entries;
5561 : }
5562 :
5563 0 : static int py_drsuapi_MSPrefixMap_Ctr_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
5564 : {
5565 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(py_obj);
5566 0 : if (value == NULL) {
5567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_entries");
5568 0 : return -1;
5569 : }
5570 : {
5571 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_entries));
5572 0 : if (PyLong_Check(value)) {
5573 : unsigned long long test_var;
5574 0 : test_var = PyLong_AsUnsignedLongLong(value);
5575 0 : if (PyErr_Occurred() != NULL) {
5576 0 : return -1;
5577 : }
5578 0 : if (test_var > uint_max) {
5579 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5580 : PyLong_Type.tp_name, uint_max, test_var);
5581 0 : return -1;
5582 : }
5583 0 : object->num_entries = test_var;
5584 : } else {
5585 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5586 : PyLong_Type.tp_name);
5587 0 : return -1;
5588 : }
5589 : }
5590 0 : return 0;
5591 : }
5592 :
5593 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_get___ndr_size(PyObject *obj, void *closure)
5594 : {
5595 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(obj);
5596 : PyObject *py___ndr_size;
5597 0 : py___ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->__ndr_size);
5598 0 : return py___ndr_size;
5599 : }
5600 :
5601 0 : static int py_drsuapi_MSPrefixMap_Ctr_set___ndr_size(PyObject *py_obj, PyObject *value, void *closure)
5602 : {
5603 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(py_obj);
5604 0 : if (value == NULL) {
5605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__ndr_size");
5606 0 : return -1;
5607 : }
5608 : {
5609 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__ndr_size));
5610 0 : if (PyLong_Check(value)) {
5611 : unsigned long long test_var;
5612 0 : test_var = PyLong_AsUnsignedLongLong(value);
5613 0 : if (PyErr_Occurred() != NULL) {
5614 0 : return -1;
5615 : }
5616 0 : if (test_var > uint_max) {
5617 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5618 : PyLong_Type.tp_name, uint_max, test_var);
5619 0 : return -1;
5620 : }
5621 0 : object->__ndr_size = test_var;
5622 : } else {
5623 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5624 : PyLong_Type.tp_name);
5625 0 : return -1;
5626 : }
5627 : }
5628 0 : return 0;
5629 : }
5630 :
5631 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_get_entries(PyObject *obj, void *closure)
5632 : {
5633 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(obj);
5634 : PyObject *py_entries;
5635 0 : py_entries = PyList_New(object->num_entries);
5636 0 : if (py_entries == NULL) {
5637 0 : return NULL;
5638 : }
5639 : {
5640 : int entries_cntr_0;
5641 0 : for (entries_cntr_0 = 0; entries_cntr_0 < (object->num_entries); entries_cntr_0++) {
5642 : PyObject *py_entries_0;
5643 0 : py_entries_0 = pytalloc_reference_ex(&drsuapi_MSPrefixMap_Entry_Type, object->entries, &object->entries[entries_cntr_0]);
5644 0 : PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
5645 : }
5646 : }
5647 0 : return py_entries;
5648 : }
5649 :
5650 0 : static int py_drsuapi_MSPrefixMap_Ctr_set_entries(PyObject *py_obj, PyObject *value, void *closure)
5651 : {
5652 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(py_obj);
5653 0 : if (value == NULL) {
5654 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
5655 0 : return -1;
5656 : }
5657 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5658 : {
5659 : int entries_cntr_0;
5660 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
5661 0 : if (!object->entries) { return -1;; }
5662 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
5663 0 : for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
5664 0 : if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
5665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_0]");
5666 0 : return -1;
5667 : }
5668 0 : PY_CHECK_TYPE(&drsuapi_MSPrefixMap_Entry_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
5669 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
5670 0 : PyErr_NoMemory();
5671 0 : return -1;
5672 : }
5673 0 : object->entries[entries_cntr_0] = *(struct drsuapi_MSPrefixMap_Entry *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
5674 : }
5675 : }
5676 0 : return 0;
5677 : }
5678 :
5679 : static PyGetSetDef py_drsuapi_MSPrefixMap_Ctr_getsetters[] = {
5680 : {
5681 : .name = discard_const_p(char, "num_entries"),
5682 : .get = py_drsuapi_MSPrefixMap_Ctr_get_num_entries,
5683 : .set = py_drsuapi_MSPrefixMap_Ctr_set_num_entries,
5684 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5685 : },
5686 : {
5687 : .name = discard_const_p(char, "__ndr_size"),
5688 : .get = py_drsuapi_MSPrefixMap_Ctr_get___ndr_size,
5689 : .set = py_drsuapi_MSPrefixMap_Ctr_set___ndr_size,
5690 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5691 : },
5692 : {
5693 : .name = discard_const_p(char, "entries"),
5694 : .get = py_drsuapi_MSPrefixMap_Ctr_get_entries,
5695 : .set = py_drsuapi_MSPrefixMap_Ctr_set_entries,
5696 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_MSPrefixMap_Entry")
5697 : },
5698 : { .name = NULL }
5699 : };
5700 :
5701 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5702 : {
5703 0 : return pytalloc_new(struct drsuapi_MSPrefixMap_Ctr, type);
5704 : }
5705 :
5706 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5707 : {
5708 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(py_obj);
5709 0 : PyObject *ret = NULL;
5710 : DATA_BLOB blob;
5711 : enum ndr_err_code err;
5712 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5713 0 : if (tmp_ctx == NULL) {
5714 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5715 0 : return NULL;
5716 : }
5717 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_drsuapi_MSPrefixMap_Ctr);
5718 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5719 0 : TALLOC_FREE(tmp_ctx);
5720 0 : PyErr_SetNdrError(err);
5721 0 : return NULL;
5722 : }
5723 :
5724 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5725 0 : TALLOC_FREE(tmp_ctx);
5726 0 : return ret;
5727 : }
5728 :
5729 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5730 : {
5731 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(py_obj);
5732 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5733 0 : Py_ssize_t blob_length = 0;
5734 : enum ndr_err_code err;
5735 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5736 0 : PyObject *allow_remaining_obj = NULL;
5737 0 : bool allow_remaining = false;
5738 :
5739 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5740 : discard_const_p(char *, kwnames),
5741 : &blob.data, &blob_length,
5742 : &allow_remaining_obj)) {
5743 0 : return NULL;
5744 : }
5745 0 : blob.length = blob_length;
5746 :
5747 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5748 0 : allow_remaining = true;
5749 : }
5750 :
5751 0 : if (allow_remaining) {
5752 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_MSPrefixMap_Ctr);
5753 : } else {
5754 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_MSPrefixMap_Ctr);
5755 : }
5756 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5757 0 : PyErr_SetNdrError(err);
5758 0 : return NULL;
5759 : }
5760 :
5761 0 : Py_RETURN_NONE;
5762 : }
5763 :
5764 0 : static PyObject *py_drsuapi_MSPrefixMap_Ctr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5765 : {
5766 0 : struct drsuapi_MSPrefixMap_Ctr *object = (struct drsuapi_MSPrefixMap_Ctr *)pytalloc_get_ptr(py_obj);
5767 : PyObject *ret;
5768 : char *retstr;
5769 :
5770 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_drsuapi_MSPrefixMap_Ctr, "drsuapi_MSPrefixMap_Ctr", object);
5771 0 : ret = PyUnicode_FromString(retstr);
5772 0 : talloc_free(retstr);
5773 :
5774 0 : return ret;
5775 : }
5776 :
5777 : static PyMethodDef py_drsuapi_MSPrefixMap_Ctr_methods[] = {
5778 : { "__ndr_pack__", (PyCFunction)py_drsuapi_MSPrefixMap_Ctr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5779 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drsuapi_MSPrefixMap_Ctr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5780 : { "__ndr_print__", (PyCFunction)py_drsuapi_MSPrefixMap_Ctr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5781 : { NULL, NULL, 0, NULL }
5782 : };
5783 :
5784 :
5785 : static PyTypeObject drsuapi_MSPrefixMap_Ctr_Type = {
5786 : PyVarObject_HEAD_INIT(NULL, 0)
5787 : .tp_name = "drsblobs.drsuapi_MSPrefixMap_Ctr",
5788 : .tp_getset = py_drsuapi_MSPrefixMap_Ctr_getsetters,
5789 : .tp_methods = py_drsuapi_MSPrefixMap_Ctr_methods,
5790 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5791 : .tp_new = py_drsuapi_MSPrefixMap_Ctr_new,
5792 : };
5793 :
5794 48 : static PyObject *py_import_prefixMapCtr(TALLOC_CTX *mem_ctx, int level, union prefixMapCtr *in)
5795 : {
5796 : PyObject *ret;
5797 :
5798 48 : switch (level) {
5799 48 : case PREFIX_MAP_VERSION_DSDB:
5800 48 : ret = pytalloc_reference_ex(drsuapi_DsReplicaOIDMapping_Ctr_Type, mem_ctx, &in->dsdb);
5801 48 : return ret;
5802 :
5803 : }
5804 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
5805 0 : return NULL;
5806 : }
5807 :
5808 0 : static union prefixMapCtr *py_export_prefixMapCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5809 : {
5810 0 : union prefixMapCtr *ret = talloc_zero(mem_ctx, union prefixMapCtr);
5811 0 : switch (level) {
5812 0 : case PREFIX_MAP_VERSION_DSDB:
5813 0 : if (in == NULL) {
5814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dsdb");
5815 0 : talloc_free(ret); return NULL;
5816 : }
5817 0 : PY_CHECK_TYPE(drsuapi_DsReplicaOIDMapping_Ctr_Type, in, talloc_free(ret); return NULL;);
5818 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5819 0 : PyErr_NoMemory();
5820 0 : talloc_free(ret); return NULL;
5821 : }
5822 0 : ret->dsdb = *(struct drsuapi_DsReplicaOIDMapping_Ctr *)pytalloc_get_ptr(in);
5823 0 : break;
5824 :
5825 0 : default:
5826 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
5827 0 : talloc_free(ret);
5828 0 : ret = NULL;
5829 : }
5830 :
5831 0 : return ret;
5832 : }
5833 :
5834 48 : static PyObject *py_prefixMapCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5835 : {
5836 48 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5837 48 : PyObject *mem_ctx_obj = NULL;
5838 48 : TALLOC_CTX *mem_ctx = NULL;
5839 48 : int level = 0;
5840 48 : PyObject *in_obj = NULL;
5841 48 : union prefixMapCtr *in = NULL;
5842 :
5843 48 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
5844 : discard_const_p(char *, kwnames),
5845 : &mem_ctx_obj,
5846 : &level,
5847 : &in_obj)) {
5848 0 : return NULL;
5849 : }
5850 48 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5851 48 : if (mem_ctx == NULL) {
5852 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5853 0 : return NULL;
5854 : }
5855 48 : in = (union prefixMapCtr *)pytalloc_get_ptr(in_obj);
5856 48 : if (in == NULL) {
5857 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union prefixMapCtr!");
5858 0 : return NULL;
5859 : }
5860 :
5861 48 : return py_import_prefixMapCtr(mem_ctx, level, in);
5862 : }
5863 :
5864 0 : static PyObject *py_prefixMapCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5865 : {
5866 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5867 0 : PyObject *mem_ctx_obj = NULL;
5868 0 : TALLOC_CTX *mem_ctx = NULL;
5869 0 : int level = 0;
5870 0 : PyObject *in = NULL;
5871 0 : union prefixMapCtr *out = NULL;
5872 :
5873 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5874 : discard_const_p(char *, kwnames),
5875 : &mem_ctx_obj,
5876 : &level,
5877 : &in)) {
5878 0 : return NULL;
5879 : }
5880 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5881 0 : if (mem_ctx == NULL) {
5882 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5883 0 : return NULL;
5884 : }
5885 :
5886 0 : out = py_export_prefixMapCtr(mem_ctx, level, in);
5887 0 : if (out == NULL) {
5888 0 : return NULL;
5889 : }
5890 :
5891 0 : return pytalloc_GenericObject_reference(out);
5892 : }
5893 :
5894 : static PyMethodDef py_prefixMapCtr_methods[] = {
5895 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_prefixMapCtr_import),
5896 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5897 : "T.__import__(mem_ctx, level, in) => ret." },
5898 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_prefixMapCtr_export),
5899 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5900 : "T.__export__(mem_ctx, level, in) => ret." },
5901 : { NULL, NULL, 0, NULL }
5902 : };
5903 :
5904 0 : static PyObject *py_prefixMapCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5905 : {
5906 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5907 0 : return NULL;
5908 : }
5909 :
5910 :
5911 : static PyTypeObject prefixMapCtr_Type = {
5912 : PyVarObject_HEAD_INIT(NULL, 0)
5913 : .tp_name = "drsblobs.prefixMapCtr",
5914 : .tp_getset = NULL,
5915 : .tp_methods = py_prefixMapCtr_methods,
5916 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5917 : .tp_new = py_prefixMapCtr_new,
5918 : };
5919 :
5920 :
5921 0 : static PyObject *py_prefixMapBlob_get_version(PyObject *obj, void *closure)
5922 : {
5923 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(obj);
5924 : PyObject *py_version;
5925 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
5926 0 : return py_version;
5927 : }
5928 :
5929 0 : static int py_prefixMapBlob_set_version(PyObject *py_obj, PyObject *value, void *closure)
5930 : {
5931 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(py_obj);
5932 0 : if (value == NULL) {
5933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
5934 0 : return -1;
5935 : }
5936 : {
5937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
5938 0 : if (PyLong_Check(value)) {
5939 : unsigned long long test_var;
5940 0 : test_var = PyLong_AsUnsignedLongLong(value);
5941 0 : if (PyErr_Occurred() != NULL) {
5942 0 : return -1;
5943 : }
5944 0 : if (test_var > uint_max) {
5945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5946 : PyLong_Type.tp_name, uint_max, test_var);
5947 0 : return -1;
5948 : }
5949 0 : object->version = test_var;
5950 : } else {
5951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5952 : PyLong_Type.tp_name);
5953 0 : return -1;
5954 : }
5955 : }
5956 0 : return 0;
5957 : }
5958 :
5959 0 : static PyObject *py_prefixMapBlob_get_reserved(PyObject *obj, void *closure)
5960 : {
5961 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(obj);
5962 : PyObject *py_reserved;
5963 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
5964 0 : return py_reserved;
5965 : }
5966 :
5967 0 : static int py_prefixMapBlob_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
5968 : {
5969 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(py_obj);
5970 0 : if (value == NULL) {
5971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
5972 0 : return -1;
5973 : }
5974 : {
5975 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
5976 0 : if (PyLong_Check(value)) {
5977 : unsigned long long test_var;
5978 0 : test_var = PyLong_AsUnsignedLongLong(value);
5979 0 : if (PyErr_Occurred() != NULL) {
5980 0 : return -1;
5981 : }
5982 0 : if (test_var > uint_max) {
5983 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5984 : PyLong_Type.tp_name, uint_max, test_var);
5985 0 : return -1;
5986 : }
5987 0 : object->reserved = test_var;
5988 : } else {
5989 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5990 : PyLong_Type.tp_name);
5991 0 : return -1;
5992 : }
5993 : }
5994 0 : return 0;
5995 : }
5996 :
5997 48 : static PyObject *py_prefixMapBlob_get_ctr(PyObject *obj, void *closure)
5998 : {
5999 48 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(obj);
6000 : PyObject *py_ctr;
6001 48 : py_ctr = pyrpc_import_union(&prefixMapCtr_Type, pytalloc_get_mem_ctx(obj), object->version, &object->ctr, "union prefixMapCtr");
6002 48 : if (py_ctr == NULL) {
6003 0 : return NULL;
6004 : }
6005 48 : return py_ctr;
6006 : }
6007 :
6008 0 : static int py_prefixMapBlob_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
6009 : {
6010 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(py_obj);
6011 0 : if (value == NULL) {
6012 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
6013 0 : return -1;
6014 : }
6015 : {
6016 : union prefixMapCtr *ctr_switch_0;
6017 0 : ctr_switch_0 = (union prefixMapCtr *)pyrpc_export_union(&prefixMapCtr_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union prefixMapCtr");
6018 0 : if (ctr_switch_0 == NULL) {
6019 0 : return -1;
6020 : }
6021 0 : object->ctr = *ctr_switch_0;
6022 : }
6023 0 : return 0;
6024 : }
6025 :
6026 : static PyGetSetDef py_prefixMapBlob_getsetters[] = {
6027 : {
6028 : .name = discard_const_p(char, "version"),
6029 : .get = py_prefixMapBlob_get_version,
6030 : .set = py_prefixMapBlob_set_version,
6031 : .doc = discard_const_p(char, "PIDL-generated element of base type prefixMapVersion")
6032 : },
6033 : {
6034 : .name = discard_const_p(char, "reserved"),
6035 : .get = py_prefixMapBlob_get_reserved,
6036 : .set = py_prefixMapBlob_set_reserved,
6037 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6038 : },
6039 : {
6040 : .name = discard_const_p(char, "ctr"),
6041 : .get = py_prefixMapBlob_get_ctr,
6042 : .set = py_prefixMapBlob_set_ctr,
6043 : .doc = discard_const_p(char, "PIDL-generated element of base type prefixMapCtr")
6044 : },
6045 : { .name = NULL }
6046 : };
6047 :
6048 12 : static PyObject *py_prefixMapBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6049 : {
6050 12 : return pytalloc_new(struct prefixMapBlob, type);
6051 : }
6052 :
6053 0 : static PyObject *py_prefixMapBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6054 : {
6055 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(py_obj);
6056 0 : PyObject *ret = NULL;
6057 : DATA_BLOB blob;
6058 : enum ndr_err_code err;
6059 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6060 0 : if (tmp_ctx == NULL) {
6061 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6062 0 : return NULL;
6063 : }
6064 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob);
6065 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6066 0 : TALLOC_FREE(tmp_ctx);
6067 0 : PyErr_SetNdrError(err);
6068 0 : return NULL;
6069 : }
6070 :
6071 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6072 0 : TALLOC_FREE(tmp_ctx);
6073 0 : return ret;
6074 : }
6075 :
6076 12 : static PyObject *py_prefixMapBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6077 : {
6078 12 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(py_obj);
6079 12 : DATA_BLOB blob = {.data = NULL, .length = 0};
6080 12 : Py_ssize_t blob_length = 0;
6081 : enum ndr_err_code err;
6082 12 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6083 12 : PyObject *allow_remaining_obj = NULL;
6084 12 : bool allow_remaining = false;
6085 :
6086 12 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6087 : discard_const_p(char *, kwnames),
6088 : &blob.data, &blob_length,
6089 : &allow_remaining_obj)) {
6090 0 : return NULL;
6091 : }
6092 12 : blob.length = blob_length;
6093 :
6094 12 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6095 0 : allow_remaining = true;
6096 : }
6097 :
6098 12 : if (allow_remaining) {
6099 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob);
6100 : } else {
6101 12 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob);
6102 : }
6103 12 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6104 0 : PyErr_SetNdrError(err);
6105 0 : return NULL;
6106 : }
6107 :
6108 12 : Py_RETURN_NONE;
6109 : }
6110 :
6111 0 : static PyObject *py_prefixMapBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6112 : {
6113 0 : struct prefixMapBlob *object = (struct prefixMapBlob *)pytalloc_get_ptr(py_obj);
6114 : PyObject *ret;
6115 : char *retstr;
6116 :
6117 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_prefixMapBlob, "prefixMapBlob", object);
6118 0 : ret = PyUnicode_FromString(retstr);
6119 0 : talloc_free(retstr);
6120 :
6121 0 : return ret;
6122 : }
6123 :
6124 : static PyMethodDef py_prefixMapBlob_methods[] = {
6125 : { "__ndr_pack__", (PyCFunction)py_prefixMapBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6126 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_prefixMapBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6127 : { "__ndr_print__", (PyCFunction)py_prefixMapBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6128 : { NULL, NULL, 0, NULL }
6129 : };
6130 :
6131 :
6132 : static PyTypeObject prefixMapBlob_Type = {
6133 : PyVarObject_HEAD_INIT(NULL, 0)
6134 : .tp_name = "drsblobs.prefixMapBlob",
6135 : .tp_getset = py_prefixMapBlob_getsetters,
6136 : .tp_methods = py_prefixMapBlob_methods,
6137 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6138 : .tp_new = py_prefixMapBlob_new,
6139 : };
6140 :
6141 0 : static PyObject *py_import_ldapControlDirSyncExtra(TALLOC_CTX *mem_ctx, int level, union ldapControlDirSyncExtra *in)
6142 : {
6143 : PyObject *ret;
6144 :
6145 0 : switch (level) {
6146 0 : case 0:
6147 0 : ret = Py_None;
6148 0 : Py_INCREF(ret);
6149 0 : return ret;
6150 :
6151 0 : default:
6152 0 : ret = pytalloc_reference_ex(&replUpToDateVectorBlob_Type, mem_ctx, &in->uptodateness_vector);
6153 0 : return ret;
6154 :
6155 : }
6156 : PyErr_SetString(PyExc_TypeError, "unknown union level");
6157 : return NULL;
6158 : }
6159 :
6160 0 : static union ldapControlDirSyncExtra *py_export_ldapControlDirSyncExtra(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6161 : {
6162 0 : union ldapControlDirSyncExtra *ret = talloc_zero(mem_ctx, union ldapControlDirSyncExtra);
6163 0 : switch (level) {
6164 0 : case 0:
6165 0 : break;
6166 :
6167 0 : default:
6168 0 : if (in == NULL) {
6169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uptodateness_vector");
6170 0 : talloc_free(ret); return NULL;
6171 : }
6172 0 : PY_CHECK_TYPE(&replUpToDateVectorBlob_Type, in, talloc_free(ret); return NULL;);
6173 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6174 0 : PyErr_NoMemory();
6175 0 : talloc_free(ret); return NULL;
6176 : }
6177 0 : ret->uptodateness_vector = *(struct replUpToDateVectorBlob *)pytalloc_get_ptr(in);
6178 0 : break;
6179 :
6180 : }
6181 :
6182 0 : return ret;
6183 : }
6184 :
6185 0 : static PyObject *py_ldapControlDirSyncExtra_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6186 : {
6187 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
6188 0 : PyObject *mem_ctx_obj = NULL;
6189 0 : TALLOC_CTX *mem_ctx = NULL;
6190 0 : int level = 0;
6191 0 : PyObject *in_obj = NULL;
6192 0 : union ldapControlDirSyncExtra *in = NULL;
6193 :
6194 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
6195 : discard_const_p(char *, kwnames),
6196 : &mem_ctx_obj,
6197 : &level,
6198 : &in_obj)) {
6199 0 : return NULL;
6200 : }
6201 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
6202 0 : if (mem_ctx == NULL) {
6203 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
6204 0 : return NULL;
6205 : }
6206 0 : in = (union ldapControlDirSyncExtra *)pytalloc_get_ptr(in_obj);
6207 0 : if (in == NULL) {
6208 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union ldapControlDirSyncExtra!");
6209 0 : return NULL;
6210 : }
6211 :
6212 0 : return py_import_ldapControlDirSyncExtra(mem_ctx, level, in);
6213 : }
6214 :
6215 0 : static PyObject *py_ldapControlDirSyncExtra_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6216 : {
6217 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
6218 0 : PyObject *mem_ctx_obj = NULL;
6219 0 : TALLOC_CTX *mem_ctx = NULL;
6220 0 : int level = 0;
6221 0 : PyObject *in = NULL;
6222 0 : union ldapControlDirSyncExtra *out = NULL;
6223 :
6224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
6225 : discard_const_p(char *, kwnames),
6226 : &mem_ctx_obj,
6227 : &level,
6228 : &in)) {
6229 0 : return NULL;
6230 : }
6231 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
6232 0 : if (mem_ctx == NULL) {
6233 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
6234 0 : return NULL;
6235 : }
6236 :
6237 0 : out = py_export_ldapControlDirSyncExtra(mem_ctx, level, in);
6238 0 : if (out == NULL) {
6239 0 : return NULL;
6240 : }
6241 :
6242 0 : return pytalloc_GenericObject_reference(out);
6243 : }
6244 :
6245 : static PyMethodDef py_ldapControlDirSyncExtra_methods[] = {
6246 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ldapControlDirSyncExtra_import),
6247 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
6248 : "T.__import__(mem_ctx, level, in) => ret." },
6249 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ldapControlDirSyncExtra_export),
6250 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
6251 : "T.__export__(mem_ctx, level, in) => ret." },
6252 : { NULL, NULL, 0, NULL }
6253 : };
6254 :
6255 0 : static PyObject *py_ldapControlDirSyncExtra_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6256 : {
6257 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
6258 0 : return NULL;
6259 : }
6260 :
6261 :
6262 : static PyTypeObject ldapControlDirSyncExtra_Type = {
6263 : PyVarObject_HEAD_INIT(NULL, 0)
6264 : .tp_name = "drsblobs.ldapControlDirSyncExtra",
6265 : .tp_getset = NULL,
6266 : .tp_methods = py_ldapControlDirSyncExtra_methods,
6267 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6268 : .tp_new = py_ldapControlDirSyncExtra_new,
6269 : };
6270 :
6271 :
6272 0 : static PyObject *py_ldapControlDirSyncBlob_get_u1(PyObject *obj, void *closure)
6273 : {
6274 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6275 : PyObject *py_u1;
6276 0 : py_u1 = PyLong_FromUnsignedLongLong((uint32_t)object->u1);
6277 0 : return py_u1;
6278 : }
6279 :
6280 0 : static int py_ldapControlDirSyncBlob_set_u1(PyObject *py_obj, PyObject *value, void *closure)
6281 : {
6282 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6283 0 : if (value == NULL) {
6284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->u1");
6285 0 : return -1;
6286 : }
6287 : {
6288 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->u1));
6289 0 : if (PyLong_Check(value)) {
6290 : unsigned long long test_var;
6291 0 : test_var = PyLong_AsUnsignedLongLong(value);
6292 0 : if (PyErr_Occurred() != NULL) {
6293 0 : return -1;
6294 : }
6295 0 : if (test_var > uint_max) {
6296 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6297 : PyLong_Type.tp_name, uint_max, test_var);
6298 0 : return -1;
6299 : }
6300 0 : object->u1 = test_var;
6301 : } else {
6302 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6303 : PyLong_Type.tp_name);
6304 0 : return -1;
6305 : }
6306 : }
6307 0 : return 0;
6308 : }
6309 :
6310 0 : static PyObject *py_ldapControlDirSyncBlob_get_time(PyObject *obj, void *closure)
6311 : {
6312 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6313 : PyObject *py_time;
6314 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
6315 0 : return py_time;
6316 : }
6317 :
6318 0 : static int py_ldapControlDirSyncBlob_set_time(PyObject *py_obj, PyObject *value, void *closure)
6319 : {
6320 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6321 0 : if (value == NULL) {
6322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
6323 0 : return -1;
6324 : }
6325 : {
6326 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
6327 0 : if (PyLong_Check(value)) {
6328 : unsigned long long test_var;
6329 0 : test_var = PyLong_AsUnsignedLongLong(value);
6330 0 : if (PyErr_Occurred() != NULL) {
6331 0 : return -1;
6332 : }
6333 0 : if (test_var > uint_max) {
6334 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6335 : PyLong_Type.tp_name, uint_max, test_var);
6336 0 : return -1;
6337 : }
6338 0 : object->time = test_var;
6339 : } else {
6340 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6341 : PyLong_Type.tp_name);
6342 0 : return -1;
6343 : }
6344 : }
6345 0 : return 0;
6346 : }
6347 :
6348 0 : static PyObject *py_ldapControlDirSyncBlob_get_u2(PyObject *obj, void *closure)
6349 : {
6350 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6351 : PyObject *py_u2;
6352 0 : py_u2 = PyLong_FromUnsignedLongLong((uint32_t)object->u2);
6353 0 : return py_u2;
6354 : }
6355 :
6356 0 : static int py_ldapControlDirSyncBlob_set_u2(PyObject *py_obj, PyObject *value, void *closure)
6357 : {
6358 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6359 0 : if (value == NULL) {
6360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->u2");
6361 0 : return -1;
6362 : }
6363 : {
6364 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->u2));
6365 0 : if (PyLong_Check(value)) {
6366 : unsigned long long test_var;
6367 0 : test_var = PyLong_AsUnsignedLongLong(value);
6368 0 : if (PyErr_Occurred() != NULL) {
6369 0 : return -1;
6370 : }
6371 0 : if (test_var > uint_max) {
6372 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6373 : PyLong_Type.tp_name, uint_max, test_var);
6374 0 : return -1;
6375 : }
6376 0 : object->u2 = test_var;
6377 : } else {
6378 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6379 : PyLong_Type.tp_name);
6380 0 : return -1;
6381 : }
6382 : }
6383 0 : return 0;
6384 : }
6385 :
6386 0 : static PyObject *py_ldapControlDirSyncBlob_get_u3(PyObject *obj, void *closure)
6387 : {
6388 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6389 : PyObject *py_u3;
6390 0 : py_u3 = PyLong_FromUnsignedLongLong((uint32_t)object->u3);
6391 0 : return py_u3;
6392 : }
6393 :
6394 0 : static int py_ldapControlDirSyncBlob_set_u3(PyObject *py_obj, PyObject *value, void *closure)
6395 : {
6396 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6397 0 : if (value == NULL) {
6398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->u3");
6399 0 : return -1;
6400 : }
6401 : {
6402 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->u3));
6403 0 : if (PyLong_Check(value)) {
6404 : unsigned long long test_var;
6405 0 : test_var = PyLong_AsUnsignedLongLong(value);
6406 0 : if (PyErr_Occurred() != NULL) {
6407 0 : return -1;
6408 : }
6409 0 : if (test_var > uint_max) {
6410 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6411 : PyLong_Type.tp_name, uint_max, test_var);
6412 0 : return -1;
6413 : }
6414 0 : object->u3 = test_var;
6415 : } else {
6416 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6417 : PyLong_Type.tp_name);
6418 0 : return -1;
6419 : }
6420 : }
6421 0 : return 0;
6422 : }
6423 :
6424 0 : static PyObject *py_ldapControlDirSyncBlob_get_extra_length(PyObject *obj, void *closure)
6425 : {
6426 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6427 : PyObject *py_extra_length;
6428 0 : py_extra_length = PyLong_FromUnsignedLongLong((uint32_t)object->extra_length);
6429 0 : return py_extra_length;
6430 : }
6431 :
6432 0 : static int py_ldapControlDirSyncBlob_set_extra_length(PyObject *py_obj, PyObject *value, void *closure)
6433 : {
6434 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6435 0 : if (value == NULL) {
6436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->extra_length");
6437 0 : return -1;
6438 : }
6439 : {
6440 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->extra_length));
6441 0 : if (PyLong_Check(value)) {
6442 : unsigned long long test_var;
6443 0 : test_var = PyLong_AsUnsignedLongLong(value);
6444 0 : if (PyErr_Occurred() != NULL) {
6445 0 : return -1;
6446 : }
6447 0 : if (test_var > uint_max) {
6448 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6449 : PyLong_Type.tp_name, uint_max, test_var);
6450 0 : return -1;
6451 : }
6452 0 : object->extra_length = test_var;
6453 : } else {
6454 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6455 : PyLong_Type.tp_name);
6456 0 : return -1;
6457 : }
6458 : }
6459 0 : return 0;
6460 : }
6461 :
6462 0 : static PyObject *py_ldapControlDirSyncBlob_get_highwatermark(PyObject *obj, void *closure)
6463 : {
6464 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6465 : PyObject *py_highwatermark;
6466 0 : py_highwatermark = pytalloc_reference_ex(drsuapi_DsReplicaHighWaterMark_Type, pytalloc_get_mem_ctx(obj), &object->highwatermark);
6467 0 : return py_highwatermark;
6468 : }
6469 :
6470 0 : static int py_ldapControlDirSyncBlob_set_highwatermark(PyObject *py_obj, PyObject *value, void *closure)
6471 : {
6472 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6473 0 : if (value == NULL) {
6474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->highwatermark");
6475 0 : return -1;
6476 : }
6477 0 : PY_CHECK_TYPE(drsuapi_DsReplicaHighWaterMark_Type, value, return -1;);
6478 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6479 0 : PyErr_NoMemory();
6480 0 : return -1;
6481 : }
6482 0 : object->highwatermark = *(struct drsuapi_DsReplicaHighWaterMark *)pytalloc_get_ptr(value);
6483 0 : return 0;
6484 : }
6485 :
6486 0 : static PyObject *py_ldapControlDirSyncBlob_get_guid1(PyObject *obj, void *closure)
6487 : {
6488 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6489 : PyObject *py_guid1;
6490 0 : py_guid1 = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->guid1);
6491 0 : return py_guid1;
6492 : }
6493 :
6494 1 : static int py_ldapControlDirSyncBlob_set_guid1(PyObject *py_obj, PyObject *value, void *closure)
6495 : {
6496 1 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6497 1 : if (value == NULL) {
6498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->guid1");
6499 0 : return -1;
6500 : }
6501 1 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
6502 1 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6503 0 : PyErr_NoMemory();
6504 0 : return -1;
6505 : }
6506 1 : object->guid1 = *(struct GUID *)pytalloc_get_ptr(value);
6507 1 : return 0;
6508 : }
6509 :
6510 0 : static PyObject *py_ldapControlDirSyncBlob_get_extra(PyObject *obj, void *closure)
6511 : {
6512 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(obj);
6513 : PyObject *py_extra;
6514 0 : py_extra = pyrpc_import_union(&ldapControlDirSyncExtra_Type, pytalloc_get_mem_ctx(obj), object->extra_length, &object->extra, "union ldapControlDirSyncExtra");
6515 0 : if (py_extra == NULL) {
6516 0 : return NULL;
6517 : }
6518 0 : return py_extra;
6519 : }
6520 :
6521 0 : static int py_ldapControlDirSyncBlob_set_extra(PyObject *py_obj, PyObject *value, void *closure)
6522 : {
6523 0 : struct ldapControlDirSyncBlob *object = (struct ldapControlDirSyncBlob *)pytalloc_get_ptr(py_obj);
6524 0 : if (value == NULL) {
6525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->extra");
6526 0 : return -1;
6527 : }
6528 : {
6529 : union ldapControlDirSyncExtra *extra_switch_0;
6530 0 : extra_switch_0 = (union ldapControlDirSyncExtra *)pyrpc_export_union(&ldapControlDirSyncExtra_Type, pytalloc_get_mem_ctx(py_obj), object->extra_length, value, "union ldapControlDirSyncExtra");
6531 0 : if (extra_switch_0 == NULL) {
6532 0 : return -1;
6533 : }
6534 0 : object->extra = *extra_switch_0;
6535 : }
6536 0 : return 0;
6537 : }
6538 :
6539 : static PyGetSetDef py_ldapControlDirSyncBlob_getsetters[] = {
6540 : {
6541 : .name = discard_const_p(char, "u1"),
6542 : .get = py_ldapControlDirSyncBlob_get_u1,
6543 : .set = py_ldapControlDirSyncBlob_set_u1,
6544 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6545 : },
6546 : {
6547 : .name = discard_const_p(char, "time"),
6548 : .get = py_ldapControlDirSyncBlob_get_time,
6549 : .set = py_ldapControlDirSyncBlob_set_time,
6550 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
6551 : },
6552 : {
6553 : .name = discard_const_p(char, "u2"),
6554 : .get = py_ldapControlDirSyncBlob_get_u2,
6555 : .set = py_ldapControlDirSyncBlob_set_u2,
6556 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6557 : },
6558 : {
6559 : .name = discard_const_p(char, "u3"),
6560 : .get = py_ldapControlDirSyncBlob_get_u3,
6561 : .set = py_ldapControlDirSyncBlob_set_u3,
6562 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6563 : },
6564 : {
6565 : .name = discard_const_p(char, "extra_length"),
6566 : .get = py_ldapControlDirSyncBlob_get_extra_length,
6567 : .set = py_ldapControlDirSyncBlob_set_extra_length,
6568 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6569 : },
6570 : {
6571 : .name = discard_const_p(char, "highwatermark"),
6572 : .get = py_ldapControlDirSyncBlob_get_highwatermark,
6573 : .set = py_ldapControlDirSyncBlob_set_highwatermark,
6574 : .doc = discard_const_p(char, "PIDL-generated element of base type drsuapi_DsReplicaHighWaterMark")
6575 : },
6576 : {
6577 : .name = discard_const_p(char, "guid1"),
6578 : .get = py_ldapControlDirSyncBlob_get_guid1,
6579 : .set = py_ldapControlDirSyncBlob_set_guid1,
6580 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
6581 : },
6582 : {
6583 : .name = discard_const_p(char, "extra"),
6584 : .get = py_ldapControlDirSyncBlob_get_extra,
6585 : .set = py_ldapControlDirSyncBlob_set_extra,
6586 : .doc = discard_const_p(char, "PIDL-generated element of base type ldapControlDirSyncExtra")
6587 : },
6588 : { .name = NULL }
6589 : };
6590 :
6591 0 : static PyObject *py_ldapControlDirSyncBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6592 : {
6593 0 : return pytalloc_new(struct ldapControlDirSyncBlob, type);
6594 : }
6595 :
6596 :
6597 : static PyTypeObject ldapControlDirSyncBlob_Type = {
6598 : PyVarObject_HEAD_INIT(NULL, 0)
6599 : .tp_name = "drsblobs.ldapControlDirSyncBlob",
6600 : .tp_getset = py_ldapControlDirSyncBlob_getsetters,
6601 : .tp_methods = NULL,
6602 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6603 : .tp_new = py_ldapControlDirSyncBlob_new,
6604 : };
6605 :
6606 :
6607 0 : static PyObject *py_ldapControlDirSyncCookie_get_msds(PyObject *obj, void *closure)
6608 : {
6609 0 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(obj);
6610 : PyObject *py_msds;
6611 0 : if (object->msds == NULL) {
6612 0 : py_msds = Py_None;
6613 0 : Py_INCREF(py_msds);
6614 : } else {
6615 0 : py_msds = PyUnicode_Decode(object->msds, strlen(object->msds), "utf-8", "ignore");
6616 : }
6617 0 : return py_msds;
6618 : }
6619 :
6620 0 : static int py_ldapControlDirSyncCookie_set_msds(PyObject *py_obj, PyObject *value, void *closure)
6621 : {
6622 0 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(py_obj);
6623 0 : if (value == NULL) {
6624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->msds");
6625 0 : return -1;
6626 : }
6627 : {
6628 : const char *test_str;
6629 : const char *talloc_str;
6630 0 : PyObject *unicode = NULL;
6631 0 : if (PyUnicode_Check(value)) {
6632 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6633 0 : if (unicode == NULL) {
6634 0 : PyErr_NoMemory();
6635 0 : return -1;
6636 : }
6637 0 : test_str = PyBytes_AS_STRING(unicode);
6638 0 : } else if (PyBytes_Check(value)) {
6639 0 : test_str = PyBytes_AS_STRING(value);
6640 : } else {
6641 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6642 0 : return -1;
6643 : }
6644 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6645 0 : if (unicode != NULL) {
6646 0 : Py_DECREF(unicode);
6647 : }
6648 0 : if (talloc_str == NULL) {
6649 0 : PyErr_NoMemory();
6650 0 : return -1;
6651 : }
6652 0 : object->msds = talloc_str;
6653 : }
6654 0 : return 0;
6655 : }
6656 :
6657 1 : static PyObject *py_ldapControlDirSyncCookie_get_blob(PyObject *obj, void *closure)
6658 : {
6659 1 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(obj);
6660 : PyObject *py_blob;
6661 1 : py_blob = pytalloc_reference_ex(&ldapControlDirSyncBlob_Type, pytalloc_get_mem_ctx(obj), &object->blob);
6662 1 : return py_blob;
6663 : }
6664 :
6665 0 : static int py_ldapControlDirSyncCookie_set_blob(PyObject *py_obj, PyObject *value, void *closure)
6666 : {
6667 0 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(py_obj);
6668 0 : if (value == NULL) {
6669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blob");
6670 0 : return -1;
6671 : }
6672 0 : PY_CHECK_TYPE(&ldapControlDirSyncBlob_Type, value, return -1;);
6673 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6674 0 : PyErr_NoMemory();
6675 0 : return -1;
6676 : }
6677 0 : object->blob = *(struct ldapControlDirSyncBlob *)pytalloc_get_ptr(value);
6678 0 : return 0;
6679 : }
6680 :
6681 : static PyGetSetDef py_ldapControlDirSyncCookie_getsetters[] = {
6682 : {
6683 : .name = discard_const_p(char, "msds"),
6684 : .get = py_ldapControlDirSyncCookie_get_msds,
6685 : .set = py_ldapControlDirSyncCookie_set_msds,
6686 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6687 : },
6688 : {
6689 : .name = discard_const_p(char, "blob"),
6690 : .get = py_ldapControlDirSyncCookie_get_blob,
6691 : .set = py_ldapControlDirSyncCookie_set_blob,
6692 : .doc = discard_const_p(char, "PIDL-generated element of base type ldapControlDirSyncBlob")
6693 : },
6694 : { .name = NULL }
6695 : };
6696 :
6697 1 : static PyObject *py_ldapControlDirSyncCookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6698 : {
6699 1 : return pytalloc_new(struct ldapControlDirSyncCookie, type);
6700 : }
6701 :
6702 1 : static PyObject *py_ldapControlDirSyncCookie_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6703 : {
6704 1 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(py_obj);
6705 1 : PyObject *ret = NULL;
6706 : DATA_BLOB blob;
6707 : enum ndr_err_code err;
6708 1 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6709 1 : if (tmp_ctx == NULL) {
6710 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6711 0 : return NULL;
6712 : }
6713 1 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ldapControlDirSyncCookie);
6714 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6715 0 : TALLOC_FREE(tmp_ctx);
6716 0 : PyErr_SetNdrError(err);
6717 0 : return NULL;
6718 : }
6719 :
6720 1 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6721 1 : TALLOC_FREE(tmp_ctx);
6722 1 : return ret;
6723 : }
6724 :
6725 1 : static PyObject *py_ldapControlDirSyncCookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6726 : {
6727 1 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(py_obj);
6728 1 : DATA_BLOB blob = {.data = NULL, .length = 0};
6729 1 : Py_ssize_t blob_length = 0;
6730 : enum ndr_err_code err;
6731 1 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6732 1 : PyObject *allow_remaining_obj = NULL;
6733 1 : bool allow_remaining = false;
6734 :
6735 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6736 : discard_const_p(char *, kwnames),
6737 : &blob.data, &blob_length,
6738 : &allow_remaining_obj)) {
6739 0 : return NULL;
6740 : }
6741 1 : blob.length = blob_length;
6742 :
6743 1 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6744 0 : allow_remaining = true;
6745 : }
6746 :
6747 1 : if (allow_remaining) {
6748 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ldapControlDirSyncCookie);
6749 : } else {
6750 1 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ldapControlDirSyncCookie);
6751 : }
6752 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6753 0 : PyErr_SetNdrError(err);
6754 0 : return NULL;
6755 : }
6756 :
6757 1 : Py_RETURN_NONE;
6758 : }
6759 :
6760 0 : static PyObject *py_ldapControlDirSyncCookie_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6761 : {
6762 0 : struct ldapControlDirSyncCookie *object = (struct ldapControlDirSyncCookie *)pytalloc_get_ptr(py_obj);
6763 : PyObject *ret;
6764 : char *retstr;
6765 :
6766 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ldapControlDirSyncCookie, "ldapControlDirSyncCookie", object);
6767 0 : ret = PyUnicode_FromString(retstr);
6768 0 : talloc_free(retstr);
6769 :
6770 0 : return ret;
6771 : }
6772 :
6773 : static PyMethodDef py_ldapControlDirSyncCookie_methods[] = {
6774 : { "__ndr_pack__", (PyCFunction)py_ldapControlDirSyncCookie_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6775 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ldapControlDirSyncCookie_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6776 : { "__ndr_print__", (PyCFunction)py_ldapControlDirSyncCookie_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6777 : { NULL, NULL, 0, NULL }
6778 : };
6779 :
6780 :
6781 : static PyTypeObject ldapControlDirSyncCookie_Type = {
6782 : PyVarObject_HEAD_INIT(NULL, 0)
6783 : .tp_name = "drsblobs.ldapControlDirSyncCookie",
6784 : .tp_getset = py_ldapControlDirSyncCookie_getsetters,
6785 : .tp_methods = py_ldapControlDirSyncCookie_methods,
6786 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6787 : .tp_new = py_ldapControlDirSyncCookie_new,
6788 : };
6789 :
6790 :
6791 0 : static PyObject *py_supplementalCredentialsPackage_get_name_len(PyObject *obj, void *closure)
6792 : {
6793 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(obj);
6794 : PyObject *py_name_len;
6795 0 : py_name_len = PyLong_FromLong((uint16_t)object->name_len);
6796 0 : return py_name_len;
6797 : }
6798 :
6799 0 : static int py_supplementalCredentialsPackage_set_name_len(PyObject *py_obj, PyObject *value, void *closure)
6800 : {
6801 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
6802 0 : if (value == NULL) {
6803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name_len");
6804 0 : return -1;
6805 : }
6806 : {
6807 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_len));
6808 0 : if (PyLong_Check(value)) {
6809 : unsigned long long test_var;
6810 0 : test_var = PyLong_AsUnsignedLongLong(value);
6811 0 : if (PyErr_Occurred() != NULL) {
6812 0 : return -1;
6813 : }
6814 0 : if (test_var > uint_max) {
6815 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6816 : PyLong_Type.tp_name, uint_max, test_var);
6817 0 : return -1;
6818 : }
6819 0 : object->name_len = test_var;
6820 : } else {
6821 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6822 : PyLong_Type.tp_name);
6823 0 : return -1;
6824 : }
6825 : }
6826 0 : return 0;
6827 : }
6828 :
6829 0 : static PyObject *py_supplementalCredentialsPackage_get_data_len(PyObject *obj, void *closure)
6830 : {
6831 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(obj);
6832 : PyObject *py_data_len;
6833 0 : py_data_len = PyLong_FromLong((uint16_t)object->data_len);
6834 0 : return py_data_len;
6835 : }
6836 :
6837 0 : static int py_supplementalCredentialsPackage_set_data_len(PyObject *py_obj, PyObject *value, void *closure)
6838 : {
6839 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
6840 0 : if (value == NULL) {
6841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_len");
6842 0 : return -1;
6843 : }
6844 : {
6845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_len));
6846 0 : if (PyLong_Check(value)) {
6847 : unsigned long long test_var;
6848 0 : test_var = PyLong_AsUnsignedLongLong(value);
6849 0 : if (PyErr_Occurred() != NULL) {
6850 0 : return -1;
6851 : }
6852 0 : if (test_var > uint_max) {
6853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6854 : PyLong_Type.tp_name, uint_max, test_var);
6855 0 : return -1;
6856 : }
6857 0 : object->data_len = test_var;
6858 : } else {
6859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6860 : PyLong_Type.tp_name);
6861 0 : return -1;
6862 : }
6863 : }
6864 0 : return 0;
6865 : }
6866 :
6867 0 : static PyObject *py_supplementalCredentialsPackage_get_reserved(PyObject *obj, void *closure)
6868 : {
6869 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(obj);
6870 : PyObject *py_reserved;
6871 0 : py_reserved = PyLong_FromLong((uint16_t)object->reserved);
6872 0 : return py_reserved;
6873 : }
6874 :
6875 0 : static int py_supplementalCredentialsPackage_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
6876 : {
6877 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
6878 0 : if (value == NULL) {
6879 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
6880 0 : return -1;
6881 : }
6882 : {
6883 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
6884 0 : if (PyLong_Check(value)) {
6885 : unsigned long long test_var;
6886 0 : test_var = PyLong_AsUnsignedLongLong(value);
6887 0 : if (PyErr_Occurred() != NULL) {
6888 0 : return -1;
6889 : }
6890 0 : if (test_var > uint_max) {
6891 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6892 : PyLong_Type.tp_name, uint_max, test_var);
6893 0 : return -1;
6894 : }
6895 0 : object->reserved = test_var;
6896 : } else {
6897 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6898 : PyLong_Type.tp_name);
6899 0 : return -1;
6900 : }
6901 : }
6902 0 : return 0;
6903 : }
6904 :
6905 2101 : static PyObject *py_supplementalCredentialsPackage_get_name(PyObject *obj, void *closure)
6906 : {
6907 2101 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(obj);
6908 : PyObject *py_name;
6909 2101 : if (object->name == NULL) {
6910 0 : py_name = Py_None;
6911 0 : Py_INCREF(py_name);
6912 : } else {
6913 2101 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
6914 : }
6915 2101 : return py_name;
6916 : }
6917 :
6918 0 : static int py_supplementalCredentialsPackage_set_name(PyObject *py_obj, PyObject *value, void *closure)
6919 : {
6920 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
6921 0 : if (value == NULL) {
6922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
6923 0 : return -1;
6924 : }
6925 : {
6926 : const char *test_str;
6927 : const char *talloc_str;
6928 0 : PyObject *unicode = NULL;
6929 0 : if (PyUnicode_Check(value)) {
6930 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6931 0 : if (unicode == NULL) {
6932 0 : PyErr_NoMemory();
6933 0 : return -1;
6934 : }
6935 0 : test_str = PyBytes_AS_STRING(unicode);
6936 0 : } else if (PyBytes_Check(value)) {
6937 0 : test_str = PyBytes_AS_STRING(value);
6938 : } else {
6939 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6940 0 : return -1;
6941 : }
6942 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6943 0 : if (unicode != NULL) {
6944 0 : Py_DECREF(unicode);
6945 : }
6946 0 : if (talloc_str == NULL) {
6947 0 : PyErr_NoMemory();
6948 0 : return -1;
6949 : }
6950 0 : object->name = talloc_str;
6951 : }
6952 0 : return 0;
6953 : }
6954 :
6955 329 : static PyObject *py_supplementalCredentialsPackage_get_data(PyObject *obj, void *closure)
6956 : {
6957 329 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(obj);
6958 : PyObject *py_data;
6959 329 : if (object->data == NULL) {
6960 0 : py_data = Py_None;
6961 0 : Py_INCREF(py_data);
6962 : } else {
6963 329 : py_data = PyUnicode_Decode(object->data, strlen(object->data), "utf-8", "ignore");
6964 : }
6965 329 : return py_data;
6966 : }
6967 :
6968 0 : static int py_supplementalCredentialsPackage_set_data(PyObject *py_obj, PyObject *value, void *closure)
6969 : {
6970 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
6971 0 : if (value == NULL) {
6972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
6973 0 : return -1;
6974 : }
6975 : {
6976 : const char *test_str;
6977 : const char *talloc_str;
6978 0 : PyObject *unicode = NULL;
6979 0 : if (PyUnicode_Check(value)) {
6980 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6981 0 : if (unicode == NULL) {
6982 0 : PyErr_NoMemory();
6983 0 : return -1;
6984 : }
6985 0 : test_str = PyBytes_AS_STRING(unicode);
6986 0 : } else if (PyBytes_Check(value)) {
6987 0 : test_str = PyBytes_AS_STRING(value);
6988 : } else {
6989 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6990 0 : return -1;
6991 : }
6992 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6993 0 : if (unicode != NULL) {
6994 0 : Py_DECREF(unicode);
6995 : }
6996 0 : if (talloc_str == NULL) {
6997 0 : PyErr_NoMemory();
6998 0 : return -1;
6999 : }
7000 0 : object->data = talloc_str;
7001 : }
7002 0 : return 0;
7003 : }
7004 :
7005 : static PyGetSetDef py_supplementalCredentialsPackage_getsetters[] = {
7006 : {
7007 : .name = discard_const_p(char, "name_len"),
7008 : .get = py_supplementalCredentialsPackage_get_name_len,
7009 : .set = py_supplementalCredentialsPackage_set_name_len,
7010 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7011 : },
7012 : {
7013 : .name = discard_const_p(char, "data_len"),
7014 : .get = py_supplementalCredentialsPackage_get_data_len,
7015 : .set = py_supplementalCredentialsPackage_set_data_len,
7016 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7017 : },
7018 : {
7019 : .name = discard_const_p(char, "reserved"),
7020 : .get = py_supplementalCredentialsPackage_get_reserved,
7021 : .set = py_supplementalCredentialsPackage_set_reserved,
7022 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7023 : },
7024 : {
7025 : .name = discard_const_p(char, "name"),
7026 : .get = py_supplementalCredentialsPackage_get_name,
7027 : .set = py_supplementalCredentialsPackage_set_name,
7028 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7029 : },
7030 : {
7031 : .name = discard_const_p(char, "data"),
7032 : .get = py_supplementalCredentialsPackage_get_data,
7033 : .set = py_supplementalCredentialsPackage_set_data,
7034 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7035 : },
7036 : { .name = NULL }
7037 : };
7038 :
7039 0 : static PyObject *py_supplementalCredentialsPackage_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7040 : {
7041 0 : return pytalloc_new(struct supplementalCredentialsPackage, type);
7042 : }
7043 :
7044 0 : static PyObject *py_supplementalCredentialsPackage_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7045 : {
7046 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
7047 0 : PyObject *ret = NULL;
7048 : DATA_BLOB blob;
7049 : enum ndr_err_code err;
7050 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7051 0 : if (tmp_ctx == NULL) {
7052 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7053 0 : return NULL;
7054 : }
7055 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsPackage);
7056 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7057 0 : TALLOC_FREE(tmp_ctx);
7058 0 : PyErr_SetNdrError(err);
7059 0 : return NULL;
7060 : }
7061 :
7062 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7063 0 : TALLOC_FREE(tmp_ctx);
7064 0 : return ret;
7065 : }
7066 :
7067 0 : static PyObject *py_supplementalCredentialsPackage_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7068 : {
7069 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
7070 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7071 0 : Py_ssize_t blob_length = 0;
7072 : enum ndr_err_code err;
7073 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7074 0 : PyObject *allow_remaining_obj = NULL;
7075 0 : bool allow_remaining = false;
7076 :
7077 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7078 : discard_const_p(char *, kwnames),
7079 : &blob.data, &blob_length,
7080 : &allow_remaining_obj)) {
7081 0 : return NULL;
7082 : }
7083 0 : blob.length = blob_length;
7084 :
7085 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7086 0 : allow_remaining = true;
7087 : }
7088 :
7089 0 : if (allow_remaining) {
7090 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsPackage);
7091 : } else {
7092 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsPackage);
7093 : }
7094 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7095 0 : PyErr_SetNdrError(err);
7096 0 : return NULL;
7097 : }
7098 :
7099 0 : Py_RETURN_NONE;
7100 : }
7101 :
7102 0 : static PyObject *py_supplementalCredentialsPackage_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7103 : {
7104 0 : struct supplementalCredentialsPackage *object = (struct supplementalCredentialsPackage *)pytalloc_get_ptr(py_obj);
7105 : PyObject *ret;
7106 : char *retstr;
7107 :
7108 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_supplementalCredentialsPackage, "supplementalCredentialsPackage", object);
7109 0 : ret = PyUnicode_FromString(retstr);
7110 0 : talloc_free(retstr);
7111 :
7112 0 : return ret;
7113 : }
7114 :
7115 : static PyMethodDef py_supplementalCredentialsPackage_methods[] = {
7116 : { "__ndr_pack__", (PyCFunction)py_supplementalCredentialsPackage_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7117 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_supplementalCredentialsPackage_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7118 : { "__ndr_print__", (PyCFunction)py_supplementalCredentialsPackage_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7119 : { NULL, NULL, 0, NULL }
7120 : };
7121 :
7122 :
7123 : static PyTypeObject supplementalCredentialsPackage_Type = {
7124 : PyVarObject_HEAD_INIT(NULL, 0)
7125 : .tp_name = "drsblobs.supplementalCredentialsPackage",
7126 : .tp_getset = py_supplementalCredentialsPackage_getsetters,
7127 : .tp_methods = py_supplementalCredentialsPackage_methods,
7128 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7129 : .tp_new = py_supplementalCredentialsPackage_new,
7130 : };
7131 :
7132 :
7133 0 : static PyObject *py_supplementalCredentialsSubBlob_get_prefix(PyObject *obj, void *closure)
7134 : {
7135 0 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(obj);
7136 : PyObject *py_prefix;
7137 0 : if (object->prefix == NULL) {
7138 0 : py_prefix = Py_None;
7139 0 : Py_INCREF(py_prefix);
7140 : } else {
7141 0 : py_prefix = PyUnicode_Decode(object->prefix, strlen(object->prefix), "utf-8", "ignore");
7142 : }
7143 0 : return py_prefix;
7144 : }
7145 :
7146 0 : static int py_supplementalCredentialsSubBlob_set_prefix(PyObject *py_obj, PyObject *value, void *closure)
7147 : {
7148 0 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(py_obj);
7149 0 : if (value == NULL) {
7150 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->prefix");
7151 0 : return -1;
7152 : }
7153 : {
7154 : const char *test_str;
7155 : const char *talloc_str;
7156 0 : PyObject *unicode = NULL;
7157 0 : if (PyUnicode_Check(value)) {
7158 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7159 0 : if (unicode == NULL) {
7160 0 : PyErr_NoMemory();
7161 0 : return -1;
7162 : }
7163 0 : test_str = PyBytes_AS_STRING(unicode);
7164 0 : } else if (PyBytes_Check(value)) {
7165 0 : test_str = PyBytes_AS_STRING(value);
7166 : } else {
7167 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7168 0 : return -1;
7169 : }
7170 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7171 0 : if (unicode != NULL) {
7172 0 : Py_DECREF(unicode);
7173 : }
7174 0 : if (talloc_str == NULL) {
7175 0 : PyErr_NoMemory();
7176 0 : return -1;
7177 : }
7178 0 : object->prefix = talloc_str;
7179 : }
7180 0 : return 0;
7181 : }
7182 :
7183 0 : static PyObject *py_supplementalCredentialsSubBlob_get_signature(PyObject *obj, void *closure)
7184 : {
7185 0 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(obj);
7186 : PyObject *py_signature;
7187 0 : py_signature = PyLong_FromLong((uint16_t)object->signature);
7188 0 : return py_signature;
7189 : }
7190 :
7191 0 : static int py_supplementalCredentialsSubBlob_set_signature(PyObject *py_obj, PyObject *value, void *closure)
7192 : {
7193 0 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(py_obj);
7194 0 : if (value == NULL) {
7195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature");
7196 0 : return -1;
7197 : }
7198 : {
7199 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->signature));
7200 0 : if (PyLong_Check(value)) {
7201 : unsigned long long test_var;
7202 0 : test_var = PyLong_AsUnsignedLongLong(value);
7203 0 : if (PyErr_Occurred() != NULL) {
7204 0 : return -1;
7205 : }
7206 0 : if (test_var > uint_max) {
7207 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7208 : PyLong_Type.tp_name, uint_max, test_var);
7209 0 : return -1;
7210 : }
7211 0 : object->signature = test_var;
7212 : } else {
7213 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7214 : PyLong_Type.tp_name);
7215 0 : return -1;
7216 : }
7217 : }
7218 0 : return 0;
7219 : }
7220 :
7221 48 : static PyObject *py_supplementalCredentialsSubBlob_get_num_packages(PyObject *obj, void *closure)
7222 : {
7223 48 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(obj);
7224 : PyObject *py_num_packages;
7225 48 : py_num_packages = PyLong_FromLong((uint16_t)object->num_packages);
7226 48 : return py_num_packages;
7227 : }
7228 :
7229 0 : static int py_supplementalCredentialsSubBlob_set_num_packages(PyObject *py_obj, PyObject *value, void *closure)
7230 : {
7231 0 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(py_obj);
7232 0 : if (value == NULL) {
7233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_packages");
7234 0 : return -1;
7235 : }
7236 : {
7237 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_packages));
7238 0 : if (PyLong_Check(value)) {
7239 : unsigned long long test_var;
7240 0 : test_var = PyLong_AsUnsignedLongLong(value);
7241 0 : if (PyErr_Occurred() != NULL) {
7242 0 : return -1;
7243 : }
7244 0 : if (test_var > uint_max) {
7245 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7246 : PyLong_Type.tp_name, uint_max, test_var);
7247 0 : return -1;
7248 : }
7249 0 : object->num_packages = test_var;
7250 : } else {
7251 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7252 : PyLong_Type.tp_name);
7253 0 : return -1;
7254 : }
7255 : }
7256 0 : return 0;
7257 : }
7258 :
7259 820 : static PyObject *py_supplementalCredentialsSubBlob_get_packages(PyObject *obj, void *closure)
7260 : {
7261 820 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(obj);
7262 : PyObject *py_packages;
7263 820 : py_packages = PyList_New(object->num_packages);
7264 820 : if (py_packages == NULL) {
7265 0 : return NULL;
7266 : }
7267 : {
7268 : int packages_cntr_0;
7269 4173 : for (packages_cntr_0 = 0; packages_cntr_0 < (object->num_packages); packages_cntr_0++) {
7270 : PyObject *py_packages_0;
7271 3353 : py_packages_0 = pytalloc_reference_ex(&supplementalCredentialsPackage_Type, object->packages, &object->packages[packages_cntr_0]);
7272 3353 : PyList_SetItem(py_packages, packages_cntr_0, py_packages_0);
7273 : }
7274 : }
7275 820 : return py_packages;
7276 : }
7277 :
7278 0 : static int py_supplementalCredentialsSubBlob_set_packages(PyObject *py_obj, PyObject *value, void *closure)
7279 : {
7280 0 : struct supplementalCredentialsSubBlob *object = (struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(py_obj);
7281 0 : if (value == NULL) {
7282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->packages");
7283 0 : return -1;
7284 : }
7285 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7286 : {
7287 : int packages_cntr_0;
7288 0 : object->packages = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->packages, PyList_GET_SIZE(value));
7289 0 : if (!object->packages) { return -1;; }
7290 0 : talloc_set_name_const(object->packages, "ARRAY: object->packages");
7291 0 : for (packages_cntr_0 = 0; packages_cntr_0 < PyList_GET_SIZE(value); packages_cntr_0++) {
7292 0 : if (PyList_GET_ITEM(value, packages_cntr_0) == NULL) {
7293 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->packages[packages_cntr_0]");
7294 0 : return -1;
7295 : }
7296 0 : PY_CHECK_TYPE(&supplementalCredentialsPackage_Type, PyList_GET_ITEM(value, packages_cntr_0), return -1;);
7297 0 : if (talloc_reference(object->packages, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, packages_cntr_0))) == NULL) {
7298 0 : PyErr_NoMemory();
7299 0 : return -1;
7300 : }
7301 0 : object->packages[packages_cntr_0] = *(struct supplementalCredentialsPackage *)pytalloc_get_ptr(PyList_GET_ITEM(value, packages_cntr_0));
7302 : }
7303 : }
7304 0 : return 0;
7305 : }
7306 :
7307 : static PyGetSetDef py_supplementalCredentialsSubBlob_getsetters[] = {
7308 : {
7309 : .name = discard_const_p(char, "prefix"),
7310 : .get = py_supplementalCredentialsSubBlob_get_prefix,
7311 : .set = py_supplementalCredentialsSubBlob_set_prefix,
7312 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7313 : },
7314 : {
7315 : .name = discard_const_p(char, "signature"),
7316 : .get = py_supplementalCredentialsSubBlob_get_signature,
7317 : .set = py_supplementalCredentialsSubBlob_set_signature,
7318 : .doc = discard_const_p(char, "PIDL-generated element of base type supplementalCredentialsSignature")
7319 : },
7320 : {
7321 : .name = discard_const_p(char, "num_packages"),
7322 : .get = py_supplementalCredentialsSubBlob_get_num_packages,
7323 : .set = py_supplementalCredentialsSubBlob_set_num_packages,
7324 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7325 : },
7326 : {
7327 : .name = discard_const_p(char, "packages"),
7328 : .get = py_supplementalCredentialsSubBlob_get_packages,
7329 : .set = py_supplementalCredentialsSubBlob_set_packages,
7330 : .doc = discard_const_p(char, "PIDL-generated element of base type supplementalCredentialsPackage")
7331 : },
7332 : { .name = NULL }
7333 : };
7334 :
7335 0 : static PyObject *py_supplementalCredentialsSubBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7336 : {
7337 0 : return pytalloc_new(struct supplementalCredentialsSubBlob, type);
7338 : }
7339 :
7340 :
7341 : static PyTypeObject supplementalCredentialsSubBlob_Type = {
7342 : PyVarObject_HEAD_INIT(NULL, 0)
7343 : .tp_name = "drsblobs.supplementalCredentialsSubBlob",
7344 : .tp_getset = py_supplementalCredentialsSubBlob_getsetters,
7345 : .tp_methods = NULL,
7346 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7347 : .tp_new = py_supplementalCredentialsSubBlob_new,
7348 : };
7349 :
7350 :
7351 0 : static PyObject *py_supplementalCredentialsBlob_get_unknown1(PyObject *obj, void *closure)
7352 : {
7353 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(obj);
7354 : PyObject *py_unknown1;
7355 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1);
7356 0 : return py_unknown1;
7357 : }
7358 :
7359 0 : static int py_supplementalCredentialsBlob_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
7360 : {
7361 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7362 0 : if (value == NULL) {
7363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
7364 0 : return -1;
7365 : }
7366 : {
7367 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
7368 0 : if (PyLong_Check(value)) {
7369 : unsigned long long test_var;
7370 0 : test_var = PyLong_AsUnsignedLongLong(value);
7371 0 : if (PyErr_Occurred() != NULL) {
7372 0 : return -1;
7373 : }
7374 0 : if (test_var > uint_max) {
7375 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7376 : PyLong_Type.tp_name, uint_max, test_var);
7377 0 : return -1;
7378 : }
7379 0 : object->unknown1 = test_var;
7380 : } else {
7381 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7382 : PyLong_Type.tp_name);
7383 0 : return -1;
7384 : }
7385 : }
7386 0 : return 0;
7387 : }
7388 :
7389 0 : static PyObject *py_supplementalCredentialsBlob_get___ndr_size(PyObject *obj, void *closure)
7390 : {
7391 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(obj);
7392 : PyObject *py___ndr_size;
7393 0 : py___ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->__ndr_size);
7394 0 : return py___ndr_size;
7395 : }
7396 :
7397 0 : static int py_supplementalCredentialsBlob_set___ndr_size(PyObject *py_obj, PyObject *value, void *closure)
7398 : {
7399 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7400 0 : if (value == NULL) {
7401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__ndr_size");
7402 0 : return -1;
7403 : }
7404 : {
7405 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__ndr_size));
7406 0 : if (PyLong_Check(value)) {
7407 : unsigned long long test_var;
7408 0 : test_var = PyLong_AsUnsignedLongLong(value);
7409 0 : if (PyErr_Occurred() != NULL) {
7410 0 : return -1;
7411 : }
7412 0 : if (test_var > uint_max) {
7413 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7414 : PyLong_Type.tp_name, uint_max, test_var);
7415 0 : return -1;
7416 : }
7417 0 : object->__ndr_size = test_var;
7418 : } else {
7419 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7420 : PyLong_Type.tp_name);
7421 0 : return -1;
7422 : }
7423 : }
7424 0 : return 0;
7425 : }
7426 :
7427 0 : static PyObject *py_supplementalCredentialsBlob_get_unknown2(PyObject *obj, void *closure)
7428 : {
7429 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(obj);
7430 : PyObject *py_unknown2;
7431 0 : py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2);
7432 0 : return py_unknown2;
7433 : }
7434 :
7435 0 : static int py_supplementalCredentialsBlob_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
7436 : {
7437 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7438 0 : if (value == NULL) {
7439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
7440 0 : return -1;
7441 : }
7442 : {
7443 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2));
7444 0 : if (PyLong_Check(value)) {
7445 : unsigned long long test_var;
7446 0 : test_var = PyLong_AsUnsignedLongLong(value);
7447 0 : if (PyErr_Occurred() != NULL) {
7448 0 : return -1;
7449 : }
7450 0 : if (test_var > uint_max) {
7451 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7452 : PyLong_Type.tp_name, uint_max, test_var);
7453 0 : return -1;
7454 : }
7455 0 : object->unknown2 = test_var;
7456 : } else {
7457 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7458 : PyLong_Type.tp_name);
7459 0 : return -1;
7460 : }
7461 : }
7462 0 : return 0;
7463 : }
7464 :
7465 868 : static PyObject *py_supplementalCredentialsBlob_get_sub(PyObject *obj, void *closure)
7466 : {
7467 868 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(obj);
7468 : PyObject *py_sub;
7469 868 : py_sub = pytalloc_reference_ex(&supplementalCredentialsSubBlob_Type, pytalloc_get_mem_ctx(obj), &object->sub);
7470 868 : return py_sub;
7471 : }
7472 :
7473 0 : static int py_supplementalCredentialsBlob_set_sub(PyObject *py_obj, PyObject *value, void *closure)
7474 : {
7475 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7476 0 : if (value == NULL) {
7477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub");
7478 0 : return -1;
7479 : }
7480 0 : PY_CHECK_TYPE(&supplementalCredentialsSubBlob_Type, value, return -1;);
7481 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7482 0 : PyErr_NoMemory();
7483 0 : return -1;
7484 : }
7485 0 : object->sub = *(struct supplementalCredentialsSubBlob *)pytalloc_get_ptr(value);
7486 0 : return 0;
7487 : }
7488 :
7489 0 : static PyObject *py_supplementalCredentialsBlob_get_unknown3(PyObject *obj, void *closure)
7490 : {
7491 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(obj);
7492 : PyObject *py_unknown3;
7493 0 : py_unknown3 = PyLong_FromLong((uint16_t)object->unknown3);
7494 0 : return py_unknown3;
7495 : }
7496 :
7497 0 : static int py_supplementalCredentialsBlob_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
7498 : {
7499 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7500 0 : if (value == NULL) {
7501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
7502 0 : return -1;
7503 : }
7504 : {
7505 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3));
7506 0 : if (PyLong_Check(value)) {
7507 : unsigned long long test_var;
7508 0 : test_var = PyLong_AsUnsignedLongLong(value);
7509 0 : if (PyErr_Occurred() != NULL) {
7510 0 : return -1;
7511 : }
7512 0 : if (test_var > uint_max) {
7513 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7514 : PyLong_Type.tp_name, uint_max, test_var);
7515 0 : return -1;
7516 : }
7517 0 : object->unknown3 = test_var;
7518 : } else {
7519 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7520 : PyLong_Type.tp_name);
7521 0 : return -1;
7522 : }
7523 : }
7524 0 : return 0;
7525 : }
7526 :
7527 : static PyGetSetDef py_supplementalCredentialsBlob_getsetters[] = {
7528 : {
7529 : .name = discard_const_p(char, "unknown1"),
7530 : .get = py_supplementalCredentialsBlob_get_unknown1,
7531 : .set = py_supplementalCredentialsBlob_set_unknown1,
7532 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7533 : },
7534 : {
7535 : .name = discard_const_p(char, "__ndr_size"),
7536 : .get = py_supplementalCredentialsBlob_get___ndr_size,
7537 : .set = py_supplementalCredentialsBlob_set___ndr_size,
7538 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7539 : },
7540 : {
7541 : .name = discard_const_p(char, "unknown2"),
7542 : .get = py_supplementalCredentialsBlob_get_unknown2,
7543 : .set = py_supplementalCredentialsBlob_set_unknown2,
7544 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7545 : },
7546 : {
7547 : .name = discard_const_p(char, "sub"),
7548 : .get = py_supplementalCredentialsBlob_get_sub,
7549 : .set = py_supplementalCredentialsBlob_set_sub,
7550 : .doc = discard_const_p(char, "PIDL-generated element of base type supplementalCredentialsSubBlob")
7551 : },
7552 : {
7553 : .name = discard_const_p(char, "unknown3"),
7554 : .get = py_supplementalCredentialsBlob_get_unknown3,
7555 : .set = py_supplementalCredentialsBlob_set_unknown3,
7556 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7557 : },
7558 : { .name = NULL }
7559 : };
7560 :
7561 364 : static PyObject *py_supplementalCredentialsBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7562 : {
7563 364 : return pytalloc_new(struct supplementalCredentialsBlob, type);
7564 : }
7565 :
7566 0 : static PyObject *py_supplementalCredentialsBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7567 : {
7568 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7569 0 : PyObject *ret = NULL;
7570 : DATA_BLOB blob;
7571 : enum ndr_err_code err;
7572 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7573 0 : if (tmp_ctx == NULL) {
7574 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7575 0 : return NULL;
7576 : }
7577 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsBlob);
7578 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7579 0 : TALLOC_FREE(tmp_ctx);
7580 0 : PyErr_SetNdrError(err);
7581 0 : return NULL;
7582 : }
7583 :
7584 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7585 0 : TALLOC_FREE(tmp_ctx);
7586 0 : return ret;
7587 : }
7588 :
7589 364 : static PyObject *py_supplementalCredentialsBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7590 : {
7591 364 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7592 364 : DATA_BLOB blob = {.data = NULL, .length = 0};
7593 364 : Py_ssize_t blob_length = 0;
7594 : enum ndr_err_code err;
7595 364 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7596 364 : PyObject *allow_remaining_obj = NULL;
7597 364 : bool allow_remaining = false;
7598 :
7599 364 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7600 : discard_const_p(char *, kwnames),
7601 : &blob.data, &blob_length,
7602 : &allow_remaining_obj)) {
7603 0 : return NULL;
7604 : }
7605 364 : blob.length = blob_length;
7606 :
7607 364 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7608 0 : allow_remaining = true;
7609 : }
7610 :
7611 364 : if (allow_remaining) {
7612 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob);
7613 : } else {
7614 364 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob);
7615 : }
7616 364 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7617 0 : PyErr_SetNdrError(err);
7618 0 : return NULL;
7619 : }
7620 :
7621 364 : Py_RETURN_NONE;
7622 : }
7623 :
7624 0 : static PyObject *py_supplementalCredentialsBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7625 : {
7626 0 : struct supplementalCredentialsBlob *object = (struct supplementalCredentialsBlob *)pytalloc_get_ptr(py_obj);
7627 : PyObject *ret;
7628 : char *retstr;
7629 :
7630 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_supplementalCredentialsBlob, "supplementalCredentialsBlob", object);
7631 0 : ret = PyUnicode_FromString(retstr);
7632 0 : talloc_free(retstr);
7633 :
7634 0 : return ret;
7635 : }
7636 :
7637 : static PyMethodDef py_supplementalCredentialsBlob_methods[] = {
7638 : { "__ndr_pack__", (PyCFunction)py_supplementalCredentialsBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7639 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_supplementalCredentialsBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7640 : { "__ndr_print__", (PyCFunction)py_supplementalCredentialsBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7641 : { NULL, NULL, 0, NULL }
7642 : };
7643 :
7644 :
7645 : static PyTypeObject supplementalCredentialsBlob_Type = {
7646 : PyVarObject_HEAD_INIT(NULL, 0)
7647 : .tp_name = "drsblobs.supplementalCredentialsBlob",
7648 : .tp_getset = py_supplementalCredentialsBlob_getsetters,
7649 : .tp_methods = py_supplementalCredentialsBlob_methods,
7650 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7651 : .tp_new = py_supplementalCredentialsBlob_new,
7652 : };
7653 :
7654 :
7655 0 : static PyObject *py_package_PackagesBlob_get_names(PyObject *obj, void *closure)
7656 : {
7657 0 : struct package_PackagesBlob *object = (struct package_PackagesBlob *)pytalloc_get_ptr(obj);
7658 : PyObject *py_names;
7659 0 : py_names = pytalloc_GenericObject_reference_ex(pytalloc_get_mem_ctx(obj), object->names);
7660 0 : return py_names;
7661 : }
7662 :
7663 0 : static int py_package_PackagesBlob_set_names(PyObject *py_obj, PyObject *value, void *closure)
7664 : {
7665 0 : struct package_PackagesBlob *object = (struct package_PackagesBlob *)pytalloc_get_ptr(py_obj);
7666 0 : if (value == NULL) {
7667 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
7668 0 : return -1;
7669 : }
7670 0 : object->names = pytalloc_get_ptr(value);
7671 0 : return 0;
7672 : }
7673 :
7674 : static PyGetSetDef py_package_PackagesBlob_getsetters[] = {
7675 : {
7676 : .name = discard_const_p(char, "names"),
7677 : .get = py_package_PackagesBlob_get_names,
7678 : .set = py_package_PackagesBlob_set_names,
7679 : .doc = discard_const_p(char, "PIDL-generated element of base type string_array")
7680 : },
7681 : { .name = NULL }
7682 : };
7683 :
7684 0 : static PyObject *py_package_PackagesBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7685 : {
7686 0 : return pytalloc_new(struct package_PackagesBlob, type);
7687 : }
7688 :
7689 0 : static PyObject *py_package_PackagesBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7690 : {
7691 0 : struct package_PackagesBlob *object = (struct package_PackagesBlob *)pytalloc_get_ptr(py_obj);
7692 0 : PyObject *ret = NULL;
7693 : DATA_BLOB blob;
7694 : enum ndr_err_code err;
7695 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7696 0 : if (tmp_ctx == NULL) {
7697 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7698 0 : return NULL;
7699 : }
7700 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_package_PackagesBlob);
7701 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7702 0 : TALLOC_FREE(tmp_ctx);
7703 0 : PyErr_SetNdrError(err);
7704 0 : return NULL;
7705 : }
7706 :
7707 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7708 0 : TALLOC_FREE(tmp_ctx);
7709 0 : return ret;
7710 : }
7711 :
7712 0 : static PyObject *py_package_PackagesBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7713 : {
7714 0 : struct package_PackagesBlob *object = (struct package_PackagesBlob *)pytalloc_get_ptr(py_obj);
7715 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7716 0 : Py_ssize_t blob_length = 0;
7717 : enum ndr_err_code err;
7718 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7719 0 : PyObject *allow_remaining_obj = NULL;
7720 0 : bool allow_remaining = false;
7721 :
7722 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7723 : discard_const_p(char *, kwnames),
7724 : &blob.data, &blob_length,
7725 : &allow_remaining_obj)) {
7726 0 : return NULL;
7727 : }
7728 0 : blob.length = blob_length;
7729 :
7730 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7731 0 : allow_remaining = true;
7732 : }
7733 :
7734 0 : if (allow_remaining) {
7735 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PackagesBlob);
7736 : } else {
7737 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PackagesBlob);
7738 : }
7739 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7740 0 : PyErr_SetNdrError(err);
7741 0 : return NULL;
7742 : }
7743 :
7744 0 : Py_RETURN_NONE;
7745 : }
7746 :
7747 0 : static PyObject *py_package_PackagesBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7748 : {
7749 0 : struct package_PackagesBlob *object = (struct package_PackagesBlob *)pytalloc_get_ptr(py_obj);
7750 : PyObject *ret;
7751 : char *retstr;
7752 :
7753 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_package_PackagesBlob, "package_PackagesBlob", object);
7754 0 : ret = PyUnicode_FromString(retstr);
7755 0 : talloc_free(retstr);
7756 :
7757 0 : return ret;
7758 : }
7759 :
7760 : static PyMethodDef py_package_PackagesBlob_methods[] = {
7761 : { "__ndr_pack__", (PyCFunction)py_package_PackagesBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7762 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PackagesBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7763 : { "__ndr_print__", (PyCFunction)py_package_PackagesBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7764 : { NULL, NULL, 0, NULL }
7765 : };
7766 :
7767 :
7768 : static PyTypeObject package_PackagesBlob_Type = {
7769 : PyVarObject_HEAD_INIT(NULL, 0)
7770 : .tp_name = "drsblobs.package_PackagesBlob",
7771 : .tp_getset = py_package_PackagesBlob_getsetters,
7772 : .tp_methods = py_package_PackagesBlob_methods,
7773 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7774 : .tp_new = py_package_PackagesBlob_new,
7775 : };
7776 :
7777 :
7778 0 : static PyObject *py_package_PrimaryKerberosString_get_length(PyObject *obj, void *closure)
7779 : {
7780 0 : struct package_PrimaryKerberosString *object = (struct package_PrimaryKerberosString *)pytalloc_get_ptr(obj);
7781 : PyObject *py_length;
7782 0 : py_length = PyLong_FromLong((uint16_t)object->length);
7783 0 : return py_length;
7784 : }
7785 :
7786 0 : static int py_package_PrimaryKerberosString_set_length(PyObject *py_obj, PyObject *value, void *closure)
7787 : {
7788 0 : struct package_PrimaryKerberosString *object = (struct package_PrimaryKerberosString *)pytalloc_get_ptr(py_obj);
7789 0 : if (value == NULL) {
7790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
7791 0 : return -1;
7792 : }
7793 : {
7794 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
7795 0 : if (PyLong_Check(value)) {
7796 : unsigned long long test_var;
7797 0 : test_var = PyLong_AsUnsignedLongLong(value);
7798 0 : if (PyErr_Occurred() != NULL) {
7799 0 : return -1;
7800 : }
7801 0 : if (test_var > uint_max) {
7802 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7803 : PyLong_Type.tp_name, uint_max, test_var);
7804 0 : return -1;
7805 : }
7806 0 : object->length = test_var;
7807 : } else {
7808 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7809 : PyLong_Type.tp_name);
7810 0 : return -1;
7811 : }
7812 : }
7813 0 : return 0;
7814 : }
7815 :
7816 0 : static PyObject *py_package_PrimaryKerberosString_get_size(PyObject *obj, void *closure)
7817 : {
7818 0 : struct package_PrimaryKerberosString *object = (struct package_PrimaryKerberosString *)pytalloc_get_ptr(obj);
7819 : PyObject *py_size;
7820 0 : py_size = PyLong_FromLong((uint16_t)object->size);
7821 0 : return py_size;
7822 : }
7823 :
7824 0 : static int py_package_PrimaryKerberosString_set_size(PyObject *py_obj, PyObject *value, void *closure)
7825 : {
7826 0 : struct package_PrimaryKerberosString *object = (struct package_PrimaryKerberosString *)pytalloc_get_ptr(py_obj);
7827 0 : if (value == NULL) {
7828 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
7829 0 : return -1;
7830 : }
7831 : {
7832 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
7833 0 : if (PyLong_Check(value)) {
7834 : unsigned long long test_var;
7835 0 : test_var = PyLong_AsUnsignedLongLong(value);
7836 0 : if (PyErr_Occurred() != NULL) {
7837 0 : return -1;
7838 : }
7839 0 : if (test_var > uint_max) {
7840 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7841 : PyLong_Type.tp_name, uint_max, test_var);
7842 0 : return -1;
7843 : }
7844 0 : object->size = test_var;
7845 : } else {
7846 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7847 : PyLong_Type.tp_name);
7848 0 : return -1;
7849 : }
7850 : }
7851 0 : return 0;
7852 : }
7853 :
7854 76 : static PyObject *py_package_PrimaryKerberosString_get_string(PyObject *obj, void *closure)
7855 : {
7856 76 : struct package_PrimaryKerberosString *object = (struct package_PrimaryKerberosString *)pytalloc_get_ptr(obj);
7857 : PyObject *py_string;
7858 76 : if (object->string == NULL) {
7859 0 : Py_RETURN_NONE;
7860 : }
7861 76 : if (object->string == NULL) {
7862 0 : py_string = Py_None;
7863 0 : Py_INCREF(py_string);
7864 : } else {
7865 76 : py_string = PyString_FromStringOrNULL(object->string);
7866 : }
7867 76 : return py_string;
7868 : }
7869 :
7870 0 : static int py_package_PrimaryKerberosString_set_string(PyObject *py_obj, PyObject *value, void *closure)
7871 : {
7872 0 : struct package_PrimaryKerberosString *object = (struct package_PrimaryKerberosString *)pytalloc_get_ptr(py_obj);
7873 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->string));
7874 0 : if (value == NULL) {
7875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
7876 0 : return -1;
7877 : }
7878 0 : if (value == Py_None) {
7879 0 : object->string = NULL;
7880 : } else {
7881 0 : object->string = NULL;
7882 : {
7883 : const char *test_str;
7884 : const char *talloc_str;
7885 0 : PyObject *unicode = NULL;
7886 0 : if (PyUnicode_Check(value)) {
7887 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7888 0 : if (unicode == NULL) {
7889 0 : PyErr_NoMemory();
7890 0 : return -1;
7891 : }
7892 0 : test_str = PyBytes_AS_STRING(unicode);
7893 0 : } else if (PyBytes_Check(value)) {
7894 0 : test_str = PyBytes_AS_STRING(value);
7895 : } else {
7896 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7897 0 : return -1;
7898 : }
7899 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7900 0 : if (unicode != NULL) {
7901 0 : Py_DECREF(unicode);
7902 : }
7903 0 : if (talloc_str == NULL) {
7904 0 : PyErr_NoMemory();
7905 0 : return -1;
7906 : }
7907 0 : object->string = talloc_str;
7908 : }
7909 : }
7910 0 : return 0;
7911 : }
7912 :
7913 : static PyGetSetDef py_package_PrimaryKerberosString_getsetters[] = {
7914 : {
7915 : .name = discard_const_p(char, "length"),
7916 : .get = py_package_PrimaryKerberosString_get_length,
7917 : .set = py_package_PrimaryKerberosString_set_length,
7918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7919 : },
7920 : {
7921 : .name = discard_const_p(char, "size"),
7922 : .get = py_package_PrimaryKerberosString_get_size,
7923 : .set = py_package_PrimaryKerberosString_set_size,
7924 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7925 : },
7926 : {
7927 : .name = discard_const_p(char, "string"),
7928 : .get = py_package_PrimaryKerberosString_get_string,
7929 : .set = py_package_PrimaryKerberosString_set_string,
7930 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7931 : },
7932 : { .name = NULL }
7933 : };
7934 :
7935 0 : static PyObject *py_package_PrimaryKerberosString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7936 : {
7937 0 : return pytalloc_new(struct package_PrimaryKerberosString, type);
7938 : }
7939 :
7940 :
7941 : static PyTypeObject package_PrimaryKerberosString_Type = {
7942 : PyVarObject_HEAD_INIT(NULL, 0)
7943 : .tp_name = "drsblobs.package_PrimaryKerberosString",
7944 : .tp_getset = py_package_PrimaryKerberosString_getsetters,
7945 : .tp_methods = NULL,
7946 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7947 : .tp_new = py_package_PrimaryKerberosString_new,
7948 : };
7949 :
7950 :
7951 0 : static PyObject *py_package_PrimaryKerberosKey3_get_reserved1(PyObject *obj, void *closure)
7952 : {
7953 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(obj);
7954 : PyObject *py_reserved1;
7955 0 : py_reserved1 = PyLong_FromLong((uint16_t)object->reserved1);
7956 0 : return py_reserved1;
7957 : }
7958 :
7959 0 : static int py_package_PrimaryKerberosKey3_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
7960 : {
7961 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(py_obj);
7962 0 : if (value == NULL) {
7963 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved1");
7964 0 : return -1;
7965 : }
7966 : {
7967 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved1));
7968 0 : if (PyLong_Check(value)) {
7969 : unsigned long long test_var;
7970 0 : test_var = PyLong_AsUnsignedLongLong(value);
7971 0 : if (PyErr_Occurred() != NULL) {
7972 0 : return -1;
7973 : }
7974 0 : if (test_var > uint_max) {
7975 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7976 : PyLong_Type.tp_name, uint_max, test_var);
7977 0 : return -1;
7978 : }
7979 0 : object->reserved1 = test_var;
7980 : } else {
7981 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7982 : PyLong_Type.tp_name);
7983 0 : return -1;
7984 : }
7985 : }
7986 0 : return 0;
7987 : }
7988 :
7989 0 : static PyObject *py_package_PrimaryKerberosKey3_get_reserved2(PyObject *obj, void *closure)
7990 : {
7991 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(obj);
7992 : PyObject *py_reserved2;
7993 0 : py_reserved2 = PyLong_FromLong((uint16_t)object->reserved2);
7994 0 : return py_reserved2;
7995 : }
7996 :
7997 0 : static int py_package_PrimaryKerberosKey3_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
7998 : {
7999 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(py_obj);
8000 0 : if (value == NULL) {
8001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved2");
8002 0 : return -1;
8003 : }
8004 : {
8005 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
8006 0 : if (PyLong_Check(value)) {
8007 : unsigned long long test_var;
8008 0 : test_var = PyLong_AsUnsignedLongLong(value);
8009 0 : if (PyErr_Occurred() != NULL) {
8010 0 : return -1;
8011 : }
8012 0 : if (test_var > uint_max) {
8013 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8014 : PyLong_Type.tp_name, uint_max, test_var);
8015 0 : return -1;
8016 : }
8017 0 : object->reserved2 = test_var;
8018 : } else {
8019 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8020 : PyLong_Type.tp_name);
8021 0 : return -1;
8022 : }
8023 : }
8024 0 : return 0;
8025 : }
8026 :
8027 0 : static PyObject *py_package_PrimaryKerberosKey3_get_reserved3(PyObject *obj, void *closure)
8028 : {
8029 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(obj);
8030 : PyObject *py_reserved3;
8031 0 : py_reserved3 = PyLong_FromUnsignedLongLong((uint32_t)object->reserved3);
8032 0 : return py_reserved3;
8033 : }
8034 :
8035 0 : static int py_package_PrimaryKerberosKey3_set_reserved3(PyObject *py_obj, PyObject *value, void *closure)
8036 : {
8037 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(py_obj);
8038 0 : if (value == NULL) {
8039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved3");
8040 0 : return -1;
8041 : }
8042 : {
8043 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved3));
8044 0 : if (PyLong_Check(value)) {
8045 : unsigned long long test_var;
8046 0 : test_var = PyLong_AsUnsignedLongLong(value);
8047 0 : if (PyErr_Occurred() != NULL) {
8048 0 : return -1;
8049 : }
8050 0 : if (test_var > uint_max) {
8051 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8052 : PyLong_Type.tp_name, uint_max, test_var);
8053 0 : return -1;
8054 : }
8055 0 : object->reserved3 = test_var;
8056 : } else {
8057 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8058 : PyLong_Type.tp_name);
8059 0 : return -1;
8060 : }
8061 : }
8062 0 : return 0;
8063 : }
8064 :
8065 0 : static PyObject *py_package_PrimaryKerberosKey3_get_keytype(PyObject *obj, void *closure)
8066 : {
8067 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(obj);
8068 : PyObject *py_keytype;
8069 0 : py_keytype = PyLong_FromUnsignedLongLong((uint32_t)object->keytype);
8070 0 : return py_keytype;
8071 : }
8072 :
8073 0 : static int py_package_PrimaryKerberosKey3_set_keytype(PyObject *py_obj, PyObject *value, void *closure)
8074 : {
8075 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(py_obj);
8076 0 : if (value == NULL) {
8077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keytype");
8078 0 : return -1;
8079 : }
8080 : {
8081 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->keytype));
8082 0 : if (PyLong_Check(value)) {
8083 : unsigned long long test_var;
8084 0 : test_var = PyLong_AsUnsignedLongLong(value);
8085 0 : if (PyErr_Occurred() != NULL) {
8086 0 : return -1;
8087 : }
8088 0 : if (test_var > uint_max) {
8089 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8090 : PyLong_Type.tp_name, uint_max, test_var);
8091 0 : return -1;
8092 : }
8093 0 : object->keytype = test_var;
8094 : } else {
8095 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8096 : PyLong_Type.tp_name);
8097 0 : return -1;
8098 : }
8099 : }
8100 0 : return 0;
8101 : }
8102 :
8103 0 : static PyObject *py_package_PrimaryKerberosKey3_get_value_len(PyObject *obj, void *closure)
8104 : {
8105 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(obj);
8106 : PyObject *py_value_len;
8107 0 : py_value_len = PyLong_FromUnsignedLongLong((uint32_t)object->value_len);
8108 0 : return py_value_len;
8109 : }
8110 :
8111 0 : static int py_package_PrimaryKerberosKey3_set_value_len(PyObject *py_obj, PyObject *value, void *closure)
8112 : {
8113 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(py_obj);
8114 0 : if (value == NULL) {
8115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value_len");
8116 0 : return -1;
8117 : }
8118 : {
8119 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->value_len));
8120 0 : if (PyLong_Check(value)) {
8121 : unsigned long long test_var;
8122 0 : test_var = PyLong_AsUnsignedLongLong(value);
8123 0 : if (PyErr_Occurred() != NULL) {
8124 0 : return -1;
8125 : }
8126 0 : if (test_var > uint_max) {
8127 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8128 : PyLong_Type.tp_name, uint_max, test_var);
8129 0 : return -1;
8130 : }
8131 0 : object->value_len = test_var;
8132 : } else {
8133 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8134 : PyLong_Type.tp_name);
8135 0 : return -1;
8136 : }
8137 : }
8138 0 : return 0;
8139 : }
8140 :
8141 0 : static PyObject *py_package_PrimaryKerberosKey3_get_value(PyObject *obj, void *closure)
8142 : {
8143 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(obj);
8144 : PyObject *py_value;
8145 0 : if (object->value == NULL) {
8146 0 : Py_RETURN_NONE;
8147 : }
8148 0 : if (object->value == NULL) {
8149 0 : py_value = Py_None;
8150 0 : Py_INCREF(py_value);
8151 : } else {
8152 0 : py_value = PyBytes_FromStringAndSize((char *)(*object->value).data, (*object->value).length);
8153 : }
8154 0 : return py_value;
8155 : }
8156 :
8157 0 : static int py_package_PrimaryKerberosKey3_set_value(PyObject *py_obj, PyObject *value, void *closure)
8158 : {
8159 0 : struct package_PrimaryKerberosKey3 *object = (struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(py_obj);
8160 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->value));
8161 0 : if (value == NULL) {
8162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value");
8163 0 : return -1;
8164 : }
8165 0 : if (value == Py_None) {
8166 0 : object->value = NULL;
8167 : } else {
8168 0 : object->value = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->value);
8169 0 : if (object->value == NULL) {
8170 0 : PyErr_NoMemory();
8171 0 : return -1;
8172 : }
8173 0 : *object->value = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
8174 : }
8175 0 : return 0;
8176 : }
8177 :
8178 : static PyGetSetDef py_package_PrimaryKerberosKey3_getsetters[] = {
8179 : {
8180 : .name = discard_const_p(char, "reserved1"),
8181 : .get = py_package_PrimaryKerberosKey3_get_reserved1,
8182 : .set = py_package_PrimaryKerberosKey3_set_reserved1,
8183 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8184 : },
8185 : {
8186 : .name = discard_const_p(char, "reserved2"),
8187 : .get = py_package_PrimaryKerberosKey3_get_reserved2,
8188 : .set = py_package_PrimaryKerberosKey3_set_reserved2,
8189 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8190 : },
8191 : {
8192 : .name = discard_const_p(char, "reserved3"),
8193 : .get = py_package_PrimaryKerberosKey3_get_reserved3,
8194 : .set = py_package_PrimaryKerberosKey3_set_reserved3,
8195 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8196 : },
8197 : {
8198 : .name = discard_const_p(char, "keytype"),
8199 : .get = py_package_PrimaryKerberosKey3_get_keytype,
8200 : .set = py_package_PrimaryKerberosKey3_set_keytype,
8201 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8202 : },
8203 : {
8204 : .name = discard_const_p(char, "value_len"),
8205 : .get = py_package_PrimaryKerberosKey3_get_value_len,
8206 : .set = py_package_PrimaryKerberosKey3_set_value_len,
8207 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8208 : },
8209 : {
8210 : .name = discard_const_p(char, "value"),
8211 : .get = py_package_PrimaryKerberosKey3_get_value,
8212 : .set = py_package_PrimaryKerberosKey3_set_value,
8213 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
8214 : },
8215 : { .name = NULL }
8216 : };
8217 :
8218 0 : static PyObject *py_package_PrimaryKerberosKey3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8219 : {
8220 0 : return pytalloc_new(struct package_PrimaryKerberosKey3, type);
8221 : }
8222 :
8223 :
8224 : static PyTypeObject package_PrimaryKerberosKey3_Type = {
8225 : PyVarObject_HEAD_INIT(NULL, 0)
8226 : .tp_name = "drsblobs.package_PrimaryKerberosKey3",
8227 : .tp_getset = py_package_PrimaryKerberosKey3_getsetters,
8228 : .tp_methods = NULL,
8229 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8230 : .tp_new = py_package_PrimaryKerberosKey3_new,
8231 : };
8232 :
8233 :
8234 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_num_keys(PyObject *obj, void *closure)
8235 : {
8236 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8237 : PyObject *py_num_keys;
8238 0 : py_num_keys = PyLong_FromLong((uint16_t)object->num_keys);
8239 0 : return py_num_keys;
8240 : }
8241 :
8242 0 : static int py_package_PrimaryKerberosCtr3_set_num_keys(PyObject *py_obj, PyObject *value, void *closure)
8243 : {
8244 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8245 0 : if (value == NULL) {
8246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_keys");
8247 0 : return -1;
8248 : }
8249 : {
8250 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_keys));
8251 0 : if (PyLong_Check(value)) {
8252 : unsigned long long test_var;
8253 0 : test_var = PyLong_AsUnsignedLongLong(value);
8254 0 : if (PyErr_Occurred() != NULL) {
8255 0 : return -1;
8256 : }
8257 0 : if (test_var > uint_max) {
8258 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8259 : PyLong_Type.tp_name, uint_max, test_var);
8260 0 : return -1;
8261 : }
8262 0 : object->num_keys = test_var;
8263 : } else {
8264 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8265 : PyLong_Type.tp_name);
8266 0 : return -1;
8267 : }
8268 : }
8269 0 : return 0;
8270 : }
8271 :
8272 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_num_old_keys(PyObject *obj, void *closure)
8273 : {
8274 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8275 : PyObject *py_num_old_keys;
8276 0 : py_num_old_keys = PyLong_FromLong((uint16_t)object->num_old_keys);
8277 0 : return py_num_old_keys;
8278 : }
8279 :
8280 0 : static int py_package_PrimaryKerberosCtr3_set_num_old_keys(PyObject *py_obj, PyObject *value, void *closure)
8281 : {
8282 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8283 0 : if (value == NULL) {
8284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_old_keys");
8285 0 : return -1;
8286 : }
8287 : {
8288 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_old_keys));
8289 0 : if (PyLong_Check(value)) {
8290 : unsigned long long test_var;
8291 0 : test_var = PyLong_AsUnsignedLongLong(value);
8292 0 : if (PyErr_Occurred() != NULL) {
8293 0 : return -1;
8294 : }
8295 0 : if (test_var > uint_max) {
8296 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8297 : PyLong_Type.tp_name, uint_max, test_var);
8298 0 : return -1;
8299 : }
8300 0 : object->num_old_keys = test_var;
8301 : } else {
8302 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8303 : PyLong_Type.tp_name);
8304 0 : return -1;
8305 : }
8306 : }
8307 0 : return 0;
8308 : }
8309 :
8310 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_salt(PyObject *obj, void *closure)
8311 : {
8312 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8313 : PyObject *py_salt;
8314 0 : py_salt = pytalloc_reference_ex(&package_PrimaryKerberosString_Type, pytalloc_get_mem_ctx(obj), &object->salt);
8315 0 : return py_salt;
8316 : }
8317 :
8318 0 : static int py_package_PrimaryKerberosCtr3_set_salt(PyObject *py_obj, PyObject *value, void *closure)
8319 : {
8320 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8321 0 : if (value == NULL) {
8322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->salt");
8323 0 : return -1;
8324 : }
8325 0 : PY_CHECK_TYPE(&package_PrimaryKerberosString_Type, value, return -1;);
8326 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8327 0 : PyErr_NoMemory();
8328 0 : return -1;
8329 : }
8330 0 : object->salt = *(struct package_PrimaryKerberosString *)pytalloc_get_ptr(value);
8331 0 : return 0;
8332 : }
8333 :
8334 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_keys(PyObject *obj, void *closure)
8335 : {
8336 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8337 : PyObject *py_keys;
8338 0 : py_keys = PyList_New(object->num_keys);
8339 0 : if (py_keys == NULL) {
8340 0 : return NULL;
8341 : }
8342 : {
8343 : int keys_cntr_0;
8344 0 : for (keys_cntr_0 = 0; keys_cntr_0 < (object->num_keys); keys_cntr_0++) {
8345 : PyObject *py_keys_0;
8346 0 : py_keys_0 = pytalloc_reference_ex(&package_PrimaryKerberosKey3_Type, object->keys, &object->keys[keys_cntr_0]);
8347 0 : PyList_SetItem(py_keys, keys_cntr_0, py_keys_0);
8348 : }
8349 : }
8350 0 : return py_keys;
8351 : }
8352 :
8353 0 : static int py_package_PrimaryKerberosCtr3_set_keys(PyObject *py_obj, PyObject *value, void *closure)
8354 : {
8355 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8356 0 : if (value == NULL) {
8357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys");
8358 0 : return -1;
8359 : }
8360 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8361 : {
8362 : int keys_cntr_0;
8363 0 : object->keys = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->keys, PyList_GET_SIZE(value));
8364 0 : if (!object->keys) { return -1;; }
8365 0 : talloc_set_name_const(object->keys, "ARRAY: object->keys");
8366 0 : for (keys_cntr_0 = 0; keys_cntr_0 < PyList_GET_SIZE(value); keys_cntr_0++) {
8367 0 : if (PyList_GET_ITEM(value, keys_cntr_0) == NULL) {
8368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys[keys_cntr_0]");
8369 0 : return -1;
8370 : }
8371 0 : PY_CHECK_TYPE(&package_PrimaryKerberosKey3_Type, PyList_GET_ITEM(value, keys_cntr_0), return -1;);
8372 0 : if (talloc_reference(object->keys, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, keys_cntr_0))) == NULL) {
8373 0 : PyErr_NoMemory();
8374 0 : return -1;
8375 : }
8376 0 : object->keys[keys_cntr_0] = *(struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, keys_cntr_0));
8377 : }
8378 : }
8379 0 : return 0;
8380 : }
8381 :
8382 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_old_keys(PyObject *obj, void *closure)
8383 : {
8384 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8385 : PyObject *py_old_keys;
8386 0 : py_old_keys = PyList_New(object->num_old_keys);
8387 0 : if (py_old_keys == NULL) {
8388 0 : return NULL;
8389 : }
8390 : {
8391 : int old_keys_cntr_0;
8392 0 : for (old_keys_cntr_0 = 0; old_keys_cntr_0 < (object->num_old_keys); old_keys_cntr_0++) {
8393 : PyObject *py_old_keys_0;
8394 0 : py_old_keys_0 = pytalloc_reference_ex(&package_PrimaryKerberosKey3_Type, object->old_keys, &object->old_keys[old_keys_cntr_0]);
8395 0 : PyList_SetItem(py_old_keys, old_keys_cntr_0, py_old_keys_0);
8396 : }
8397 : }
8398 0 : return py_old_keys;
8399 : }
8400 :
8401 0 : static int py_package_PrimaryKerberosCtr3_set_old_keys(PyObject *py_obj, PyObject *value, void *closure)
8402 : {
8403 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8404 0 : if (value == NULL) {
8405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_keys");
8406 0 : return -1;
8407 : }
8408 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8409 : {
8410 : int old_keys_cntr_0;
8411 0 : object->old_keys = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->old_keys, PyList_GET_SIZE(value));
8412 0 : if (!object->old_keys) { return -1;; }
8413 0 : talloc_set_name_const(object->old_keys, "ARRAY: object->old_keys");
8414 0 : for (old_keys_cntr_0 = 0; old_keys_cntr_0 < PyList_GET_SIZE(value); old_keys_cntr_0++) {
8415 0 : if (PyList_GET_ITEM(value, old_keys_cntr_0) == NULL) {
8416 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_keys[old_keys_cntr_0]");
8417 0 : return -1;
8418 : }
8419 0 : PY_CHECK_TYPE(&package_PrimaryKerberosKey3_Type, PyList_GET_ITEM(value, old_keys_cntr_0), return -1;);
8420 0 : if (talloc_reference(object->old_keys, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, old_keys_cntr_0))) == NULL) {
8421 0 : PyErr_NoMemory();
8422 0 : return -1;
8423 : }
8424 0 : object->old_keys[old_keys_cntr_0] = *(struct package_PrimaryKerberosKey3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, old_keys_cntr_0));
8425 : }
8426 : }
8427 0 : return 0;
8428 : }
8429 :
8430 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_padding1(PyObject *obj, void *closure)
8431 : {
8432 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8433 : PyObject *py_padding1;
8434 0 : py_padding1 = PyLong_FromUnsignedLongLong((uint32_t)object->padding1);
8435 0 : return py_padding1;
8436 : }
8437 :
8438 0 : static int py_package_PrimaryKerberosCtr3_set_padding1(PyObject *py_obj, PyObject *value, void *closure)
8439 : {
8440 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8441 0 : if (value == NULL) {
8442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding1");
8443 0 : return -1;
8444 : }
8445 : {
8446 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->padding1));
8447 0 : if (PyLong_Check(value)) {
8448 : unsigned long long test_var;
8449 0 : test_var = PyLong_AsUnsignedLongLong(value);
8450 0 : if (PyErr_Occurred() != NULL) {
8451 0 : return -1;
8452 : }
8453 0 : if (test_var > uint_max) {
8454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8455 : PyLong_Type.tp_name, uint_max, test_var);
8456 0 : return -1;
8457 : }
8458 0 : object->padding1 = test_var;
8459 : } else {
8460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8461 : PyLong_Type.tp_name);
8462 0 : return -1;
8463 : }
8464 : }
8465 0 : return 0;
8466 : }
8467 :
8468 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_padding2(PyObject *obj, void *closure)
8469 : {
8470 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8471 : PyObject *py_padding2;
8472 0 : py_padding2 = PyLong_FromUnsignedLongLong((uint32_t)object->padding2);
8473 0 : return py_padding2;
8474 : }
8475 :
8476 0 : static int py_package_PrimaryKerberosCtr3_set_padding2(PyObject *py_obj, PyObject *value, void *closure)
8477 : {
8478 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8479 0 : if (value == NULL) {
8480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding2");
8481 0 : return -1;
8482 : }
8483 : {
8484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->padding2));
8485 0 : if (PyLong_Check(value)) {
8486 : unsigned long long test_var;
8487 0 : test_var = PyLong_AsUnsignedLongLong(value);
8488 0 : if (PyErr_Occurred() != NULL) {
8489 0 : return -1;
8490 : }
8491 0 : if (test_var > uint_max) {
8492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8493 : PyLong_Type.tp_name, uint_max, test_var);
8494 0 : return -1;
8495 : }
8496 0 : object->padding2 = test_var;
8497 : } else {
8498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8499 : PyLong_Type.tp_name);
8500 0 : return -1;
8501 : }
8502 : }
8503 0 : return 0;
8504 : }
8505 :
8506 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_padding3(PyObject *obj, void *closure)
8507 : {
8508 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8509 : PyObject *py_padding3;
8510 0 : py_padding3 = PyLong_FromUnsignedLongLong((uint32_t)object->padding3);
8511 0 : return py_padding3;
8512 : }
8513 :
8514 0 : static int py_package_PrimaryKerberosCtr3_set_padding3(PyObject *py_obj, PyObject *value, void *closure)
8515 : {
8516 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8517 0 : if (value == NULL) {
8518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding3");
8519 0 : return -1;
8520 : }
8521 : {
8522 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->padding3));
8523 0 : if (PyLong_Check(value)) {
8524 : unsigned long long test_var;
8525 0 : test_var = PyLong_AsUnsignedLongLong(value);
8526 0 : if (PyErr_Occurred() != NULL) {
8527 0 : return -1;
8528 : }
8529 0 : if (test_var > uint_max) {
8530 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8531 : PyLong_Type.tp_name, uint_max, test_var);
8532 0 : return -1;
8533 : }
8534 0 : object->padding3 = test_var;
8535 : } else {
8536 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8537 : PyLong_Type.tp_name);
8538 0 : return -1;
8539 : }
8540 : }
8541 0 : return 0;
8542 : }
8543 :
8544 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_padding4(PyObject *obj, void *closure)
8545 : {
8546 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8547 : PyObject *py_padding4;
8548 0 : py_padding4 = PyLong_FromUnsignedLongLong((uint32_t)object->padding4);
8549 0 : return py_padding4;
8550 : }
8551 :
8552 0 : static int py_package_PrimaryKerberosCtr3_set_padding4(PyObject *py_obj, PyObject *value, void *closure)
8553 : {
8554 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8555 0 : if (value == NULL) {
8556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding4");
8557 0 : return -1;
8558 : }
8559 : {
8560 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->padding4));
8561 0 : if (PyLong_Check(value)) {
8562 : unsigned long long test_var;
8563 0 : test_var = PyLong_AsUnsignedLongLong(value);
8564 0 : if (PyErr_Occurred() != NULL) {
8565 0 : return -1;
8566 : }
8567 0 : if (test_var > uint_max) {
8568 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8569 : PyLong_Type.tp_name, uint_max, test_var);
8570 0 : return -1;
8571 : }
8572 0 : object->padding4 = test_var;
8573 : } else {
8574 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8575 : PyLong_Type.tp_name);
8576 0 : return -1;
8577 : }
8578 : }
8579 0 : return 0;
8580 : }
8581 :
8582 0 : static PyObject *py_package_PrimaryKerberosCtr3_get_padding5(PyObject *obj, void *closure)
8583 : {
8584 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(obj);
8585 : PyObject *py_padding5;
8586 0 : py_padding5 = PyLong_FromUnsignedLongLong((uint32_t)object->padding5);
8587 0 : return py_padding5;
8588 : }
8589 :
8590 0 : static int py_package_PrimaryKerberosCtr3_set_padding5(PyObject *py_obj, PyObject *value, void *closure)
8591 : {
8592 0 : struct package_PrimaryKerberosCtr3 *object = (struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(py_obj);
8593 0 : if (value == NULL) {
8594 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding5");
8595 0 : return -1;
8596 : }
8597 : {
8598 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->padding5));
8599 0 : if (PyLong_Check(value)) {
8600 : unsigned long long test_var;
8601 0 : test_var = PyLong_AsUnsignedLongLong(value);
8602 0 : if (PyErr_Occurred() != NULL) {
8603 0 : return -1;
8604 : }
8605 0 : if (test_var > uint_max) {
8606 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8607 : PyLong_Type.tp_name, uint_max, test_var);
8608 0 : return -1;
8609 : }
8610 0 : object->padding5 = test_var;
8611 : } else {
8612 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8613 : PyLong_Type.tp_name);
8614 0 : return -1;
8615 : }
8616 : }
8617 0 : return 0;
8618 : }
8619 :
8620 : static PyGetSetDef py_package_PrimaryKerberosCtr3_getsetters[] = {
8621 : {
8622 : .name = discard_const_p(char, "num_keys"),
8623 : .get = py_package_PrimaryKerberosCtr3_get_num_keys,
8624 : .set = py_package_PrimaryKerberosCtr3_set_num_keys,
8625 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8626 : },
8627 : {
8628 : .name = discard_const_p(char, "num_old_keys"),
8629 : .get = py_package_PrimaryKerberosCtr3_get_num_old_keys,
8630 : .set = py_package_PrimaryKerberosCtr3_set_num_old_keys,
8631 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8632 : },
8633 : {
8634 : .name = discard_const_p(char, "salt"),
8635 : .get = py_package_PrimaryKerberosCtr3_get_salt,
8636 : .set = py_package_PrimaryKerberosCtr3_set_salt,
8637 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosString")
8638 : },
8639 : {
8640 : .name = discard_const_p(char, "keys"),
8641 : .get = py_package_PrimaryKerberosCtr3_get_keys,
8642 : .set = py_package_PrimaryKerberosCtr3_set_keys,
8643 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosKey3")
8644 : },
8645 : {
8646 : .name = discard_const_p(char, "old_keys"),
8647 : .get = py_package_PrimaryKerberosCtr3_get_old_keys,
8648 : .set = py_package_PrimaryKerberosCtr3_set_old_keys,
8649 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosKey3")
8650 : },
8651 : {
8652 : .name = discard_const_p(char, "padding1"),
8653 : .get = py_package_PrimaryKerberosCtr3_get_padding1,
8654 : .set = py_package_PrimaryKerberosCtr3_set_padding1,
8655 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8656 : },
8657 : {
8658 : .name = discard_const_p(char, "padding2"),
8659 : .get = py_package_PrimaryKerberosCtr3_get_padding2,
8660 : .set = py_package_PrimaryKerberosCtr3_set_padding2,
8661 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8662 : },
8663 : {
8664 : .name = discard_const_p(char, "padding3"),
8665 : .get = py_package_PrimaryKerberosCtr3_get_padding3,
8666 : .set = py_package_PrimaryKerberosCtr3_set_padding3,
8667 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8668 : },
8669 : {
8670 : .name = discard_const_p(char, "padding4"),
8671 : .get = py_package_PrimaryKerberosCtr3_get_padding4,
8672 : .set = py_package_PrimaryKerberosCtr3_set_padding4,
8673 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8674 : },
8675 : {
8676 : .name = discard_const_p(char, "padding5"),
8677 : .get = py_package_PrimaryKerberosCtr3_get_padding5,
8678 : .set = py_package_PrimaryKerberosCtr3_set_padding5,
8679 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8680 : },
8681 : { .name = NULL }
8682 : };
8683 :
8684 0 : static PyObject *py_package_PrimaryKerberosCtr3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8685 : {
8686 0 : return pytalloc_new(struct package_PrimaryKerberosCtr3, type);
8687 : }
8688 :
8689 :
8690 : static PyTypeObject package_PrimaryKerberosCtr3_Type = {
8691 : PyVarObject_HEAD_INIT(NULL, 0)
8692 : .tp_name = "drsblobs.package_PrimaryKerberosCtr3",
8693 : .tp_getset = py_package_PrimaryKerberosCtr3_getsetters,
8694 : .tp_methods = NULL,
8695 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8696 : .tp_new = py_package_PrimaryKerberosCtr3_new,
8697 : };
8698 :
8699 :
8700 0 : static PyObject *py_package_PrimaryKerberosKey4_get_reserved1(PyObject *obj, void *closure)
8701 : {
8702 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8703 : PyObject *py_reserved1;
8704 0 : py_reserved1 = PyLong_FromLong((uint16_t)object->reserved1);
8705 0 : return py_reserved1;
8706 : }
8707 :
8708 0 : static int py_package_PrimaryKerberosKey4_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
8709 : {
8710 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8711 0 : if (value == NULL) {
8712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved1");
8713 0 : return -1;
8714 : }
8715 : {
8716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved1));
8717 0 : if (PyLong_Check(value)) {
8718 : unsigned long long test_var;
8719 0 : test_var = PyLong_AsUnsignedLongLong(value);
8720 0 : if (PyErr_Occurred() != NULL) {
8721 0 : return -1;
8722 : }
8723 0 : if (test_var > uint_max) {
8724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8725 : PyLong_Type.tp_name, uint_max, test_var);
8726 0 : return -1;
8727 : }
8728 0 : object->reserved1 = test_var;
8729 : } else {
8730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8731 : PyLong_Type.tp_name);
8732 0 : return -1;
8733 : }
8734 : }
8735 0 : return 0;
8736 : }
8737 :
8738 0 : static PyObject *py_package_PrimaryKerberosKey4_get_reserved2(PyObject *obj, void *closure)
8739 : {
8740 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8741 : PyObject *py_reserved2;
8742 0 : py_reserved2 = PyLong_FromLong((uint16_t)object->reserved2);
8743 0 : return py_reserved2;
8744 : }
8745 :
8746 0 : static int py_package_PrimaryKerberosKey4_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
8747 : {
8748 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8749 0 : if (value == NULL) {
8750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved2");
8751 0 : return -1;
8752 : }
8753 : {
8754 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
8755 0 : if (PyLong_Check(value)) {
8756 : unsigned long long test_var;
8757 0 : test_var = PyLong_AsUnsignedLongLong(value);
8758 0 : if (PyErr_Occurred() != NULL) {
8759 0 : return -1;
8760 : }
8761 0 : if (test_var > uint_max) {
8762 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8763 : PyLong_Type.tp_name, uint_max, test_var);
8764 0 : return -1;
8765 : }
8766 0 : object->reserved2 = test_var;
8767 : } else {
8768 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8769 : PyLong_Type.tp_name);
8770 0 : return -1;
8771 : }
8772 : }
8773 0 : return 0;
8774 : }
8775 :
8776 0 : static PyObject *py_package_PrimaryKerberosKey4_get_reserved3(PyObject *obj, void *closure)
8777 : {
8778 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8779 : PyObject *py_reserved3;
8780 0 : py_reserved3 = PyLong_FromUnsignedLongLong((uint32_t)object->reserved3);
8781 0 : return py_reserved3;
8782 : }
8783 :
8784 0 : static int py_package_PrimaryKerberosKey4_set_reserved3(PyObject *py_obj, PyObject *value, void *closure)
8785 : {
8786 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8787 0 : if (value == NULL) {
8788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved3");
8789 0 : return -1;
8790 : }
8791 : {
8792 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved3));
8793 0 : if (PyLong_Check(value)) {
8794 : unsigned long long test_var;
8795 0 : test_var = PyLong_AsUnsignedLongLong(value);
8796 0 : if (PyErr_Occurred() != NULL) {
8797 0 : return -1;
8798 : }
8799 0 : if (test_var > uint_max) {
8800 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8801 : PyLong_Type.tp_name, uint_max, test_var);
8802 0 : return -1;
8803 : }
8804 0 : object->reserved3 = test_var;
8805 : } else {
8806 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8807 : PyLong_Type.tp_name);
8808 0 : return -1;
8809 : }
8810 : }
8811 0 : return 0;
8812 : }
8813 :
8814 0 : static PyObject *py_package_PrimaryKerberosKey4_get_iteration_count(PyObject *obj, void *closure)
8815 : {
8816 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8817 : PyObject *py_iteration_count;
8818 0 : py_iteration_count = PyLong_FromUnsignedLongLong((uint32_t)object->iteration_count);
8819 0 : return py_iteration_count;
8820 : }
8821 :
8822 0 : static int py_package_PrimaryKerberosKey4_set_iteration_count(PyObject *py_obj, PyObject *value, void *closure)
8823 : {
8824 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8825 0 : if (value == NULL) {
8826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->iteration_count");
8827 0 : return -1;
8828 : }
8829 : {
8830 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iteration_count));
8831 0 : if (PyLong_Check(value)) {
8832 : unsigned long long test_var;
8833 0 : test_var = PyLong_AsUnsignedLongLong(value);
8834 0 : if (PyErr_Occurred() != NULL) {
8835 0 : return -1;
8836 : }
8837 0 : if (test_var > uint_max) {
8838 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8839 : PyLong_Type.tp_name, uint_max, test_var);
8840 0 : return -1;
8841 : }
8842 0 : object->iteration_count = test_var;
8843 : } else {
8844 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8845 : PyLong_Type.tp_name);
8846 0 : return -1;
8847 : }
8848 : }
8849 0 : return 0;
8850 : }
8851 :
8852 876 : static PyObject *py_package_PrimaryKerberosKey4_get_keytype(PyObject *obj, void *closure)
8853 : {
8854 876 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8855 : PyObject *py_keytype;
8856 876 : py_keytype = PyLong_FromUnsignedLongLong((uint32_t)object->keytype);
8857 876 : return py_keytype;
8858 : }
8859 :
8860 0 : static int py_package_PrimaryKerberosKey4_set_keytype(PyObject *py_obj, PyObject *value, void *closure)
8861 : {
8862 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8863 0 : if (value == NULL) {
8864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keytype");
8865 0 : return -1;
8866 : }
8867 : {
8868 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->keytype));
8869 0 : if (PyLong_Check(value)) {
8870 : unsigned long long test_var;
8871 0 : test_var = PyLong_AsUnsignedLongLong(value);
8872 0 : if (PyErr_Occurred() != NULL) {
8873 0 : return -1;
8874 : }
8875 0 : if (test_var > uint_max) {
8876 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8877 : PyLong_Type.tp_name, uint_max, test_var);
8878 0 : return -1;
8879 : }
8880 0 : object->keytype = test_var;
8881 : } else {
8882 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8883 : PyLong_Type.tp_name);
8884 0 : return -1;
8885 : }
8886 : }
8887 0 : return 0;
8888 : }
8889 :
8890 0 : static PyObject *py_package_PrimaryKerberosKey4_get_value_len(PyObject *obj, void *closure)
8891 : {
8892 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8893 : PyObject *py_value_len;
8894 0 : py_value_len = PyLong_FromUnsignedLongLong((uint32_t)object->value_len);
8895 0 : return py_value_len;
8896 : }
8897 :
8898 0 : static int py_package_PrimaryKerberosKey4_set_value_len(PyObject *py_obj, PyObject *value, void *closure)
8899 : {
8900 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8901 0 : if (value == NULL) {
8902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value_len");
8903 0 : return -1;
8904 : }
8905 : {
8906 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->value_len));
8907 0 : if (PyLong_Check(value)) {
8908 : unsigned long long test_var;
8909 0 : test_var = PyLong_AsUnsignedLongLong(value);
8910 0 : if (PyErr_Occurred() != NULL) {
8911 0 : return -1;
8912 : }
8913 0 : if (test_var > uint_max) {
8914 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8915 : PyLong_Type.tp_name, uint_max, test_var);
8916 0 : return -1;
8917 : }
8918 0 : object->value_len = test_var;
8919 : } else {
8920 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8921 : PyLong_Type.tp_name);
8922 0 : return -1;
8923 : }
8924 : }
8925 0 : return 0;
8926 : }
8927 :
8928 400 : static PyObject *py_package_PrimaryKerberosKey4_get_value(PyObject *obj, void *closure)
8929 : {
8930 400 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(obj);
8931 : PyObject *py_value;
8932 400 : if (object->value == NULL) {
8933 0 : Py_RETURN_NONE;
8934 : }
8935 400 : if (object->value == NULL) {
8936 0 : py_value = Py_None;
8937 0 : Py_INCREF(py_value);
8938 : } else {
8939 400 : py_value = PyBytes_FromStringAndSize((char *)(*object->value).data, (*object->value).length);
8940 : }
8941 400 : return py_value;
8942 : }
8943 :
8944 0 : static int py_package_PrimaryKerberosKey4_set_value(PyObject *py_obj, PyObject *value, void *closure)
8945 : {
8946 0 : struct package_PrimaryKerberosKey4 *object = (struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(py_obj);
8947 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->value));
8948 0 : if (value == NULL) {
8949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value");
8950 0 : return -1;
8951 : }
8952 0 : if (value == Py_None) {
8953 0 : object->value = NULL;
8954 : } else {
8955 0 : object->value = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->value);
8956 0 : if (object->value == NULL) {
8957 0 : PyErr_NoMemory();
8958 0 : return -1;
8959 : }
8960 0 : *object->value = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
8961 : }
8962 0 : return 0;
8963 : }
8964 :
8965 : static PyGetSetDef py_package_PrimaryKerberosKey4_getsetters[] = {
8966 : {
8967 : .name = discard_const_p(char, "reserved1"),
8968 : .get = py_package_PrimaryKerberosKey4_get_reserved1,
8969 : .set = py_package_PrimaryKerberosKey4_set_reserved1,
8970 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8971 : },
8972 : {
8973 : .name = discard_const_p(char, "reserved2"),
8974 : .get = py_package_PrimaryKerberosKey4_get_reserved2,
8975 : .set = py_package_PrimaryKerberosKey4_set_reserved2,
8976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8977 : },
8978 : {
8979 : .name = discard_const_p(char, "reserved3"),
8980 : .get = py_package_PrimaryKerberosKey4_get_reserved3,
8981 : .set = py_package_PrimaryKerberosKey4_set_reserved3,
8982 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8983 : },
8984 : {
8985 : .name = discard_const_p(char, "iteration_count"),
8986 : .get = py_package_PrimaryKerberosKey4_get_iteration_count,
8987 : .set = py_package_PrimaryKerberosKey4_set_iteration_count,
8988 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8989 : },
8990 : {
8991 : .name = discard_const_p(char, "keytype"),
8992 : .get = py_package_PrimaryKerberosKey4_get_keytype,
8993 : .set = py_package_PrimaryKerberosKey4_set_keytype,
8994 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8995 : },
8996 : {
8997 : .name = discard_const_p(char, "value_len"),
8998 : .get = py_package_PrimaryKerberosKey4_get_value_len,
8999 : .set = py_package_PrimaryKerberosKey4_set_value_len,
9000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9001 : },
9002 : {
9003 : .name = discard_const_p(char, "value"),
9004 : .get = py_package_PrimaryKerberosKey4_get_value,
9005 : .set = py_package_PrimaryKerberosKey4_set_value,
9006 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9007 : },
9008 : { .name = NULL }
9009 : };
9010 :
9011 0 : static PyObject *py_package_PrimaryKerberosKey4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9012 : {
9013 0 : return pytalloc_new(struct package_PrimaryKerberosKey4, type);
9014 : }
9015 :
9016 :
9017 : static PyTypeObject package_PrimaryKerberosKey4_Type = {
9018 : PyVarObject_HEAD_INIT(NULL, 0)
9019 : .tp_name = "drsblobs.package_PrimaryKerberosKey4",
9020 : .tp_getset = py_package_PrimaryKerberosKey4_getsetters,
9021 : .tp_methods = NULL,
9022 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9023 : .tp_new = py_package_PrimaryKerberosKey4_new,
9024 : };
9025 :
9026 :
9027 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_num_keys(PyObject *obj, void *closure)
9028 : {
9029 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9030 : PyObject *py_num_keys;
9031 0 : py_num_keys = PyLong_FromLong((uint16_t)object->num_keys);
9032 0 : return py_num_keys;
9033 : }
9034 :
9035 0 : static int py_package_PrimaryKerberosCtr4_set_num_keys(PyObject *py_obj, PyObject *value, void *closure)
9036 : {
9037 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9038 0 : if (value == NULL) {
9039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_keys");
9040 0 : return -1;
9041 : }
9042 : {
9043 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_keys));
9044 0 : if (PyLong_Check(value)) {
9045 : unsigned long long test_var;
9046 0 : test_var = PyLong_AsUnsignedLongLong(value);
9047 0 : if (PyErr_Occurred() != NULL) {
9048 0 : return -1;
9049 : }
9050 0 : if (test_var > uint_max) {
9051 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9052 : PyLong_Type.tp_name, uint_max, test_var);
9053 0 : return -1;
9054 : }
9055 0 : object->num_keys = test_var;
9056 : } else {
9057 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9058 : PyLong_Type.tp_name);
9059 0 : return -1;
9060 : }
9061 : }
9062 0 : return 0;
9063 : }
9064 :
9065 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_num_service_keys(PyObject *obj, void *closure)
9066 : {
9067 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9068 : PyObject *py_num_service_keys;
9069 0 : py_num_service_keys = PyLong_FromLong((uint16_t)object->num_service_keys);
9070 0 : return py_num_service_keys;
9071 : }
9072 :
9073 0 : static int py_package_PrimaryKerberosCtr4_set_num_service_keys(PyObject *py_obj, PyObject *value, void *closure)
9074 : {
9075 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9076 0 : if (value == NULL) {
9077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_service_keys");
9078 0 : return -1;
9079 : }
9080 : {
9081 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_service_keys));
9082 0 : if (PyLong_Check(value)) {
9083 : unsigned long long test_var;
9084 0 : test_var = PyLong_AsUnsignedLongLong(value);
9085 0 : if (PyErr_Occurred() != NULL) {
9086 0 : return -1;
9087 : }
9088 0 : if (test_var > uint_max) {
9089 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9090 : PyLong_Type.tp_name, uint_max, test_var);
9091 0 : return -1;
9092 : }
9093 0 : object->num_service_keys = test_var;
9094 : } else {
9095 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9096 : PyLong_Type.tp_name);
9097 0 : return -1;
9098 : }
9099 : }
9100 0 : return 0;
9101 : }
9102 :
9103 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_num_old_keys(PyObject *obj, void *closure)
9104 : {
9105 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9106 : PyObject *py_num_old_keys;
9107 0 : py_num_old_keys = PyLong_FromLong((uint16_t)object->num_old_keys);
9108 0 : return py_num_old_keys;
9109 : }
9110 :
9111 0 : static int py_package_PrimaryKerberosCtr4_set_num_old_keys(PyObject *py_obj, PyObject *value, void *closure)
9112 : {
9113 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9114 0 : if (value == NULL) {
9115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_old_keys");
9116 0 : return -1;
9117 : }
9118 : {
9119 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_old_keys));
9120 0 : if (PyLong_Check(value)) {
9121 : unsigned long long test_var;
9122 0 : test_var = PyLong_AsUnsignedLongLong(value);
9123 0 : if (PyErr_Occurred() != NULL) {
9124 0 : return -1;
9125 : }
9126 0 : if (test_var > uint_max) {
9127 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9128 : PyLong_Type.tp_name, uint_max, test_var);
9129 0 : return -1;
9130 : }
9131 0 : object->num_old_keys = test_var;
9132 : } else {
9133 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9134 : PyLong_Type.tp_name);
9135 0 : return -1;
9136 : }
9137 : }
9138 0 : return 0;
9139 : }
9140 :
9141 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_num_older_keys(PyObject *obj, void *closure)
9142 : {
9143 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9144 : PyObject *py_num_older_keys;
9145 0 : py_num_older_keys = PyLong_FromLong((uint16_t)object->num_older_keys);
9146 0 : return py_num_older_keys;
9147 : }
9148 :
9149 0 : static int py_package_PrimaryKerberosCtr4_set_num_older_keys(PyObject *py_obj, PyObject *value, void *closure)
9150 : {
9151 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9152 0 : if (value == NULL) {
9153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_older_keys");
9154 0 : return -1;
9155 : }
9156 : {
9157 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_older_keys));
9158 0 : if (PyLong_Check(value)) {
9159 : unsigned long long test_var;
9160 0 : test_var = PyLong_AsUnsignedLongLong(value);
9161 0 : if (PyErr_Occurred() != NULL) {
9162 0 : return -1;
9163 : }
9164 0 : if (test_var > uint_max) {
9165 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9166 : PyLong_Type.tp_name, uint_max, test_var);
9167 0 : return -1;
9168 : }
9169 0 : object->num_older_keys = test_var;
9170 : } else {
9171 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9172 : PyLong_Type.tp_name);
9173 0 : return -1;
9174 : }
9175 : }
9176 0 : return 0;
9177 : }
9178 :
9179 76 : static PyObject *py_package_PrimaryKerberosCtr4_get_salt(PyObject *obj, void *closure)
9180 : {
9181 76 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9182 : PyObject *py_salt;
9183 76 : py_salt = pytalloc_reference_ex(&package_PrimaryKerberosString_Type, pytalloc_get_mem_ctx(obj), &object->salt);
9184 76 : return py_salt;
9185 : }
9186 :
9187 0 : static int py_package_PrimaryKerberosCtr4_set_salt(PyObject *py_obj, PyObject *value, void *closure)
9188 : {
9189 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9190 0 : if (value == NULL) {
9191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->salt");
9192 0 : return -1;
9193 : }
9194 0 : PY_CHECK_TYPE(&package_PrimaryKerberosString_Type, value, return -1;);
9195 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9196 0 : PyErr_NoMemory();
9197 0 : return -1;
9198 : }
9199 0 : object->salt = *(struct package_PrimaryKerberosString *)pytalloc_get_ptr(value);
9200 0 : return 0;
9201 : }
9202 :
9203 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_default_iteration_count(PyObject *obj, void *closure)
9204 : {
9205 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9206 : PyObject *py_default_iteration_count;
9207 0 : py_default_iteration_count = PyLong_FromUnsignedLongLong((uint32_t)object->default_iteration_count);
9208 0 : return py_default_iteration_count;
9209 : }
9210 :
9211 0 : static int py_package_PrimaryKerberosCtr4_set_default_iteration_count(PyObject *py_obj, PyObject *value, void *closure)
9212 : {
9213 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9214 0 : if (value == NULL) {
9215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->default_iteration_count");
9216 0 : return -1;
9217 : }
9218 : {
9219 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->default_iteration_count));
9220 0 : if (PyLong_Check(value)) {
9221 : unsigned long long test_var;
9222 0 : test_var = PyLong_AsUnsignedLongLong(value);
9223 0 : if (PyErr_Occurred() != NULL) {
9224 0 : return -1;
9225 : }
9226 0 : if (test_var > uint_max) {
9227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9228 : PyLong_Type.tp_name, uint_max, test_var);
9229 0 : return -1;
9230 : }
9231 0 : object->default_iteration_count = test_var;
9232 : } else {
9233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9234 : PyLong_Type.tp_name);
9235 0 : return -1;
9236 : }
9237 : }
9238 0 : return 0;
9239 : }
9240 :
9241 352 : static PyObject *py_package_PrimaryKerberosCtr4_get_keys(PyObject *obj, void *closure)
9242 : {
9243 352 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9244 : PyObject *py_keys;
9245 352 : py_keys = PyList_New(object->num_keys);
9246 352 : if (py_keys == NULL) {
9247 0 : return NULL;
9248 : }
9249 : {
9250 : int keys_cntr_0;
9251 1760 : for (keys_cntr_0 = 0; keys_cntr_0 < (object->num_keys); keys_cntr_0++) {
9252 : PyObject *py_keys_0;
9253 1408 : py_keys_0 = pytalloc_reference_ex(&package_PrimaryKerberosKey4_Type, object->keys, &object->keys[keys_cntr_0]);
9254 1408 : PyList_SetItem(py_keys, keys_cntr_0, py_keys_0);
9255 : }
9256 : }
9257 352 : return py_keys;
9258 : }
9259 :
9260 0 : static int py_package_PrimaryKerberosCtr4_set_keys(PyObject *py_obj, PyObject *value, void *closure)
9261 : {
9262 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9263 0 : if (value == NULL) {
9264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys");
9265 0 : return -1;
9266 : }
9267 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9268 : {
9269 : int keys_cntr_0;
9270 0 : object->keys = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->keys, PyList_GET_SIZE(value));
9271 0 : if (!object->keys) { return -1;; }
9272 0 : talloc_set_name_const(object->keys, "ARRAY: object->keys");
9273 0 : for (keys_cntr_0 = 0; keys_cntr_0 < PyList_GET_SIZE(value); keys_cntr_0++) {
9274 0 : if (PyList_GET_ITEM(value, keys_cntr_0) == NULL) {
9275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys[keys_cntr_0]");
9276 0 : return -1;
9277 : }
9278 0 : PY_CHECK_TYPE(&package_PrimaryKerberosKey4_Type, PyList_GET_ITEM(value, keys_cntr_0), return -1;);
9279 0 : if (talloc_reference(object->keys, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, keys_cntr_0))) == NULL) {
9280 0 : PyErr_NoMemory();
9281 0 : return -1;
9282 : }
9283 0 : object->keys[keys_cntr_0] = *(struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(PyList_GET_ITEM(value, keys_cntr_0));
9284 : }
9285 : }
9286 0 : return 0;
9287 : }
9288 :
9289 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_service_keys(PyObject *obj, void *closure)
9290 : {
9291 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9292 : PyObject *py_service_keys;
9293 0 : py_service_keys = PyList_New(object->num_service_keys);
9294 0 : if (py_service_keys == NULL) {
9295 0 : return NULL;
9296 : }
9297 : {
9298 : int service_keys_cntr_0;
9299 0 : for (service_keys_cntr_0 = 0; service_keys_cntr_0 < (object->num_service_keys); service_keys_cntr_0++) {
9300 : PyObject *py_service_keys_0;
9301 0 : py_service_keys_0 = pytalloc_reference_ex(&package_PrimaryKerberosKey4_Type, object->service_keys, &object->service_keys[service_keys_cntr_0]);
9302 0 : PyList_SetItem(py_service_keys, service_keys_cntr_0, py_service_keys_0);
9303 : }
9304 : }
9305 0 : return py_service_keys;
9306 : }
9307 :
9308 0 : static int py_package_PrimaryKerberosCtr4_set_service_keys(PyObject *py_obj, PyObject *value, void *closure)
9309 : {
9310 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9311 0 : if (value == NULL) {
9312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_keys");
9313 0 : return -1;
9314 : }
9315 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9316 : {
9317 : int service_keys_cntr_0;
9318 0 : object->service_keys = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->service_keys, PyList_GET_SIZE(value));
9319 0 : if (!object->service_keys) { return -1;; }
9320 0 : talloc_set_name_const(object->service_keys, "ARRAY: object->service_keys");
9321 0 : for (service_keys_cntr_0 = 0; service_keys_cntr_0 < PyList_GET_SIZE(value); service_keys_cntr_0++) {
9322 0 : if (PyList_GET_ITEM(value, service_keys_cntr_0) == NULL) {
9323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_keys[service_keys_cntr_0]");
9324 0 : return -1;
9325 : }
9326 0 : PY_CHECK_TYPE(&package_PrimaryKerberosKey4_Type, PyList_GET_ITEM(value, service_keys_cntr_0), return -1;);
9327 0 : if (talloc_reference(object->service_keys, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, service_keys_cntr_0))) == NULL) {
9328 0 : PyErr_NoMemory();
9329 0 : return -1;
9330 : }
9331 0 : object->service_keys[service_keys_cntr_0] = *(struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(PyList_GET_ITEM(value, service_keys_cntr_0));
9332 : }
9333 : }
9334 0 : return 0;
9335 : }
9336 :
9337 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_old_keys(PyObject *obj, void *closure)
9338 : {
9339 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9340 : PyObject *py_old_keys;
9341 0 : py_old_keys = PyList_New(object->num_old_keys);
9342 0 : if (py_old_keys == NULL) {
9343 0 : return NULL;
9344 : }
9345 : {
9346 : int old_keys_cntr_0;
9347 0 : for (old_keys_cntr_0 = 0; old_keys_cntr_0 < (object->num_old_keys); old_keys_cntr_0++) {
9348 : PyObject *py_old_keys_0;
9349 0 : py_old_keys_0 = pytalloc_reference_ex(&package_PrimaryKerberosKey4_Type, object->old_keys, &object->old_keys[old_keys_cntr_0]);
9350 0 : PyList_SetItem(py_old_keys, old_keys_cntr_0, py_old_keys_0);
9351 : }
9352 : }
9353 0 : return py_old_keys;
9354 : }
9355 :
9356 0 : static int py_package_PrimaryKerberosCtr4_set_old_keys(PyObject *py_obj, PyObject *value, void *closure)
9357 : {
9358 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9359 0 : if (value == NULL) {
9360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_keys");
9361 0 : return -1;
9362 : }
9363 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9364 : {
9365 : int old_keys_cntr_0;
9366 0 : object->old_keys = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->old_keys, PyList_GET_SIZE(value));
9367 0 : if (!object->old_keys) { return -1;; }
9368 0 : talloc_set_name_const(object->old_keys, "ARRAY: object->old_keys");
9369 0 : for (old_keys_cntr_0 = 0; old_keys_cntr_0 < PyList_GET_SIZE(value); old_keys_cntr_0++) {
9370 0 : if (PyList_GET_ITEM(value, old_keys_cntr_0) == NULL) {
9371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_keys[old_keys_cntr_0]");
9372 0 : return -1;
9373 : }
9374 0 : PY_CHECK_TYPE(&package_PrimaryKerberosKey4_Type, PyList_GET_ITEM(value, old_keys_cntr_0), return -1;);
9375 0 : if (talloc_reference(object->old_keys, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, old_keys_cntr_0))) == NULL) {
9376 0 : PyErr_NoMemory();
9377 0 : return -1;
9378 : }
9379 0 : object->old_keys[old_keys_cntr_0] = *(struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(PyList_GET_ITEM(value, old_keys_cntr_0));
9380 : }
9381 : }
9382 0 : return 0;
9383 : }
9384 :
9385 0 : static PyObject *py_package_PrimaryKerberosCtr4_get_older_keys(PyObject *obj, void *closure)
9386 : {
9387 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(obj);
9388 : PyObject *py_older_keys;
9389 0 : py_older_keys = PyList_New(object->num_older_keys);
9390 0 : if (py_older_keys == NULL) {
9391 0 : return NULL;
9392 : }
9393 : {
9394 : int older_keys_cntr_0;
9395 0 : for (older_keys_cntr_0 = 0; older_keys_cntr_0 < (object->num_older_keys); older_keys_cntr_0++) {
9396 : PyObject *py_older_keys_0;
9397 0 : py_older_keys_0 = pytalloc_reference_ex(&package_PrimaryKerberosKey4_Type, object->older_keys, &object->older_keys[older_keys_cntr_0]);
9398 0 : PyList_SetItem(py_older_keys, older_keys_cntr_0, py_older_keys_0);
9399 : }
9400 : }
9401 0 : return py_older_keys;
9402 : }
9403 :
9404 0 : static int py_package_PrimaryKerberosCtr4_set_older_keys(PyObject *py_obj, PyObject *value, void *closure)
9405 : {
9406 0 : struct package_PrimaryKerberosCtr4 *object = (struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(py_obj);
9407 0 : if (value == NULL) {
9408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->older_keys");
9409 0 : return -1;
9410 : }
9411 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9412 : {
9413 : int older_keys_cntr_0;
9414 0 : object->older_keys = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->older_keys, PyList_GET_SIZE(value));
9415 0 : if (!object->older_keys) { return -1;; }
9416 0 : talloc_set_name_const(object->older_keys, "ARRAY: object->older_keys");
9417 0 : for (older_keys_cntr_0 = 0; older_keys_cntr_0 < PyList_GET_SIZE(value); older_keys_cntr_0++) {
9418 0 : if (PyList_GET_ITEM(value, older_keys_cntr_0) == NULL) {
9419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->older_keys[older_keys_cntr_0]");
9420 0 : return -1;
9421 : }
9422 0 : PY_CHECK_TYPE(&package_PrimaryKerberosKey4_Type, PyList_GET_ITEM(value, older_keys_cntr_0), return -1;);
9423 0 : if (talloc_reference(object->older_keys, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, older_keys_cntr_0))) == NULL) {
9424 0 : PyErr_NoMemory();
9425 0 : return -1;
9426 : }
9427 0 : object->older_keys[older_keys_cntr_0] = *(struct package_PrimaryKerberosKey4 *)pytalloc_get_ptr(PyList_GET_ITEM(value, older_keys_cntr_0));
9428 : }
9429 : }
9430 0 : return 0;
9431 : }
9432 :
9433 : static PyGetSetDef py_package_PrimaryKerberosCtr4_getsetters[] = {
9434 : {
9435 : .name = discard_const_p(char, "num_keys"),
9436 : .get = py_package_PrimaryKerberosCtr4_get_num_keys,
9437 : .set = py_package_PrimaryKerberosCtr4_set_num_keys,
9438 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9439 : },
9440 : {
9441 : .name = discard_const_p(char, "num_service_keys"),
9442 : .get = py_package_PrimaryKerberosCtr4_get_num_service_keys,
9443 : .set = py_package_PrimaryKerberosCtr4_set_num_service_keys,
9444 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9445 : },
9446 : {
9447 : .name = discard_const_p(char, "num_old_keys"),
9448 : .get = py_package_PrimaryKerberosCtr4_get_num_old_keys,
9449 : .set = py_package_PrimaryKerberosCtr4_set_num_old_keys,
9450 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9451 : },
9452 : {
9453 : .name = discard_const_p(char, "num_older_keys"),
9454 : .get = py_package_PrimaryKerberosCtr4_get_num_older_keys,
9455 : .set = py_package_PrimaryKerberosCtr4_set_num_older_keys,
9456 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9457 : },
9458 : {
9459 : .name = discard_const_p(char, "salt"),
9460 : .get = py_package_PrimaryKerberosCtr4_get_salt,
9461 : .set = py_package_PrimaryKerberosCtr4_set_salt,
9462 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosString")
9463 : },
9464 : {
9465 : .name = discard_const_p(char, "default_iteration_count"),
9466 : .get = py_package_PrimaryKerberosCtr4_get_default_iteration_count,
9467 : .set = py_package_PrimaryKerberosCtr4_set_default_iteration_count,
9468 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9469 : },
9470 : {
9471 : .name = discard_const_p(char, "keys"),
9472 : .get = py_package_PrimaryKerberosCtr4_get_keys,
9473 : .set = py_package_PrimaryKerberosCtr4_set_keys,
9474 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosKey4")
9475 : },
9476 : {
9477 : .name = discard_const_p(char, "service_keys"),
9478 : .get = py_package_PrimaryKerberosCtr4_get_service_keys,
9479 : .set = py_package_PrimaryKerberosCtr4_set_service_keys,
9480 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosKey4")
9481 : },
9482 : {
9483 : .name = discard_const_p(char, "old_keys"),
9484 : .get = py_package_PrimaryKerberosCtr4_get_old_keys,
9485 : .set = py_package_PrimaryKerberosCtr4_set_old_keys,
9486 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosKey4")
9487 : },
9488 : {
9489 : .name = discard_const_p(char, "older_keys"),
9490 : .get = py_package_PrimaryKerberosCtr4_get_older_keys,
9491 : .set = py_package_PrimaryKerberosCtr4_set_older_keys,
9492 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosKey4")
9493 : },
9494 : { .name = NULL }
9495 : };
9496 :
9497 0 : static PyObject *py_package_PrimaryKerberosCtr4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9498 : {
9499 0 : return pytalloc_new(struct package_PrimaryKerberosCtr4, type);
9500 : }
9501 :
9502 :
9503 : static PyTypeObject package_PrimaryKerberosCtr4_Type = {
9504 : PyVarObject_HEAD_INIT(NULL, 0)
9505 : .tp_name = "drsblobs.package_PrimaryKerberosCtr4",
9506 : .tp_getset = py_package_PrimaryKerberosCtr4_getsetters,
9507 : .tp_methods = NULL,
9508 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9509 : .tp_new = py_package_PrimaryKerberosCtr4_new,
9510 : };
9511 :
9512 276 : static PyObject *py_import_package_PrimaryKerberosCtr(TALLOC_CTX *mem_ctx, int level, union package_PrimaryKerberosCtr *in)
9513 : {
9514 : PyObject *ret;
9515 :
9516 276 : switch (level) {
9517 0 : case 3:
9518 0 : ret = pytalloc_reference_ex(&package_PrimaryKerberosCtr3_Type, mem_ctx, &in->ctr3);
9519 0 : return ret;
9520 :
9521 276 : case 4:
9522 276 : ret = pytalloc_reference_ex(&package_PrimaryKerberosCtr4_Type, mem_ctx, &in->ctr4);
9523 276 : return ret;
9524 :
9525 : }
9526 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9527 0 : return NULL;
9528 : }
9529 :
9530 0 : static union package_PrimaryKerberosCtr *py_export_package_PrimaryKerberosCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9531 : {
9532 0 : union package_PrimaryKerberosCtr *ret = talloc_zero(mem_ctx, union package_PrimaryKerberosCtr);
9533 0 : switch (level) {
9534 0 : case 3:
9535 0 : if (in == NULL) {
9536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr3");
9537 0 : talloc_free(ret); return NULL;
9538 : }
9539 0 : PY_CHECK_TYPE(&package_PrimaryKerberosCtr3_Type, in, talloc_free(ret); return NULL;);
9540 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9541 0 : PyErr_NoMemory();
9542 0 : talloc_free(ret); return NULL;
9543 : }
9544 0 : ret->ctr3 = *(struct package_PrimaryKerberosCtr3 *)pytalloc_get_ptr(in);
9545 0 : break;
9546 :
9547 0 : case 4:
9548 0 : if (in == NULL) {
9549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr4");
9550 0 : talloc_free(ret); return NULL;
9551 : }
9552 0 : PY_CHECK_TYPE(&package_PrimaryKerberosCtr4_Type, in, talloc_free(ret); return NULL;);
9553 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9554 0 : PyErr_NoMemory();
9555 0 : talloc_free(ret); return NULL;
9556 : }
9557 0 : ret->ctr4 = *(struct package_PrimaryKerberosCtr4 *)pytalloc_get_ptr(in);
9558 0 : break;
9559 :
9560 0 : default:
9561 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9562 0 : talloc_free(ret);
9563 0 : ret = NULL;
9564 : }
9565 :
9566 0 : return ret;
9567 : }
9568 :
9569 276 : static PyObject *py_package_PrimaryKerberosCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9570 : {
9571 276 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9572 276 : PyObject *mem_ctx_obj = NULL;
9573 276 : TALLOC_CTX *mem_ctx = NULL;
9574 276 : int level = 0;
9575 276 : PyObject *in_obj = NULL;
9576 276 : union package_PrimaryKerberosCtr *in = NULL;
9577 :
9578 276 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9579 : discard_const_p(char *, kwnames),
9580 : &mem_ctx_obj,
9581 : &level,
9582 : &in_obj)) {
9583 0 : return NULL;
9584 : }
9585 276 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9586 276 : if (mem_ctx == NULL) {
9587 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9588 0 : return NULL;
9589 : }
9590 276 : in = (union package_PrimaryKerberosCtr *)pytalloc_get_ptr(in_obj);
9591 276 : if (in == NULL) {
9592 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union package_PrimaryKerberosCtr!");
9593 0 : return NULL;
9594 : }
9595 :
9596 276 : return py_import_package_PrimaryKerberosCtr(mem_ctx, level, in);
9597 : }
9598 :
9599 0 : static PyObject *py_package_PrimaryKerberosCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9600 : {
9601 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9602 0 : PyObject *mem_ctx_obj = NULL;
9603 0 : TALLOC_CTX *mem_ctx = NULL;
9604 0 : int level = 0;
9605 0 : PyObject *in = NULL;
9606 0 : union package_PrimaryKerberosCtr *out = NULL;
9607 :
9608 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9609 : discard_const_p(char *, kwnames),
9610 : &mem_ctx_obj,
9611 : &level,
9612 : &in)) {
9613 0 : return NULL;
9614 : }
9615 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9616 0 : if (mem_ctx == NULL) {
9617 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9618 0 : return NULL;
9619 : }
9620 :
9621 0 : out = py_export_package_PrimaryKerberosCtr(mem_ctx, level, in);
9622 0 : if (out == NULL) {
9623 0 : return NULL;
9624 : }
9625 :
9626 0 : return pytalloc_GenericObject_reference(out);
9627 : }
9628 :
9629 : static PyMethodDef py_package_PrimaryKerberosCtr_methods[] = {
9630 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimaryKerberosCtr_import),
9631 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9632 : "T.__import__(mem_ctx, level, in) => ret." },
9633 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimaryKerberosCtr_export),
9634 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9635 : "T.__export__(mem_ctx, level, in) => ret." },
9636 : { NULL, NULL, 0, NULL }
9637 : };
9638 :
9639 0 : static PyObject *py_package_PrimaryKerberosCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9640 : {
9641 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9642 0 : return NULL;
9643 : }
9644 :
9645 :
9646 : static PyTypeObject package_PrimaryKerberosCtr_Type = {
9647 : PyVarObject_HEAD_INIT(NULL, 0)
9648 : .tp_name = "drsblobs.package_PrimaryKerberosCtr",
9649 : .tp_getset = NULL,
9650 : .tp_methods = py_package_PrimaryKerberosCtr_methods,
9651 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9652 : .tp_new = py_package_PrimaryKerberosCtr_new,
9653 : };
9654 :
9655 :
9656 76 : static PyObject *py_package_PrimaryKerberosBlob_get_version(PyObject *obj, void *closure)
9657 : {
9658 76 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(obj);
9659 : PyObject *py_version;
9660 76 : py_version = PyLong_FromLong((uint16_t)object->version);
9661 76 : return py_version;
9662 : }
9663 :
9664 0 : static int py_package_PrimaryKerberosBlob_set_version(PyObject *py_obj, PyObject *value, void *closure)
9665 : {
9666 0 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(py_obj);
9667 0 : if (value == NULL) {
9668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
9669 0 : return -1;
9670 : }
9671 : {
9672 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
9673 0 : if (PyLong_Check(value)) {
9674 : unsigned long long test_var;
9675 0 : test_var = PyLong_AsUnsignedLongLong(value);
9676 0 : if (PyErr_Occurred() != NULL) {
9677 0 : return -1;
9678 : }
9679 0 : if (test_var > uint_max) {
9680 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9681 : PyLong_Type.tp_name, uint_max, test_var);
9682 0 : return -1;
9683 : }
9684 0 : object->version = test_var;
9685 : } else {
9686 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9687 : PyLong_Type.tp_name);
9688 0 : return -1;
9689 : }
9690 : }
9691 0 : return 0;
9692 : }
9693 :
9694 0 : static PyObject *py_package_PrimaryKerberosBlob_get_flags(PyObject *obj, void *closure)
9695 : {
9696 0 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(obj);
9697 : PyObject *py_flags;
9698 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
9699 0 : return py_flags;
9700 : }
9701 :
9702 0 : static int py_package_PrimaryKerberosBlob_set_flags(PyObject *py_obj, PyObject *value, void *closure)
9703 : {
9704 0 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(py_obj);
9705 0 : if (value == NULL) {
9706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
9707 0 : return -1;
9708 : }
9709 : {
9710 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
9711 0 : if (PyLong_Check(value)) {
9712 : unsigned long long test_var;
9713 0 : test_var = PyLong_AsUnsignedLongLong(value);
9714 0 : if (PyErr_Occurred() != NULL) {
9715 0 : return -1;
9716 : }
9717 0 : if (test_var > uint_max) {
9718 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9719 : PyLong_Type.tp_name, uint_max, test_var);
9720 0 : return -1;
9721 : }
9722 0 : object->flags = test_var;
9723 : } else {
9724 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9725 : PyLong_Type.tp_name);
9726 0 : return -1;
9727 : }
9728 : }
9729 0 : return 0;
9730 : }
9731 :
9732 276 : static PyObject *py_package_PrimaryKerberosBlob_get_ctr(PyObject *obj, void *closure)
9733 : {
9734 276 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(obj);
9735 : PyObject *py_ctr;
9736 276 : py_ctr = pyrpc_import_union(&package_PrimaryKerberosCtr_Type, pytalloc_get_mem_ctx(obj), object->version, &object->ctr, "union package_PrimaryKerberosCtr");
9737 276 : if (py_ctr == NULL) {
9738 0 : return NULL;
9739 : }
9740 276 : return py_ctr;
9741 : }
9742 :
9743 0 : static int py_package_PrimaryKerberosBlob_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
9744 : {
9745 0 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(py_obj);
9746 0 : if (value == NULL) {
9747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
9748 0 : return -1;
9749 : }
9750 : {
9751 : union package_PrimaryKerberosCtr *ctr_switch_0;
9752 0 : ctr_switch_0 = (union package_PrimaryKerberosCtr *)pyrpc_export_union(&package_PrimaryKerberosCtr_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union package_PrimaryKerberosCtr");
9753 0 : if (ctr_switch_0 == NULL) {
9754 0 : return -1;
9755 : }
9756 0 : object->ctr = *ctr_switch_0;
9757 : }
9758 0 : return 0;
9759 : }
9760 :
9761 : static PyGetSetDef py_package_PrimaryKerberosBlob_getsetters[] = {
9762 : {
9763 : .name = discard_const_p(char, "version"),
9764 : .get = py_package_PrimaryKerberosBlob_get_version,
9765 : .set = py_package_PrimaryKerberosBlob_set_version,
9766 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9767 : },
9768 : {
9769 : .name = discard_const_p(char, "flags"),
9770 : .get = py_package_PrimaryKerberosBlob_get_flags,
9771 : .set = py_package_PrimaryKerberosBlob_set_flags,
9772 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9773 : },
9774 : {
9775 : .name = discard_const_p(char, "ctr"),
9776 : .get = py_package_PrimaryKerberosBlob_get_ctr,
9777 : .set = py_package_PrimaryKerberosBlob_set_ctr,
9778 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryKerberosCtr")
9779 : },
9780 : { .name = NULL }
9781 : };
9782 :
9783 276 : static PyObject *py_package_PrimaryKerberosBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9784 : {
9785 276 : return pytalloc_new(struct package_PrimaryKerberosBlob, type);
9786 : }
9787 :
9788 0 : static PyObject *py_package_PrimaryKerberosBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9789 : {
9790 0 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(py_obj);
9791 0 : PyObject *ret = NULL;
9792 : DATA_BLOB blob;
9793 : enum ndr_err_code err;
9794 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9795 0 : if (tmp_ctx == NULL) {
9796 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9797 0 : return NULL;
9798 : }
9799 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_package_PrimaryKerberosBlob);
9800 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9801 0 : TALLOC_FREE(tmp_ctx);
9802 0 : PyErr_SetNdrError(err);
9803 0 : return NULL;
9804 : }
9805 :
9806 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9807 0 : TALLOC_FREE(tmp_ctx);
9808 0 : return ret;
9809 : }
9810 :
9811 276 : static PyObject *py_package_PrimaryKerberosBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9812 : {
9813 276 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(py_obj);
9814 276 : DATA_BLOB blob = {.data = NULL, .length = 0};
9815 276 : Py_ssize_t blob_length = 0;
9816 : enum ndr_err_code err;
9817 276 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9818 276 : PyObject *allow_remaining_obj = NULL;
9819 276 : bool allow_remaining = false;
9820 :
9821 276 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
9822 : discard_const_p(char *, kwnames),
9823 : &blob.data, &blob_length,
9824 : &allow_remaining_obj)) {
9825 0 : return NULL;
9826 : }
9827 276 : blob.length = blob_length;
9828 :
9829 276 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9830 0 : allow_remaining = true;
9831 : }
9832 :
9833 276 : if (allow_remaining) {
9834 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob);
9835 : } else {
9836 276 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob);
9837 : }
9838 276 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9839 0 : PyErr_SetNdrError(err);
9840 0 : return NULL;
9841 : }
9842 :
9843 276 : Py_RETURN_NONE;
9844 : }
9845 :
9846 0 : static PyObject *py_package_PrimaryKerberosBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9847 : {
9848 0 : struct package_PrimaryKerberosBlob *object = (struct package_PrimaryKerberosBlob *)pytalloc_get_ptr(py_obj);
9849 : PyObject *ret;
9850 : char *retstr;
9851 :
9852 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_package_PrimaryKerberosBlob, "package_PrimaryKerberosBlob", object);
9853 0 : ret = PyUnicode_FromString(retstr);
9854 0 : talloc_free(retstr);
9855 :
9856 0 : return ret;
9857 : }
9858 :
9859 : static PyMethodDef py_package_PrimaryKerberosBlob_methods[] = {
9860 : { "__ndr_pack__", (PyCFunction)py_package_PrimaryKerberosBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9861 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimaryKerberosBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9862 : { "__ndr_print__", (PyCFunction)py_package_PrimaryKerberosBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
9863 : { NULL, NULL, 0, NULL }
9864 : };
9865 :
9866 :
9867 : static PyTypeObject package_PrimaryKerberosBlob_Type = {
9868 : PyVarObject_HEAD_INIT(NULL, 0)
9869 : .tp_name = "drsblobs.package_PrimaryKerberosBlob",
9870 : .tp_getset = py_package_PrimaryKerberosBlob_getsetters,
9871 : .tp_methods = py_package_PrimaryKerberosBlob_methods,
9872 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9873 : .tp_new = py_package_PrimaryKerberosBlob_new,
9874 : };
9875 :
9876 :
9877 6 : static PyObject *py_package_PrimaryCLEARTEXTBlob_get_cleartext(PyObject *obj, void *closure)
9878 : {
9879 6 : struct package_PrimaryCLEARTEXTBlob *object = (struct package_PrimaryCLEARTEXTBlob *)pytalloc_get_ptr(obj);
9880 : PyObject *py_cleartext;
9881 6 : py_cleartext = PyBytes_FromStringAndSize((char *)(object->cleartext).data, (object->cleartext).length);
9882 6 : return py_cleartext;
9883 : }
9884 :
9885 0 : static int py_package_PrimaryCLEARTEXTBlob_set_cleartext(PyObject *py_obj, PyObject *value, void *closure)
9886 : {
9887 0 : struct package_PrimaryCLEARTEXTBlob *object = (struct package_PrimaryCLEARTEXTBlob *)pytalloc_get_ptr(py_obj);
9888 0 : if (value == NULL) {
9889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cleartext");
9890 0 : return -1;
9891 : }
9892 0 : object->cleartext = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9893 0 : return 0;
9894 : }
9895 :
9896 : static PyGetSetDef py_package_PrimaryCLEARTEXTBlob_getsetters[] = {
9897 : {
9898 : .name = discard_const_p(char, "cleartext"),
9899 : .get = py_package_PrimaryCLEARTEXTBlob_get_cleartext,
9900 : .set = py_package_PrimaryCLEARTEXTBlob_set_cleartext,
9901 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9902 : },
9903 : { .name = NULL }
9904 : };
9905 :
9906 6 : static PyObject *py_package_PrimaryCLEARTEXTBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9907 : {
9908 6 : return pytalloc_new(struct package_PrimaryCLEARTEXTBlob, type);
9909 : }
9910 :
9911 0 : static PyObject *py_package_PrimaryCLEARTEXTBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9912 : {
9913 0 : struct package_PrimaryCLEARTEXTBlob *object = (struct package_PrimaryCLEARTEXTBlob *)pytalloc_get_ptr(py_obj);
9914 0 : PyObject *ret = NULL;
9915 : DATA_BLOB blob;
9916 : enum ndr_err_code err;
9917 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9918 0 : if (tmp_ctx == NULL) {
9919 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9920 0 : return NULL;
9921 : }
9922 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_package_PrimaryCLEARTEXTBlob);
9923 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9924 0 : TALLOC_FREE(tmp_ctx);
9925 0 : PyErr_SetNdrError(err);
9926 0 : return NULL;
9927 : }
9928 :
9929 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9930 0 : TALLOC_FREE(tmp_ctx);
9931 0 : return ret;
9932 : }
9933 :
9934 6 : static PyObject *py_package_PrimaryCLEARTEXTBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9935 : {
9936 6 : struct package_PrimaryCLEARTEXTBlob *object = (struct package_PrimaryCLEARTEXTBlob *)pytalloc_get_ptr(py_obj);
9937 6 : DATA_BLOB blob = {.data = NULL, .length = 0};
9938 6 : Py_ssize_t blob_length = 0;
9939 : enum ndr_err_code err;
9940 6 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9941 6 : PyObject *allow_remaining_obj = NULL;
9942 6 : bool allow_remaining = false;
9943 :
9944 6 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
9945 : discard_const_p(char *, kwnames),
9946 : &blob.data, &blob_length,
9947 : &allow_remaining_obj)) {
9948 0 : return NULL;
9949 : }
9950 6 : blob.length = blob_length;
9951 :
9952 6 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9953 0 : allow_remaining = true;
9954 : }
9955 :
9956 6 : if (allow_remaining) {
9957 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryCLEARTEXTBlob);
9958 : } else {
9959 6 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryCLEARTEXTBlob);
9960 : }
9961 6 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9962 0 : PyErr_SetNdrError(err);
9963 0 : return NULL;
9964 : }
9965 :
9966 6 : Py_RETURN_NONE;
9967 : }
9968 :
9969 0 : static PyObject *py_package_PrimaryCLEARTEXTBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9970 : {
9971 0 : struct package_PrimaryCLEARTEXTBlob *object = (struct package_PrimaryCLEARTEXTBlob *)pytalloc_get_ptr(py_obj);
9972 : PyObject *ret;
9973 : char *retstr;
9974 :
9975 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_package_PrimaryCLEARTEXTBlob, "package_PrimaryCLEARTEXTBlob", object);
9976 0 : ret = PyUnicode_FromString(retstr);
9977 0 : talloc_free(retstr);
9978 :
9979 0 : return ret;
9980 : }
9981 :
9982 : static PyMethodDef py_package_PrimaryCLEARTEXTBlob_methods[] = {
9983 : { "__ndr_pack__", (PyCFunction)py_package_PrimaryCLEARTEXTBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9984 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimaryCLEARTEXTBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9985 : { "__ndr_print__", (PyCFunction)py_package_PrimaryCLEARTEXTBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
9986 : { NULL, NULL, 0, NULL }
9987 : };
9988 :
9989 :
9990 : static PyTypeObject package_PrimaryCLEARTEXTBlob_Type = {
9991 : PyVarObject_HEAD_INIT(NULL, 0)
9992 : .tp_name = "drsblobs.package_PrimaryCLEARTEXTBlob",
9993 : .tp_getset = py_package_PrimaryCLEARTEXTBlob_getsetters,
9994 : .tp_methods = py_package_PrimaryCLEARTEXTBlob_methods,
9995 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9996 : .tp_new = py_package_PrimaryCLEARTEXTBlob_new,
9997 : };
9998 :
9999 :
10000 377 : static PyObject *py_package_PrimaryWDigestHash_get_hash(PyObject *obj, void *closure)
10001 : {
10002 377 : struct package_PrimaryWDigestHash *object = (struct package_PrimaryWDigestHash *)pytalloc_get_ptr(obj);
10003 : PyObject *py_hash;
10004 377 : py_hash = PyList_New(16);
10005 377 : if (py_hash == NULL) {
10006 0 : return NULL;
10007 : }
10008 : {
10009 : int hash_cntr_0;
10010 6409 : for (hash_cntr_0 = 0; hash_cntr_0 < (16); hash_cntr_0++) {
10011 : PyObject *py_hash_0;
10012 6032 : py_hash_0 = PyLong_FromLong((uint16_t)object->hash[hash_cntr_0]);
10013 6032 : PyList_SetItem(py_hash, hash_cntr_0, py_hash_0);
10014 : }
10015 : }
10016 377 : return py_hash;
10017 : }
10018 :
10019 0 : static int py_package_PrimaryWDigestHash_set_hash(PyObject *py_obj, PyObject *value, void *closure)
10020 : {
10021 0 : struct package_PrimaryWDigestHash *object = (struct package_PrimaryWDigestHash *)pytalloc_get_ptr(py_obj);
10022 0 : if (value == NULL) {
10023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
10024 0 : return -1;
10025 : }
10026 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10027 : {
10028 : int hash_cntr_0;
10029 0 : if (ARRAY_SIZE(object->hash) != PyList_GET_SIZE(value)) {
10030 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->hash), PyList_GET_SIZE(value));
10031 0 : return -1;
10032 : }
10033 0 : for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) {
10034 0 : if (PyList_GET_ITEM(value, hash_cntr_0) == NULL) {
10035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash[hash_cntr_0]");
10036 0 : return -1;
10037 : }
10038 : {
10039 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash[hash_cntr_0]));
10040 0 : if (PyLong_Check(PyList_GET_ITEM(value, hash_cntr_0))) {
10041 : unsigned long long test_var;
10042 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, hash_cntr_0));
10043 0 : if (PyErr_Occurred() != NULL) {
10044 0 : return -1;
10045 : }
10046 0 : if (test_var > uint_max) {
10047 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10048 : PyLong_Type.tp_name, uint_max, test_var);
10049 0 : return -1;
10050 : }
10051 0 : object->hash[hash_cntr_0] = test_var;
10052 : } else {
10053 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10054 : PyLong_Type.tp_name);
10055 0 : return -1;
10056 : }
10057 : }
10058 : }
10059 : }
10060 0 : return 0;
10061 : }
10062 :
10063 : static PyGetSetDef py_package_PrimaryWDigestHash_getsetters[] = {
10064 : {
10065 : .name = discard_const_p(char, "hash"),
10066 : .get = py_package_PrimaryWDigestHash_get_hash,
10067 : .set = py_package_PrimaryWDigestHash_set_hash,
10068 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10069 : },
10070 : { .name = NULL }
10071 : };
10072 :
10073 0 : static PyObject *py_package_PrimaryWDigestHash_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10074 : {
10075 0 : return pytalloc_new(struct package_PrimaryWDigestHash, type);
10076 : }
10077 :
10078 :
10079 : static PyTypeObject package_PrimaryWDigestHash_Type = {
10080 : PyVarObject_HEAD_INIT(NULL, 0)
10081 : .tp_name = "drsblobs.package_PrimaryWDigestHash",
10082 : .tp_getset = py_package_PrimaryWDigestHash_getsetters,
10083 : .tp_methods = NULL,
10084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10085 : .tp_new = py_package_PrimaryWDigestHash_new,
10086 : };
10087 :
10088 :
10089 0 : static PyObject *py_package_PrimaryWDigestBlob_get_unknown1(PyObject *obj, void *closure)
10090 : {
10091 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(obj);
10092 : PyObject *py_unknown1;
10093 0 : py_unknown1 = PyLong_FromLong((uint16_t)object->unknown1);
10094 0 : return py_unknown1;
10095 : }
10096 :
10097 0 : static int py_package_PrimaryWDigestBlob_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
10098 : {
10099 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10100 0 : if (value == NULL) {
10101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
10102 0 : return -1;
10103 : }
10104 : {
10105 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
10106 0 : if (PyLong_Check(value)) {
10107 : unsigned long long test_var;
10108 0 : test_var = PyLong_AsUnsignedLongLong(value);
10109 0 : if (PyErr_Occurred() != NULL) {
10110 0 : return -1;
10111 : }
10112 0 : if (test_var > uint_max) {
10113 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10114 : PyLong_Type.tp_name, uint_max, test_var);
10115 0 : return -1;
10116 : }
10117 0 : object->unknown1 = test_var;
10118 : } else {
10119 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10120 : PyLong_Type.tp_name);
10121 0 : return -1;
10122 : }
10123 : }
10124 0 : return 0;
10125 : }
10126 :
10127 0 : static PyObject *py_package_PrimaryWDigestBlob_get_unknown2(PyObject *obj, void *closure)
10128 : {
10129 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(obj);
10130 : PyObject *py_unknown2;
10131 0 : py_unknown2 = PyLong_FromLong((uint16_t)object->unknown2);
10132 0 : return py_unknown2;
10133 : }
10134 :
10135 0 : static int py_package_PrimaryWDigestBlob_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
10136 : {
10137 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10138 0 : if (value == NULL) {
10139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
10140 0 : return -1;
10141 : }
10142 : {
10143 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2));
10144 0 : if (PyLong_Check(value)) {
10145 : unsigned long long test_var;
10146 0 : test_var = PyLong_AsUnsignedLongLong(value);
10147 0 : if (PyErr_Occurred() != NULL) {
10148 0 : return -1;
10149 : }
10150 0 : if (test_var > uint_max) {
10151 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10152 : PyLong_Type.tp_name, uint_max, test_var);
10153 0 : return -1;
10154 : }
10155 0 : object->unknown2 = test_var;
10156 : } else {
10157 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10158 : PyLong_Type.tp_name);
10159 0 : return -1;
10160 : }
10161 : }
10162 0 : return 0;
10163 : }
10164 :
10165 12 : static PyObject *py_package_PrimaryWDigestBlob_get_num_hashes(PyObject *obj, void *closure)
10166 : {
10167 12 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(obj);
10168 : PyObject *py_num_hashes;
10169 12 : py_num_hashes = PyLong_FromLong((uint16_t)object->num_hashes);
10170 12 : return py_num_hashes;
10171 : }
10172 :
10173 0 : static int py_package_PrimaryWDigestBlob_set_num_hashes(PyObject *py_obj, PyObject *value, void *closure)
10174 : {
10175 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10176 0 : if (value == NULL) {
10177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_hashes");
10178 0 : return -1;
10179 : }
10180 : {
10181 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_hashes));
10182 0 : if (PyLong_Check(value)) {
10183 : unsigned long long test_var;
10184 0 : test_var = PyLong_AsUnsignedLongLong(value);
10185 0 : if (PyErr_Occurred() != NULL) {
10186 0 : return -1;
10187 : }
10188 0 : if (test_var > uint_max) {
10189 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10190 : PyLong_Type.tp_name, uint_max, test_var);
10191 0 : return -1;
10192 : }
10193 0 : object->num_hashes = test_var;
10194 : } else {
10195 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10196 : PyLong_Type.tp_name);
10197 0 : return -1;
10198 : }
10199 : }
10200 0 : return 0;
10201 : }
10202 :
10203 0 : static PyObject *py_package_PrimaryWDigestBlob_get_unknown3(PyObject *obj, void *closure)
10204 : {
10205 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(obj);
10206 : PyObject *py_unknown3;
10207 0 : py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3);
10208 0 : return py_unknown3;
10209 : }
10210 :
10211 0 : static int py_package_PrimaryWDigestBlob_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
10212 : {
10213 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10214 0 : if (value == NULL) {
10215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
10216 0 : return -1;
10217 : }
10218 : {
10219 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3));
10220 0 : if (PyLong_Check(value)) {
10221 : unsigned long long test_var;
10222 0 : test_var = PyLong_AsUnsignedLongLong(value);
10223 0 : if (PyErr_Occurred() != NULL) {
10224 0 : return -1;
10225 : }
10226 0 : if (test_var > uint_max) {
10227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10228 : PyLong_Type.tp_name, uint_max, test_var);
10229 0 : return -1;
10230 : }
10231 0 : object->unknown3 = test_var;
10232 : } else {
10233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10234 : PyLong_Type.tp_name);
10235 0 : return -1;
10236 : }
10237 : }
10238 0 : return 0;
10239 : }
10240 :
10241 0 : static PyObject *py_package_PrimaryWDigestBlob_get_uuknown4(PyObject *obj, void *closure)
10242 : {
10243 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(obj);
10244 : PyObject *py_uuknown4;
10245 0 : py_uuknown4 = PyLong_FromUnsignedLongLong(object->uuknown4);
10246 0 : return py_uuknown4;
10247 : }
10248 :
10249 0 : static int py_package_PrimaryWDigestBlob_set_uuknown4(PyObject *py_obj, PyObject *value, void *closure)
10250 : {
10251 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10252 0 : if (value == NULL) {
10253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uuknown4");
10254 0 : return -1;
10255 : }
10256 : {
10257 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uuknown4));
10258 0 : if (PyLong_Check(value)) {
10259 : unsigned long long test_var;
10260 0 : test_var = PyLong_AsUnsignedLongLong(value);
10261 0 : if (PyErr_Occurred() != NULL) {
10262 0 : return -1;
10263 : }
10264 0 : if (test_var > uint_max) {
10265 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10266 : PyLong_Type.tp_name, uint_max, test_var);
10267 0 : return -1;
10268 : }
10269 0 : object->uuknown4 = test_var;
10270 : } else {
10271 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10272 : PyLong_Type.tp_name);
10273 0 : return -1;
10274 : }
10275 : }
10276 0 : return 0;
10277 : }
10278 :
10279 377 : static PyObject *py_package_PrimaryWDigestBlob_get_hashes(PyObject *obj, void *closure)
10280 : {
10281 377 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(obj);
10282 : PyObject *py_hashes;
10283 377 : py_hashes = PyList_New(object->num_hashes);
10284 377 : if (py_hashes == NULL) {
10285 0 : return NULL;
10286 : }
10287 : {
10288 : int hashes_cntr_0;
10289 11310 : for (hashes_cntr_0 = 0; hashes_cntr_0 < (object->num_hashes); hashes_cntr_0++) {
10290 : PyObject *py_hashes_0;
10291 10933 : py_hashes_0 = pytalloc_reference_ex(&package_PrimaryWDigestHash_Type, object->hashes, &object->hashes[hashes_cntr_0]);
10292 10933 : PyList_SetItem(py_hashes, hashes_cntr_0, py_hashes_0);
10293 : }
10294 : }
10295 377 : return py_hashes;
10296 : }
10297 :
10298 0 : static int py_package_PrimaryWDigestBlob_set_hashes(PyObject *py_obj, PyObject *value, void *closure)
10299 : {
10300 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10301 0 : if (value == NULL) {
10302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hashes");
10303 0 : return -1;
10304 : }
10305 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10306 : {
10307 : int hashes_cntr_0;
10308 0 : object->hashes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->hashes, PyList_GET_SIZE(value));
10309 0 : if (!object->hashes) { return -1;; }
10310 0 : talloc_set_name_const(object->hashes, "ARRAY: object->hashes");
10311 0 : for (hashes_cntr_0 = 0; hashes_cntr_0 < PyList_GET_SIZE(value); hashes_cntr_0++) {
10312 0 : if (PyList_GET_ITEM(value, hashes_cntr_0) == NULL) {
10313 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hashes[hashes_cntr_0]");
10314 0 : return -1;
10315 : }
10316 0 : PY_CHECK_TYPE(&package_PrimaryWDigestHash_Type, PyList_GET_ITEM(value, hashes_cntr_0), return -1;);
10317 0 : if (talloc_reference(object->hashes, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, hashes_cntr_0))) == NULL) {
10318 0 : PyErr_NoMemory();
10319 0 : return -1;
10320 : }
10321 0 : object->hashes[hashes_cntr_0] = *(struct package_PrimaryWDigestHash *)pytalloc_get_ptr(PyList_GET_ITEM(value, hashes_cntr_0));
10322 : }
10323 : }
10324 0 : return 0;
10325 : }
10326 :
10327 : static PyGetSetDef py_package_PrimaryWDigestBlob_getsetters[] = {
10328 : {
10329 : .name = discard_const_p(char, "unknown1"),
10330 : .get = py_package_PrimaryWDigestBlob_get_unknown1,
10331 : .set = py_package_PrimaryWDigestBlob_set_unknown1,
10332 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10333 : },
10334 : {
10335 : .name = discard_const_p(char, "unknown2"),
10336 : .get = py_package_PrimaryWDigestBlob_get_unknown2,
10337 : .set = py_package_PrimaryWDigestBlob_set_unknown2,
10338 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10339 : },
10340 : {
10341 : .name = discard_const_p(char, "num_hashes"),
10342 : .get = py_package_PrimaryWDigestBlob_get_num_hashes,
10343 : .set = py_package_PrimaryWDigestBlob_set_num_hashes,
10344 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10345 : },
10346 : {
10347 : .name = discard_const_p(char, "unknown3"),
10348 : .get = py_package_PrimaryWDigestBlob_get_unknown3,
10349 : .set = py_package_PrimaryWDigestBlob_set_unknown3,
10350 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10351 : },
10352 : {
10353 : .name = discard_const_p(char, "uuknown4"),
10354 : .get = py_package_PrimaryWDigestBlob_get_uuknown4,
10355 : .set = py_package_PrimaryWDigestBlob_set_uuknown4,
10356 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
10357 : },
10358 : {
10359 : .name = discard_const_p(char, "hashes"),
10360 : .get = py_package_PrimaryWDigestBlob_get_hashes,
10361 : .set = py_package_PrimaryWDigestBlob_set_hashes,
10362 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryWDigestHash")
10363 : },
10364 : { .name = NULL }
10365 : };
10366 :
10367 41 : static PyObject *py_package_PrimaryWDigestBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10368 : {
10369 41 : return pytalloc_new(struct package_PrimaryWDigestBlob, type);
10370 : }
10371 :
10372 0 : static PyObject *py_package_PrimaryWDigestBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10373 : {
10374 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10375 0 : PyObject *ret = NULL;
10376 : DATA_BLOB blob;
10377 : enum ndr_err_code err;
10378 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10379 0 : if (tmp_ctx == NULL) {
10380 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10381 0 : return NULL;
10382 : }
10383 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_package_PrimaryWDigestBlob);
10384 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10385 0 : TALLOC_FREE(tmp_ctx);
10386 0 : PyErr_SetNdrError(err);
10387 0 : return NULL;
10388 : }
10389 :
10390 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10391 0 : TALLOC_FREE(tmp_ctx);
10392 0 : return ret;
10393 : }
10394 :
10395 41 : static PyObject *py_package_PrimaryWDigestBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10396 : {
10397 41 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10398 41 : DATA_BLOB blob = {.data = NULL, .length = 0};
10399 41 : Py_ssize_t blob_length = 0;
10400 : enum ndr_err_code err;
10401 41 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10402 41 : PyObject *allow_remaining_obj = NULL;
10403 41 : bool allow_remaining = false;
10404 :
10405 41 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10406 : discard_const_p(char *, kwnames),
10407 : &blob.data, &blob_length,
10408 : &allow_remaining_obj)) {
10409 0 : return NULL;
10410 : }
10411 41 : blob.length = blob_length;
10412 :
10413 41 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10414 0 : allow_remaining = true;
10415 : }
10416 :
10417 41 : if (allow_remaining) {
10418 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryWDigestBlob);
10419 : } else {
10420 41 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryWDigestBlob);
10421 : }
10422 41 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10423 0 : PyErr_SetNdrError(err);
10424 0 : return NULL;
10425 : }
10426 :
10427 41 : Py_RETURN_NONE;
10428 : }
10429 :
10430 0 : static PyObject *py_package_PrimaryWDigestBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10431 : {
10432 0 : struct package_PrimaryWDigestBlob *object = (struct package_PrimaryWDigestBlob *)pytalloc_get_ptr(py_obj);
10433 : PyObject *ret;
10434 : char *retstr;
10435 :
10436 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_package_PrimaryWDigestBlob, "package_PrimaryWDigestBlob", object);
10437 0 : ret = PyUnicode_FromString(retstr);
10438 0 : talloc_free(retstr);
10439 :
10440 0 : return ret;
10441 : }
10442 :
10443 : static PyMethodDef py_package_PrimaryWDigestBlob_methods[] = {
10444 : { "__ndr_pack__", (PyCFunction)py_package_PrimaryWDigestBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10445 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimaryWDigestBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10446 : { "__ndr_print__", (PyCFunction)py_package_PrimaryWDigestBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10447 : { NULL, NULL, 0, NULL }
10448 : };
10449 :
10450 :
10451 : static PyTypeObject package_PrimaryWDigestBlob_Type = {
10452 : PyVarObject_HEAD_INIT(NULL, 0)
10453 : .tp_name = "drsblobs.package_PrimaryWDigestBlob",
10454 : .tp_getset = py_package_PrimaryWDigestBlob_getsetters,
10455 : .tp_methods = py_package_PrimaryWDigestBlob_methods,
10456 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10457 : .tp_new = py_package_PrimaryWDigestBlob_new,
10458 : };
10459 :
10460 :
10461 0 : static PyObject *py_package_PrimarySambaGPGBlob_get_gpg_blob(PyObject *obj, void *closure)
10462 : {
10463 0 : struct package_PrimarySambaGPGBlob *object = (struct package_PrimarySambaGPGBlob *)pytalloc_get_ptr(obj);
10464 : PyObject *py_gpg_blob;
10465 0 : py_gpg_blob = PyBytes_FromStringAndSize((char *)(object->gpg_blob).data, (object->gpg_blob).length);
10466 0 : return py_gpg_blob;
10467 : }
10468 :
10469 0 : static int py_package_PrimarySambaGPGBlob_set_gpg_blob(PyObject *py_obj, PyObject *value, void *closure)
10470 : {
10471 0 : struct package_PrimarySambaGPGBlob *object = (struct package_PrimarySambaGPGBlob *)pytalloc_get_ptr(py_obj);
10472 0 : if (value == NULL) {
10473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->gpg_blob");
10474 0 : return -1;
10475 : }
10476 0 : object->gpg_blob = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
10477 0 : return 0;
10478 : }
10479 :
10480 : static PyGetSetDef py_package_PrimarySambaGPGBlob_getsetters[] = {
10481 : {
10482 : .name = discard_const_p(char, "gpg_blob"),
10483 : .get = py_package_PrimarySambaGPGBlob_get_gpg_blob,
10484 : .set = py_package_PrimarySambaGPGBlob_set_gpg_blob,
10485 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
10486 : },
10487 : { .name = NULL }
10488 : };
10489 :
10490 0 : static PyObject *py_package_PrimarySambaGPGBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10491 : {
10492 0 : return pytalloc_new(struct package_PrimarySambaGPGBlob, type);
10493 : }
10494 :
10495 0 : static PyObject *py_package_PrimarySambaGPGBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10496 : {
10497 0 : struct package_PrimarySambaGPGBlob *object = (struct package_PrimarySambaGPGBlob *)pytalloc_get_ptr(py_obj);
10498 0 : PyObject *ret = NULL;
10499 : DATA_BLOB blob;
10500 : enum ndr_err_code err;
10501 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10502 0 : if (tmp_ctx == NULL) {
10503 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10504 0 : return NULL;
10505 : }
10506 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_package_PrimarySambaGPGBlob);
10507 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10508 0 : TALLOC_FREE(tmp_ctx);
10509 0 : PyErr_SetNdrError(err);
10510 0 : return NULL;
10511 : }
10512 :
10513 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10514 0 : TALLOC_FREE(tmp_ctx);
10515 0 : return ret;
10516 : }
10517 :
10518 0 : static PyObject *py_package_PrimarySambaGPGBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10519 : {
10520 0 : struct package_PrimarySambaGPGBlob *object = (struct package_PrimarySambaGPGBlob *)pytalloc_get_ptr(py_obj);
10521 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10522 0 : Py_ssize_t blob_length = 0;
10523 : enum ndr_err_code err;
10524 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10525 0 : PyObject *allow_remaining_obj = NULL;
10526 0 : bool allow_remaining = false;
10527 :
10528 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10529 : discard_const_p(char *, kwnames),
10530 : &blob.data, &blob_length,
10531 : &allow_remaining_obj)) {
10532 0 : return NULL;
10533 : }
10534 0 : blob.length = blob_length;
10535 :
10536 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10537 0 : allow_remaining = true;
10538 : }
10539 :
10540 0 : if (allow_remaining) {
10541 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimarySambaGPGBlob);
10542 : } else {
10543 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimarySambaGPGBlob);
10544 : }
10545 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10546 0 : PyErr_SetNdrError(err);
10547 0 : return NULL;
10548 : }
10549 :
10550 0 : Py_RETURN_NONE;
10551 : }
10552 :
10553 0 : static PyObject *py_package_PrimarySambaGPGBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10554 : {
10555 0 : struct package_PrimarySambaGPGBlob *object = (struct package_PrimarySambaGPGBlob *)pytalloc_get_ptr(py_obj);
10556 : PyObject *ret;
10557 : char *retstr;
10558 :
10559 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_package_PrimarySambaGPGBlob, "package_PrimarySambaGPGBlob", object);
10560 0 : ret = PyUnicode_FromString(retstr);
10561 0 : talloc_free(retstr);
10562 :
10563 0 : return ret;
10564 : }
10565 :
10566 : static PyMethodDef py_package_PrimarySambaGPGBlob_methods[] = {
10567 : { "__ndr_pack__", (PyCFunction)py_package_PrimarySambaGPGBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10568 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimarySambaGPGBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10569 : { "__ndr_print__", (PyCFunction)py_package_PrimarySambaGPGBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10570 : { NULL, NULL, 0, NULL }
10571 : };
10572 :
10573 :
10574 : static PyTypeObject package_PrimarySambaGPGBlob_Type = {
10575 : PyVarObject_HEAD_INIT(NULL, 0)
10576 : .tp_name = "drsblobs.package_PrimarySambaGPGBlob",
10577 : .tp_getset = py_package_PrimarySambaGPGBlob_getsetters,
10578 : .tp_methods = py_package_PrimarySambaGPGBlob_methods,
10579 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10580 : .tp_new = py_package_PrimarySambaGPGBlob_new,
10581 : };
10582 :
10583 :
10584 0 : static PyObject *py_package_PrimaryUserPasswordValue_get_scheme_len(PyObject *obj, void *closure)
10585 : {
10586 0 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(obj);
10587 : PyObject *py_scheme_len;
10588 0 : py_scheme_len = PyLong_FromLong((uint16_t)object->scheme_len);
10589 0 : return py_scheme_len;
10590 : }
10591 :
10592 0 : static int py_package_PrimaryUserPasswordValue_set_scheme_len(PyObject *py_obj, PyObject *value, void *closure)
10593 : {
10594 0 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(py_obj);
10595 0 : if (value == NULL) {
10596 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->scheme_len");
10597 0 : return -1;
10598 : }
10599 : {
10600 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scheme_len));
10601 0 : if (PyLong_Check(value)) {
10602 : unsigned long long test_var;
10603 0 : test_var = PyLong_AsUnsignedLongLong(value);
10604 0 : if (PyErr_Occurred() != NULL) {
10605 0 : return -1;
10606 : }
10607 0 : if (test_var > uint_max) {
10608 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10609 : PyLong_Type.tp_name, uint_max, test_var);
10610 0 : return -1;
10611 : }
10612 0 : object->scheme_len = test_var;
10613 : } else {
10614 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10615 : PyLong_Type.tp_name);
10616 0 : return -1;
10617 : }
10618 : }
10619 0 : return 0;
10620 : }
10621 :
10622 6 : static PyObject *py_package_PrimaryUserPasswordValue_get_scheme(PyObject *obj, void *closure)
10623 : {
10624 6 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(obj);
10625 : PyObject *py_scheme;
10626 6 : if (object->scheme == NULL) {
10627 0 : py_scheme = Py_None;
10628 0 : Py_INCREF(py_scheme);
10629 : } else {
10630 6 : py_scheme = PyUnicode_Decode(object->scheme, strlen(object->scheme), "utf-8", "ignore");
10631 : }
10632 6 : return py_scheme;
10633 : }
10634 :
10635 0 : static int py_package_PrimaryUserPasswordValue_set_scheme(PyObject *py_obj, PyObject *value, void *closure)
10636 : {
10637 0 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(py_obj);
10638 0 : if (value == NULL) {
10639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->scheme");
10640 0 : return -1;
10641 : }
10642 : {
10643 : const char *test_str;
10644 : const char *talloc_str;
10645 0 : PyObject *unicode = NULL;
10646 0 : if (PyUnicode_Check(value)) {
10647 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10648 0 : if (unicode == NULL) {
10649 0 : PyErr_NoMemory();
10650 0 : return -1;
10651 : }
10652 0 : test_str = PyBytes_AS_STRING(unicode);
10653 0 : } else if (PyBytes_Check(value)) {
10654 0 : test_str = PyBytes_AS_STRING(value);
10655 : } else {
10656 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10657 0 : return -1;
10658 : }
10659 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10660 0 : if (unicode != NULL) {
10661 0 : Py_DECREF(unicode);
10662 : }
10663 0 : if (talloc_str == NULL) {
10664 0 : PyErr_NoMemory();
10665 0 : return -1;
10666 : }
10667 0 : object->scheme = talloc_str;
10668 : }
10669 0 : return 0;
10670 : }
10671 :
10672 0 : static PyObject *py_package_PrimaryUserPasswordValue_get_value_len(PyObject *obj, void *closure)
10673 : {
10674 0 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(obj);
10675 : PyObject *py_value_len;
10676 0 : py_value_len = PyLong_FromUnsignedLongLong((uint32_t)object->value_len);
10677 0 : return py_value_len;
10678 : }
10679 :
10680 0 : static int py_package_PrimaryUserPasswordValue_set_value_len(PyObject *py_obj, PyObject *value, void *closure)
10681 : {
10682 0 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(py_obj);
10683 0 : if (value == NULL) {
10684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value_len");
10685 0 : return -1;
10686 : }
10687 : {
10688 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->value_len));
10689 0 : if (PyLong_Check(value)) {
10690 : unsigned long long test_var;
10691 0 : test_var = PyLong_AsUnsignedLongLong(value);
10692 0 : if (PyErr_Occurred() != NULL) {
10693 0 : return -1;
10694 : }
10695 0 : if (test_var > uint_max) {
10696 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10697 : PyLong_Type.tp_name, uint_max, test_var);
10698 0 : return -1;
10699 : }
10700 0 : object->value_len = test_var;
10701 : } else {
10702 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10703 : PyLong_Type.tp_name);
10704 0 : return -1;
10705 : }
10706 : }
10707 0 : return 0;
10708 : }
10709 :
10710 12 : static PyObject *py_package_PrimaryUserPasswordValue_get_value(PyObject *obj, void *closure)
10711 : {
10712 12 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(obj);
10713 : PyObject *py_value;
10714 12 : if (object->value == NULL) {
10715 0 : Py_RETURN_NONE;
10716 : }
10717 12 : if (object->value == NULL) {
10718 0 : py_value = Py_None;
10719 0 : Py_INCREF(py_value);
10720 : } else {
10721 12 : py_value = PyBytes_FromStringAndSize((char *)(*object->value).data, (*object->value).length);
10722 : }
10723 12 : return py_value;
10724 : }
10725 :
10726 0 : static int py_package_PrimaryUserPasswordValue_set_value(PyObject *py_obj, PyObject *value, void *closure)
10727 : {
10728 0 : struct package_PrimaryUserPasswordValue *object = (struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(py_obj);
10729 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->value));
10730 0 : if (value == NULL) {
10731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value");
10732 0 : return -1;
10733 : }
10734 0 : if (value == Py_None) {
10735 0 : object->value = NULL;
10736 : } else {
10737 0 : object->value = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->value);
10738 0 : if (object->value == NULL) {
10739 0 : PyErr_NoMemory();
10740 0 : return -1;
10741 : }
10742 0 : *object->value = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
10743 : }
10744 0 : return 0;
10745 : }
10746 :
10747 : static PyGetSetDef py_package_PrimaryUserPasswordValue_getsetters[] = {
10748 : {
10749 : .name = discard_const_p(char, "scheme_len"),
10750 : .get = py_package_PrimaryUserPasswordValue_get_scheme_len,
10751 : .set = py_package_PrimaryUserPasswordValue_set_scheme_len,
10752 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10753 : },
10754 : {
10755 : .name = discard_const_p(char, "scheme"),
10756 : .get = py_package_PrimaryUserPasswordValue_get_scheme,
10757 : .set = py_package_PrimaryUserPasswordValue_set_scheme,
10758 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10759 : },
10760 : {
10761 : .name = discard_const_p(char, "value_len"),
10762 : .get = py_package_PrimaryUserPasswordValue_get_value_len,
10763 : .set = py_package_PrimaryUserPasswordValue_set_value_len,
10764 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10765 : },
10766 : {
10767 : .name = discard_const_p(char, "value"),
10768 : .get = py_package_PrimaryUserPasswordValue_get_value,
10769 : .set = py_package_PrimaryUserPasswordValue_set_value,
10770 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
10771 : },
10772 : { .name = NULL }
10773 : };
10774 :
10775 0 : static PyObject *py_package_PrimaryUserPasswordValue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10776 : {
10777 0 : return pytalloc_new(struct package_PrimaryUserPasswordValue, type);
10778 : }
10779 :
10780 :
10781 : static PyTypeObject package_PrimaryUserPasswordValue_Type = {
10782 : PyVarObject_HEAD_INIT(NULL, 0)
10783 : .tp_name = "drsblobs.package_PrimaryUserPasswordValue",
10784 : .tp_getset = py_package_PrimaryUserPasswordValue_getsetters,
10785 : .tp_methods = NULL,
10786 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10787 : .tp_new = py_package_PrimaryUserPasswordValue_new,
10788 : };
10789 :
10790 :
10791 6 : static PyObject *py_package_PrimaryUserPasswordBlob_get_current_nt_hash(PyObject *obj, void *closure)
10792 : {
10793 6 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(obj);
10794 : PyObject *py_current_nt_hash;
10795 6 : py_current_nt_hash = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->current_nt_hash);
10796 6 : return py_current_nt_hash;
10797 : }
10798 :
10799 0 : static int py_package_PrimaryUserPasswordBlob_set_current_nt_hash(PyObject *py_obj, PyObject *value, void *closure)
10800 : {
10801 0 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(py_obj);
10802 0 : if (value == NULL) {
10803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_nt_hash");
10804 0 : return -1;
10805 : }
10806 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
10807 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10808 0 : PyErr_NoMemory();
10809 0 : return -1;
10810 : }
10811 0 : object->current_nt_hash = *(struct samr_Password *)pytalloc_get_ptr(value);
10812 0 : return 0;
10813 : }
10814 :
10815 6 : static PyObject *py_package_PrimaryUserPasswordBlob_get_num_hashes(PyObject *obj, void *closure)
10816 : {
10817 6 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(obj);
10818 : PyObject *py_num_hashes;
10819 6 : py_num_hashes = PyLong_FromLong((uint16_t)object->num_hashes);
10820 6 : return py_num_hashes;
10821 : }
10822 :
10823 0 : static int py_package_PrimaryUserPasswordBlob_set_num_hashes(PyObject *py_obj, PyObject *value, void *closure)
10824 : {
10825 0 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(py_obj);
10826 0 : if (value == NULL) {
10827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_hashes");
10828 0 : return -1;
10829 : }
10830 : {
10831 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_hashes));
10832 0 : if (PyLong_Check(value)) {
10833 : unsigned long long test_var;
10834 0 : test_var = PyLong_AsUnsignedLongLong(value);
10835 0 : if (PyErr_Occurred() != NULL) {
10836 0 : return -1;
10837 : }
10838 0 : if (test_var > uint_max) {
10839 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10840 : PyLong_Type.tp_name, uint_max, test_var);
10841 0 : return -1;
10842 : }
10843 0 : object->num_hashes = test_var;
10844 : } else {
10845 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10846 : PyLong_Type.tp_name);
10847 0 : return -1;
10848 : }
10849 : }
10850 0 : return 0;
10851 : }
10852 :
10853 18 : static PyObject *py_package_PrimaryUserPasswordBlob_get_hashes(PyObject *obj, void *closure)
10854 : {
10855 18 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(obj);
10856 : PyObject *py_hashes;
10857 18 : py_hashes = PyList_New(object->num_hashes);
10858 18 : if (py_hashes == NULL) {
10859 0 : return NULL;
10860 : }
10861 : {
10862 : int hashes_cntr_0;
10863 36 : for (hashes_cntr_0 = 0; hashes_cntr_0 < (object->num_hashes); hashes_cntr_0++) {
10864 : PyObject *py_hashes_0;
10865 18 : py_hashes_0 = pytalloc_reference_ex(&package_PrimaryUserPasswordValue_Type, object->hashes, &object->hashes[hashes_cntr_0]);
10866 18 : PyList_SetItem(py_hashes, hashes_cntr_0, py_hashes_0);
10867 : }
10868 : }
10869 18 : return py_hashes;
10870 : }
10871 :
10872 0 : static int py_package_PrimaryUserPasswordBlob_set_hashes(PyObject *py_obj, PyObject *value, void *closure)
10873 : {
10874 0 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(py_obj);
10875 0 : if (value == NULL) {
10876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hashes");
10877 0 : return -1;
10878 : }
10879 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10880 : {
10881 : int hashes_cntr_0;
10882 0 : object->hashes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->hashes, PyList_GET_SIZE(value));
10883 0 : if (!object->hashes) { return -1;; }
10884 0 : talloc_set_name_const(object->hashes, "ARRAY: object->hashes");
10885 0 : for (hashes_cntr_0 = 0; hashes_cntr_0 < PyList_GET_SIZE(value); hashes_cntr_0++) {
10886 0 : if (PyList_GET_ITEM(value, hashes_cntr_0) == NULL) {
10887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hashes[hashes_cntr_0]");
10888 0 : return -1;
10889 : }
10890 0 : PY_CHECK_TYPE(&package_PrimaryUserPasswordValue_Type, PyList_GET_ITEM(value, hashes_cntr_0), return -1;);
10891 0 : if (talloc_reference(object->hashes, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, hashes_cntr_0))) == NULL) {
10892 0 : PyErr_NoMemory();
10893 0 : return -1;
10894 : }
10895 0 : object->hashes[hashes_cntr_0] = *(struct package_PrimaryUserPasswordValue *)pytalloc_get_ptr(PyList_GET_ITEM(value, hashes_cntr_0));
10896 : }
10897 : }
10898 0 : return 0;
10899 : }
10900 :
10901 : static PyGetSetDef py_package_PrimaryUserPasswordBlob_getsetters[] = {
10902 : {
10903 : .name = discard_const_p(char, "current_nt_hash"),
10904 : .get = py_package_PrimaryUserPasswordBlob_get_current_nt_hash,
10905 : .set = py_package_PrimaryUserPasswordBlob_set_current_nt_hash,
10906 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
10907 : },
10908 : {
10909 : .name = discard_const_p(char, "num_hashes"),
10910 : .get = py_package_PrimaryUserPasswordBlob_get_num_hashes,
10911 : .set = py_package_PrimaryUserPasswordBlob_set_num_hashes,
10912 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10913 : },
10914 : {
10915 : .name = discard_const_p(char, "hashes"),
10916 : .get = py_package_PrimaryUserPasswordBlob_get_hashes,
10917 : .set = py_package_PrimaryUserPasswordBlob_set_hashes,
10918 : .doc = discard_const_p(char, "PIDL-generated element of base type package_PrimaryUserPasswordValue")
10919 : },
10920 : { .name = NULL }
10921 : };
10922 :
10923 6 : static PyObject *py_package_PrimaryUserPasswordBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10924 : {
10925 6 : return pytalloc_new(struct package_PrimaryUserPasswordBlob, type);
10926 : }
10927 :
10928 0 : static PyObject *py_package_PrimaryUserPasswordBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10929 : {
10930 0 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(py_obj);
10931 0 : PyObject *ret = NULL;
10932 : DATA_BLOB blob;
10933 : enum ndr_err_code err;
10934 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10935 0 : if (tmp_ctx == NULL) {
10936 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10937 0 : return NULL;
10938 : }
10939 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_package_PrimaryUserPasswordBlob);
10940 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10941 0 : TALLOC_FREE(tmp_ctx);
10942 0 : PyErr_SetNdrError(err);
10943 0 : return NULL;
10944 : }
10945 :
10946 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10947 0 : TALLOC_FREE(tmp_ctx);
10948 0 : return ret;
10949 : }
10950 :
10951 6 : static PyObject *py_package_PrimaryUserPasswordBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10952 : {
10953 6 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(py_obj);
10954 6 : DATA_BLOB blob = {.data = NULL, .length = 0};
10955 6 : Py_ssize_t blob_length = 0;
10956 : enum ndr_err_code err;
10957 6 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10958 6 : PyObject *allow_remaining_obj = NULL;
10959 6 : bool allow_remaining = false;
10960 :
10961 6 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10962 : discard_const_p(char *, kwnames),
10963 : &blob.data, &blob_length,
10964 : &allow_remaining_obj)) {
10965 0 : return NULL;
10966 : }
10967 6 : blob.length = blob_length;
10968 :
10969 6 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10970 0 : allow_remaining = true;
10971 : }
10972 :
10973 6 : if (allow_remaining) {
10974 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryUserPasswordBlob);
10975 : } else {
10976 6 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryUserPasswordBlob);
10977 : }
10978 6 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10979 0 : PyErr_SetNdrError(err);
10980 0 : return NULL;
10981 : }
10982 :
10983 6 : Py_RETURN_NONE;
10984 : }
10985 :
10986 0 : static PyObject *py_package_PrimaryUserPasswordBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10987 : {
10988 0 : struct package_PrimaryUserPasswordBlob *object = (struct package_PrimaryUserPasswordBlob *)pytalloc_get_ptr(py_obj);
10989 : PyObject *ret;
10990 : char *retstr;
10991 :
10992 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_package_PrimaryUserPasswordBlob, "package_PrimaryUserPasswordBlob", object);
10993 0 : ret = PyUnicode_FromString(retstr);
10994 0 : talloc_free(retstr);
10995 :
10996 0 : return ret;
10997 : }
10998 :
10999 : static PyMethodDef py_package_PrimaryUserPasswordBlob_methods[] = {
11000 : { "__ndr_pack__", (PyCFunction)py_package_PrimaryUserPasswordBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11001 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_package_PrimaryUserPasswordBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11002 : { "__ndr_print__", (PyCFunction)py_package_PrimaryUserPasswordBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11003 : { NULL, NULL, 0, NULL }
11004 : };
11005 :
11006 :
11007 : static PyTypeObject package_PrimaryUserPasswordBlob_Type = {
11008 : PyVarObject_HEAD_INIT(NULL, 0)
11009 : .tp_name = "drsblobs.package_PrimaryUserPasswordBlob",
11010 : .tp_getset = py_package_PrimaryUserPasswordBlob_getsetters,
11011 : .tp_methods = py_package_PrimaryUserPasswordBlob_methods,
11012 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11013 : .tp_new = py_package_PrimaryUserPasswordBlob_new,
11014 : };
11015 :
11016 :
11017 0 : static PyObject *py_AuthInfoNone_get_size(PyObject *obj, void *closure)
11018 : {
11019 0 : struct AuthInfoNone *object = (struct AuthInfoNone *)pytalloc_get_ptr(obj);
11020 : PyObject *py_size;
11021 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
11022 0 : return py_size;
11023 : }
11024 :
11025 0 : static int py_AuthInfoNone_set_size(PyObject *py_obj, PyObject *value, void *closure)
11026 : {
11027 0 : struct AuthInfoNone *object = (struct AuthInfoNone *)pytalloc_get_ptr(py_obj);
11028 0 : if (value == NULL) {
11029 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
11030 0 : return -1;
11031 : }
11032 : {
11033 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
11034 0 : if (PyLong_Check(value)) {
11035 : unsigned long long test_var;
11036 0 : test_var = PyLong_AsUnsignedLongLong(value);
11037 0 : if (PyErr_Occurred() != NULL) {
11038 0 : return -1;
11039 : }
11040 0 : if (test_var > uint_max) {
11041 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11042 : PyLong_Type.tp_name, uint_max, test_var);
11043 0 : return -1;
11044 : }
11045 0 : object->size = test_var;
11046 : } else {
11047 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11048 : PyLong_Type.tp_name);
11049 0 : return -1;
11050 : }
11051 : }
11052 0 : return 0;
11053 : }
11054 :
11055 : static PyGetSetDef py_AuthInfoNone_getsetters[] = {
11056 : {
11057 : .name = discard_const_p(char, "size"),
11058 : .get = py_AuthInfoNone_get_size,
11059 : .set = py_AuthInfoNone_set_size,
11060 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11061 : },
11062 : { .name = NULL }
11063 : };
11064 :
11065 0 : static PyObject *py_AuthInfoNone_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11066 : {
11067 0 : return pytalloc_new(struct AuthInfoNone, type);
11068 : }
11069 :
11070 :
11071 : static PyTypeObject AuthInfoNone_Type = {
11072 : PyVarObject_HEAD_INIT(NULL, 0)
11073 : .tp_name = "drsblobs.AuthInfoNone",
11074 : .tp_getset = py_AuthInfoNone_getsetters,
11075 : .tp_methods = NULL,
11076 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11077 : .tp_new = py_AuthInfoNone_new,
11078 : };
11079 :
11080 :
11081 0 : static PyObject *py_AuthInfoNT4Owf_get_size(PyObject *obj, void *closure)
11082 : {
11083 0 : struct AuthInfoNT4Owf *object = (struct AuthInfoNT4Owf *)pytalloc_get_ptr(obj);
11084 : PyObject *py_size;
11085 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
11086 0 : return py_size;
11087 : }
11088 :
11089 0 : static int py_AuthInfoNT4Owf_set_size(PyObject *py_obj, PyObject *value, void *closure)
11090 : {
11091 0 : struct AuthInfoNT4Owf *object = (struct AuthInfoNT4Owf *)pytalloc_get_ptr(py_obj);
11092 0 : if (value == NULL) {
11093 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
11094 0 : return -1;
11095 : }
11096 : {
11097 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
11098 0 : if (PyLong_Check(value)) {
11099 : unsigned long long test_var;
11100 0 : test_var = PyLong_AsUnsignedLongLong(value);
11101 0 : if (PyErr_Occurred() != NULL) {
11102 0 : return -1;
11103 : }
11104 0 : if (test_var > uint_max) {
11105 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11106 : PyLong_Type.tp_name, uint_max, test_var);
11107 0 : return -1;
11108 : }
11109 0 : object->size = test_var;
11110 : } else {
11111 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11112 : PyLong_Type.tp_name);
11113 0 : return -1;
11114 : }
11115 : }
11116 0 : return 0;
11117 : }
11118 :
11119 0 : static PyObject *py_AuthInfoNT4Owf_get_password(PyObject *obj, void *closure)
11120 : {
11121 0 : struct AuthInfoNT4Owf *object = (struct AuthInfoNT4Owf *)pytalloc_get_ptr(obj);
11122 : PyObject *py_password;
11123 0 : py_password = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->password);
11124 0 : return py_password;
11125 : }
11126 :
11127 0 : static int py_AuthInfoNT4Owf_set_password(PyObject *py_obj, PyObject *value, void *closure)
11128 : {
11129 0 : struct AuthInfoNT4Owf *object = (struct AuthInfoNT4Owf *)pytalloc_get_ptr(py_obj);
11130 0 : if (value == NULL) {
11131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
11132 0 : return -1;
11133 : }
11134 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
11135 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11136 0 : PyErr_NoMemory();
11137 0 : return -1;
11138 : }
11139 0 : object->password = *(struct samr_Password *)pytalloc_get_ptr(value);
11140 0 : return 0;
11141 : }
11142 :
11143 : static PyGetSetDef py_AuthInfoNT4Owf_getsetters[] = {
11144 : {
11145 : .name = discard_const_p(char, "size"),
11146 : .get = py_AuthInfoNT4Owf_get_size,
11147 : .set = py_AuthInfoNT4Owf_set_size,
11148 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11149 : },
11150 : {
11151 : .name = discard_const_p(char, "password"),
11152 : .get = py_AuthInfoNT4Owf_get_password,
11153 : .set = py_AuthInfoNT4Owf_set_password,
11154 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
11155 : },
11156 : { .name = NULL }
11157 : };
11158 :
11159 0 : static PyObject *py_AuthInfoNT4Owf_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11160 : {
11161 0 : return pytalloc_new(struct AuthInfoNT4Owf, type);
11162 : }
11163 :
11164 :
11165 : static PyTypeObject AuthInfoNT4Owf_Type = {
11166 : PyVarObject_HEAD_INIT(NULL, 0)
11167 : .tp_name = "drsblobs.AuthInfoNT4Owf",
11168 : .tp_getset = py_AuthInfoNT4Owf_getsetters,
11169 : .tp_methods = NULL,
11170 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11171 : .tp_new = py_AuthInfoNT4Owf_new,
11172 : };
11173 :
11174 :
11175 0 : static PyObject *py_AuthInfoClear_get_size(PyObject *obj, void *closure)
11176 : {
11177 0 : struct AuthInfoClear *object = (struct AuthInfoClear *)pytalloc_get_ptr(obj);
11178 : PyObject *py_size;
11179 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
11180 0 : return py_size;
11181 : }
11182 :
11183 19 : static int py_AuthInfoClear_set_size(PyObject *py_obj, PyObject *value, void *closure)
11184 : {
11185 19 : struct AuthInfoClear *object = (struct AuthInfoClear *)pytalloc_get_ptr(py_obj);
11186 19 : if (value == NULL) {
11187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
11188 0 : return -1;
11189 : }
11190 : {
11191 19 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
11192 19 : if (PyLong_Check(value)) {
11193 : unsigned long long test_var;
11194 19 : test_var = PyLong_AsUnsignedLongLong(value);
11195 19 : if (PyErr_Occurred() != NULL) {
11196 0 : return -1;
11197 : }
11198 19 : if (test_var > uint_max) {
11199 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11200 : PyLong_Type.tp_name, uint_max, test_var);
11201 0 : return -1;
11202 : }
11203 19 : object->size = test_var;
11204 : } else {
11205 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11206 : PyLong_Type.tp_name);
11207 0 : return -1;
11208 : }
11209 : }
11210 19 : return 0;
11211 : }
11212 :
11213 0 : static PyObject *py_AuthInfoClear_get_password(PyObject *obj, void *closure)
11214 : {
11215 0 : struct AuthInfoClear *object = (struct AuthInfoClear *)pytalloc_get_ptr(obj);
11216 : PyObject *py_password;
11217 0 : py_password = PyList_New(object->size);
11218 0 : if (py_password == NULL) {
11219 0 : return NULL;
11220 : }
11221 : {
11222 : int password_cntr_0;
11223 0 : for (password_cntr_0 = 0; password_cntr_0 < (object->size); password_cntr_0++) {
11224 : PyObject *py_password_0;
11225 0 : py_password_0 = PyLong_FromLong((uint16_t)object->password[password_cntr_0]);
11226 0 : PyList_SetItem(py_password, password_cntr_0, py_password_0);
11227 : }
11228 : }
11229 0 : return py_password;
11230 : }
11231 :
11232 19 : static int py_AuthInfoClear_set_password(PyObject *py_obj, PyObject *value, void *closure)
11233 : {
11234 19 : struct AuthInfoClear *object = (struct AuthInfoClear *)pytalloc_get_ptr(py_obj);
11235 19 : if (value == NULL) {
11236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
11237 0 : return -1;
11238 : }
11239 19 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11240 : {
11241 : int password_cntr_0;
11242 19 : object->password = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->password, PyList_GET_SIZE(value));
11243 19 : if (!object->password) { return -1;; }
11244 19 : talloc_set_name_const(object->password, "ARRAY: object->password");
11245 4579 : for (password_cntr_0 = 0; password_cntr_0 < PyList_GET_SIZE(value); password_cntr_0++) {
11246 4560 : if (PyList_GET_ITEM(value, password_cntr_0) == NULL) {
11247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password[password_cntr_0]");
11248 0 : return -1;
11249 : }
11250 : {
11251 4560 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password[password_cntr_0]));
11252 4560 : if (PyLong_Check(PyList_GET_ITEM(value, password_cntr_0))) {
11253 : unsigned long long test_var;
11254 4560 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, password_cntr_0));
11255 4560 : if (PyErr_Occurred() != NULL) {
11256 0 : return -1;
11257 : }
11258 4560 : if (test_var > uint_max) {
11259 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11260 : PyLong_Type.tp_name, uint_max, test_var);
11261 0 : return -1;
11262 : }
11263 4560 : object->password[password_cntr_0] = test_var;
11264 : } else {
11265 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11266 : PyLong_Type.tp_name);
11267 0 : return -1;
11268 : }
11269 : }
11270 : }
11271 : }
11272 19 : return 0;
11273 : }
11274 :
11275 : static PyGetSetDef py_AuthInfoClear_getsetters[] = {
11276 : {
11277 : .name = discard_const_p(char, "size"),
11278 : .get = py_AuthInfoClear_get_size,
11279 : .set = py_AuthInfoClear_set_size,
11280 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11281 : },
11282 : {
11283 : .name = discard_const_p(char, "password"),
11284 : .get = py_AuthInfoClear_get_password,
11285 : .set = py_AuthInfoClear_set_password,
11286 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11287 : },
11288 : { .name = NULL }
11289 : };
11290 :
11291 19 : static PyObject *py_AuthInfoClear_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11292 : {
11293 19 : return pytalloc_new(struct AuthInfoClear, type);
11294 : }
11295 :
11296 :
11297 : static PyTypeObject AuthInfoClear_Type = {
11298 : PyVarObject_HEAD_INIT(NULL, 0)
11299 : .tp_name = "drsblobs.AuthInfoClear",
11300 : .tp_getset = py_AuthInfoClear_getsetters,
11301 : .tp_methods = NULL,
11302 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11303 : .tp_new = py_AuthInfoClear_new,
11304 : };
11305 :
11306 :
11307 0 : static PyObject *py_AuthInfoVersion_get_size(PyObject *obj, void *closure)
11308 : {
11309 0 : struct AuthInfoVersion *object = (struct AuthInfoVersion *)pytalloc_get_ptr(obj);
11310 : PyObject *py_size;
11311 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
11312 0 : return py_size;
11313 : }
11314 :
11315 0 : static int py_AuthInfoVersion_set_size(PyObject *py_obj, PyObject *value, void *closure)
11316 : {
11317 0 : struct AuthInfoVersion *object = (struct AuthInfoVersion *)pytalloc_get_ptr(py_obj);
11318 0 : if (value == NULL) {
11319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
11320 0 : return -1;
11321 : }
11322 : {
11323 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
11324 0 : if (PyLong_Check(value)) {
11325 : unsigned long long test_var;
11326 0 : test_var = PyLong_AsUnsignedLongLong(value);
11327 0 : if (PyErr_Occurred() != NULL) {
11328 0 : return -1;
11329 : }
11330 0 : if (test_var > uint_max) {
11331 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11332 : PyLong_Type.tp_name, uint_max, test_var);
11333 0 : return -1;
11334 : }
11335 0 : object->size = test_var;
11336 : } else {
11337 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11338 : PyLong_Type.tp_name);
11339 0 : return -1;
11340 : }
11341 : }
11342 0 : return 0;
11343 : }
11344 :
11345 0 : static PyObject *py_AuthInfoVersion_get_version(PyObject *obj, void *closure)
11346 : {
11347 0 : struct AuthInfoVersion *object = (struct AuthInfoVersion *)pytalloc_get_ptr(obj);
11348 : PyObject *py_version;
11349 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
11350 0 : return py_version;
11351 : }
11352 :
11353 0 : static int py_AuthInfoVersion_set_version(PyObject *py_obj, PyObject *value, void *closure)
11354 : {
11355 0 : struct AuthInfoVersion *object = (struct AuthInfoVersion *)pytalloc_get_ptr(py_obj);
11356 0 : if (value == NULL) {
11357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
11358 0 : return -1;
11359 : }
11360 : {
11361 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
11362 0 : if (PyLong_Check(value)) {
11363 : unsigned long long test_var;
11364 0 : test_var = PyLong_AsUnsignedLongLong(value);
11365 0 : if (PyErr_Occurred() != NULL) {
11366 0 : return -1;
11367 : }
11368 0 : if (test_var > uint_max) {
11369 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11370 : PyLong_Type.tp_name, uint_max, test_var);
11371 0 : return -1;
11372 : }
11373 0 : object->version = test_var;
11374 : } else {
11375 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11376 : PyLong_Type.tp_name);
11377 0 : return -1;
11378 : }
11379 : }
11380 0 : return 0;
11381 : }
11382 :
11383 : static PyGetSetDef py_AuthInfoVersion_getsetters[] = {
11384 : {
11385 : .name = discard_const_p(char, "size"),
11386 : .get = py_AuthInfoVersion_get_size,
11387 : .set = py_AuthInfoVersion_set_size,
11388 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11389 : },
11390 : {
11391 : .name = discard_const_p(char, "version"),
11392 : .get = py_AuthInfoVersion_get_version,
11393 : .set = py_AuthInfoVersion_set_version,
11394 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11395 : },
11396 : { .name = NULL }
11397 : };
11398 :
11399 0 : static PyObject *py_AuthInfoVersion_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11400 : {
11401 0 : return pytalloc_new(struct AuthInfoVersion, type);
11402 : }
11403 :
11404 :
11405 : static PyTypeObject AuthInfoVersion_Type = {
11406 : PyVarObject_HEAD_INIT(NULL, 0)
11407 : .tp_name = "drsblobs.AuthInfoVersion",
11408 : .tp_getset = py_AuthInfoVersion_getsetters,
11409 : .tp_methods = NULL,
11410 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11411 : .tp_new = py_AuthInfoVersion_new,
11412 : };
11413 :
11414 0 : static PyObject *py_import_AuthInfo(TALLOC_CTX *mem_ctx, int level, union AuthInfo *in)
11415 : {
11416 : PyObject *ret;
11417 :
11418 0 : switch (level) {
11419 0 : case TRUST_AUTH_TYPE_NONE:
11420 0 : ret = pytalloc_reference_ex(&AuthInfoNone_Type, mem_ctx, &in->none);
11421 0 : return ret;
11422 :
11423 0 : case TRUST_AUTH_TYPE_NT4OWF:
11424 0 : ret = pytalloc_reference_ex(&AuthInfoNT4Owf_Type, mem_ctx, &in->nt4owf);
11425 0 : return ret;
11426 :
11427 0 : case TRUST_AUTH_TYPE_CLEAR:
11428 0 : ret = pytalloc_reference_ex(&AuthInfoClear_Type, mem_ctx, &in->clear);
11429 0 : return ret;
11430 :
11431 0 : case TRUST_AUTH_TYPE_VERSION:
11432 0 : ret = pytalloc_reference_ex(&AuthInfoVersion_Type, mem_ctx, &in->version);
11433 0 : return ret;
11434 :
11435 : }
11436 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11437 0 : return NULL;
11438 : }
11439 :
11440 19 : static union AuthInfo *py_export_AuthInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11441 : {
11442 19 : union AuthInfo *ret = talloc_zero(mem_ctx, union AuthInfo);
11443 19 : switch (level) {
11444 0 : case TRUST_AUTH_TYPE_NONE:
11445 0 : if (in == NULL) {
11446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->none");
11447 0 : talloc_free(ret); return NULL;
11448 : }
11449 0 : PY_CHECK_TYPE(&AuthInfoNone_Type, in, talloc_free(ret); return NULL;);
11450 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11451 0 : PyErr_NoMemory();
11452 0 : talloc_free(ret); return NULL;
11453 : }
11454 0 : ret->none = *(struct AuthInfoNone *)pytalloc_get_ptr(in);
11455 0 : break;
11456 :
11457 0 : case TRUST_AUTH_TYPE_NT4OWF:
11458 0 : if (in == NULL) {
11459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt4owf");
11460 0 : talloc_free(ret); return NULL;
11461 : }
11462 0 : PY_CHECK_TYPE(&AuthInfoNT4Owf_Type, in, talloc_free(ret); return NULL;);
11463 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11464 0 : PyErr_NoMemory();
11465 0 : talloc_free(ret); return NULL;
11466 : }
11467 0 : ret->nt4owf = *(struct AuthInfoNT4Owf *)pytalloc_get_ptr(in);
11468 0 : break;
11469 :
11470 19 : case TRUST_AUTH_TYPE_CLEAR:
11471 19 : if (in == NULL) {
11472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->clear");
11473 0 : talloc_free(ret); return NULL;
11474 : }
11475 19 : PY_CHECK_TYPE(&AuthInfoClear_Type, in, talloc_free(ret); return NULL;);
11476 19 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11477 0 : PyErr_NoMemory();
11478 0 : talloc_free(ret); return NULL;
11479 : }
11480 19 : ret->clear = *(struct AuthInfoClear *)pytalloc_get_ptr(in);
11481 19 : break;
11482 :
11483 0 : case TRUST_AUTH_TYPE_VERSION:
11484 0 : if (in == NULL) {
11485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->version");
11486 0 : talloc_free(ret); return NULL;
11487 : }
11488 0 : PY_CHECK_TYPE(&AuthInfoVersion_Type, in, talloc_free(ret); return NULL;);
11489 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11490 0 : PyErr_NoMemory();
11491 0 : talloc_free(ret); return NULL;
11492 : }
11493 0 : ret->version = *(struct AuthInfoVersion *)pytalloc_get_ptr(in);
11494 0 : break;
11495 :
11496 0 : default:
11497 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
11498 0 : talloc_free(ret);
11499 0 : ret = NULL;
11500 : }
11501 :
11502 19 : return ret;
11503 : }
11504 :
11505 0 : static PyObject *py_AuthInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11506 : {
11507 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11508 0 : PyObject *mem_ctx_obj = NULL;
11509 0 : TALLOC_CTX *mem_ctx = NULL;
11510 0 : int level = 0;
11511 0 : PyObject *in_obj = NULL;
11512 0 : union AuthInfo *in = NULL;
11513 :
11514 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11515 : discard_const_p(char *, kwnames),
11516 : &mem_ctx_obj,
11517 : &level,
11518 : &in_obj)) {
11519 0 : return NULL;
11520 : }
11521 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11522 0 : if (mem_ctx == NULL) {
11523 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11524 0 : return NULL;
11525 : }
11526 0 : in = (union AuthInfo *)pytalloc_get_ptr(in_obj);
11527 0 : if (in == NULL) {
11528 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union AuthInfo!");
11529 0 : return NULL;
11530 : }
11531 :
11532 0 : return py_import_AuthInfo(mem_ctx, level, in);
11533 : }
11534 :
11535 19 : static PyObject *py_AuthInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11536 : {
11537 19 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11538 19 : PyObject *mem_ctx_obj = NULL;
11539 19 : TALLOC_CTX *mem_ctx = NULL;
11540 19 : int level = 0;
11541 19 : PyObject *in = NULL;
11542 19 : union AuthInfo *out = NULL;
11543 :
11544 19 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11545 : discard_const_p(char *, kwnames),
11546 : &mem_ctx_obj,
11547 : &level,
11548 : &in)) {
11549 0 : return NULL;
11550 : }
11551 19 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11552 19 : if (mem_ctx == NULL) {
11553 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11554 0 : return NULL;
11555 : }
11556 :
11557 19 : out = py_export_AuthInfo(mem_ctx, level, in);
11558 19 : if (out == NULL) {
11559 0 : return NULL;
11560 : }
11561 :
11562 19 : return pytalloc_GenericObject_reference(out);
11563 : }
11564 :
11565 : static PyMethodDef py_AuthInfo_methods[] = {
11566 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_AuthInfo_import),
11567 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11568 : "T.__import__(mem_ctx, level, in) => ret." },
11569 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_AuthInfo_export),
11570 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11571 : "T.__export__(mem_ctx, level, in) => ret." },
11572 : { NULL, NULL, 0, NULL }
11573 : };
11574 :
11575 0 : static PyObject *py_AuthInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11576 : {
11577 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
11578 0 : return NULL;
11579 : }
11580 :
11581 :
11582 : static PyTypeObject AuthInfo_Type = {
11583 : PyVarObject_HEAD_INIT(NULL, 0)
11584 : .tp_name = "drsblobs.AuthInfo",
11585 : .tp_getset = NULL,
11586 : .tp_methods = py_AuthInfo_methods,
11587 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11588 : .tp_new = py_AuthInfo_new,
11589 : };
11590 :
11591 :
11592 0 : static PyObject *py_AuthenticationInformation_get_LastUpdateTime(PyObject *obj, void *closure)
11593 : {
11594 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(obj);
11595 : PyObject *py_LastUpdateTime;
11596 0 : py_LastUpdateTime = PyLong_FromUnsignedLongLong(object->LastUpdateTime);
11597 0 : return py_LastUpdateTime;
11598 : }
11599 :
11600 19 : static int py_AuthenticationInformation_set_LastUpdateTime(PyObject *py_obj, PyObject *value, void *closure)
11601 : {
11602 19 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11603 19 : if (value == NULL) {
11604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->LastUpdateTime");
11605 0 : return -1;
11606 : }
11607 : {
11608 19 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->LastUpdateTime));
11609 19 : if (PyLong_Check(value)) {
11610 : unsigned long long test_var;
11611 19 : test_var = PyLong_AsUnsignedLongLong(value);
11612 19 : if (PyErr_Occurred() != NULL) {
11613 0 : return -1;
11614 : }
11615 19 : if (test_var > uint_max) {
11616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11617 : PyLong_Type.tp_name, uint_max, test_var);
11618 0 : return -1;
11619 : }
11620 19 : object->LastUpdateTime = test_var;
11621 : } else {
11622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11623 : PyLong_Type.tp_name);
11624 0 : return -1;
11625 : }
11626 : }
11627 19 : return 0;
11628 : }
11629 :
11630 0 : static PyObject *py_AuthenticationInformation_get_AuthType(PyObject *obj, void *closure)
11631 : {
11632 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(obj);
11633 : PyObject *py_AuthType;
11634 0 : py_AuthType = PyLong_FromUnsignedLongLong((uint32_t)object->AuthType);
11635 0 : return py_AuthType;
11636 : }
11637 :
11638 19 : static int py_AuthenticationInformation_set_AuthType(PyObject *py_obj, PyObject *value, void *closure)
11639 : {
11640 19 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11641 19 : if (value == NULL) {
11642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->AuthType");
11643 0 : return -1;
11644 : }
11645 : {
11646 19 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AuthType));
11647 19 : if (PyLong_Check(value)) {
11648 : unsigned long long test_var;
11649 19 : test_var = PyLong_AsUnsignedLongLong(value);
11650 19 : if (PyErr_Occurred() != NULL) {
11651 0 : return -1;
11652 : }
11653 19 : if (test_var > uint_max) {
11654 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11655 : PyLong_Type.tp_name, uint_max, test_var);
11656 0 : return -1;
11657 : }
11658 19 : object->AuthType = test_var;
11659 : } else {
11660 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11661 : PyLong_Type.tp_name);
11662 0 : return -1;
11663 : }
11664 : }
11665 19 : return 0;
11666 : }
11667 :
11668 0 : static PyObject *py_AuthenticationInformation_get_AuthInfo(PyObject *obj, void *closure)
11669 : {
11670 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(obj);
11671 : PyObject *py_AuthInfo;
11672 0 : py_AuthInfo = pyrpc_import_union(&AuthInfo_Type, pytalloc_get_mem_ctx(obj), object->AuthType, &object->AuthInfo, "union AuthInfo");
11673 0 : if (py_AuthInfo == NULL) {
11674 0 : return NULL;
11675 : }
11676 0 : return py_AuthInfo;
11677 : }
11678 :
11679 19 : static int py_AuthenticationInformation_set_AuthInfo(PyObject *py_obj, PyObject *value, void *closure)
11680 : {
11681 19 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11682 19 : if (value == NULL) {
11683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->AuthInfo");
11684 0 : return -1;
11685 : }
11686 : {
11687 : union AuthInfo *AuthInfo_switch_0;
11688 19 : AuthInfo_switch_0 = (union AuthInfo *)pyrpc_export_union(&AuthInfo_Type, pytalloc_get_mem_ctx(py_obj), object->AuthType, value, "union AuthInfo");
11689 19 : if (AuthInfo_switch_0 == NULL) {
11690 0 : return -1;
11691 : }
11692 19 : object->AuthInfo = *AuthInfo_switch_0;
11693 : }
11694 19 : return 0;
11695 : }
11696 :
11697 0 : static PyObject *py_AuthenticationInformation_get__pad(PyObject *obj, void *closure)
11698 : {
11699 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(obj);
11700 : PyObject *py__pad;
11701 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
11702 0 : return py__pad;
11703 : }
11704 :
11705 0 : static int py_AuthenticationInformation_set__pad(PyObject *py_obj, PyObject *value, void *closure)
11706 : {
11707 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11708 0 : if (value == NULL) {
11709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
11710 0 : return -1;
11711 : }
11712 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
11713 0 : return 0;
11714 : }
11715 :
11716 : static PyGetSetDef py_AuthenticationInformation_getsetters[] = {
11717 : {
11718 : .name = discard_const_p(char, "LastUpdateTime"),
11719 : .get = py_AuthenticationInformation_get_LastUpdateTime,
11720 : .set = py_AuthenticationInformation_set_LastUpdateTime,
11721 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
11722 : },
11723 : {
11724 : .name = discard_const_p(char, "AuthType"),
11725 : .get = py_AuthenticationInformation_get_AuthType,
11726 : .set = py_AuthenticationInformation_set_AuthType,
11727 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAuthType")
11728 : },
11729 : {
11730 : .name = discard_const_p(char, "AuthInfo"),
11731 : .get = py_AuthenticationInformation_get_AuthInfo,
11732 : .set = py_AuthenticationInformation_set_AuthInfo,
11733 : .doc = discard_const_p(char, "PIDL-generated element of base type AuthInfo")
11734 : },
11735 : {
11736 : .name = discard_const_p(char, "_pad"),
11737 : .get = py_AuthenticationInformation_get__pad,
11738 : .set = py_AuthenticationInformation_set__pad,
11739 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
11740 : },
11741 : { .name = NULL }
11742 : };
11743 :
11744 19 : static PyObject *py_AuthenticationInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11745 : {
11746 19 : return pytalloc_new(struct AuthenticationInformation, type);
11747 : }
11748 :
11749 0 : static PyObject *py_AuthenticationInformation_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11750 : {
11751 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11752 0 : PyObject *ret = NULL;
11753 : DATA_BLOB blob;
11754 : enum ndr_err_code err;
11755 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11756 0 : if (tmp_ctx == NULL) {
11757 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11758 0 : return NULL;
11759 : }
11760 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_AuthenticationInformation);
11761 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11762 0 : TALLOC_FREE(tmp_ctx);
11763 0 : PyErr_SetNdrError(err);
11764 0 : return NULL;
11765 : }
11766 :
11767 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11768 0 : TALLOC_FREE(tmp_ctx);
11769 0 : return ret;
11770 : }
11771 :
11772 0 : static PyObject *py_AuthenticationInformation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11773 : {
11774 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11775 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11776 0 : Py_ssize_t blob_length = 0;
11777 : enum ndr_err_code err;
11778 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11779 0 : PyObject *allow_remaining_obj = NULL;
11780 0 : bool allow_remaining = false;
11781 :
11782 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11783 : discard_const_p(char *, kwnames),
11784 : &blob.data, &blob_length,
11785 : &allow_remaining_obj)) {
11786 0 : return NULL;
11787 : }
11788 0 : blob.length = blob_length;
11789 :
11790 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11791 0 : allow_remaining = true;
11792 : }
11793 :
11794 0 : if (allow_remaining) {
11795 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_AuthenticationInformation);
11796 : } else {
11797 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_AuthenticationInformation);
11798 : }
11799 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11800 0 : PyErr_SetNdrError(err);
11801 0 : return NULL;
11802 : }
11803 :
11804 0 : Py_RETURN_NONE;
11805 : }
11806 :
11807 0 : static PyObject *py_AuthenticationInformation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11808 : {
11809 0 : struct AuthenticationInformation *object = (struct AuthenticationInformation *)pytalloc_get_ptr(py_obj);
11810 : PyObject *ret;
11811 : char *retstr;
11812 :
11813 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_AuthenticationInformation, "AuthenticationInformation", object);
11814 0 : ret = PyUnicode_FromString(retstr);
11815 0 : talloc_free(retstr);
11816 :
11817 0 : return ret;
11818 : }
11819 :
11820 : static PyMethodDef py_AuthenticationInformation_methods[] = {
11821 : { "__ndr_pack__", (PyCFunction)py_AuthenticationInformation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11822 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_AuthenticationInformation_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11823 : { "__ndr_print__", (PyCFunction)py_AuthenticationInformation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11824 : { NULL, NULL, 0, NULL }
11825 : };
11826 :
11827 :
11828 : static PyTypeObject AuthenticationInformation_Type = {
11829 : PyVarObject_HEAD_INIT(NULL, 0)
11830 : .tp_name = "drsblobs.AuthenticationInformation",
11831 : .tp_getset = py_AuthenticationInformation_getsetters,
11832 : .tp_methods = py_AuthenticationInformation_methods,
11833 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11834 : .tp_new = py_AuthenticationInformation_new,
11835 : };
11836 :
11837 :
11838 0 : static PyObject *py_AuthenticationInformationArray_get_count(PyObject *obj, void *closure)
11839 : {
11840 0 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(obj);
11841 : PyObject *py_count;
11842 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11843 0 : return py_count;
11844 : }
11845 :
11846 19 : static int py_AuthenticationInformationArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
11847 : {
11848 19 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(py_obj);
11849 19 : if (value == NULL) {
11850 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11851 0 : return -1;
11852 : }
11853 : {
11854 19 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11855 19 : if (PyLong_Check(value)) {
11856 : unsigned long long test_var;
11857 19 : test_var = PyLong_AsUnsignedLongLong(value);
11858 19 : if (PyErr_Occurred() != NULL) {
11859 0 : return -1;
11860 : }
11861 19 : if (test_var > uint_max) {
11862 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11863 : PyLong_Type.tp_name, uint_max, test_var);
11864 0 : return -1;
11865 : }
11866 19 : object->count = test_var;
11867 : } else {
11868 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11869 : PyLong_Type.tp_name);
11870 0 : return -1;
11871 : }
11872 : }
11873 19 : return 0;
11874 : }
11875 :
11876 0 : static PyObject *py_AuthenticationInformationArray_get_array(PyObject *obj, void *closure)
11877 : {
11878 0 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(obj);
11879 : PyObject *py_array;
11880 0 : py_array = PyList_New(object->count);
11881 0 : if (py_array == NULL) {
11882 0 : return NULL;
11883 : }
11884 : {
11885 : int array_cntr_0;
11886 0 : for (array_cntr_0 = 0; array_cntr_0 < (object->count); array_cntr_0++) {
11887 : PyObject *py_array_0;
11888 0 : py_array_0 = pytalloc_reference_ex(&AuthenticationInformation_Type, object->array, &object->array[array_cntr_0]);
11889 0 : PyList_SetItem(py_array, array_cntr_0, py_array_0);
11890 : }
11891 : }
11892 0 : return py_array;
11893 : }
11894 :
11895 19 : static int py_AuthenticationInformationArray_set_array(PyObject *py_obj, PyObject *value, void *closure)
11896 : {
11897 19 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(py_obj);
11898 19 : if (value == NULL) {
11899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
11900 0 : return -1;
11901 : }
11902 19 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11903 : {
11904 : int array_cntr_0;
11905 19 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
11906 19 : if (!object->array) { return -1;; }
11907 19 : talloc_set_name_const(object->array, "ARRAY: object->array");
11908 38 : for (array_cntr_0 = 0; array_cntr_0 < PyList_GET_SIZE(value); array_cntr_0++) {
11909 19 : if (PyList_GET_ITEM(value, array_cntr_0) == NULL) {
11910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_0]");
11911 0 : return -1;
11912 : }
11913 19 : PY_CHECK_TYPE(&AuthenticationInformation_Type, PyList_GET_ITEM(value, array_cntr_0), return -1;);
11914 19 : if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_0))) == NULL) {
11915 0 : PyErr_NoMemory();
11916 0 : return -1;
11917 : }
11918 19 : object->array[array_cntr_0] = *(struct AuthenticationInformation *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_0));
11919 : }
11920 : }
11921 19 : return 0;
11922 : }
11923 :
11924 : static PyGetSetDef py_AuthenticationInformationArray_getsetters[] = {
11925 : {
11926 : .name = discard_const_p(char, "count"),
11927 : .get = py_AuthenticationInformationArray_get_count,
11928 : .set = py_AuthenticationInformationArray_set_count,
11929 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11930 : },
11931 : {
11932 : .name = discard_const_p(char, "array"),
11933 : .get = py_AuthenticationInformationArray_get_array,
11934 : .set = py_AuthenticationInformationArray_set_array,
11935 : .doc = discard_const_p(char, "PIDL-generated element of base type AuthenticationInformation")
11936 : },
11937 : { .name = NULL }
11938 : };
11939 :
11940 19 : static PyObject *py_AuthenticationInformationArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11941 : {
11942 19 : return pytalloc_new(struct AuthenticationInformationArray, type);
11943 : }
11944 :
11945 0 : static PyObject *py_AuthenticationInformationArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11946 : {
11947 0 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(py_obj);
11948 0 : PyObject *ret = NULL;
11949 : DATA_BLOB blob;
11950 : enum ndr_err_code err;
11951 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11952 0 : if (tmp_ctx == NULL) {
11953 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11954 0 : return NULL;
11955 : }
11956 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_AuthenticationInformationArray);
11957 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11958 0 : TALLOC_FREE(tmp_ctx);
11959 0 : PyErr_SetNdrError(err);
11960 0 : return NULL;
11961 : }
11962 :
11963 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11964 0 : TALLOC_FREE(tmp_ctx);
11965 0 : return ret;
11966 : }
11967 :
11968 0 : static PyObject *py_AuthenticationInformationArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11969 : {
11970 0 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(py_obj);
11971 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11972 0 : Py_ssize_t blob_length = 0;
11973 : enum ndr_err_code err;
11974 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11975 0 : PyObject *allow_remaining_obj = NULL;
11976 0 : bool allow_remaining = false;
11977 :
11978 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11979 : discard_const_p(char *, kwnames),
11980 : &blob.data, &blob_length,
11981 : &allow_remaining_obj)) {
11982 0 : return NULL;
11983 : }
11984 0 : blob.length = blob_length;
11985 :
11986 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11987 0 : allow_remaining = true;
11988 : }
11989 :
11990 0 : if (allow_remaining) {
11991 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_AuthenticationInformationArray);
11992 : } else {
11993 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_AuthenticationInformationArray);
11994 : }
11995 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11996 0 : PyErr_SetNdrError(err);
11997 0 : return NULL;
11998 : }
11999 :
12000 0 : Py_RETURN_NONE;
12001 : }
12002 :
12003 0 : static PyObject *py_AuthenticationInformationArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12004 : {
12005 0 : struct AuthenticationInformationArray *object = (struct AuthenticationInformationArray *)pytalloc_get_ptr(py_obj);
12006 : PyObject *ret;
12007 : char *retstr;
12008 :
12009 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_AuthenticationInformationArray, "AuthenticationInformationArray", object);
12010 0 : ret = PyUnicode_FromString(retstr);
12011 0 : talloc_free(retstr);
12012 :
12013 0 : return ret;
12014 : }
12015 :
12016 : static PyMethodDef py_AuthenticationInformationArray_methods[] = {
12017 : { "__ndr_pack__", (PyCFunction)py_AuthenticationInformationArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
12018 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_AuthenticationInformationArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
12019 : { "__ndr_print__", (PyCFunction)py_AuthenticationInformationArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
12020 : { NULL, NULL, 0, NULL }
12021 : };
12022 :
12023 :
12024 : static PyTypeObject AuthenticationInformationArray_Type = {
12025 : PyVarObject_HEAD_INIT(NULL, 0)
12026 : .tp_name = "drsblobs.AuthenticationInformationArray",
12027 : .tp_getset = py_AuthenticationInformationArray_getsetters,
12028 : .tp_methods = py_AuthenticationInformationArray_methods,
12029 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12030 : .tp_new = py_AuthenticationInformationArray_new,
12031 : };
12032 :
12033 :
12034 0 : static PyObject *py_trustAuthInOutBlob_get_count(PyObject *obj, void *closure)
12035 : {
12036 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(obj);
12037 : PyObject *py_count;
12038 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
12039 0 : return py_count;
12040 : }
12041 :
12042 22 : static int py_trustAuthInOutBlob_set_count(PyObject *py_obj, PyObject *value, void *closure)
12043 : {
12044 22 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12045 22 : if (value == NULL) {
12046 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
12047 0 : return -1;
12048 : }
12049 : {
12050 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
12051 22 : if (PyLong_Check(value)) {
12052 : unsigned long long test_var;
12053 22 : test_var = PyLong_AsUnsignedLongLong(value);
12054 22 : if (PyErr_Occurred() != NULL) {
12055 0 : return -1;
12056 : }
12057 22 : if (test_var > uint_max) {
12058 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12059 : PyLong_Type.tp_name, uint_max, test_var);
12060 0 : return -1;
12061 : }
12062 22 : object->count = test_var;
12063 : } else {
12064 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12065 : PyLong_Type.tp_name);
12066 0 : return -1;
12067 : }
12068 : }
12069 22 : return 0;
12070 : }
12071 :
12072 0 : static PyObject *py_trustAuthInOutBlob_get_current_offset(PyObject *obj, void *closure)
12073 : {
12074 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(obj);
12075 : PyObject *py_current_offset;
12076 0 : py_current_offset = PyLong_FromUnsignedLongLong((uint32_t)object->current_offset);
12077 0 : return py_current_offset;
12078 : }
12079 :
12080 0 : static int py_trustAuthInOutBlob_set_current_offset(PyObject *py_obj, PyObject *value, void *closure)
12081 : {
12082 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12083 0 : if (value == NULL) {
12084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_offset");
12085 0 : return -1;
12086 : }
12087 : {
12088 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_offset));
12089 0 : if (PyLong_Check(value)) {
12090 : unsigned long long test_var;
12091 0 : test_var = PyLong_AsUnsignedLongLong(value);
12092 0 : if (PyErr_Occurred() != NULL) {
12093 0 : return -1;
12094 : }
12095 0 : if (test_var > uint_max) {
12096 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12097 : PyLong_Type.tp_name, uint_max, test_var);
12098 0 : return -1;
12099 : }
12100 0 : object->current_offset = test_var;
12101 : } else {
12102 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12103 : PyLong_Type.tp_name);
12104 0 : return -1;
12105 : }
12106 : }
12107 0 : return 0;
12108 : }
12109 :
12110 0 : static PyObject *py_trustAuthInOutBlob_get_previous_offset(PyObject *obj, void *closure)
12111 : {
12112 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(obj);
12113 : PyObject *py_previous_offset;
12114 0 : py_previous_offset = PyLong_FromUnsignedLongLong((uint32_t)object->previous_offset);
12115 0 : return py_previous_offset;
12116 : }
12117 :
12118 0 : static int py_trustAuthInOutBlob_set_previous_offset(PyObject *py_obj, PyObject *value, void *closure)
12119 : {
12120 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12121 0 : if (value == NULL) {
12122 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->previous_offset");
12123 0 : return -1;
12124 : }
12125 : {
12126 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->previous_offset));
12127 0 : if (PyLong_Check(value)) {
12128 : unsigned long long test_var;
12129 0 : test_var = PyLong_AsUnsignedLongLong(value);
12130 0 : if (PyErr_Occurred() != NULL) {
12131 0 : return -1;
12132 : }
12133 0 : if (test_var > uint_max) {
12134 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12135 : PyLong_Type.tp_name, uint_max, test_var);
12136 0 : return -1;
12137 : }
12138 0 : object->previous_offset = test_var;
12139 : } else {
12140 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12141 : PyLong_Type.tp_name);
12142 0 : return -1;
12143 : }
12144 : }
12145 0 : return 0;
12146 : }
12147 :
12148 0 : static PyObject *py_trustAuthInOutBlob_get_current(PyObject *obj, void *closure)
12149 : {
12150 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(obj);
12151 : PyObject *py_current;
12152 0 : py_current = pytalloc_reference_ex(&AuthenticationInformationArray_Type, pytalloc_get_mem_ctx(obj), &object->current);
12153 0 : return py_current;
12154 : }
12155 :
12156 19 : static int py_trustAuthInOutBlob_set_current(PyObject *py_obj, PyObject *value, void *closure)
12157 : {
12158 19 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12159 19 : if (value == NULL) {
12160 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current");
12161 0 : return -1;
12162 : }
12163 19 : PY_CHECK_TYPE(&AuthenticationInformationArray_Type, value, return -1;);
12164 19 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12165 0 : PyErr_NoMemory();
12166 0 : return -1;
12167 : }
12168 19 : object->current = *(struct AuthenticationInformationArray *)pytalloc_get_ptr(value);
12169 19 : return 0;
12170 : }
12171 :
12172 0 : static PyObject *py_trustAuthInOutBlob_get_previous(PyObject *obj, void *closure)
12173 : {
12174 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(obj);
12175 : PyObject *py_previous;
12176 0 : py_previous = pytalloc_reference_ex(&AuthenticationInformationArray_Type, pytalloc_get_mem_ctx(obj), &object->previous);
12177 0 : return py_previous;
12178 : }
12179 :
12180 0 : static int py_trustAuthInOutBlob_set_previous(PyObject *py_obj, PyObject *value, void *closure)
12181 : {
12182 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12183 0 : if (value == NULL) {
12184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->previous");
12185 0 : return -1;
12186 : }
12187 0 : PY_CHECK_TYPE(&AuthenticationInformationArray_Type, value, return -1;);
12188 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12189 0 : PyErr_NoMemory();
12190 0 : return -1;
12191 : }
12192 0 : object->previous = *(struct AuthenticationInformationArray *)pytalloc_get_ptr(value);
12193 0 : return 0;
12194 : }
12195 :
12196 : static PyGetSetDef py_trustAuthInOutBlob_getsetters[] = {
12197 : {
12198 : .name = discard_const_p(char, "count"),
12199 : .get = py_trustAuthInOutBlob_get_count,
12200 : .set = py_trustAuthInOutBlob_set_count,
12201 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12202 : },
12203 : {
12204 : .name = discard_const_p(char, "current_offset"),
12205 : .get = py_trustAuthInOutBlob_get_current_offset,
12206 : .set = py_trustAuthInOutBlob_set_current_offset,
12207 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12208 : },
12209 : {
12210 : .name = discard_const_p(char, "previous_offset"),
12211 : .get = py_trustAuthInOutBlob_get_previous_offset,
12212 : .set = py_trustAuthInOutBlob_set_previous_offset,
12213 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12214 : },
12215 : {
12216 : .name = discard_const_p(char, "current"),
12217 : .get = py_trustAuthInOutBlob_get_current,
12218 : .set = py_trustAuthInOutBlob_set_current,
12219 : .doc = discard_const_p(char, "PIDL-generated element of base type AuthenticationInformationArray")
12220 : },
12221 : {
12222 : .name = discard_const_p(char, "previous"),
12223 : .get = py_trustAuthInOutBlob_get_previous,
12224 : .set = py_trustAuthInOutBlob_set_previous,
12225 : .doc = discard_const_p(char, "PIDL-generated element of base type AuthenticationInformationArray")
12226 : },
12227 : { .name = NULL }
12228 : };
12229 :
12230 22 : static PyObject *py_trustAuthInOutBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12231 : {
12232 22 : return pytalloc_new(struct trustAuthInOutBlob, type);
12233 : }
12234 :
12235 0 : static PyObject *py_trustAuthInOutBlob_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12236 : {
12237 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12238 0 : PyObject *ret = NULL;
12239 : DATA_BLOB blob;
12240 : enum ndr_err_code err;
12241 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
12242 0 : if (tmp_ctx == NULL) {
12243 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12244 0 : return NULL;
12245 : }
12246 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_trustAuthInOutBlob);
12247 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12248 0 : TALLOC_FREE(tmp_ctx);
12249 0 : PyErr_SetNdrError(err);
12250 0 : return NULL;
12251 : }
12252 :
12253 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12254 0 : TALLOC_FREE(tmp_ctx);
12255 0 : return ret;
12256 : }
12257 :
12258 0 : static PyObject *py_trustAuthInOutBlob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12259 : {
12260 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12261 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
12262 0 : Py_ssize_t blob_length = 0;
12263 : enum ndr_err_code err;
12264 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
12265 0 : PyObject *allow_remaining_obj = NULL;
12266 0 : bool allow_remaining = false;
12267 :
12268 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
12269 : discard_const_p(char *, kwnames),
12270 : &blob.data, &blob_length,
12271 : &allow_remaining_obj)) {
12272 0 : return NULL;
12273 : }
12274 0 : blob.length = blob_length;
12275 :
12276 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12277 0 : allow_remaining = true;
12278 : }
12279 :
12280 0 : if (allow_remaining) {
12281 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_trustAuthInOutBlob);
12282 : } else {
12283 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_trustAuthInOutBlob);
12284 : }
12285 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12286 0 : PyErr_SetNdrError(err);
12287 0 : return NULL;
12288 : }
12289 :
12290 0 : Py_RETURN_NONE;
12291 : }
12292 :
12293 0 : static PyObject *py_trustAuthInOutBlob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12294 : {
12295 0 : struct trustAuthInOutBlob *object = (struct trustAuthInOutBlob *)pytalloc_get_ptr(py_obj);
12296 : PyObject *ret;
12297 : char *retstr;
12298 :
12299 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_trustAuthInOutBlob, "trustAuthInOutBlob", object);
12300 0 : ret = PyUnicode_FromString(retstr);
12301 0 : talloc_free(retstr);
12302 :
12303 0 : return ret;
12304 : }
12305 :
12306 : static PyMethodDef py_trustAuthInOutBlob_methods[] = {
12307 : { "__ndr_pack__", (PyCFunction)py_trustAuthInOutBlob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
12308 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_trustAuthInOutBlob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
12309 : { "__ndr_print__", (PyCFunction)py_trustAuthInOutBlob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
12310 : { NULL, NULL, 0, NULL }
12311 : };
12312 :
12313 :
12314 : static PyTypeObject trustAuthInOutBlob_Type = {
12315 : PyVarObject_HEAD_INIT(NULL, 0)
12316 : .tp_name = "drsblobs.trustAuthInOutBlob",
12317 : .tp_getset = py_trustAuthInOutBlob_getsetters,
12318 : .tp_methods = py_trustAuthInOutBlob_methods,
12319 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12320 : .tp_new = py_trustAuthInOutBlob_new,
12321 : };
12322 :
12323 :
12324 0 : static PyObject *py_trustDomainPasswords_get_confounder(PyObject *obj, void *closure)
12325 : {
12326 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(obj);
12327 : PyObject *py_confounder;
12328 0 : py_confounder = PyList_New(512);
12329 0 : if (py_confounder == NULL) {
12330 0 : return NULL;
12331 : }
12332 : {
12333 : int confounder_cntr_0;
12334 0 : for (confounder_cntr_0 = 0; confounder_cntr_0 < (512); confounder_cntr_0++) {
12335 : PyObject *py_confounder_0;
12336 0 : py_confounder_0 = PyLong_FromLong((uint16_t)object->confounder[confounder_cntr_0]);
12337 0 : PyList_SetItem(py_confounder, confounder_cntr_0, py_confounder_0);
12338 : }
12339 : }
12340 0 : return py_confounder;
12341 : }
12342 :
12343 22 : static int py_trustDomainPasswords_set_confounder(PyObject *py_obj, PyObject *value, void *closure)
12344 : {
12345 22 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12346 22 : if (value == NULL) {
12347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->confounder");
12348 0 : return -1;
12349 : }
12350 22 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12351 : {
12352 : int confounder_cntr_0;
12353 22 : if (ARRAY_SIZE(object->confounder) != PyList_GET_SIZE(value)) {
12354 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->confounder), PyList_GET_SIZE(value));
12355 0 : return -1;
12356 : }
12357 11286 : for (confounder_cntr_0 = 0; confounder_cntr_0 < PyList_GET_SIZE(value); confounder_cntr_0++) {
12358 11264 : if (PyList_GET_ITEM(value, confounder_cntr_0) == NULL) {
12359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->confounder[confounder_cntr_0]");
12360 0 : return -1;
12361 : }
12362 : {
12363 11264 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->confounder[confounder_cntr_0]));
12364 11264 : if (PyLong_Check(PyList_GET_ITEM(value, confounder_cntr_0))) {
12365 : unsigned long long test_var;
12366 11264 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, confounder_cntr_0));
12367 11264 : if (PyErr_Occurred() != NULL) {
12368 0 : return -1;
12369 : }
12370 11264 : if (test_var > uint_max) {
12371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12372 : PyLong_Type.tp_name, uint_max, test_var);
12373 0 : return -1;
12374 : }
12375 11264 : object->confounder[confounder_cntr_0] = test_var;
12376 : } else {
12377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12378 : PyLong_Type.tp_name);
12379 0 : return -1;
12380 : }
12381 : }
12382 : }
12383 : }
12384 22 : return 0;
12385 : }
12386 :
12387 0 : static PyObject *py_trustDomainPasswords_get_outgoing(PyObject *obj, void *closure)
12388 : {
12389 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(obj);
12390 : PyObject *py_outgoing;
12391 0 : py_outgoing = pytalloc_reference_ex(&trustAuthInOutBlob_Type, pytalloc_get_mem_ctx(obj), &object->outgoing);
12392 0 : return py_outgoing;
12393 : }
12394 :
12395 22 : static int py_trustDomainPasswords_set_outgoing(PyObject *py_obj, PyObject *value, void *closure)
12396 : {
12397 22 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12398 22 : if (value == NULL) {
12399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing");
12400 0 : return -1;
12401 : }
12402 22 : PY_CHECK_TYPE(&trustAuthInOutBlob_Type, value, return -1;);
12403 22 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12404 0 : PyErr_NoMemory();
12405 0 : return -1;
12406 : }
12407 22 : object->outgoing = *(struct trustAuthInOutBlob *)pytalloc_get_ptr(value);
12408 22 : return 0;
12409 : }
12410 :
12411 0 : static PyObject *py_trustDomainPasswords_get_incoming(PyObject *obj, void *closure)
12412 : {
12413 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(obj);
12414 : PyObject *py_incoming;
12415 0 : py_incoming = pytalloc_reference_ex(&trustAuthInOutBlob_Type, pytalloc_get_mem_ctx(obj), &object->incoming);
12416 0 : return py_incoming;
12417 : }
12418 :
12419 22 : static int py_trustDomainPasswords_set_incoming(PyObject *py_obj, PyObject *value, void *closure)
12420 : {
12421 22 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12422 22 : if (value == NULL) {
12423 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming");
12424 0 : return -1;
12425 : }
12426 22 : PY_CHECK_TYPE(&trustAuthInOutBlob_Type, value, return -1;);
12427 22 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12428 0 : PyErr_NoMemory();
12429 0 : return -1;
12430 : }
12431 22 : object->incoming = *(struct trustAuthInOutBlob *)pytalloc_get_ptr(value);
12432 22 : return 0;
12433 : }
12434 :
12435 0 : static PyObject *py_trustDomainPasswords_get_outgoing_size(PyObject *obj, void *closure)
12436 : {
12437 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(obj);
12438 : PyObject *py_outgoing_size;
12439 0 : py_outgoing_size = PyLong_FromUnsignedLongLong((uint32_t)object->outgoing_size);
12440 0 : return py_outgoing_size;
12441 : }
12442 :
12443 0 : static int py_trustDomainPasswords_set_outgoing_size(PyObject *py_obj, PyObject *value, void *closure)
12444 : {
12445 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12446 0 : if (value == NULL) {
12447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_size");
12448 0 : return -1;
12449 : }
12450 : {
12451 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->outgoing_size));
12452 0 : if (PyLong_Check(value)) {
12453 : unsigned long long test_var;
12454 0 : test_var = PyLong_AsUnsignedLongLong(value);
12455 0 : if (PyErr_Occurred() != NULL) {
12456 0 : return -1;
12457 : }
12458 0 : if (test_var > uint_max) {
12459 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12460 : PyLong_Type.tp_name, uint_max, test_var);
12461 0 : return -1;
12462 : }
12463 0 : object->outgoing_size = test_var;
12464 : } else {
12465 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12466 : PyLong_Type.tp_name);
12467 0 : return -1;
12468 : }
12469 : }
12470 0 : return 0;
12471 : }
12472 :
12473 0 : static PyObject *py_trustDomainPasswords_get_incoming_size(PyObject *obj, void *closure)
12474 : {
12475 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(obj);
12476 : PyObject *py_incoming_size;
12477 0 : py_incoming_size = PyLong_FromUnsignedLongLong((uint32_t)object->incoming_size);
12478 0 : return py_incoming_size;
12479 : }
12480 :
12481 0 : static int py_trustDomainPasswords_set_incoming_size(PyObject *py_obj, PyObject *value, void *closure)
12482 : {
12483 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12484 0 : if (value == NULL) {
12485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_size");
12486 0 : return -1;
12487 : }
12488 : {
12489 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->incoming_size));
12490 0 : if (PyLong_Check(value)) {
12491 : unsigned long long test_var;
12492 0 : test_var = PyLong_AsUnsignedLongLong(value);
12493 0 : if (PyErr_Occurred() != NULL) {
12494 0 : return -1;
12495 : }
12496 0 : if (test_var > uint_max) {
12497 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12498 : PyLong_Type.tp_name, uint_max, test_var);
12499 0 : return -1;
12500 : }
12501 0 : object->incoming_size = test_var;
12502 : } else {
12503 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12504 : PyLong_Type.tp_name);
12505 0 : return -1;
12506 : }
12507 : }
12508 0 : return 0;
12509 : }
12510 :
12511 : static PyGetSetDef py_trustDomainPasswords_getsetters[] = {
12512 : {
12513 : .name = discard_const_p(char, "confounder"),
12514 : .get = py_trustDomainPasswords_get_confounder,
12515 : .set = py_trustDomainPasswords_set_confounder,
12516 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12517 : },
12518 : {
12519 : .name = discard_const_p(char, "outgoing"),
12520 : .get = py_trustDomainPasswords_get_outgoing,
12521 : .set = py_trustDomainPasswords_set_outgoing,
12522 : .doc = discard_const_p(char, "PIDL-generated element of base type trustAuthInOutBlob")
12523 : },
12524 : {
12525 : .name = discard_const_p(char, "incoming"),
12526 : .get = py_trustDomainPasswords_get_incoming,
12527 : .set = py_trustDomainPasswords_set_incoming,
12528 : .doc = discard_const_p(char, "PIDL-generated element of base type trustAuthInOutBlob")
12529 : },
12530 : {
12531 : .name = discard_const_p(char, "outgoing_size"),
12532 : .get = py_trustDomainPasswords_get_outgoing_size,
12533 : .set = py_trustDomainPasswords_set_outgoing_size,
12534 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12535 : },
12536 : {
12537 : .name = discard_const_p(char, "incoming_size"),
12538 : .get = py_trustDomainPasswords_get_incoming_size,
12539 : .set = py_trustDomainPasswords_set_incoming_size,
12540 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12541 : },
12542 : { .name = NULL }
12543 : };
12544 :
12545 22 : static PyObject *py_trustDomainPasswords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12546 : {
12547 22 : return pytalloc_new(struct trustDomainPasswords, type);
12548 : }
12549 :
12550 22 : static PyObject *py_trustDomainPasswords_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12551 : {
12552 22 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12553 22 : PyObject *ret = NULL;
12554 : DATA_BLOB blob;
12555 : enum ndr_err_code err;
12556 22 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
12557 22 : if (tmp_ctx == NULL) {
12558 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12559 0 : return NULL;
12560 : }
12561 22 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_trustDomainPasswords);
12562 22 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12563 0 : TALLOC_FREE(tmp_ctx);
12564 0 : PyErr_SetNdrError(err);
12565 0 : return NULL;
12566 : }
12567 :
12568 22 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12569 22 : TALLOC_FREE(tmp_ctx);
12570 22 : return ret;
12571 : }
12572 :
12573 0 : static PyObject *py_trustDomainPasswords_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12574 : {
12575 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12576 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
12577 0 : Py_ssize_t blob_length = 0;
12578 : enum ndr_err_code err;
12579 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
12580 0 : PyObject *allow_remaining_obj = NULL;
12581 0 : bool allow_remaining = false;
12582 :
12583 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
12584 : discard_const_p(char *, kwnames),
12585 : &blob.data, &blob_length,
12586 : &allow_remaining_obj)) {
12587 0 : return NULL;
12588 : }
12589 0 : blob.length = blob_length;
12590 :
12591 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12592 0 : allow_remaining = true;
12593 : }
12594 :
12595 0 : if (allow_remaining) {
12596 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_trustDomainPasswords);
12597 : } else {
12598 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_trustDomainPasswords);
12599 : }
12600 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12601 0 : PyErr_SetNdrError(err);
12602 0 : return NULL;
12603 : }
12604 :
12605 0 : Py_RETURN_NONE;
12606 : }
12607 :
12608 0 : static PyObject *py_trustDomainPasswords_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12609 : {
12610 0 : struct trustDomainPasswords *object = (struct trustDomainPasswords *)pytalloc_get_ptr(py_obj);
12611 : PyObject *ret;
12612 : char *retstr;
12613 :
12614 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_trustDomainPasswords, "trustDomainPasswords", object);
12615 0 : ret = PyUnicode_FromString(retstr);
12616 0 : talloc_free(retstr);
12617 :
12618 0 : return ret;
12619 : }
12620 :
12621 : static PyMethodDef py_trustDomainPasswords_methods[] = {
12622 : { "__ndr_pack__", (PyCFunction)py_trustDomainPasswords_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
12623 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_trustDomainPasswords_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
12624 : { "__ndr_print__", (PyCFunction)py_trustDomainPasswords_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
12625 : { NULL, NULL, 0, NULL }
12626 : };
12627 :
12628 :
12629 : static PyTypeObject trustDomainPasswords_Type = {
12630 : PyVarObject_HEAD_INIT(NULL, 0)
12631 : .tp_name = "drsblobs.trustDomainPasswords",
12632 : .tp_getset = py_trustDomainPasswords_getsetters,
12633 : .tp_methods = py_trustDomainPasswords_methods,
12634 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12635 : .tp_new = py_trustDomainPasswords_new,
12636 : };
12637 :
12638 :
12639 0 : static PyObject *py_DsCompressedChunk_get_marker(PyObject *obj, void *closure)
12640 : {
12641 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(obj);
12642 : PyObject *py_marker;
12643 0 : py_marker = PyLong_FromUnsignedLongLong((uint32_t)object->marker);
12644 0 : return py_marker;
12645 : }
12646 :
12647 0 : static int py_DsCompressedChunk_set_marker(PyObject *py_obj, PyObject *value, void *closure)
12648 : {
12649 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(py_obj);
12650 0 : if (value == NULL) {
12651 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->marker");
12652 0 : return -1;
12653 : }
12654 : {
12655 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->marker));
12656 0 : if (PyLong_Check(value)) {
12657 : unsigned long long test_var;
12658 0 : test_var = PyLong_AsUnsignedLongLong(value);
12659 0 : if (PyErr_Occurred() != NULL) {
12660 0 : return -1;
12661 : }
12662 0 : if (test_var > uint_max) {
12663 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12664 : PyLong_Type.tp_name, uint_max, test_var);
12665 0 : return -1;
12666 : }
12667 0 : object->marker = test_var;
12668 : } else {
12669 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12670 : PyLong_Type.tp_name);
12671 0 : return -1;
12672 : }
12673 : }
12674 0 : return 0;
12675 : }
12676 :
12677 0 : static PyObject *py_DsCompressedChunk_get_data(PyObject *obj, void *closure)
12678 : {
12679 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(obj);
12680 : PyObject *py_data;
12681 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
12682 0 : return py_data;
12683 : }
12684 :
12685 0 : static int py_DsCompressedChunk_set_data(PyObject *py_obj, PyObject *value, void *closure)
12686 : {
12687 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(py_obj);
12688 0 : if (value == NULL) {
12689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
12690 0 : return -1;
12691 : }
12692 0 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
12693 0 : return 0;
12694 : }
12695 :
12696 : static PyGetSetDef py_DsCompressedChunk_getsetters[] = {
12697 : {
12698 : .name = discard_const_p(char, "marker"),
12699 : .get = py_DsCompressedChunk_get_marker,
12700 : .set = py_DsCompressedChunk_set_marker,
12701 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12702 : },
12703 : {
12704 : .name = discard_const_p(char, "data"),
12705 : .get = py_DsCompressedChunk_get_data,
12706 : .set = py_DsCompressedChunk_set_data,
12707 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
12708 : },
12709 : { .name = NULL }
12710 : };
12711 :
12712 0 : static PyObject *py_DsCompressedChunk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12713 : {
12714 0 : return pytalloc_new(struct DsCompressedChunk, type);
12715 : }
12716 :
12717 0 : static PyObject *py_DsCompressedChunk_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12718 : {
12719 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(py_obj);
12720 0 : PyObject *ret = NULL;
12721 : DATA_BLOB blob;
12722 : enum ndr_err_code err;
12723 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
12724 0 : if (tmp_ctx == NULL) {
12725 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12726 0 : return NULL;
12727 : }
12728 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_DsCompressedChunk);
12729 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12730 0 : TALLOC_FREE(tmp_ctx);
12731 0 : PyErr_SetNdrError(err);
12732 0 : return NULL;
12733 : }
12734 :
12735 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12736 0 : TALLOC_FREE(tmp_ctx);
12737 0 : return ret;
12738 : }
12739 :
12740 0 : static PyObject *py_DsCompressedChunk_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12741 : {
12742 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(py_obj);
12743 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
12744 0 : Py_ssize_t blob_length = 0;
12745 : enum ndr_err_code err;
12746 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
12747 0 : PyObject *allow_remaining_obj = NULL;
12748 0 : bool allow_remaining = false;
12749 :
12750 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
12751 : discard_const_p(char *, kwnames),
12752 : &blob.data, &blob_length,
12753 : &allow_remaining_obj)) {
12754 0 : return NULL;
12755 : }
12756 0 : blob.length = blob_length;
12757 :
12758 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12759 0 : allow_remaining = true;
12760 : }
12761 :
12762 0 : if (allow_remaining) {
12763 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_DsCompressedChunk);
12764 : } else {
12765 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_DsCompressedChunk);
12766 : }
12767 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12768 0 : PyErr_SetNdrError(err);
12769 0 : return NULL;
12770 : }
12771 :
12772 0 : Py_RETURN_NONE;
12773 : }
12774 :
12775 0 : static PyObject *py_DsCompressedChunk_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12776 : {
12777 0 : struct DsCompressedChunk *object = (struct DsCompressedChunk *)pytalloc_get_ptr(py_obj);
12778 : PyObject *ret;
12779 : char *retstr;
12780 :
12781 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_DsCompressedChunk, "DsCompressedChunk", object);
12782 0 : ret = PyUnicode_FromString(retstr);
12783 0 : talloc_free(retstr);
12784 :
12785 0 : return ret;
12786 : }
12787 :
12788 : static PyMethodDef py_DsCompressedChunk_methods[] = {
12789 : { "__ndr_pack__", (PyCFunction)py_DsCompressedChunk_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
12790 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_DsCompressedChunk_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
12791 : { "__ndr_print__", (PyCFunction)py_DsCompressedChunk_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
12792 : { NULL, NULL, 0, NULL }
12793 : };
12794 :
12795 :
12796 : static PyTypeObject DsCompressedChunk_Type = {
12797 : PyVarObject_HEAD_INIT(NULL, 0)
12798 : .tp_name = "drsblobs.DsCompressedChunk",
12799 : .tp_getset = py_DsCompressedChunk_getsetters,
12800 : .tp_methods = py_DsCompressedChunk_methods,
12801 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12802 : .tp_new = py_DsCompressedChunk_new,
12803 : };
12804 :
12805 :
12806 0 : static PyObject *py_ExtendedErrorAString_get___size(PyObject *obj, void *closure)
12807 : {
12808 0 : struct ExtendedErrorAString *object = (struct ExtendedErrorAString *)pytalloc_get_ptr(obj);
12809 : PyObject *py___size;
12810 0 : py___size = PyLong_FromLong((uint16_t)object->__size);
12811 0 : return py___size;
12812 : }
12813 :
12814 0 : static int py_ExtendedErrorAString_set___size(PyObject *py_obj, PyObject *value, void *closure)
12815 : {
12816 0 : struct ExtendedErrorAString *object = (struct ExtendedErrorAString *)pytalloc_get_ptr(py_obj);
12817 0 : if (value == NULL) {
12818 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__size");
12819 0 : return -1;
12820 : }
12821 : {
12822 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__size));
12823 0 : if (PyLong_Check(value)) {
12824 : unsigned long long test_var;
12825 0 : test_var = PyLong_AsUnsignedLongLong(value);
12826 0 : if (PyErr_Occurred() != NULL) {
12827 0 : return -1;
12828 : }
12829 0 : if (test_var > uint_max) {
12830 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12831 : PyLong_Type.tp_name, uint_max, test_var);
12832 0 : return -1;
12833 : }
12834 0 : object->__size = test_var;
12835 : } else {
12836 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12837 : PyLong_Type.tp_name);
12838 0 : return -1;
12839 : }
12840 : }
12841 0 : return 0;
12842 : }
12843 :
12844 0 : static PyObject *py_ExtendedErrorAString_get_string(PyObject *obj, void *closure)
12845 : {
12846 0 : struct ExtendedErrorAString *object = (struct ExtendedErrorAString *)pytalloc_get_ptr(obj);
12847 : PyObject *py_string;
12848 0 : if (object->string == NULL) {
12849 0 : Py_RETURN_NONE;
12850 : }
12851 0 : if (object->string == NULL) {
12852 0 : py_string = Py_None;
12853 0 : Py_INCREF(py_string);
12854 : } else {
12855 0 : if (object->string == NULL) {
12856 0 : py_string = Py_None;
12857 0 : Py_INCREF(py_string);
12858 : } else {
12859 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
12860 : }
12861 : }
12862 0 : return py_string;
12863 : }
12864 :
12865 0 : static int py_ExtendedErrorAString_set_string(PyObject *py_obj, PyObject *value, void *closure)
12866 : {
12867 0 : struct ExtendedErrorAString *object = (struct ExtendedErrorAString *)pytalloc_get_ptr(py_obj);
12868 0 : if (value == NULL) {
12869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
12870 0 : return -1;
12871 : }
12872 0 : if (value == Py_None) {
12873 0 : object->string = NULL;
12874 : } else {
12875 0 : object->string = NULL;
12876 : {
12877 : const char *test_str;
12878 : const char *talloc_str;
12879 0 : PyObject *unicode = NULL;
12880 0 : if (PyUnicode_Check(value)) {
12881 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12882 0 : if (unicode == NULL) {
12883 0 : PyErr_NoMemory();
12884 0 : return -1;
12885 : }
12886 0 : test_str = PyBytes_AS_STRING(unicode);
12887 0 : } else if (PyBytes_Check(value)) {
12888 0 : test_str = PyBytes_AS_STRING(value);
12889 : } else {
12890 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12891 0 : return -1;
12892 : }
12893 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12894 0 : if (unicode != NULL) {
12895 0 : Py_DECREF(unicode);
12896 : }
12897 0 : if (talloc_str == NULL) {
12898 0 : PyErr_NoMemory();
12899 0 : return -1;
12900 : }
12901 0 : object->string = talloc_str;
12902 : }
12903 : }
12904 0 : return 0;
12905 : }
12906 :
12907 : static PyGetSetDef py_ExtendedErrorAString_getsetters[] = {
12908 : {
12909 : .name = discard_const_p(char, "__size"),
12910 : .get = py_ExtendedErrorAString_get___size,
12911 : .set = py_ExtendedErrorAString_set___size,
12912 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
12913 : },
12914 : {
12915 : .name = discard_const_p(char, "string"),
12916 : .get = py_ExtendedErrorAString_get_string,
12917 : .set = py_ExtendedErrorAString_set_string,
12918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12919 : },
12920 : { .name = NULL }
12921 : };
12922 :
12923 0 : static PyObject *py_ExtendedErrorAString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12924 : {
12925 0 : return pytalloc_new(struct ExtendedErrorAString, type);
12926 : }
12927 :
12928 :
12929 : static PyTypeObject ExtendedErrorAString_Type = {
12930 : PyVarObject_HEAD_INIT(NULL, 0)
12931 : .tp_name = "drsblobs.ExtendedErrorAString",
12932 : .tp_getset = py_ExtendedErrorAString_getsetters,
12933 : .tp_methods = NULL,
12934 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12935 : .tp_new = py_ExtendedErrorAString_new,
12936 : };
12937 :
12938 :
12939 0 : static PyObject *py_ExtendedErrorUString_get___size(PyObject *obj, void *closure)
12940 : {
12941 0 : struct ExtendedErrorUString *object = (struct ExtendedErrorUString *)pytalloc_get_ptr(obj);
12942 : PyObject *py___size;
12943 0 : py___size = PyLong_FromLong((uint16_t)object->__size);
12944 0 : return py___size;
12945 : }
12946 :
12947 0 : static int py_ExtendedErrorUString_set___size(PyObject *py_obj, PyObject *value, void *closure)
12948 : {
12949 0 : struct ExtendedErrorUString *object = (struct ExtendedErrorUString *)pytalloc_get_ptr(py_obj);
12950 0 : if (value == NULL) {
12951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__size");
12952 0 : return -1;
12953 : }
12954 : {
12955 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__size));
12956 0 : if (PyLong_Check(value)) {
12957 : unsigned long long test_var;
12958 0 : test_var = PyLong_AsUnsignedLongLong(value);
12959 0 : if (PyErr_Occurred() != NULL) {
12960 0 : return -1;
12961 : }
12962 0 : if (test_var > uint_max) {
12963 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12964 : PyLong_Type.tp_name, uint_max, test_var);
12965 0 : return -1;
12966 : }
12967 0 : object->__size = test_var;
12968 : } else {
12969 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12970 : PyLong_Type.tp_name);
12971 0 : return -1;
12972 : }
12973 : }
12974 0 : return 0;
12975 : }
12976 :
12977 0 : static PyObject *py_ExtendedErrorUString_get_string(PyObject *obj, void *closure)
12978 : {
12979 0 : struct ExtendedErrorUString *object = (struct ExtendedErrorUString *)pytalloc_get_ptr(obj);
12980 : PyObject *py_string;
12981 0 : if (object->string == NULL) {
12982 0 : Py_RETURN_NONE;
12983 : }
12984 0 : if (object->string == NULL) {
12985 0 : py_string = Py_None;
12986 0 : Py_INCREF(py_string);
12987 : } else {
12988 0 : if (object->string == NULL) {
12989 0 : py_string = Py_None;
12990 0 : Py_INCREF(py_string);
12991 : } else {
12992 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
12993 : }
12994 : }
12995 0 : return py_string;
12996 : }
12997 :
12998 0 : static int py_ExtendedErrorUString_set_string(PyObject *py_obj, PyObject *value, void *closure)
12999 : {
13000 0 : struct ExtendedErrorUString *object = (struct ExtendedErrorUString *)pytalloc_get_ptr(py_obj);
13001 0 : if (value == NULL) {
13002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
13003 0 : return -1;
13004 : }
13005 0 : if (value == Py_None) {
13006 0 : object->string = NULL;
13007 : } else {
13008 0 : object->string = NULL;
13009 : {
13010 : const char *test_str;
13011 : const char *talloc_str;
13012 0 : PyObject *unicode = NULL;
13013 0 : if (PyUnicode_Check(value)) {
13014 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13015 0 : if (unicode == NULL) {
13016 0 : PyErr_NoMemory();
13017 0 : return -1;
13018 : }
13019 0 : test_str = PyBytes_AS_STRING(unicode);
13020 0 : } else if (PyBytes_Check(value)) {
13021 0 : test_str = PyBytes_AS_STRING(value);
13022 : } else {
13023 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13024 0 : return -1;
13025 : }
13026 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13027 0 : if (unicode != NULL) {
13028 0 : Py_DECREF(unicode);
13029 : }
13030 0 : if (talloc_str == NULL) {
13031 0 : PyErr_NoMemory();
13032 0 : return -1;
13033 : }
13034 0 : object->string = talloc_str;
13035 : }
13036 : }
13037 0 : return 0;
13038 : }
13039 :
13040 : static PyGetSetDef py_ExtendedErrorUString_getsetters[] = {
13041 : {
13042 : .name = discard_const_p(char, "__size"),
13043 : .get = py_ExtendedErrorUString_get___size,
13044 : .set = py_ExtendedErrorUString_set___size,
13045 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13046 : },
13047 : {
13048 : .name = discard_const_p(char, "string"),
13049 : .get = py_ExtendedErrorUString_get_string,
13050 : .set = py_ExtendedErrorUString_set_string,
13051 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13052 : },
13053 : { .name = NULL }
13054 : };
13055 :
13056 0 : static PyObject *py_ExtendedErrorUString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13057 : {
13058 0 : return pytalloc_new(struct ExtendedErrorUString, type);
13059 : }
13060 :
13061 :
13062 : static PyTypeObject ExtendedErrorUString_Type = {
13063 : PyVarObject_HEAD_INIT(NULL, 0)
13064 : .tp_name = "drsblobs.ExtendedErrorUString",
13065 : .tp_getset = py_ExtendedErrorUString_getsetters,
13066 : .tp_methods = NULL,
13067 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13068 : .tp_new = py_ExtendedErrorUString_new,
13069 : };
13070 :
13071 :
13072 0 : static PyObject *py_ExtendedErrorBlob_get_length(PyObject *obj, void *closure)
13073 : {
13074 0 : struct ExtendedErrorBlob *object = (struct ExtendedErrorBlob *)pytalloc_get_ptr(obj);
13075 : PyObject *py_length;
13076 0 : py_length = PyLong_FromLong((uint16_t)object->length);
13077 0 : return py_length;
13078 : }
13079 :
13080 0 : static int py_ExtendedErrorBlob_set_length(PyObject *py_obj, PyObject *value, void *closure)
13081 : {
13082 0 : struct ExtendedErrorBlob *object = (struct ExtendedErrorBlob *)pytalloc_get_ptr(py_obj);
13083 0 : if (value == NULL) {
13084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
13085 0 : return -1;
13086 : }
13087 : {
13088 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
13089 0 : if (PyLong_Check(value)) {
13090 : unsigned long long test_var;
13091 0 : test_var = PyLong_AsUnsignedLongLong(value);
13092 0 : if (PyErr_Occurred() != NULL) {
13093 0 : return -1;
13094 : }
13095 0 : if (test_var > uint_max) {
13096 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13097 : PyLong_Type.tp_name, uint_max, test_var);
13098 0 : return -1;
13099 : }
13100 0 : object->length = test_var;
13101 : } else {
13102 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13103 : PyLong_Type.tp_name);
13104 0 : return -1;
13105 : }
13106 : }
13107 0 : return 0;
13108 : }
13109 :
13110 0 : static PyObject *py_ExtendedErrorBlob_get_data(PyObject *obj, void *closure)
13111 : {
13112 0 : struct ExtendedErrorBlob *object = (struct ExtendedErrorBlob *)pytalloc_get_ptr(obj);
13113 : PyObject *py_data;
13114 0 : if (object->data == NULL) {
13115 0 : Py_RETURN_NONE;
13116 : }
13117 0 : if (object->data == NULL) {
13118 0 : py_data = Py_None;
13119 0 : Py_INCREF(py_data);
13120 : } else {
13121 0 : py_data = PyList_New(object->length);
13122 0 : if (py_data == NULL) {
13123 0 : return NULL;
13124 : }
13125 : {
13126 : int data_cntr_1;
13127 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
13128 : PyObject *py_data_1;
13129 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
13130 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
13131 : }
13132 : }
13133 : }
13134 0 : return py_data;
13135 : }
13136 :
13137 0 : static int py_ExtendedErrorBlob_set_data(PyObject *py_obj, PyObject *value, void *closure)
13138 : {
13139 0 : struct ExtendedErrorBlob *object = (struct ExtendedErrorBlob *)pytalloc_get_ptr(py_obj);
13140 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
13141 0 : if (value == NULL) {
13142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
13143 0 : return -1;
13144 : }
13145 0 : if (value == Py_None) {
13146 0 : object->data = NULL;
13147 : } else {
13148 0 : object->data = NULL;
13149 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13150 : {
13151 : int data_cntr_1;
13152 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
13153 0 : if (!object->data) { return -1;; }
13154 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
13155 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
13156 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
13157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
13158 0 : return -1;
13159 : }
13160 : {
13161 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
13162 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
13163 : unsigned long long test_var;
13164 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
13165 0 : if (PyErr_Occurred() != NULL) {
13166 0 : return -1;
13167 : }
13168 0 : if (test_var > uint_max) {
13169 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13170 : PyLong_Type.tp_name, uint_max, test_var);
13171 0 : return -1;
13172 : }
13173 0 : object->data[data_cntr_1] = test_var;
13174 : } else {
13175 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13176 : PyLong_Type.tp_name);
13177 0 : return -1;
13178 : }
13179 : }
13180 : }
13181 : }
13182 : }
13183 0 : return 0;
13184 : }
13185 :
13186 : static PyGetSetDef py_ExtendedErrorBlob_getsetters[] = {
13187 : {
13188 : .name = discard_const_p(char, "length"),
13189 : .get = py_ExtendedErrorBlob_get_length,
13190 : .set = py_ExtendedErrorBlob_set_length,
13191 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13192 : },
13193 : {
13194 : .name = discard_const_p(char, "data"),
13195 : .get = py_ExtendedErrorBlob_get_data,
13196 : .set = py_ExtendedErrorBlob_set_data,
13197 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13198 : },
13199 : { .name = NULL }
13200 : };
13201 :
13202 0 : static PyObject *py_ExtendedErrorBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13203 : {
13204 0 : return pytalloc_new(struct ExtendedErrorBlob, type);
13205 : }
13206 :
13207 :
13208 : static PyTypeObject ExtendedErrorBlob_Type = {
13209 : PyVarObject_HEAD_INIT(NULL, 0)
13210 : .tp_name = "drsblobs.ExtendedErrorBlob",
13211 : .tp_getset = py_ExtendedErrorBlob_getsetters,
13212 : .tp_methods = NULL,
13213 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13214 : .tp_new = py_ExtendedErrorBlob_new,
13215 : };
13216 :
13217 0 : static PyObject *py_import_ExtendedErrorComputerNameU(TALLOC_CTX *mem_ctx, int level, union ExtendedErrorComputerNameU *in)
13218 : {
13219 : PyObject *ret;
13220 :
13221 0 : switch (level) {
13222 0 : case EXTENDED_ERROR_COMPUTER_NAME_PRESENT:
13223 0 : ret = pytalloc_reference_ex(&ExtendedErrorUString_Type, mem_ctx, &in->name);
13224 0 : return ret;
13225 :
13226 0 : case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT:
13227 0 : ret = Py_None;
13228 0 : Py_INCREF(ret);
13229 0 : return ret;
13230 :
13231 : }
13232 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
13233 0 : return NULL;
13234 : }
13235 :
13236 0 : static union ExtendedErrorComputerNameU *py_export_ExtendedErrorComputerNameU(TALLOC_CTX *mem_ctx, int level, PyObject *in)
13237 : {
13238 0 : union ExtendedErrorComputerNameU *ret = talloc_zero(mem_ctx, union ExtendedErrorComputerNameU);
13239 0 : switch (level) {
13240 0 : case EXTENDED_ERROR_COMPUTER_NAME_PRESENT:
13241 0 : if (in == NULL) {
13242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
13243 0 : talloc_free(ret); return NULL;
13244 : }
13245 0 : PY_CHECK_TYPE(&ExtendedErrorUString_Type, in, talloc_free(ret); return NULL;);
13246 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13247 0 : PyErr_NoMemory();
13248 0 : talloc_free(ret); return NULL;
13249 : }
13250 0 : ret->name = *(struct ExtendedErrorUString *)pytalloc_get_ptr(in);
13251 0 : break;
13252 :
13253 0 : case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT:
13254 0 : break;
13255 :
13256 0 : default:
13257 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
13258 0 : talloc_free(ret);
13259 0 : ret = NULL;
13260 : }
13261 :
13262 0 : return ret;
13263 : }
13264 :
13265 0 : static PyObject *py_ExtendedErrorComputerNameU_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13266 : {
13267 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13268 0 : PyObject *mem_ctx_obj = NULL;
13269 0 : TALLOC_CTX *mem_ctx = NULL;
13270 0 : int level = 0;
13271 0 : PyObject *in_obj = NULL;
13272 0 : union ExtendedErrorComputerNameU *in = NULL;
13273 :
13274 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
13275 : discard_const_p(char *, kwnames),
13276 : &mem_ctx_obj,
13277 : &level,
13278 : &in_obj)) {
13279 0 : return NULL;
13280 : }
13281 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13282 0 : if (mem_ctx == NULL) {
13283 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13284 0 : return NULL;
13285 : }
13286 0 : in = (union ExtendedErrorComputerNameU *)pytalloc_get_ptr(in_obj);
13287 0 : if (in == NULL) {
13288 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union ExtendedErrorComputerNameU!");
13289 0 : return NULL;
13290 : }
13291 :
13292 0 : return py_import_ExtendedErrorComputerNameU(mem_ctx, level, in);
13293 : }
13294 :
13295 0 : static PyObject *py_ExtendedErrorComputerNameU_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13296 : {
13297 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13298 0 : PyObject *mem_ctx_obj = NULL;
13299 0 : TALLOC_CTX *mem_ctx = NULL;
13300 0 : int level = 0;
13301 0 : PyObject *in = NULL;
13302 0 : union ExtendedErrorComputerNameU *out = NULL;
13303 :
13304 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
13305 : discard_const_p(char *, kwnames),
13306 : &mem_ctx_obj,
13307 : &level,
13308 : &in)) {
13309 0 : return NULL;
13310 : }
13311 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13312 0 : if (mem_ctx == NULL) {
13313 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13314 0 : return NULL;
13315 : }
13316 :
13317 0 : out = py_export_ExtendedErrorComputerNameU(mem_ctx, level, in);
13318 0 : if (out == NULL) {
13319 0 : return NULL;
13320 : }
13321 :
13322 0 : return pytalloc_GenericObject_reference(out);
13323 : }
13324 :
13325 : static PyMethodDef py_ExtendedErrorComputerNameU_methods[] = {
13326 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ExtendedErrorComputerNameU_import),
13327 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13328 : "T.__import__(mem_ctx, level, in) => ret." },
13329 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ExtendedErrorComputerNameU_export),
13330 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13331 : "T.__export__(mem_ctx, level, in) => ret." },
13332 : { NULL, NULL, 0, NULL }
13333 : };
13334 :
13335 0 : static PyObject *py_ExtendedErrorComputerNameU_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13336 : {
13337 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
13338 0 : return NULL;
13339 : }
13340 :
13341 :
13342 : static PyTypeObject ExtendedErrorComputerNameU_Type = {
13343 : PyVarObject_HEAD_INIT(NULL, 0)
13344 : .tp_name = "drsblobs.ExtendedErrorComputerNameU",
13345 : .tp_getset = NULL,
13346 : .tp_methods = py_ExtendedErrorComputerNameU_methods,
13347 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13348 : .tp_new = py_ExtendedErrorComputerNameU_new,
13349 : };
13350 :
13351 :
13352 0 : static PyObject *py_ExtendedErrorComputerName_get_present(PyObject *obj, void *closure)
13353 : {
13354 0 : struct ExtendedErrorComputerName *object = (struct ExtendedErrorComputerName *)pytalloc_get_ptr(obj);
13355 : PyObject *py_present;
13356 0 : py_present = PyLong_FromLong((uint16_t)object->present);
13357 0 : return py_present;
13358 : }
13359 :
13360 0 : static int py_ExtendedErrorComputerName_set_present(PyObject *py_obj, PyObject *value, void *closure)
13361 : {
13362 0 : struct ExtendedErrorComputerName *object = (struct ExtendedErrorComputerName *)pytalloc_get_ptr(py_obj);
13363 0 : if (value == NULL) {
13364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->present");
13365 0 : return -1;
13366 : }
13367 : {
13368 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->present));
13369 0 : if (PyLong_Check(value)) {
13370 : unsigned long long test_var;
13371 0 : test_var = PyLong_AsUnsignedLongLong(value);
13372 0 : if (PyErr_Occurred() != NULL) {
13373 0 : return -1;
13374 : }
13375 0 : if (test_var > uint_max) {
13376 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13377 : PyLong_Type.tp_name, uint_max, test_var);
13378 0 : return -1;
13379 : }
13380 0 : object->present = test_var;
13381 : } else {
13382 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13383 : PyLong_Type.tp_name);
13384 0 : return -1;
13385 : }
13386 : }
13387 0 : return 0;
13388 : }
13389 :
13390 0 : static PyObject *py_ExtendedErrorComputerName_get_n(PyObject *obj, void *closure)
13391 : {
13392 0 : struct ExtendedErrorComputerName *object = (struct ExtendedErrorComputerName *)pytalloc_get_ptr(obj);
13393 : PyObject *py_n;
13394 0 : py_n = pyrpc_import_union(&ExtendedErrorComputerNameU_Type, pytalloc_get_mem_ctx(obj), object->present, &object->n, "union ExtendedErrorComputerNameU");
13395 0 : if (py_n == NULL) {
13396 0 : return NULL;
13397 : }
13398 0 : return py_n;
13399 : }
13400 :
13401 0 : static int py_ExtendedErrorComputerName_set_n(PyObject *py_obj, PyObject *value, void *closure)
13402 : {
13403 0 : struct ExtendedErrorComputerName *object = (struct ExtendedErrorComputerName *)pytalloc_get_ptr(py_obj);
13404 0 : if (value == NULL) {
13405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->n");
13406 0 : return -1;
13407 : }
13408 : {
13409 : union ExtendedErrorComputerNameU *n_switch_0;
13410 0 : n_switch_0 = (union ExtendedErrorComputerNameU *)pyrpc_export_union(&ExtendedErrorComputerNameU_Type, pytalloc_get_mem_ctx(py_obj), object->present, value, "union ExtendedErrorComputerNameU");
13411 0 : if (n_switch_0 == NULL) {
13412 0 : return -1;
13413 : }
13414 0 : object->n = *n_switch_0;
13415 : }
13416 0 : return 0;
13417 : }
13418 :
13419 : static PyGetSetDef py_ExtendedErrorComputerName_getsetters[] = {
13420 : {
13421 : .name = discard_const_p(char, "present"),
13422 : .get = py_ExtendedErrorComputerName_get_present,
13423 : .set = py_ExtendedErrorComputerName_set_present,
13424 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorComputerNamePresent")
13425 : },
13426 : {
13427 : .name = discard_const_p(char, "n"),
13428 : .get = py_ExtendedErrorComputerName_get_n,
13429 : .set = py_ExtendedErrorComputerName_set_n,
13430 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorComputerNameU")
13431 : },
13432 : { .name = NULL }
13433 : };
13434 :
13435 0 : static PyObject *py_ExtendedErrorComputerName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13436 : {
13437 0 : return pytalloc_new(struct ExtendedErrorComputerName, type);
13438 : }
13439 :
13440 :
13441 : static PyTypeObject ExtendedErrorComputerName_Type = {
13442 : PyVarObject_HEAD_INIT(NULL, 0)
13443 : .tp_name = "drsblobs.ExtendedErrorComputerName",
13444 : .tp_getset = py_ExtendedErrorComputerName_getsetters,
13445 : .tp_methods = NULL,
13446 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13447 : .tp_new = py_ExtendedErrorComputerName_new,
13448 : };
13449 :
13450 0 : static PyObject *py_import_ExtendedErrorParamU(TALLOC_CTX *mem_ctx, int level, union ExtendedErrorParamU *in)
13451 : {
13452 : PyObject *ret;
13453 :
13454 0 : switch (level) {
13455 0 : case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING:
13456 0 : ret = pytalloc_reference_ex(&ExtendedErrorAString_Type, mem_ctx, &in->a_string);
13457 0 : return ret;
13458 :
13459 0 : case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING:
13460 0 : ret = pytalloc_reference_ex(&ExtendedErrorUString_Type, mem_ctx, &in->u_string);
13461 0 : return ret;
13462 :
13463 0 : case EXTENDED_ERROR_PARAM_TYPE_UINT32:
13464 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->uint32);
13465 0 : return ret;
13466 :
13467 0 : case EXTENDED_ERROR_PARAM_TYPE_UINT16:
13468 0 : ret = PyLong_FromLong((uint16_t)in->uint16);
13469 0 : return ret;
13470 :
13471 0 : case EXTENDED_ERROR_PARAM_TYPE_UINT64:
13472 0 : ret = PyLong_FromUnsignedLongLong(in->uint64);
13473 0 : return ret;
13474 :
13475 0 : case EXTENDED_ERROR_PARAM_TYPE_NONE:
13476 0 : ret = Py_None;
13477 0 : Py_INCREF(ret);
13478 0 : return ret;
13479 :
13480 0 : case EXTENDED_ERROR_PARAM_TYPE_BLOB:
13481 0 : ret = pytalloc_reference_ex(&ExtendedErrorBlob_Type, mem_ctx, &in->blob);
13482 0 : return ret;
13483 :
13484 : }
13485 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
13486 0 : return NULL;
13487 : }
13488 :
13489 0 : static union ExtendedErrorParamU *py_export_ExtendedErrorParamU(TALLOC_CTX *mem_ctx, int level, PyObject *in)
13490 : {
13491 0 : union ExtendedErrorParamU *ret = talloc_zero(mem_ctx, union ExtendedErrorParamU);
13492 0 : switch (level) {
13493 0 : case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING:
13494 0 : if (in == NULL) {
13495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->a_string");
13496 0 : talloc_free(ret); return NULL;
13497 : }
13498 0 : PY_CHECK_TYPE(&ExtendedErrorAString_Type, in, talloc_free(ret); return NULL;);
13499 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13500 0 : PyErr_NoMemory();
13501 0 : talloc_free(ret); return NULL;
13502 : }
13503 0 : ret->a_string = *(struct ExtendedErrorAString *)pytalloc_get_ptr(in);
13504 0 : break;
13505 :
13506 0 : case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING:
13507 0 : if (in == NULL) {
13508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->u_string");
13509 0 : talloc_free(ret); return NULL;
13510 : }
13511 0 : PY_CHECK_TYPE(&ExtendedErrorUString_Type, in, talloc_free(ret); return NULL;);
13512 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13513 0 : PyErr_NoMemory();
13514 0 : talloc_free(ret); return NULL;
13515 : }
13516 0 : ret->u_string = *(struct ExtendedErrorUString *)pytalloc_get_ptr(in);
13517 0 : break;
13518 :
13519 0 : case EXTENDED_ERROR_PARAM_TYPE_UINT32:
13520 0 : if (in == NULL) {
13521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uint32");
13522 0 : talloc_free(ret); return NULL;
13523 : }
13524 : {
13525 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->uint32));
13526 0 : if (PyLong_Check(in)) {
13527 : unsigned long long test_var;
13528 0 : test_var = PyLong_AsUnsignedLongLong(in);
13529 0 : if (PyErr_Occurred() != NULL) {
13530 0 : talloc_free(ret); return NULL;
13531 : }
13532 0 : if (test_var > uint_max) {
13533 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13534 : PyLong_Type.tp_name, uint_max, test_var);
13535 0 : talloc_free(ret); return NULL;
13536 : }
13537 0 : ret->uint32 = test_var;
13538 : } else {
13539 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13540 : PyLong_Type.tp_name);
13541 0 : talloc_free(ret); return NULL;
13542 : }
13543 : }
13544 0 : break;
13545 :
13546 0 : case EXTENDED_ERROR_PARAM_TYPE_UINT16:
13547 0 : if (in == NULL) {
13548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uint16");
13549 0 : talloc_free(ret); return NULL;
13550 : }
13551 : {
13552 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->uint16));
13553 0 : if (PyLong_Check(in)) {
13554 : unsigned long long test_var;
13555 0 : test_var = PyLong_AsUnsignedLongLong(in);
13556 0 : if (PyErr_Occurred() != NULL) {
13557 0 : talloc_free(ret); return NULL;
13558 : }
13559 0 : if (test_var > uint_max) {
13560 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13561 : PyLong_Type.tp_name, uint_max, test_var);
13562 0 : talloc_free(ret); return NULL;
13563 : }
13564 0 : ret->uint16 = test_var;
13565 : } else {
13566 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13567 : PyLong_Type.tp_name);
13568 0 : talloc_free(ret); return NULL;
13569 : }
13570 : }
13571 0 : break;
13572 :
13573 0 : case EXTENDED_ERROR_PARAM_TYPE_UINT64:
13574 0 : if (in == NULL) {
13575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uint64");
13576 0 : talloc_free(ret); return NULL;
13577 : }
13578 : {
13579 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->uint64));
13580 0 : if (PyLong_Check(in)) {
13581 : unsigned long long test_var;
13582 0 : test_var = PyLong_AsUnsignedLongLong(in);
13583 0 : if (PyErr_Occurred() != NULL) {
13584 0 : talloc_free(ret); return NULL;
13585 : }
13586 0 : if (test_var > uint_max) {
13587 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13588 : PyLong_Type.tp_name, uint_max, test_var);
13589 0 : talloc_free(ret); return NULL;
13590 : }
13591 0 : ret->uint64 = test_var;
13592 : } else {
13593 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13594 : PyLong_Type.tp_name);
13595 0 : talloc_free(ret); return NULL;
13596 : }
13597 : }
13598 0 : break;
13599 :
13600 0 : case EXTENDED_ERROR_PARAM_TYPE_NONE:
13601 0 : break;
13602 :
13603 0 : case EXTENDED_ERROR_PARAM_TYPE_BLOB:
13604 0 : if (in == NULL) {
13605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->blob");
13606 0 : talloc_free(ret); return NULL;
13607 : }
13608 0 : PY_CHECK_TYPE(&ExtendedErrorBlob_Type, in, talloc_free(ret); return NULL;);
13609 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13610 0 : PyErr_NoMemory();
13611 0 : talloc_free(ret); return NULL;
13612 : }
13613 0 : ret->blob = *(struct ExtendedErrorBlob *)pytalloc_get_ptr(in);
13614 0 : break;
13615 :
13616 0 : default:
13617 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
13618 0 : talloc_free(ret);
13619 0 : ret = NULL;
13620 : }
13621 :
13622 0 : return ret;
13623 : }
13624 :
13625 0 : static PyObject *py_ExtendedErrorParamU_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13626 : {
13627 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13628 0 : PyObject *mem_ctx_obj = NULL;
13629 0 : TALLOC_CTX *mem_ctx = NULL;
13630 0 : int level = 0;
13631 0 : PyObject *in_obj = NULL;
13632 0 : union ExtendedErrorParamU *in = NULL;
13633 :
13634 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
13635 : discard_const_p(char *, kwnames),
13636 : &mem_ctx_obj,
13637 : &level,
13638 : &in_obj)) {
13639 0 : return NULL;
13640 : }
13641 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13642 0 : if (mem_ctx == NULL) {
13643 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13644 0 : return NULL;
13645 : }
13646 0 : in = (union ExtendedErrorParamU *)pytalloc_get_ptr(in_obj);
13647 0 : if (in == NULL) {
13648 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union ExtendedErrorParamU!");
13649 0 : return NULL;
13650 : }
13651 :
13652 0 : return py_import_ExtendedErrorParamU(mem_ctx, level, in);
13653 : }
13654 :
13655 0 : static PyObject *py_ExtendedErrorParamU_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13656 : {
13657 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13658 0 : PyObject *mem_ctx_obj = NULL;
13659 0 : TALLOC_CTX *mem_ctx = NULL;
13660 0 : int level = 0;
13661 0 : PyObject *in = NULL;
13662 0 : union ExtendedErrorParamU *out = NULL;
13663 :
13664 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
13665 : discard_const_p(char *, kwnames),
13666 : &mem_ctx_obj,
13667 : &level,
13668 : &in)) {
13669 0 : return NULL;
13670 : }
13671 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13672 0 : if (mem_ctx == NULL) {
13673 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13674 0 : return NULL;
13675 : }
13676 :
13677 0 : out = py_export_ExtendedErrorParamU(mem_ctx, level, in);
13678 0 : if (out == NULL) {
13679 0 : return NULL;
13680 : }
13681 :
13682 0 : return pytalloc_GenericObject_reference(out);
13683 : }
13684 :
13685 : static PyMethodDef py_ExtendedErrorParamU_methods[] = {
13686 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ExtendedErrorParamU_import),
13687 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13688 : "T.__import__(mem_ctx, level, in) => ret." },
13689 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ExtendedErrorParamU_export),
13690 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13691 : "T.__export__(mem_ctx, level, in) => ret." },
13692 : { NULL, NULL, 0, NULL }
13693 : };
13694 :
13695 0 : static PyObject *py_ExtendedErrorParamU_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13696 : {
13697 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
13698 0 : return NULL;
13699 : }
13700 :
13701 :
13702 : static PyTypeObject ExtendedErrorParamU_Type = {
13703 : PyVarObject_HEAD_INIT(NULL, 0)
13704 : .tp_name = "drsblobs.ExtendedErrorParamU",
13705 : .tp_getset = NULL,
13706 : .tp_methods = py_ExtendedErrorParamU_methods,
13707 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13708 : .tp_new = py_ExtendedErrorParamU_new,
13709 : };
13710 :
13711 :
13712 0 : static PyObject *py_ExtendedErrorParam_get_type(PyObject *obj, void *closure)
13713 : {
13714 0 : struct ExtendedErrorParam *object = (struct ExtendedErrorParam *)pytalloc_get_ptr(obj);
13715 : PyObject *py_type;
13716 0 : py_type = PyLong_FromLong((uint16_t)object->type);
13717 0 : return py_type;
13718 : }
13719 :
13720 0 : static int py_ExtendedErrorParam_set_type(PyObject *py_obj, PyObject *value, void *closure)
13721 : {
13722 0 : struct ExtendedErrorParam *object = (struct ExtendedErrorParam *)pytalloc_get_ptr(py_obj);
13723 0 : if (value == NULL) {
13724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
13725 0 : return -1;
13726 : }
13727 : {
13728 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
13729 0 : if (PyLong_Check(value)) {
13730 : unsigned long long test_var;
13731 0 : test_var = PyLong_AsUnsignedLongLong(value);
13732 0 : if (PyErr_Occurred() != NULL) {
13733 0 : return -1;
13734 : }
13735 0 : if (test_var > uint_max) {
13736 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13737 : PyLong_Type.tp_name, uint_max, test_var);
13738 0 : return -1;
13739 : }
13740 0 : object->type = test_var;
13741 : } else {
13742 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13743 : PyLong_Type.tp_name);
13744 0 : return -1;
13745 : }
13746 : }
13747 0 : return 0;
13748 : }
13749 :
13750 0 : static PyObject *py_ExtendedErrorParam_get_p(PyObject *obj, void *closure)
13751 : {
13752 0 : struct ExtendedErrorParam *object = (struct ExtendedErrorParam *)pytalloc_get_ptr(obj);
13753 : PyObject *py_p;
13754 0 : py_p = pyrpc_import_union(&ExtendedErrorParamU_Type, pytalloc_get_mem_ctx(obj), object->type, &object->p, "union ExtendedErrorParamU");
13755 0 : if (py_p == NULL) {
13756 0 : return NULL;
13757 : }
13758 0 : return py_p;
13759 : }
13760 :
13761 0 : static int py_ExtendedErrorParam_set_p(PyObject *py_obj, PyObject *value, void *closure)
13762 : {
13763 0 : struct ExtendedErrorParam *object = (struct ExtendedErrorParam *)pytalloc_get_ptr(py_obj);
13764 0 : if (value == NULL) {
13765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->p");
13766 0 : return -1;
13767 : }
13768 : {
13769 : union ExtendedErrorParamU *p_switch_0;
13770 0 : p_switch_0 = (union ExtendedErrorParamU *)pyrpc_export_union(&ExtendedErrorParamU_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union ExtendedErrorParamU");
13771 0 : if (p_switch_0 == NULL) {
13772 0 : return -1;
13773 : }
13774 0 : object->p = *p_switch_0;
13775 : }
13776 0 : return 0;
13777 : }
13778 :
13779 : static PyGetSetDef py_ExtendedErrorParam_getsetters[] = {
13780 : {
13781 : .name = discard_const_p(char, "type"),
13782 : .get = py_ExtendedErrorParam_get_type,
13783 : .set = py_ExtendedErrorParam_set_type,
13784 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorParamType")
13785 : },
13786 : {
13787 : .name = discard_const_p(char, "p"),
13788 : .get = py_ExtendedErrorParam_get_p,
13789 : .set = py_ExtendedErrorParam_set_p,
13790 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorParamU")
13791 : },
13792 : { .name = NULL }
13793 : };
13794 :
13795 0 : static PyObject *py_ExtendedErrorParam_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13796 : {
13797 0 : return pytalloc_new(struct ExtendedErrorParam, type);
13798 : }
13799 :
13800 :
13801 : static PyTypeObject ExtendedErrorParam_Type = {
13802 : PyVarObject_HEAD_INIT(NULL, 0)
13803 : .tp_name = "drsblobs.ExtendedErrorParam",
13804 : .tp_getset = py_ExtendedErrorParam_getsetters,
13805 : .tp_methods = NULL,
13806 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13807 : .tp_new = py_ExtendedErrorParam_new,
13808 : };
13809 :
13810 :
13811 0 : static PyObject *py_ExtendedErrorInfo_get_next(PyObject *obj, void *closure)
13812 : {
13813 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
13814 : PyObject *py_next;
13815 0 : if (object->next == NULL) {
13816 0 : Py_RETURN_NONE;
13817 : }
13818 0 : if (object->next == NULL) {
13819 0 : py_next = Py_None;
13820 0 : Py_INCREF(py_next);
13821 : } else {
13822 0 : py_next = pytalloc_reference_ex(&ExtendedErrorInfo_Type, object->next, object->next);
13823 : }
13824 0 : return py_next;
13825 : }
13826 :
13827 0 : static int py_ExtendedErrorInfo_set_next(PyObject *py_obj, PyObject *value, void *closure)
13828 : {
13829 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
13830 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->next));
13831 0 : if (value == NULL) {
13832 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->next");
13833 0 : return -1;
13834 : }
13835 0 : if (value == Py_None) {
13836 0 : object->next = NULL;
13837 : } else {
13838 0 : object->next = NULL;
13839 0 : PY_CHECK_TYPE(&ExtendedErrorInfo_Type, value, return -1;);
13840 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13841 0 : PyErr_NoMemory();
13842 0 : return -1;
13843 : }
13844 0 : object->next = (struct ExtendedErrorInfo *)pytalloc_get_ptr(value);
13845 : }
13846 0 : return 0;
13847 : }
13848 :
13849 0 : static PyObject *py_ExtendedErrorInfo_get_computer_name(PyObject *obj, void *closure)
13850 : {
13851 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
13852 : PyObject *py_computer_name;
13853 0 : py_computer_name = pytalloc_reference_ex(&ExtendedErrorComputerName_Type, pytalloc_get_mem_ctx(obj), &object->computer_name);
13854 0 : return py_computer_name;
13855 : }
13856 :
13857 0 : static int py_ExtendedErrorInfo_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
13858 : {
13859 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
13860 0 : if (value == NULL) {
13861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
13862 0 : return -1;
13863 : }
13864 0 : PY_CHECK_TYPE(&ExtendedErrorComputerName_Type, value, return -1;);
13865 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13866 0 : PyErr_NoMemory();
13867 0 : return -1;
13868 : }
13869 0 : object->computer_name = *(struct ExtendedErrorComputerName *)pytalloc_get_ptr(value);
13870 0 : return 0;
13871 : }
13872 :
13873 0 : static PyObject *py_ExtendedErrorInfo_get_pid(PyObject *obj, void *closure)
13874 : {
13875 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
13876 : PyObject *py_pid;
13877 0 : py_pid = PyLong_FromUnsignedLongLong(object->pid);
13878 0 : return py_pid;
13879 : }
13880 :
13881 0 : static int py_ExtendedErrorInfo_set_pid(PyObject *py_obj, PyObject *value, void *closure)
13882 : {
13883 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
13884 0 : if (value == NULL) {
13885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid");
13886 0 : return -1;
13887 : }
13888 : {
13889 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid));
13890 0 : if (PyLong_Check(value)) {
13891 : unsigned long long test_var;
13892 0 : test_var = PyLong_AsUnsignedLongLong(value);
13893 0 : if (PyErr_Occurred() != NULL) {
13894 0 : return -1;
13895 : }
13896 0 : if (test_var > uint_max) {
13897 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13898 : PyLong_Type.tp_name, uint_max, test_var);
13899 0 : return -1;
13900 : }
13901 0 : object->pid = test_var;
13902 : } else {
13903 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13904 : PyLong_Type.tp_name);
13905 0 : return -1;
13906 : }
13907 : }
13908 0 : return 0;
13909 : }
13910 :
13911 0 : static PyObject *py_ExtendedErrorInfo_get_time(PyObject *obj, void *closure)
13912 : {
13913 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
13914 : PyObject *py_time;
13915 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
13916 0 : return py_time;
13917 : }
13918 :
13919 0 : static int py_ExtendedErrorInfo_set_time(PyObject *py_obj, PyObject *value, void *closure)
13920 : {
13921 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
13922 0 : if (value == NULL) {
13923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
13924 0 : return -1;
13925 : }
13926 : {
13927 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
13928 0 : if (PyLong_Check(value)) {
13929 : unsigned long long test_var;
13930 0 : test_var = PyLong_AsUnsignedLongLong(value);
13931 0 : if (PyErr_Occurred() != NULL) {
13932 0 : return -1;
13933 : }
13934 0 : if (test_var > uint_max) {
13935 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13936 : PyLong_Type.tp_name, uint_max, test_var);
13937 0 : return -1;
13938 : }
13939 0 : object->time = test_var;
13940 : } else {
13941 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13942 : PyLong_Type.tp_name);
13943 0 : return -1;
13944 : }
13945 : }
13946 0 : return 0;
13947 : }
13948 :
13949 0 : static PyObject *py_ExtendedErrorInfo_get_generating_component(PyObject *obj, void *closure)
13950 : {
13951 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
13952 : PyObject *py_generating_component;
13953 0 : py_generating_component = PyLong_FromUnsignedLongLong((uint32_t)object->generating_component);
13954 0 : return py_generating_component;
13955 : }
13956 :
13957 0 : static int py_ExtendedErrorInfo_set_generating_component(PyObject *py_obj, PyObject *value, void *closure)
13958 : {
13959 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
13960 0 : if (value == NULL) {
13961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generating_component");
13962 0 : return -1;
13963 : }
13964 : {
13965 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generating_component));
13966 0 : if (PyLong_Check(value)) {
13967 : unsigned long long test_var;
13968 0 : test_var = PyLong_AsUnsignedLongLong(value);
13969 0 : if (PyErr_Occurred() != NULL) {
13970 0 : return -1;
13971 : }
13972 0 : if (test_var > uint_max) {
13973 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13974 : PyLong_Type.tp_name, uint_max, test_var);
13975 0 : return -1;
13976 : }
13977 0 : object->generating_component = test_var;
13978 : } else {
13979 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13980 : PyLong_Type.tp_name);
13981 0 : return -1;
13982 : }
13983 : }
13984 0 : return 0;
13985 : }
13986 :
13987 0 : static PyObject *py_ExtendedErrorInfo_get_status(PyObject *obj, void *closure)
13988 : {
13989 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
13990 : PyObject *py_status;
13991 0 : py_status = PyErr_FromWERROR(object->status);
13992 0 : return py_status;
13993 : }
13994 :
13995 0 : static int py_ExtendedErrorInfo_set_status(PyObject *py_obj, PyObject *value, void *closure)
13996 : {
13997 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
13998 0 : if (value == NULL) {
13999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
14000 0 : return -1;
14001 : }
14002 0 : object->status = W_ERROR(PyLong_AsLong(value));
14003 0 : return 0;
14004 : }
14005 :
14006 0 : static PyObject *py_ExtendedErrorInfo_get_detection_location(PyObject *obj, void *closure)
14007 : {
14008 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
14009 : PyObject *py_detection_location;
14010 0 : py_detection_location = PyLong_FromLong((uint16_t)object->detection_location);
14011 0 : return py_detection_location;
14012 : }
14013 :
14014 0 : static int py_ExtendedErrorInfo_set_detection_location(PyObject *py_obj, PyObject *value, void *closure)
14015 : {
14016 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14017 0 : if (value == NULL) {
14018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->detection_location");
14019 0 : return -1;
14020 : }
14021 : {
14022 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->detection_location));
14023 0 : if (PyLong_Check(value)) {
14024 : unsigned long long test_var;
14025 0 : test_var = PyLong_AsUnsignedLongLong(value);
14026 0 : if (PyErr_Occurred() != NULL) {
14027 0 : return -1;
14028 : }
14029 0 : if (test_var > uint_max) {
14030 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14031 : PyLong_Type.tp_name, uint_max, test_var);
14032 0 : return -1;
14033 : }
14034 0 : object->detection_location = test_var;
14035 : } else {
14036 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14037 : PyLong_Type.tp_name);
14038 0 : return -1;
14039 : }
14040 : }
14041 0 : return 0;
14042 : }
14043 :
14044 0 : static PyObject *py_ExtendedErrorInfo_get_flags(PyObject *obj, void *closure)
14045 : {
14046 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
14047 : PyObject *py_flags;
14048 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
14049 0 : return py_flags;
14050 : }
14051 :
14052 0 : static int py_ExtendedErrorInfo_set_flags(PyObject *py_obj, PyObject *value, void *closure)
14053 : {
14054 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14055 0 : if (value == NULL) {
14056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
14057 0 : return -1;
14058 : }
14059 : {
14060 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
14061 0 : if (PyLong_Check(value)) {
14062 : unsigned long long test_var;
14063 0 : test_var = PyLong_AsUnsignedLongLong(value);
14064 0 : if (PyErr_Occurred() != NULL) {
14065 0 : return -1;
14066 : }
14067 0 : if (test_var > uint_max) {
14068 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14069 : PyLong_Type.tp_name, uint_max, test_var);
14070 0 : return -1;
14071 : }
14072 0 : object->flags = test_var;
14073 : } else {
14074 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14075 : PyLong_Type.tp_name);
14076 0 : return -1;
14077 : }
14078 : }
14079 0 : return 0;
14080 : }
14081 :
14082 0 : static PyObject *py_ExtendedErrorInfo_get_num_params(PyObject *obj, void *closure)
14083 : {
14084 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
14085 : PyObject *py_num_params;
14086 0 : py_num_params = PyLong_FromLong((uint16_t)object->num_params);
14087 0 : return py_num_params;
14088 : }
14089 :
14090 0 : static int py_ExtendedErrorInfo_set_num_params(PyObject *py_obj, PyObject *value, void *closure)
14091 : {
14092 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14093 0 : if (value == NULL) {
14094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_params");
14095 0 : return -1;
14096 : }
14097 : {
14098 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_params));
14099 0 : if (PyLong_Check(value)) {
14100 : unsigned long long test_var;
14101 0 : test_var = PyLong_AsUnsignedLongLong(value);
14102 0 : if (PyErr_Occurred() != NULL) {
14103 0 : return -1;
14104 : }
14105 0 : if (test_var > uint_max) {
14106 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14107 : PyLong_Type.tp_name, uint_max, test_var);
14108 0 : return -1;
14109 : }
14110 0 : object->num_params = test_var;
14111 : } else {
14112 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14113 : PyLong_Type.tp_name);
14114 0 : return -1;
14115 : }
14116 : }
14117 0 : return 0;
14118 : }
14119 :
14120 0 : static PyObject *py_ExtendedErrorInfo_get_params(PyObject *obj, void *closure)
14121 : {
14122 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(obj);
14123 : PyObject *py_params;
14124 0 : py_params = PyList_New(object->num_params);
14125 0 : if (py_params == NULL) {
14126 0 : return NULL;
14127 : }
14128 : {
14129 : int params_cntr_0;
14130 0 : for (params_cntr_0 = 0; params_cntr_0 < (object->num_params); params_cntr_0++) {
14131 : PyObject *py_params_0;
14132 0 : py_params_0 = pytalloc_reference_ex(&ExtendedErrorParam_Type, object->params, &object->params[params_cntr_0]);
14133 0 : PyList_SetItem(py_params, params_cntr_0, py_params_0);
14134 : }
14135 : }
14136 0 : return py_params;
14137 : }
14138 :
14139 0 : static int py_ExtendedErrorInfo_set_params(PyObject *py_obj, PyObject *value, void *closure)
14140 : {
14141 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14142 0 : if (value == NULL) {
14143 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->params");
14144 0 : return -1;
14145 : }
14146 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
14147 : {
14148 : int params_cntr_0;
14149 0 : object->params = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->params, PyList_GET_SIZE(value));
14150 0 : if (!object->params) { return -1;; }
14151 0 : talloc_set_name_const(object->params, "ARRAY: object->params");
14152 0 : for (params_cntr_0 = 0; params_cntr_0 < PyList_GET_SIZE(value); params_cntr_0++) {
14153 0 : if (PyList_GET_ITEM(value, params_cntr_0) == NULL) {
14154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->params[params_cntr_0]");
14155 0 : return -1;
14156 : }
14157 0 : PY_CHECK_TYPE(&ExtendedErrorParam_Type, PyList_GET_ITEM(value, params_cntr_0), return -1;);
14158 0 : if (talloc_reference(object->params, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, params_cntr_0))) == NULL) {
14159 0 : PyErr_NoMemory();
14160 0 : return -1;
14161 : }
14162 0 : object->params[params_cntr_0] = *(struct ExtendedErrorParam *)pytalloc_get_ptr(PyList_GET_ITEM(value, params_cntr_0));
14163 : }
14164 : }
14165 0 : return 0;
14166 : }
14167 :
14168 : static PyGetSetDef py_ExtendedErrorInfo_getsetters[] = {
14169 : {
14170 : .name = discard_const_p(char, "next"),
14171 : .get = py_ExtendedErrorInfo_get_next,
14172 : .set = py_ExtendedErrorInfo_set_next,
14173 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorInfo")
14174 : },
14175 : {
14176 : .name = discard_const_p(char, "computer_name"),
14177 : .get = py_ExtendedErrorInfo_get_computer_name,
14178 : .set = py_ExtendedErrorInfo_set_computer_name,
14179 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorComputerName")
14180 : },
14181 : {
14182 : .name = discard_const_p(char, "pid"),
14183 : .get = py_ExtendedErrorInfo_get_pid,
14184 : .set = py_ExtendedErrorInfo_set_pid,
14185 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
14186 : },
14187 : {
14188 : .name = discard_const_p(char, "time"),
14189 : .get = py_ExtendedErrorInfo_get_time,
14190 : .set = py_ExtendedErrorInfo_set_time,
14191 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
14192 : },
14193 : {
14194 : .name = discard_const_p(char, "generating_component"),
14195 : .get = py_ExtendedErrorInfo_get_generating_component,
14196 : .set = py_ExtendedErrorInfo_set_generating_component,
14197 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14198 : },
14199 : {
14200 : .name = discard_const_p(char, "status"),
14201 : .get = py_ExtendedErrorInfo_get_status,
14202 : .set = py_ExtendedErrorInfo_set_status,
14203 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
14204 : },
14205 : {
14206 : .name = discard_const_p(char, "detection_location"),
14207 : .get = py_ExtendedErrorInfo_get_detection_location,
14208 : .set = py_ExtendedErrorInfo_set_detection_location,
14209 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
14210 : },
14211 : {
14212 : .name = discard_const_p(char, "flags"),
14213 : .get = py_ExtendedErrorInfo_get_flags,
14214 : .set = py_ExtendedErrorInfo_set_flags,
14215 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
14216 : },
14217 : {
14218 : .name = discard_const_p(char, "num_params"),
14219 : .get = py_ExtendedErrorInfo_get_num_params,
14220 : .set = py_ExtendedErrorInfo_set_num_params,
14221 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
14222 : },
14223 : {
14224 : .name = discard_const_p(char, "params"),
14225 : .get = py_ExtendedErrorInfo_get_params,
14226 : .set = py_ExtendedErrorInfo_set_params,
14227 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorParam")
14228 : },
14229 : { .name = NULL }
14230 : };
14231 :
14232 0 : static PyObject *py_ExtendedErrorInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14233 : {
14234 0 : return pytalloc_new(struct ExtendedErrorInfo, type);
14235 : }
14236 :
14237 0 : static PyObject *py_ExtendedErrorInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14238 : {
14239 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14240 0 : PyObject *ret = NULL;
14241 : DATA_BLOB blob;
14242 : enum ndr_err_code err;
14243 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
14244 0 : if (tmp_ctx == NULL) {
14245 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14246 0 : return NULL;
14247 : }
14248 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ExtendedErrorInfo);
14249 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14250 0 : TALLOC_FREE(tmp_ctx);
14251 0 : PyErr_SetNdrError(err);
14252 0 : return NULL;
14253 : }
14254 :
14255 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14256 0 : TALLOC_FREE(tmp_ctx);
14257 0 : return ret;
14258 : }
14259 :
14260 0 : static PyObject *py_ExtendedErrorInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14261 : {
14262 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14263 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
14264 0 : Py_ssize_t blob_length = 0;
14265 : enum ndr_err_code err;
14266 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
14267 0 : PyObject *allow_remaining_obj = NULL;
14268 0 : bool allow_remaining = false;
14269 :
14270 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
14271 : discard_const_p(char *, kwnames),
14272 : &blob.data, &blob_length,
14273 : &allow_remaining_obj)) {
14274 0 : return NULL;
14275 : }
14276 0 : blob.length = blob_length;
14277 :
14278 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14279 0 : allow_remaining = true;
14280 : }
14281 :
14282 0 : if (allow_remaining) {
14283 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ExtendedErrorInfo);
14284 : } else {
14285 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ExtendedErrorInfo);
14286 : }
14287 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14288 0 : PyErr_SetNdrError(err);
14289 0 : return NULL;
14290 : }
14291 :
14292 0 : Py_RETURN_NONE;
14293 : }
14294 :
14295 0 : static PyObject *py_ExtendedErrorInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14296 : {
14297 0 : struct ExtendedErrorInfo *object = (struct ExtendedErrorInfo *)pytalloc_get_ptr(py_obj);
14298 : PyObject *ret;
14299 : char *retstr;
14300 :
14301 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ExtendedErrorInfo, "ExtendedErrorInfo", object);
14302 0 : ret = PyUnicode_FromString(retstr);
14303 0 : talloc_free(retstr);
14304 :
14305 0 : return ret;
14306 : }
14307 :
14308 : static PyMethodDef py_ExtendedErrorInfo_methods[] = {
14309 : { "__ndr_pack__", (PyCFunction)py_ExtendedErrorInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
14310 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ExtendedErrorInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
14311 : { "__ndr_print__", (PyCFunction)py_ExtendedErrorInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
14312 : { NULL, NULL, 0, NULL }
14313 : };
14314 :
14315 :
14316 : static PyTypeObject ExtendedErrorInfo_Type = {
14317 : PyVarObject_HEAD_INIT(NULL, 0)
14318 : .tp_name = "drsblobs.ExtendedErrorInfo",
14319 : .tp_getset = py_ExtendedErrorInfo_getsetters,
14320 : .tp_methods = py_ExtendedErrorInfo_methods,
14321 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14322 : .tp_new = py_ExtendedErrorInfo_new,
14323 : };
14324 :
14325 :
14326 0 : static PyObject *py_ExtendedErrorInfoPtr_get_info(PyObject *obj, void *closure)
14327 : {
14328 0 : struct ExtendedErrorInfoPtr *object = (struct ExtendedErrorInfoPtr *)pytalloc_get_ptr(obj);
14329 : PyObject *py_info;
14330 0 : if (object->info == NULL) {
14331 0 : Py_RETURN_NONE;
14332 : }
14333 0 : if (object->info == NULL) {
14334 0 : py_info = Py_None;
14335 0 : Py_INCREF(py_info);
14336 : } else {
14337 0 : py_info = pytalloc_reference_ex(&ExtendedErrorInfo_Type, object->info, object->info);
14338 : }
14339 0 : return py_info;
14340 : }
14341 :
14342 0 : static int py_ExtendedErrorInfoPtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
14343 : {
14344 0 : struct ExtendedErrorInfoPtr *object = (struct ExtendedErrorInfoPtr *)pytalloc_get_ptr(py_obj);
14345 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
14346 0 : if (value == NULL) {
14347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
14348 0 : return -1;
14349 : }
14350 0 : if (value == Py_None) {
14351 0 : object->info = NULL;
14352 : } else {
14353 0 : object->info = NULL;
14354 0 : PY_CHECK_TYPE(&ExtendedErrorInfo_Type, value, return -1;);
14355 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14356 0 : PyErr_NoMemory();
14357 0 : return -1;
14358 : }
14359 0 : object->info = (struct ExtendedErrorInfo *)pytalloc_get_ptr(value);
14360 : }
14361 0 : return 0;
14362 : }
14363 :
14364 : static PyGetSetDef py_ExtendedErrorInfoPtr_getsetters[] = {
14365 : {
14366 : .name = discard_const_p(char, "info"),
14367 : .get = py_ExtendedErrorInfoPtr_get_info,
14368 : .set = py_ExtendedErrorInfoPtr_set_info,
14369 : .doc = discard_const_p(char, "PIDL-generated element of base type ExtendedErrorInfo")
14370 : },
14371 : { .name = NULL }
14372 : };
14373 :
14374 0 : static PyObject *py_ExtendedErrorInfoPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14375 : {
14376 0 : return pytalloc_new(struct ExtendedErrorInfoPtr, type);
14377 : }
14378 :
14379 :
14380 : static PyTypeObject ExtendedErrorInfoPtr_Type = {
14381 : PyVarObject_HEAD_INIT(NULL, 0)
14382 : .tp_name = "drsblobs.ExtendedErrorInfoPtr",
14383 : .tp_getset = py_ExtendedErrorInfoPtr_getsetters,
14384 : .tp_methods = NULL,
14385 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14386 : .tp_new = py_ExtendedErrorInfoPtr_new,
14387 : };
14388 :
14389 :
14390 0 : static PyObject *py_ForestTrustString_get_size(PyObject *obj, void *closure)
14391 : {
14392 0 : struct ForestTrustString *object = (struct ForestTrustString *)pytalloc_get_ptr(obj);
14393 : PyObject *py_size;
14394 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
14395 0 : return py_size;
14396 : }
14397 :
14398 0 : static int py_ForestTrustString_set_size(PyObject *py_obj, PyObject *value, void *closure)
14399 : {
14400 0 : struct ForestTrustString *object = (struct ForestTrustString *)pytalloc_get_ptr(py_obj);
14401 0 : if (value == NULL) {
14402 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
14403 0 : return -1;
14404 : }
14405 : {
14406 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
14407 0 : if (PyLong_Check(value)) {
14408 : unsigned long long test_var;
14409 0 : test_var = PyLong_AsUnsignedLongLong(value);
14410 0 : if (PyErr_Occurred() != NULL) {
14411 0 : return -1;
14412 : }
14413 0 : if (test_var > uint_max) {
14414 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14415 : PyLong_Type.tp_name, uint_max, test_var);
14416 0 : return -1;
14417 : }
14418 0 : object->size = test_var;
14419 : } else {
14420 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14421 : PyLong_Type.tp_name);
14422 0 : return -1;
14423 : }
14424 : }
14425 0 : return 0;
14426 : }
14427 :
14428 0 : static PyObject *py_ForestTrustString_get_string(PyObject *obj, void *closure)
14429 : {
14430 0 : struct ForestTrustString *object = (struct ForestTrustString *)pytalloc_get_ptr(obj);
14431 : PyObject *py_string;
14432 0 : if (object->string == NULL) {
14433 0 : py_string = Py_None;
14434 0 : Py_INCREF(py_string);
14435 : } else {
14436 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
14437 : }
14438 0 : return py_string;
14439 : }
14440 :
14441 0 : static int py_ForestTrustString_set_string(PyObject *py_obj, PyObject *value, void *closure)
14442 : {
14443 0 : struct ForestTrustString *object = (struct ForestTrustString *)pytalloc_get_ptr(py_obj);
14444 0 : if (value == NULL) {
14445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
14446 0 : return -1;
14447 : }
14448 : {
14449 : const char *test_str;
14450 : const char *talloc_str;
14451 0 : PyObject *unicode = NULL;
14452 0 : if (PyUnicode_Check(value)) {
14453 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
14454 0 : if (unicode == NULL) {
14455 0 : PyErr_NoMemory();
14456 0 : return -1;
14457 : }
14458 0 : test_str = PyBytes_AS_STRING(unicode);
14459 0 : } else if (PyBytes_Check(value)) {
14460 0 : test_str = PyBytes_AS_STRING(value);
14461 : } else {
14462 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
14463 0 : return -1;
14464 : }
14465 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
14466 0 : if (unicode != NULL) {
14467 0 : Py_DECREF(unicode);
14468 : }
14469 0 : if (talloc_str == NULL) {
14470 0 : PyErr_NoMemory();
14471 0 : return -1;
14472 : }
14473 0 : object->string = talloc_str;
14474 : }
14475 0 : return 0;
14476 : }
14477 :
14478 : static PyGetSetDef py_ForestTrustString_getsetters[] = {
14479 : {
14480 : .name = discard_const_p(char, "size"),
14481 : .get = py_ForestTrustString_get_size,
14482 : .set = py_ForestTrustString_set_size,
14483 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14484 : },
14485 : {
14486 : .name = discard_const_p(char, "string"),
14487 : .get = py_ForestTrustString_get_string,
14488 : .set = py_ForestTrustString_set_string,
14489 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14490 : },
14491 : { .name = NULL }
14492 : };
14493 :
14494 0 : static PyObject *py_ForestTrustString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14495 : {
14496 0 : return pytalloc_new(struct ForestTrustString, type);
14497 : }
14498 :
14499 :
14500 : static PyTypeObject ForestTrustString_Type = {
14501 : PyVarObject_HEAD_INIT(NULL, 0)
14502 : .tp_name = "drsblobs.ForestTrustString",
14503 : .tp_getset = py_ForestTrustString_getsetters,
14504 : .tp_methods = NULL,
14505 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14506 : .tp_new = py_ForestTrustString_new,
14507 : };
14508 :
14509 :
14510 0 : static PyObject *py_ForestTrustDataDomainInfo_get_sid_size(PyObject *obj, void *closure)
14511 : {
14512 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(obj);
14513 : PyObject *py_sid_size;
14514 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)object->sid_size);
14515 0 : return py_sid_size;
14516 : }
14517 :
14518 0 : static int py_ForestTrustDataDomainInfo_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
14519 : {
14520 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(py_obj);
14521 0 : if (value == NULL) {
14522 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_size");
14523 0 : return -1;
14524 : }
14525 : {
14526 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
14527 0 : if (PyLong_Check(value)) {
14528 : unsigned long long test_var;
14529 0 : test_var = PyLong_AsUnsignedLongLong(value);
14530 0 : if (PyErr_Occurred() != NULL) {
14531 0 : return -1;
14532 : }
14533 0 : if (test_var > uint_max) {
14534 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14535 : PyLong_Type.tp_name, uint_max, test_var);
14536 0 : return -1;
14537 : }
14538 0 : object->sid_size = test_var;
14539 : } else {
14540 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14541 : PyLong_Type.tp_name);
14542 0 : return -1;
14543 : }
14544 : }
14545 0 : return 0;
14546 : }
14547 :
14548 0 : static PyObject *py_ForestTrustDataDomainInfo_get_sid(PyObject *obj, void *closure)
14549 : {
14550 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(obj);
14551 : PyObject *py_sid;
14552 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
14553 0 : return py_sid;
14554 : }
14555 :
14556 0 : static int py_ForestTrustDataDomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
14557 : {
14558 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(py_obj);
14559 0 : if (value == NULL) {
14560 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
14561 0 : return -1;
14562 : }
14563 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
14564 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14565 0 : PyErr_NoMemory();
14566 0 : return -1;
14567 : }
14568 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
14569 0 : return 0;
14570 : }
14571 :
14572 0 : static PyObject *py_ForestTrustDataDomainInfo_get_dns_name(PyObject *obj, void *closure)
14573 : {
14574 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(obj);
14575 : PyObject *py_dns_name;
14576 0 : py_dns_name = pytalloc_reference_ex(&ForestTrustString_Type, pytalloc_get_mem_ctx(obj), &object->dns_name);
14577 0 : return py_dns_name;
14578 : }
14579 :
14580 0 : static int py_ForestTrustDataDomainInfo_set_dns_name(PyObject *py_obj, PyObject *value, void *closure)
14581 : {
14582 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(py_obj);
14583 0 : if (value == NULL) {
14584 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_name");
14585 0 : return -1;
14586 : }
14587 0 : PY_CHECK_TYPE(&ForestTrustString_Type, value, return -1;);
14588 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14589 0 : PyErr_NoMemory();
14590 0 : return -1;
14591 : }
14592 0 : object->dns_name = *(struct ForestTrustString *)pytalloc_get_ptr(value);
14593 0 : return 0;
14594 : }
14595 :
14596 0 : static PyObject *py_ForestTrustDataDomainInfo_get_netbios_name(PyObject *obj, void *closure)
14597 : {
14598 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(obj);
14599 : PyObject *py_netbios_name;
14600 0 : py_netbios_name = pytalloc_reference_ex(&ForestTrustString_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
14601 0 : return py_netbios_name;
14602 : }
14603 :
14604 0 : static int py_ForestTrustDataDomainInfo_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
14605 : {
14606 0 : struct ForestTrustDataDomainInfo *object = (struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(py_obj);
14607 0 : if (value == NULL) {
14608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
14609 0 : return -1;
14610 : }
14611 0 : PY_CHECK_TYPE(&ForestTrustString_Type, value, return -1;);
14612 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14613 0 : PyErr_NoMemory();
14614 0 : return -1;
14615 : }
14616 0 : object->netbios_name = *(struct ForestTrustString *)pytalloc_get_ptr(value);
14617 0 : return 0;
14618 : }
14619 :
14620 : static PyGetSetDef py_ForestTrustDataDomainInfo_getsetters[] = {
14621 : {
14622 : .name = discard_const_p(char, "sid_size"),
14623 : .get = py_ForestTrustDataDomainInfo_get_sid_size,
14624 : .set = py_ForestTrustDataDomainInfo_set_sid_size,
14625 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14626 : },
14627 : {
14628 : .name = discard_const_p(char, "sid"),
14629 : .get = py_ForestTrustDataDomainInfo_get_sid,
14630 : .set = py_ForestTrustDataDomainInfo_set_sid,
14631 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
14632 : },
14633 : {
14634 : .name = discard_const_p(char, "dns_name"),
14635 : .get = py_ForestTrustDataDomainInfo_get_dns_name,
14636 : .set = py_ForestTrustDataDomainInfo_set_dns_name,
14637 : .doc = discard_const_p(char, "PIDL-generated element of base type ForestTrustString")
14638 : },
14639 : {
14640 : .name = discard_const_p(char, "netbios_name"),
14641 : .get = py_ForestTrustDataDomainInfo_get_netbios_name,
14642 : .set = py_ForestTrustDataDomainInfo_set_netbios_name,
14643 : .doc = discard_const_p(char, "PIDL-generated element of base type ForestTrustString")
14644 : },
14645 : { .name = NULL }
14646 : };
14647 :
14648 0 : static PyObject *py_ForestTrustDataDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14649 : {
14650 0 : return pytalloc_new(struct ForestTrustDataDomainInfo, type);
14651 : }
14652 :
14653 :
14654 : static PyTypeObject ForestTrustDataDomainInfo_Type = {
14655 : PyVarObject_HEAD_INIT(NULL, 0)
14656 : .tp_name = "drsblobs.ForestTrustDataDomainInfo",
14657 : .tp_getset = py_ForestTrustDataDomainInfo_getsetters,
14658 : .tp_methods = NULL,
14659 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14660 : .tp_new = py_ForestTrustDataDomainInfo_new,
14661 : };
14662 :
14663 :
14664 0 : static PyObject *py_ForestTrustDataBinaryData_get_size(PyObject *obj, void *closure)
14665 : {
14666 0 : struct ForestTrustDataBinaryData *object = (struct ForestTrustDataBinaryData *)pytalloc_get_ptr(obj);
14667 : PyObject *py_size;
14668 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
14669 0 : return py_size;
14670 : }
14671 :
14672 0 : static int py_ForestTrustDataBinaryData_set_size(PyObject *py_obj, PyObject *value, void *closure)
14673 : {
14674 0 : struct ForestTrustDataBinaryData *object = (struct ForestTrustDataBinaryData *)pytalloc_get_ptr(py_obj);
14675 0 : if (value == NULL) {
14676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
14677 0 : return -1;
14678 : }
14679 : {
14680 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
14681 0 : if (PyLong_Check(value)) {
14682 : unsigned long long test_var;
14683 0 : test_var = PyLong_AsUnsignedLongLong(value);
14684 0 : if (PyErr_Occurred() != NULL) {
14685 0 : return -1;
14686 : }
14687 0 : if (test_var > uint_max) {
14688 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14689 : PyLong_Type.tp_name, uint_max, test_var);
14690 0 : return -1;
14691 : }
14692 0 : object->size = test_var;
14693 : } else {
14694 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14695 : PyLong_Type.tp_name);
14696 0 : return -1;
14697 : }
14698 : }
14699 0 : return 0;
14700 : }
14701 :
14702 0 : static PyObject *py_ForestTrustDataBinaryData_get_data(PyObject *obj, void *closure)
14703 : {
14704 0 : struct ForestTrustDataBinaryData *object = (struct ForestTrustDataBinaryData *)pytalloc_get_ptr(obj);
14705 : PyObject *py_data;
14706 0 : py_data = PyList_New(object->size);
14707 0 : if (py_data == NULL) {
14708 0 : return NULL;
14709 : }
14710 : {
14711 : int data_cntr_0;
14712 0 : for (data_cntr_0 = 0; data_cntr_0 < (object->size); data_cntr_0++) {
14713 : PyObject *py_data_0;
14714 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
14715 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
14716 : }
14717 : }
14718 0 : return py_data;
14719 : }
14720 :
14721 0 : static int py_ForestTrustDataBinaryData_set_data(PyObject *py_obj, PyObject *value, void *closure)
14722 : {
14723 0 : struct ForestTrustDataBinaryData *object = (struct ForestTrustDataBinaryData *)pytalloc_get_ptr(py_obj);
14724 0 : if (value == NULL) {
14725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
14726 0 : return -1;
14727 : }
14728 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
14729 : {
14730 : int data_cntr_0;
14731 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
14732 0 : if (!object->data) { return -1;; }
14733 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
14734 0 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
14735 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
14736 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
14737 0 : return -1;
14738 : }
14739 : {
14740 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
14741 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
14742 : unsigned long long test_var;
14743 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
14744 0 : if (PyErr_Occurred() != NULL) {
14745 0 : return -1;
14746 : }
14747 0 : if (test_var > uint_max) {
14748 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14749 : PyLong_Type.tp_name, uint_max, test_var);
14750 0 : return -1;
14751 : }
14752 0 : object->data[data_cntr_0] = test_var;
14753 : } else {
14754 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14755 : PyLong_Type.tp_name);
14756 0 : return -1;
14757 : }
14758 : }
14759 : }
14760 : }
14761 0 : return 0;
14762 : }
14763 :
14764 : static PyGetSetDef py_ForestTrustDataBinaryData_getsetters[] = {
14765 : {
14766 : .name = discard_const_p(char, "size"),
14767 : .get = py_ForestTrustDataBinaryData_get_size,
14768 : .set = py_ForestTrustDataBinaryData_set_size,
14769 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14770 : },
14771 : {
14772 : .name = discard_const_p(char, "data"),
14773 : .get = py_ForestTrustDataBinaryData_get_data,
14774 : .set = py_ForestTrustDataBinaryData_set_data,
14775 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14776 : },
14777 : { .name = NULL }
14778 : };
14779 :
14780 0 : static PyObject *py_ForestTrustDataBinaryData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14781 : {
14782 0 : return pytalloc_new(struct ForestTrustDataBinaryData, type);
14783 : }
14784 :
14785 :
14786 : static PyTypeObject ForestTrustDataBinaryData_Type = {
14787 : PyVarObject_HEAD_INIT(NULL, 0)
14788 : .tp_name = "drsblobs.ForestTrustDataBinaryData",
14789 : .tp_getset = py_ForestTrustDataBinaryData_getsetters,
14790 : .tp_methods = NULL,
14791 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14792 : .tp_new = py_ForestTrustDataBinaryData_new,
14793 : };
14794 :
14795 0 : static PyObject *py_import_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union ForestTrustData *in)
14796 : {
14797 : PyObject *ret;
14798 :
14799 0 : switch (level) {
14800 0 : case FOREST_TRUST_TOP_LEVEL_NAME:
14801 0 : ret = pytalloc_reference_ex(&ForestTrustString_Type, mem_ctx, &in->name);
14802 0 : return ret;
14803 :
14804 0 : case FOREST_TRUST_TOP_LEVEL_NAME_EX:
14805 0 : ret = pytalloc_reference_ex(&ForestTrustString_Type, mem_ctx, &in->name);
14806 0 : return ret;
14807 :
14808 0 : case FOREST_TRUST_DOMAIN_INFO:
14809 0 : ret = pytalloc_reference_ex(&ForestTrustDataDomainInfo_Type, mem_ctx, &in->info);
14810 0 : return ret;
14811 :
14812 0 : default:
14813 0 : ret = pytalloc_reference_ex(&ForestTrustDataBinaryData_Type, mem_ctx, &in->data);
14814 0 : return ret;
14815 :
14816 : }
14817 : PyErr_SetString(PyExc_TypeError, "unknown union level");
14818 : return NULL;
14819 : }
14820 :
14821 0 : static union ForestTrustData *py_export_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
14822 : {
14823 0 : union ForestTrustData *ret = talloc_zero(mem_ctx, union ForestTrustData);
14824 0 : switch (level) {
14825 0 : case FOREST_TRUST_TOP_LEVEL_NAME:
14826 0 : if (in == NULL) {
14827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
14828 0 : talloc_free(ret); return NULL;
14829 : }
14830 0 : PY_CHECK_TYPE(&ForestTrustString_Type, in, talloc_free(ret); return NULL;);
14831 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
14832 0 : PyErr_NoMemory();
14833 0 : talloc_free(ret); return NULL;
14834 : }
14835 0 : ret->name = *(struct ForestTrustString *)pytalloc_get_ptr(in);
14836 0 : break;
14837 :
14838 0 : case FOREST_TRUST_TOP_LEVEL_NAME_EX:
14839 0 : if (in == NULL) {
14840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
14841 0 : talloc_free(ret); return NULL;
14842 : }
14843 0 : PY_CHECK_TYPE(&ForestTrustString_Type, in, talloc_free(ret); return NULL;);
14844 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
14845 0 : PyErr_NoMemory();
14846 0 : talloc_free(ret); return NULL;
14847 : }
14848 0 : ret->name = *(struct ForestTrustString *)pytalloc_get_ptr(in);
14849 0 : break;
14850 :
14851 0 : case FOREST_TRUST_DOMAIN_INFO:
14852 0 : if (in == NULL) {
14853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info");
14854 0 : talloc_free(ret); return NULL;
14855 : }
14856 0 : PY_CHECK_TYPE(&ForestTrustDataDomainInfo_Type, in, talloc_free(ret); return NULL;);
14857 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
14858 0 : PyErr_NoMemory();
14859 0 : talloc_free(ret); return NULL;
14860 : }
14861 0 : ret->info = *(struct ForestTrustDataDomainInfo *)pytalloc_get_ptr(in);
14862 0 : break;
14863 :
14864 0 : default:
14865 0 : if (in == NULL) {
14866 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
14867 0 : talloc_free(ret); return NULL;
14868 : }
14869 0 : PY_CHECK_TYPE(&ForestTrustDataBinaryData_Type, in, talloc_free(ret); return NULL;);
14870 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
14871 0 : PyErr_NoMemory();
14872 0 : talloc_free(ret); return NULL;
14873 : }
14874 0 : ret->data = *(struct ForestTrustDataBinaryData *)pytalloc_get_ptr(in);
14875 0 : break;
14876 :
14877 : }
14878 :
14879 0 : return ret;
14880 : }
14881 :
14882 0 : static PyObject *py_ForestTrustData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14883 : {
14884 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
14885 0 : PyObject *mem_ctx_obj = NULL;
14886 0 : TALLOC_CTX *mem_ctx = NULL;
14887 0 : int level = 0;
14888 0 : PyObject *in_obj = NULL;
14889 0 : union ForestTrustData *in = NULL;
14890 :
14891 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
14892 : discard_const_p(char *, kwnames),
14893 : &mem_ctx_obj,
14894 : &level,
14895 : &in_obj)) {
14896 0 : return NULL;
14897 : }
14898 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
14899 0 : if (mem_ctx == NULL) {
14900 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
14901 0 : return NULL;
14902 : }
14903 0 : in = (union ForestTrustData *)pytalloc_get_ptr(in_obj);
14904 0 : if (in == NULL) {
14905 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union ForestTrustData!");
14906 0 : return NULL;
14907 : }
14908 :
14909 0 : return py_import_ForestTrustData(mem_ctx, level, in);
14910 : }
14911 :
14912 0 : static PyObject *py_ForestTrustData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14913 : {
14914 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
14915 0 : PyObject *mem_ctx_obj = NULL;
14916 0 : TALLOC_CTX *mem_ctx = NULL;
14917 0 : int level = 0;
14918 0 : PyObject *in = NULL;
14919 0 : union ForestTrustData *out = NULL;
14920 :
14921 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
14922 : discard_const_p(char *, kwnames),
14923 : &mem_ctx_obj,
14924 : &level,
14925 : &in)) {
14926 0 : return NULL;
14927 : }
14928 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
14929 0 : if (mem_ctx == NULL) {
14930 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
14931 0 : return NULL;
14932 : }
14933 :
14934 0 : out = py_export_ForestTrustData(mem_ctx, level, in);
14935 0 : if (out == NULL) {
14936 0 : return NULL;
14937 : }
14938 :
14939 0 : return pytalloc_GenericObject_reference(out);
14940 : }
14941 :
14942 : static PyMethodDef py_ForestTrustData_methods[] = {
14943 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ForestTrustData_import),
14944 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
14945 : "T.__import__(mem_ctx, level, in) => ret." },
14946 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ForestTrustData_export),
14947 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
14948 : "T.__export__(mem_ctx, level, in) => ret." },
14949 : { NULL, NULL, 0, NULL }
14950 : };
14951 :
14952 0 : static PyObject *py_ForestTrustData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14953 : {
14954 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
14955 0 : return NULL;
14956 : }
14957 :
14958 :
14959 : static PyTypeObject ForestTrustData_Type = {
14960 : PyVarObject_HEAD_INIT(NULL, 0)
14961 : .tp_name = "drsblobs.ForestTrustData",
14962 : .tp_getset = NULL,
14963 : .tp_methods = py_ForestTrustData_methods,
14964 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14965 : .tp_new = py_ForestTrustData_new,
14966 : };
14967 :
14968 :
14969 0 : static PyObject *py_ForestTrustInfoRecord_get_flags(PyObject *obj, void *closure)
14970 : {
14971 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(obj);
14972 : PyObject *py_flags;
14973 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
14974 0 : return py_flags;
14975 : }
14976 :
14977 0 : static int py_ForestTrustInfoRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
14978 : {
14979 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
14980 0 : if (value == NULL) {
14981 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
14982 0 : return -1;
14983 : }
14984 : {
14985 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
14986 0 : if (PyLong_Check(value)) {
14987 : unsigned long long test_var;
14988 0 : test_var = PyLong_AsUnsignedLongLong(value);
14989 0 : if (PyErr_Occurred() != NULL) {
14990 0 : return -1;
14991 : }
14992 0 : if (test_var > uint_max) {
14993 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14994 : PyLong_Type.tp_name, uint_max, test_var);
14995 0 : return -1;
14996 : }
14997 0 : object->flags = test_var;
14998 : } else {
14999 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15000 : PyLong_Type.tp_name);
15001 0 : return -1;
15002 : }
15003 : }
15004 0 : return 0;
15005 : }
15006 :
15007 0 : static PyObject *py_ForestTrustInfoRecord_get_timestamp(PyObject *obj, void *closure)
15008 : {
15009 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(obj);
15010 : PyObject *py_timestamp;
15011 0 : py_timestamp = PyLong_FromUnsignedLongLong(object->timestamp);
15012 0 : return py_timestamp;
15013 : }
15014 :
15015 0 : static int py_ForestTrustInfoRecord_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
15016 : {
15017 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
15018 0 : if (value == NULL) {
15019 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
15020 0 : return -1;
15021 : }
15022 : {
15023 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timestamp));
15024 0 : if (PyLong_Check(value)) {
15025 : unsigned long long test_var;
15026 0 : test_var = PyLong_AsUnsignedLongLong(value);
15027 0 : if (PyErr_Occurred() != NULL) {
15028 0 : return -1;
15029 : }
15030 0 : if (test_var > uint_max) {
15031 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15032 : PyLong_Type.tp_name, uint_max, test_var);
15033 0 : return -1;
15034 : }
15035 0 : object->timestamp = test_var;
15036 : } else {
15037 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15038 : PyLong_Type.tp_name);
15039 0 : return -1;
15040 : }
15041 : }
15042 0 : return 0;
15043 : }
15044 :
15045 0 : static PyObject *py_ForestTrustInfoRecord_get_type(PyObject *obj, void *closure)
15046 : {
15047 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(obj);
15048 : PyObject *py_type;
15049 0 : py_type = PyLong_FromLong((uint16_t)object->type);
15050 0 : return py_type;
15051 : }
15052 :
15053 0 : static int py_ForestTrustInfoRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
15054 : {
15055 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
15056 0 : if (value == NULL) {
15057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
15058 0 : return -1;
15059 : }
15060 : {
15061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
15062 0 : if (PyLong_Check(value)) {
15063 : unsigned long long test_var;
15064 0 : test_var = PyLong_AsUnsignedLongLong(value);
15065 0 : if (PyErr_Occurred() != NULL) {
15066 0 : return -1;
15067 : }
15068 0 : if (test_var > uint_max) {
15069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15070 : PyLong_Type.tp_name, uint_max, test_var);
15071 0 : return -1;
15072 : }
15073 0 : object->type = test_var;
15074 : } else {
15075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15076 : PyLong_Type.tp_name);
15077 0 : return -1;
15078 : }
15079 : }
15080 0 : return 0;
15081 : }
15082 :
15083 0 : static PyObject *py_ForestTrustInfoRecord_get_data(PyObject *obj, void *closure)
15084 : {
15085 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(obj);
15086 : PyObject *py_data;
15087 0 : py_data = pyrpc_import_union(&ForestTrustData_Type, pytalloc_get_mem_ctx(obj), object->type, &object->data, "union ForestTrustData");
15088 0 : if (py_data == NULL) {
15089 0 : return NULL;
15090 : }
15091 0 : return py_data;
15092 : }
15093 :
15094 0 : static int py_ForestTrustInfoRecord_set_data(PyObject *py_obj, PyObject *value, void *closure)
15095 : {
15096 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
15097 0 : if (value == NULL) {
15098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
15099 0 : return -1;
15100 : }
15101 : {
15102 : union ForestTrustData *data_switch_0;
15103 0 : data_switch_0 = (union ForestTrustData *)pyrpc_export_union(&ForestTrustData_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union ForestTrustData");
15104 0 : if (data_switch_0 == NULL) {
15105 0 : return -1;
15106 : }
15107 0 : object->data = *data_switch_0;
15108 : }
15109 0 : return 0;
15110 : }
15111 :
15112 : static PyGetSetDef py_ForestTrustInfoRecord_getsetters[] = {
15113 : {
15114 : .name = discard_const_p(char, "flags"),
15115 : .get = py_ForestTrustInfoRecord_get_flags,
15116 : .set = py_ForestTrustInfoRecord_set_flags,
15117 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
15118 : },
15119 : {
15120 : .name = discard_const_p(char, "timestamp"),
15121 : .get = py_ForestTrustInfoRecord_get_timestamp,
15122 : .set = py_ForestTrustInfoRecord_set_timestamp,
15123 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
15124 : },
15125 : {
15126 : .name = discard_const_p(char, "type"),
15127 : .get = py_ForestTrustInfoRecord_get_type,
15128 : .set = py_ForestTrustInfoRecord_set_type,
15129 : .doc = discard_const_p(char, "PIDL-generated element of base type ForestTrustInfoRecordType")
15130 : },
15131 : {
15132 : .name = discard_const_p(char, "data"),
15133 : .get = py_ForestTrustInfoRecord_get_data,
15134 : .set = py_ForestTrustInfoRecord_set_data,
15135 : .doc = discard_const_p(char, "PIDL-generated element of base type ForestTrustData")
15136 : },
15137 : { .name = NULL }
15138 : };
15139 :
15140 0 : static PyObject *py_ForestTrustInfoRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15141 : {
15142 0 : return pytalloc_new(struct ForestTrustInfoRecord, type);
15143 : }
15144 :
15145 0 : static PyObject *py_ForestTrustInfoRecord_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15146 : {
15147 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
15148 0 : PyObject *ret = NULL;
15149 : DATA_BLOB blob;
15150 : enum ndr_err_code err;
15151 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
15152 0 : if (tmp_ctx == NULL) {
15153 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15154 0 : return NULL;
15155 : }
15156 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ForestTrustInfoRecord);
15157 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15158 0 : TALLOC_FREE(tmp_ctx);
15159 0 : PyErr_SetNdrError(err);
15160 0 : return NULL;
15161 : }
15162 :
15163 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15164 0 : TALLOC_FREE(tmp_ctx);
15165 0 : return ret;
15166 : }
15167 :
15168 0 : static PyObject *py_ForestTrustInfoRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15169 : {
15170 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
15171 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
15172 0 : Py_ssize_t blob_length = 0;
15173 : enum ndr_err_code err;
15174 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
15175 0 : PyObject *allow_remaining_obj = NULL;
15176 0 : bool allow_remaining = false;
15177 :
15178 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
15179 : discard_const_p(char *, kwnames),
15180 : &blob.data, &blob_length,
15181 : &allow_remaining_obj)) {
15182 0 : return NULL;
15183 : }
15184 0 : blob.length = blob_length;
15185 :
15186 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15187 0 : allow_remaining = true;
15188 : }
15189 :
15190 0 : if (allow_remaining) {
15191 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ForestTrustInfoRecord);
15192 : } else {
15193 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ForestTrustInfoRecord);
15194 : }
15195 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15196 0 : PyErr_SetNdrError(err);
15197 0 : return NULL;
15198 : }
15199 :
15200 0 : Py_RETURN_NONE;
15201 : }
15202 :
15203 0 : static PyObject *py_ForestTrustInfoRecord_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15204 : {
15205 0 : struct ForestTrustInfoRecord *object = (struct ForestTrustInfoRecord *)pytalloc_get_ptr(py_obj);
15206 : PyObject *ret;
15207 : char *retstr;
15208 :
15209 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ForestTrustInfoRecord, "ForestTrustInfoRecord", object);
15210 0 : ret = PyUnicode_FromString(retstr);
15211 0 : talloc_free(retstr);
15212 :
15213 0 : return ret;
15214 : }
15215 :
15216 : static PyMethodDef py_ForestTrustInfoRecord_methods[] = {
15217 : { "__ndr_pack__", (PyCFunction)py_ForestTrustInfoRecord_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
15218 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ForestTrustInfoRecord_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
15219 : { "__ndr_print__", (PyCFunction)py_ForestTrustInfoRecord_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
15220 : { NULL, NULL, 0, NULL }
15221 : };
15222 :
15223 :
15224 : static PyTypeObject ForestTrustInfoRecord_Type = {
15225 : PyVarObject_HEAD_INIT(NULL, 0)
15226 : .tp_name = "drsblobs.ForestTrustInfoRecord",
15227 : .tp_getset = py_ForestTrustInfoRecord_getsetters,
15228 : .tp_methods = py_ForestTrustInfoRecord_methods,
15229 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15230 : .tp_new = py_ForestTrustInfoRecord_new,
15231 : };
15232 :
15233 :
15234 0 : static PyObject *py_ForestTrustInfoRecordArmor_get_record_size(PyObject *obj, void *closure)
15235 : {
15236 0 : struct ForestTrustInfoRecordArmor *object = (struct ForestTrustInfoRecordArmor *)pytalloc_get_ptr(obj);
15237 : PyObject *py_record_size;
15238 0 : py_record_size = PyLong_FromUnsignedLongLong((uint32_t)object->record_size);
15239 0 : return py_record_size;
15240 : }
15241 :
15242 0 : static int py_ForestTrustInfoRecordArmor_set_record_size(PyObject *py_obj, PyObject *value, void *closure)
15243 : {
15244 0 : struct ForestTrustInfoRecordArmor *object = (struct ForestTrustInfoRecordArmor *)pytalloc_get_ptr(py_obj);
15245 0 : if (value == NULL) {
15246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->record_size");
15247 0 : return -1;
15248 : }
15249 : {
15250 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->record_size));
15251 0 : if (PyLong_Check(value)) {
15252 : unsigned long long test_var;
15253 0 : test_var = PyLong_AsUnsignedLongLong(value);
15254 0 : if (PyErr_Occurred() != NULL) {
15255 0 : return -1;
15256 : }
15257 0 : if (test_var > uint_max) {
15258 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15259 : PyLong_Type.tp_name, uint_max, test_var);
15260 0 : return -1;
15261 : }
15262 0 : object->record_size = test_var;
15263 : } else {
15264 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15265 : PyLong_Type.tp_name);
15266 0 : return -1;
15267 : }
15268 : }
15269 0 : return 0;
15270 : }
15271 :
15272 0 : static PyObject *py_ForestTrustInfoRecordArmor_get_record(PyObject *obj, void *closure)
15273 : {
15274 0 : struct ForestTrustInfoRecordArmor *object = (struct ForestTrustInfoRecordArmor *)pytalloc_get_ptr(obj);
15275 : PyObject *py_record;
15276 0 : py_record = pytalloc_reference_ex(&ForestTrustInfoRecord_Type, pytalloc_get_mem_ctx(obj), &object->record);
15277 0 : return py_record;
15278 : }
15279 :
15280 0 : static int py_ForestTrustInfoRecordArmor_set_record(PyObject *py_obj, PyObject *value, void *closure)
15281 : {
15282 0 : struct ForestTrustInfoRecordArmor *object = (struct ForestTrustInfoRecordArmor *)pytalloc_get_ptr(py_obj);
15283 0 : if (value == NULL) {
15284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->record");
15285 0 : return -1;
15286 : }
15287 0 : PY_CHECK_TYPE(&ForestTrustInfoRecord_Type, value, return -1;);
15288 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15289 0 : PyErr_NoMemory();
15290 0 : return -1;
15291 : }
15292 0 : object->record = *(struct ForestTrustInfoRecord *)pytalloc_get_ptr(value);
15293 0 : return 0;
15294 : }
15295 :
15296 : static PyGetSetDef py_ForestTrustInfoRecordArmor_getsetters[] = {
15297 : {
15298 : .name = discard_const_p(char, "record_size"),
15299 : .get = py_ForestTrustInfoRecordArmor_get_record_size,
15300 : .set = py_ForestTrustInfoRecordArmor_set_record_size,
15301 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15302 : },
15303 : {
15304 : .name = discard_const_p(char, "record"),
15305 : .get = py_ForestTrustInfoRecordArmor_get_record,
15306 : .set = py_ForestTrustInfoRecordArmor_set_record,
15307 : .doc = discard_const_p(char, "PIDL-generated element of base type ForestTrustInfoRecord")
15308 : },
15309 : { .name = NULL }
15310 : };
15311 :
15312 0 : static PyObject *py_ForestTrustInfoRecordArmor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15313 : {
15314 0 : return pytalloc_new(struct ForestTrustInfoRecordArmor, type);
15315 : }
15316 :
15317 :
15318 : static PyTypeObject ForestTrustInfoRecordArmor_Type = {
15319 : PyVarObject_HEAD_INIT(NULL, 0)
15320 : .tp_name = "drsblobs.ForestTrustInfoRecordArmor",
15321 : .tp_getset = py_ForestTrustInfoRecordArmor_getsetters,
15322 : .tp_methods = NULL,
15323 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15324 : .tp_new = py_ForestTrustInfoRecordArmor_new,
15325 : };
15326 :
15327 :
15328 0 : static PyObject *py_ForestTrustInfo_get_version(PyObject *obj, void *closure)
15329 : {
15330 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(obj);
15331 : PyObject *py_version;
15332 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
15333 0 : return py_version;
15334 : }
15335 :
15336 0 : static int py_ForestTrustInfo_set_version(PyObject *py_obj, PyObject *value, void *closure)
15337 : {
15338 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(py_obj);
15339 0 : if (value == NULL) {
15340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
15341 0 : return -1;
15342 : }
15343 : {
15344 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
15345 0 : if (PyLong_Check(value)) {
15346 : unsigned long long test_var;
15347 0 : test_var = PyLong_AsUnsignedLongLong(value);
15348 0 : if (PyErr_Occurred() != NULL) {
15349 0 : return -1;
15350 : }
15351 0 : if (test_var > uint_max) {
15352 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15353 : PyLong_Type.tp_name, uint_max, test_var);
15354 0 : return -1;
15355 : }
15356 0 : object->version = test_var;
15357 : } else {
15358 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15359 : PyLong_Type.tp_name);
15360 0 : return -1;
15361 : }
15362 : }
15363 0 : return 0;
15364 : }
15365 :
15366 0 : static PyObject *py_ForestTrustInfo_get_count(PyObject *obj, void *closure)
15367 : {
15368 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(obj);
15369 : PyObject *py_count;
15370 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
15371 0 : return py_count;
15372 : }
15373 :
15374 0 : static int py_ForestTrustInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
15375 : {
15376 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(py_obj);
15377 0 : if (value == NULL) {
15378 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
15379 0 : return -1;
15380 : }
15381 : {
15382 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
15383 0 : if (PyLong_Check(value)) {
15384 : unsigned long long test_var;
15385 0 : test_var = PyLong_AsUnsignedLongLong(value);
15386 0 : if (PyErr_Occurred() != NULL) {
15387 0 : return -1;
15388 : }
15389 0 : if (test_var > uint_max) {
15390 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15391 : PyLong_Type.tp_name, uint_max, test_var);
15392 0 : return -1;
15393 : }
15394 0 : object->count = test_var;
15395 : } else {
15396 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15397 : PyLong_Type.tp_name);
15398 0 : return -1;
15399 : }
15400 : }
15401 0 : return 0;
15402 : }
15403 :
15404 0 : static PyObject *py_ForestTrustInfo_get_records(PyObject *obj, void *closure)
15405 : {
15406 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(obj);
15407 : PyObject *py_records;
15408 0 : py_records = PyList_New(object->count);
15409 0 : if (py_records == NULL) {
15410 0 : return NULL;
15411 : }
15412 : {
15413 : int records_cntr_0;
15414 0 : for (records_cntr_0 = 0; records_cntr_0 < (object->count); records_cntr_0++) {
15415 : PyObject *py_records_0;
15416 0 : py_records_0 = pytalloc_reference_ex(&ForestTrustInfoRecordArmor_Type, object->records, &object->records[records_cntr_0]);
15417 0 : PyList_SetItem(py_records, records_cntr_0, py_records_0);
15418 : }
15419 : }
15420 0 : return py_records;
15421 : }
15422 :
15423 0 : static int py_ForestTrustInfo_set_records(PyObject *py_obj, PyObject *value, void *closure)
15424 : {
15425 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(py_obj);
15426 0 : if (value == NULL) {
15427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->records");
15428 0 : return -1;
15429 : }
15430 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
15431 : {
15432 : int records_cntr_0;
15433 0 : object->records = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->records, PyList_GET_SIZE(value));
15434 0 : if (!object->records) { return -1;; }
15435 0 : talloc_set_name_const(object->records, "ARRAY: object->records");
15436 0 : for (records_cntr_0 = 0; records_cntr_0 < PyList_GET_SIZE(value); records_cntr_0++) {
15437 0 : if (PyList_GET_ITEM(value, records_cntr_0) == NULL) {
15438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->records[records_cntr_0]");
15439 0 : return -1;
15440 : }
15441 0 : PY_CHECK_TYPE(&ForestTrustInfoRecordArmor_Type, PyList_GET_ITEM(value, records_cntr_0), return -1;);
15442 0 : if (talloc_reference(object->records, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, records_cntr_0))) == NULL) {
15443 0 : PyErr_NoMemory();
15444 0 : return -1;
15445 : }
15446 0 : object->records[records_cntr_0] = *(struct ForestTrustInfoRecordArmor *)pytalloc_get_ptr(PyList_GET_ITEM(value, records_cntr_0));
15447 : }
15448 : }
15449 0 : return 0;
15450 : }
15451 :
15452 : static PyGetSetDef py_ForestTrustInfo_getsetters[] = {
15453 : {
15454 : .name = discard_const_p(char, "version"),
15455 : .get = py_ForestTrustInfo_get_version,
15456 : .set = py_ForestTrustInfo_set_version,
15457 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15458 : },
15459 : {
15460 : .name = discard_const_p(char, "count"),
15461 : .get = py_ForestTrustInfo_get_count,
15462 : .set = py_ForestTrustInfo_set_count,
15463 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15464 : },
15465 : {
15466 : .name = discard_const_p(char, "records"),
15467 : .get = py_ForestTrustInfo_get_records,
15468 : .set = py_ForestTrustInfo_set_records,
15469 : .doc = discard_const_p(char, "PIDL-generated element of base type ForestTrustInfoRecordArmor")
15470 : },
15471 : { .name = NULL }
15472 : };
15473 :
15474 0 : static PyObject *py_ForestTrustInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15475 : {
15476 0 : return pytalloc_new(struct ForestTrustInfo, type);
15477 : }
15478 :
15479 0 : static PyObject *py_ForestTrustInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15480 : {
15481 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(py_obj);
15482 0 : PyObject *ret = NULL;
15483 : DATA_BLOB blob;
15484 : enum ndr_err_code err;
15485 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
15486 0 : if (tmp_ctx == NULL) {
15487 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15488 0 : return NULL;
15489 : }
15490 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ForestTrustInfo);
15491 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15492 0 : TALLOC_FREE(tmp_ctx);
15493 0 : PyErr_SetNdrError(err);
15494 0 : return NULL;
15495 : }
15496 :
15497 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15498 0 : TALLOC_FREE(tmp_ctx);
15499 0 : return ret;
15500 : }
15501 :
15502 0 : static PyObject *py_ForestTrustInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15503 : {
15504 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(py_obj);
15505 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
15506 0 : Py_ssize_t blob_length = 0;
15507 : enum ndr_err_code err;
15508 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
15509 0 : PyObject *allow_remaining_obj = NULL;
15510 0 : bool allow_remaining = false;
15511 :
15512 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
15513 : discard_const_p(char *, kwnames),
15514 : &blob.data, &blob_length,
15515 : &allow_remaining_obj)) {
15516 0 : return NULL;
15517 : }
15518 0 : blob.length = blob_length;
15519 :
15520 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15521 0 : allow_remaining = true;
15522 : }
15523 :
15524 0 : if (allow_remaining) {
15525 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ForestTrustInfo);
15526 : } else {
15527 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ForestTrustInfo);
15528 : }
15529 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15530 0 : PyErr_SetNdrError(err);
15531 0 : return NULL;
15532 : }
15533 :
15534 0 : Py_RETURN_NONE;
15535 : }
15536 :
15537 0 : static PyObject *py_ForestTrustInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15538 : {
15539 0 : struct ForestTrustInfo *object = (struct ForestTrustInfo *)pytalloc_get_ptr(py_obj);
15540 : PyObject *ret;
15541 : char *retstr;
15542 :
15543 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ForestTrustInfo, "ForestTrustInfo", object);
15544 0 : ret = PyUnicode_FromString(retstr);
15545 0 : talloc_free(retstr);
15546 :
15547 0 : return ret;
15548 : }
15549 :
15550 : static PyMethodDef py_ForestTrustInfo_methods[] = {
15551 : { "__ndr_pack__", (PyCFunction)py_ForestTrustInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
15552 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ForestTrustInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
15553 : { "__ndr_print__", (PyCFunction)py_ForestTrustInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
15554 : { NULL, NULL, 0, NULL }
15555 : };
15556 :
15557 :
15558 : static PyTypeObject ForestTrustInfo_Type = {
15559 : PyVarObject_HEAD_INIT(NULL, 0)
15560 : .tp_name = "drsblobs.ForestTrustInfo",
15561 : .tp_getset = py_ForestTrustInfo_getsetters,
15562 : .tp_methods = py_ForestTrustInfo_methods,
15563 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15564 : .tp_new = py_ForestTrustInfo_new,
15565 : };
15566 :
15567 :
15568 0 : static PyObject *py_PlaintextSecret_get_cleartext(PyObject *obj, void *closure)
15569 : {
15570 0 : struct PlaintextSecret *object = (struct PlaintextSecret *)pytalloc_get_ptr(obj);
15571 : PyObject *py_cleartext;
15572 0 : py_cleartext = PyBytes_FromStringAndSize((char *)(object->cleartext).data, (object->cleartext).length);
15573 0 : return py_cleartext;
15574 : }
15575 :
15576 0 : static int py_PlaintextSecret_set_cleartext(PyObject *py_obj, PyObject *value, void *closure)
15577 : {
15578 0 : struct PlaintextSecret *object = (struct PlaintextSecret *)pytalloc_get_ptr(py_obj);
15579 0 : if (value == NULL) {
15580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cleartext");
15581 0 : return -1;
15582 : }
15583 0 : object->cleartext = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
15584 0 : return 0;
15585 : }
15586 :
15587 : static PyGetSetDef py_PlaintextSecret_getsetters[] = {
15588 : {
15589 : .name = discard_const_p(char, "cleartext"),
15590 : .get = py_PlaintextSecret_get_cleartext,
15591 : .set = py_PlaintextSecret_set_cleartext,
15592 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
15593 : },
15594 : { .name = NULL }
15595 : };
15596 :
15597 0 : static PyObject *py_PlaintextSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15598 : {
15599 0 : return pytalloc_new(struct PlaintextSecret, type);
15600 : }
15601 :
15602 0 : static PyObject *py_PlaintextSecret_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15603 : {
15604 0 : struct PlaintextSecret *object = (struct PlaintextSecret *)pytalloc_get_ptr(py_obj);
15605 0 : PyObject *ret = NULL;
15606 : DATA_BLOB blob;
15607 : enum ndr_err_code err;
15608 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
15609 0 : if (tmp_ctx == NULL) {
15610 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15611 0 : return NULL;
15612 : }
15613 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PlaintextSecret);
15614 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15615 0 : TALLOC_FREE(tmp_ctx);
15616 0 : PyErr_SetNdrError(err);
15617 0 : return NULL;
15618 : }
15619 :
15620 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15621 0 : TALLOC_FREE(tmp_ctx);
15622 0 : return ret;
15623 : }
15624 :
15625 0 : static PyObject *py_PlaintextSecret_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15626 : {
15627 0 : struct PlaintextSecret *object = (struct PlaintextSecret *)pytalloc_get_ptr(py_obj);
15628 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
15629 0 : Py_ssize_t blob_length = 0;
15630 : enum ndr_err_code err;
15631 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
15632 0 : PyObject *allow_remaining_obj = NULL;
15633 0 : bool allow_remaining = false;
15634 :
15635 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
15636 : discard_const_p(char *, kwnames),
15637 : &blob.data, &blob_length,
15638 : &allow_remaining_obj)) {
15639 0 : return NULL;
15640 : }
15641 0 : blob.length = blob_length;
15642 :
15643 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15644 0 : allow_remaining = true;
15645 : }
15646 :
15647 0 : if (allow_remaining) {
15648 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PlaintextSecret);
15649 : } else {
15650 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PlaintextSecret);
15651 : }
15652 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15653 0 : PyErr_SetNdrError(err);
15654 0 : return NULL;
15655 : }
15656 :
15657 0 : Py_RETURN_NONE;
15658 : }
15659 :
15660 0 : static PyObject *py_PlaintextSecret_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15661 : {
15662 0 : struct PlaintextSecret *object = (struct PlaintextSecret *)pytalloc_get_ptr(py_obj);
15663 : PyObject *ret;
15664 : char *retstr;
15665 :
15666 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PlaintextSecret, "PlaintextSecret", object);
15667 0 : ret = PyUnicode_FromString(retstr);
15668 0 : talloc_free(retstr);
15669 :
15670 0 : return ret;
15671 : }
15672 :
15673 : static PyMethodDef py_PlaintextSecret_methods[] = {
15674 : { "__ndr_pack__", (PyCFunction)py_PlaintextSecret_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
15675 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PlaintextSecret_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
15676 : { "__ndr_print__", (PyCFunction)py_PlaintextSecret_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
15677 : { NULL, NULL, 0, NULL }
15678 : };
15679 :
15680 :
15681 : static PyTypeObject PlaintextSecret_Type = {
15682 : PyVarObject_HEAD_INIT(NULL, 0)
15683 : .tp_name = "drsblobs.PlaintextSecret",
15684 : .tp_getset = py_PlaintextSecret_getsetters,
15685 : .tp_methods = py_PlaintextSecret_methods,
15686 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15687 : .tp_new = py_PlaintextSecret_new,
15688 : };
15689 :
15690 :
15691 1 : static PyObject *py_EncryptedSecretHeader_get_magic(PyObject *obj, void *closure)
15692 : {
15693 1 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(obj);
15694 : PyObject *py_magic;
15695 1 : py_magic = PyLong_FromUnsignedLongLong((uint32_t)object->magic);
15696 1 : return py_magic;
15697 : }
15698 :
15699 0 : static int py_EncryptedSecretHeader_set_magic(PyObject *py_obj, PyObject *value, void *closure)
15700 : {
15701 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15702 0 : if (value == NULL) {
15703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->magic");
15704 0 : return -1;
15705 : }
15706 : {
15707 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->magic));
15708 0 : if (PyLong_Check(value)) {
15709 : unsigned long long test_var;
15710 0 : test_var = PyLong_AsUnsignedLongLong(value);
15711 0 : if (PyErr_Occurred() != NULL) {
15712 0 : return -1;
15713 : }
15714 0 : if (test_var > uint_max) {
15715 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15716 : PyLong_Type.tp_name, uint_max, test_var);
15717 0 : return -1;
15718 : }
15719 0 : object->magic = test_var;
15720 : } else {
15721 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15722 : PyLong_Type.tp_name);
15723 0 : return -1;
15724 : }
15725 : }
15726 0 : return 0;
15727 : }
15728 :
15729 0 : static PyObject *py_EncryptedSecretHeader_get_version(PyObject *obj, void *closure)
15730 : {
15731 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(obj);
15732 : PyObject *py_version;
15733 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
15734 0 : return py_version;
15735 : }
15736 :
15737 0 : static int py_EncryptedSecretHeader_set_version(PyObject *py_obj, PyObject *value, void *closure)
15738 : {
15739 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15740 0 : if (value == NULL) {
15741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
15742 0 : return -1;
15743 : }
15744 : {
15745 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
15746 0 : if (PyLong_Check(value)) {
15747 : unsigned long long test_var;
15748 0 : test_var = PyLong_AsUnsignedLongLong(value);
15749 0 : if (PyErr_Occurred() != NULL) {
15750 0 : return -1;
15751 : }
15752 0 : if (test_var > uint_max) {
15753 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15754 : PyLong_Type.tp_name, uint_max, test_var);
15755 0 : return -1;
15756 : }
15757 0 : object->version = test_var;
15758 : } else {
15759 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15760 : PyLong_Type.tp_name);
15761 0 : return -1;
15762 : }
15763 : }
15764 0 : return 0;
15765 : }
15766 :
15767 0 : static PyObject *py_EncryptedSecretHeader_get_algorithm(PyObject *obj, void *closure)
15768 : {
15769 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(obj);
15770 : PyObject *py_algorithm;
15771 0 : py_algorithm = PyLong_FromUnsignedLongLong((uint32_t)object->algorithm);
15772 0 : return py_algorithm;
15773 : }
15774 :
15775 0 : static int py_EncryptedSecretHeader_set_algorithm(PyObject *py_obj, PyObject *value, void *closure)
15776 : {
15777 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15778 0 : if (value == NULL) {
15779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->algorithm");
15780 0 : return -1;
15781 : }
15782 : {
15783 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->algorithm));
15784 0 : if (PyLong_Check(value)) {
15785 : unsigned long long test_var;
15786 0 : test_var = PyLong_AsUnsignedLongLong(value);
15787 0 : if (PyErr_Occurred() != NULL) {
15788 0 : return -1;
15789 : }
15790 0 : if (test_var > uint_max) {
15791 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15792 : PyLong_Type.tp_name, uint_max, test_var);
15793 0 : return -1;
15794 : }
15795 0 : object->algorithm = test_var;
15796 : } else {
15797 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15798 : PyLong_Type.tp_name);
15799 0 : return -1;
15800 : }
15801 : }
15802 0 : return 0;
15803 : }
15804 :
15805 0 : static PyObject *py_EncryptedSecretHeader_get_flags(PyObject *obj, void *closure)
15806 : {
15807 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(obj);
15808 : PyObject *py_flags;
15809 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
15810 0 : return py_flags;
15811 : }
15812 :
15813 0 : static int py_EncryptedSecretHeader_set_flags(PyObject *py_obj, PyObject *value, void *closure)
15814 : {
15815 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15816 0 : if (value == NULL) {
15817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
15818 0 : return -1;
15819 : }
15820 : {
15821 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
15822 0 : if (PyLong_Check(value)) {
15823 : unsigned long long test_var;
15824 0 : test_var = PyLong_AsUnsignedLongLong(value);
15825 0 : if (PyErr_Occurred() != NULL) {
15826 0 : return -1;
15827 : }
15828 0 : if (test_var > uint_max) {
15829 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15830 : PyLong_Type.tp_name, uint_max, test_var);
15831 0 : return -1;
15832 : }
15833 0 : object->flags = test_var;
15834 : } else {
15835 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15836 : PyLong_Type.tp_name);
15837 0 : return -1;
15838 : }
15839 : }
15840 0 : return 0;
15841 : }
15842 :
15843 : static PyGetSetDef py_EncryptedSecretHeader_getsetters[] = {
15844 : {
15845 : .name = discard_const_p(char, "magic"),
15846 : .get = py_EncryptedSecretHeader_get_magic,
15847 : .set = py_EncryptedSecretHeader_set_magic,
15848 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15849 : },
15850 : {
15851 : .name = discard_const_p(char, "version"),
15852 : .get = py_EncryptedSecretHeader_get_version,
15853 : .set = py_EncryptedSecretHeader_set_version,
15854 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15855 : },
15856 : {
15857 : .name = discard_const_p(char, "algorithm"),
15858 : .get = py_EncryptedSecretHeader_get_algorithm,
15859 : .set = py_EncryptedSecretHeader_set_algorithm,
15860 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15861 : },
15862 : {
15863 : .name = discard_const_p(char, "flags"),
15864 : .get = py_EncryptedSecretHeader_get_flags,
15865 : .set = py_EncryptedSecretHeader_set_flags,
15866 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15867 : },
15868 : { .name = NULL }
15869 : };
15870 :
15871 0 : static PyObject *py_EncryptedSecretHeader_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15872 : {
15873 0 : return pytalloc_new(struct EncryptedSecretHeader, type);
15874 : }
15875 :
15876 0 : static PyObject *py_EncryptedSecretHeader_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15877 : {
15878 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15879 0 : PyObject *ret = NULL;
15880 : DATA_BLOB blob;
15881 : enum ndr_err_code err;
15882 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
15883 0 : if (tmp_ctx == NULL) {
15884 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15885 0 : return NULL;
15886 : }
15887 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_EncryptedSecretHeader);
15888 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15889 0 : TALLOC_FREE(tmp_ctx);
15890 0 : PyErr_SetNdrError(err);
15891 0 : return NULL;
15892 : }
15893 :
15894 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15895 0 : TALLOC_FREE(tmp_ctx);
15896 0 : return ret;
15897 : }
15898 :
15899 0 : static PyObject *py_EncryptedSecretHeader_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15900 : {
15901 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15902 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
15903 0 : Py_ssize_t blob_length = 0;
15904 : enum ndr_err_code err;
15905 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
15906 0 : PyObject *allow_remaining_obj = NULL;
15907 0 : bool allow_remaining = false;
15908 :
15909 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
15910 : discard_const_p(char *, kwnames),
15911 : &blob.data, &blob_length,
15912 : &allow_remaining_obj)) {
15913 0 : return NULL;
15914 : }
15915 0 : blob.length = blob_length;
15916 :
15917 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15918 0 : allow_remaining = true;
15919 : }
15920 :
15921 0 : if (allow_remaining) {
15922 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_EncryptedSecretHeader);
15923 : } else {
15924 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_EncryptedSecretHeader);
15925 : }
15926 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15927 0 : PyErr_SetNdrError(err);
15928 0 : return NULL;
15929 : }
15930 :
15931 0 : Py_RETURN_NONE;
15932 : }
15933 :
15934 0 : static PyObject *py_EncryptedSecretHeader_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15935 : {
15936 0 : struct EncryptedSecretHeader *object = (struct EncryptedSecretHeader *)pytalloc_get_ptr(py_obj);
15937 : PyObject *ret;
15938 : char *retstr;
15939 :
15940 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_EncryptedSecretHeader, "EncryptedSecretHeader", object);
15941 0 : ret = PyUnicode_FromString(retstr);
15942 0 : talloc_free(retstr);
15943 :
15944 0 : return ret;
15945 : }
15946 :
15947 : static PyMethodDef py_EncryptedSecretHeader_methods[] = {
15948 : { "__ndr_pack__", (PyCFunction)py_EncryptedSecretHeader_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
15949 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EncryptedSecretHeader_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
15950 : { "__ndr_print__", (PyCFunction)py_EncryptedSecretHeader_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
15951 : { NULL, NULL, 0, NULL }
15952 : };
15953 :
15954 :
15955 : static PyTypeObject EncryptedSecretHeader_Type = {
15956 : PyVarObject_HEAD_INIT(NULL, 0)
15957 : .tp_name = "drsblobs.EncryptedSecretHeader",
15958 : .tp_getset = py_EncryptedSecretHeader_getsetters,
15959 : .tp_methods = py_EncryptedSecretHeader_methods,
15960 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15961 : .tp_new = py_EncryptedSecretHeader_new,
15962 : };
15963 :
15964 :
15965 0 : static PyObject *py_EncryptedSecret_get_iv(PyObject *obj, void *closure)
15966 : {
15967 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(obj);
15968 : PyObject *py_iv;
15969 0 : py_iv = PyBytes_FromStringAndSize((char *)(object->iv).data, (object->iv).length);
15970 0 : return py_iv;
15971 : }
15972 :
15973 0 : static int py_EncryptedSecret_set_iv(PyObject *py_obj, PyObject *value, void *closure)
15974 : {
15975 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(py_obj);
15976 0 : if (value == NULL) {
15977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->iv");
15978 0 : return -1;
15979 : }
15980 0 : object->iv = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
15981 0 : return 0;
15982 : }
15983 :
15984 1 : static PyObject *py_EncryptedSecret_get_header(PyObject *obj, void *closure)
15985 : {
15986 1 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(obj);
15987 : PyObject *py_header;
15988 1 : py_header = pytalloc_reference_ex(&EncryptedSecretHeader_Type, pytalloc_get_mem_ctx(obj), &object->header);
15989 1 : return py_header;
15990 : }
15991 :
15992 0 : static int py_EncryptedSecret_set_header(PyObject *py_obj, PyObject *value, void *closure)
15993 : {
15994 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(py_obj);
15995 0 : if (value == NULL) {
15996 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->header");
15997 0 : return -1;
15998 : }
15999 0 : PY_CHECK_TYPE(&EncryptedSecretHeader_Type, value, return -1;);
16000 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16001 0 : PyErr_NoMemory();
16002 0 : return -1;
16003 : }
16004 0 : object->header = *(struct EncryptedSecretHeader *)pytalloc_get_ptr(value);
16005 0 : return 0;
16006 : }
16007 :
16008 0 : static PyObject *py_EncryptedSecret_get_encrypted(PyObject *obj, void *closure)
16009 : {
16010 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(obj);
16011 : PyObject *py_encrypted;
16012 0 : py_encrypted = PyBytes_FromStringAndSize((char *)(object->encrypted).data, (object->encrypted).length);
16013 0 : return py_encrypted;
16014 : }
16015 :
16016 0 : static int py_EncryptedSecret_set_encrypted(PyObject *py_obj, PyObject *value, void *closure)
16017 : {
16018 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(py_obj);
16019 0 : if (value == NULL) {
16020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->encrypted");
16021 0 : return -1;
16022 : }
16023 0 : object->encrypted = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
16024 0 : return 0;
16025 : }
16026 :
16027 : static PyGetSetDef py_EncryptedSecret_getsetters[] = {
16028 : {
16029 : .name = discard_const_p(char, "iv"),
16030 : .get = py_EncryptedSecret_get_iv,
16031 : .set = py_EncryptedSecret_set_iv,
16032 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16033 : },
16034 : {
16035 : .name = discard_const_p(char, "header"),
16036 : .get = py_EncryptedSecret_get_header,
16037 : .set = py_EncryptedSecret_set_header,
16038 : .doc = discard_const_p(char, "PIDL-generated element of base type EncryptedSecretHeader")
16039 : },
16040 : {
16041 : .name = discard_const_p(char, "encrypted"),
16042 : .get = py_EncryptedSecret_get_encrypted,
16043 : .set = py_EncryptedSecret_set_encrypted,
16044 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16045 : },
16046 : { .name = NULL }
16047 : };
16048 :
16049 1 : static PyObject *py_EncryptedSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16050 : {
16051 1 : return pytalloc_new(struct EncryptedSecret, type);
16052 : }
16053 :
16054 0 : static PyObject *py_EncryptedSecret_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16055 : {
16056 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(py_obj);
16057 0 : PyObject *ret = NULL;
16058 : DATA_BLOB blob;
16059 : enum ndr_err_code err;
16060 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
16061 0 : if (tmp_ctx == NULL) {
16062 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16063 0 : return NULL;
16064 : }
16065 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_EncryptedSecret);
16066 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16067 0 : TALLOC_FREE(tmp_ctx);
16068 0 : PyErr_SetNdrError(err);
16069 0 : return NULL;
16070 : }
16071 :
16072 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16073 0 : TALLOC_FREE(tmp_ctx);
16074 0 : return ret;
16075 : }
16076 :
16077 1 : static PyObject *py_EncryptedSecret_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16078 : {
16079 1 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(py_obj);
16080 1 : DATA_BLOB blob = {.data = NULL, .length = 0};
16081 1 : Py_ssize_t blob_length = 0;
16082 : enum ndr_err_code err;
16083 1 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
16084 1 : PyObject *allow_remaining_obj = NULL;
16085 1 : bool allow_remaining = false;
16086 :
16087 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
16088 : discard_const_p(char *, kwnames),
16089 : &blob.data, &blob_length,
16090 : &allow_remaining_obj)) {
16091 0 : return NULL;
16092 : }
16093 1 : blob.length = blob_length;
16094 :
16095 1 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16096 0 : allow_remaining = true;
16097 : }
16098 :
16099 1 : if (allow_remaining) {
16100 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_EncryptedSecret);
16101 : } else {
16102 1 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_EncryptedSecret);
16103 : }
16104 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16105 0 : PyErr_SetNdrError(err);
16106 0 : return NULL;
16107 : }
16108 :
16109 1 : Py_RETURN_NONE;
16110 : }
16111 :
16112 0 : static PyObject *py_EncryptedSecret_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16113 : {
16114 0 : struct EncryptedSecret *object = (struct EncryptedSecret *)pytalloc_get_ptr(py_obj);
16115 : PyObject *ret;
16116 : char *retstr;
16117 :
16118 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_EncryptedSecret, "EncryptedSecret", object);
16119 0 : ret = PyUnicode_FromString(retstr);
16120 0 : talloc_free(retstr);
16121 :
16122 0 : return ret;
16123 : }
16124 :
16125 : static PyMethodDef py_EncryptedSecret_methods[] = {
16126 : { "__ndr_pack__", (PyCFunction)py_EncryptedSecret_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
16127 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EncryptedSecret_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
16128 : { "__ndr_print__", (PyCFunction)py_EncryptedSecret_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
16129 : { NULL, NULL, 0, NULL }
16130 : };
16131 :
16132 :
16133 : static PyTypeObject EncryptedSecret_Type = {
16134 : PyVarObject_HEAD_INIT(NULL, 0)
16135 : .tp_name = "drsblobs.EncryptedSecret",
16136 : .tp_getset = py_EncryptedSecret_getsetters,
16137 : .tp_methods = py_EncryptedSecret_methods,
16138 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16139 : .tp_new = py_EncryptedSecret_new,
16140 : };
16141 :
16142 :
16143 : const struct PyNdrRpcMethodDef py_ndr_drsblobs_methods[] = {
16144 : {0}
16145 : };
16146 :
16147 0 : static PyObject *interface_drsblobs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16148 : {
16149 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_drsblobs);
16150 : }
16151 :
16152 : #define PY_DOC_DRSBLOBS "Active Directory Replication LDAP Blobs"
16153 : static PyTypeObject drsblobs_InterfaceType = {
16154 : PyVarObject_HEAD_INIT(NULL, 0)
16155 : .tp_name = "drsblobs.drsblobs",
16156 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
16157 : .tp_doc = "drsblobs(binding, lp_ctx=None, credentials=None) -> connection\n"
16158 : "\n"
16159 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
16160 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
16161 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_DRSBLOBS,
16162 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16163 : .tp_new = interface_drsblobs_new,
16164 : };
16165 :
16166 0 : static PyObject *syntax_drsblobs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16167 : {
16168 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_drsblobs.syntax_id);
16169 : }
16170 :
16171 : #define PY_DOC_DRSBLOBS_SYNTAX "Active Directory Replication LDAP Blobs"
16172 : static PyTypeObject drsblobs_SyntaxType = {
16173 : PyVarObject_HEAD_INIT(NULL, 0)
16174 : .tp_name = "drsblobs.drsblobs_abstract_syntax",
16175 : .tp_doc = "drsblobs_abstract_syntax()\n"PY_DOC_DRSBLOBS_SYNTAX,
16176 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16177 : .tp_new = syntax_drsblobs_new,
16178 : };
16179 :
16180 : static PyMethodDef drsblobs_methods[] = {
16181 : { NULL, NULL, 0, NULL }
16182 : };
16183 :
16184 : static struct PyModuleDef moduledef = {
16185 : PyModuleDef_HEAD_INIT,
16186 : .m_name = "drsblobs",
16187 : .m_doc = "drsblobs DCE/RPC",
16188 : .m_size = -1,
16189 : .m_methods = drsblobs_methods,
16190 : };
16191 3502 : MODULE_INIT_FUNC(drsblobs)
16192 : {
16193 3502 : PyObject *m = NULL;
16194 3502 : PyObject *dep_samba_dcerpc_drsuapi = NULL;
16195 3502 : PyObject *dep_samba_dcerpc_misc = NULL;
16196 3502 : PyObject *dep_samba_dcerpc_samr = NULL;
16197 3502 : PyObject *dep_samba_dcerpc_lsa = NULL;
16198 3502 : PyObject *dep_samba_dcerpc_security = NULL;
16199 3502 : PyObject *dep_talloc = NULL;
16200 3502 : PyObject *dep_samba_dcerpc_base = NULL;
16201 :
16202 3502 : dep_samba_dcerpc_drsuapi = PyImport_ImportModule("samba.dcerpc.drsuapi");
16203 3502 : if (dep_samba_dcerpc_drsuapi == NULL)
16204 0 : goto out;
16205 :
16206 3502 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
16207 3502 : if (dep_samba_dcerpc_misc == NULL)
16208 0 : goto out;
16209 :
16210 3502 : dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr");
16211 3502 : if (dep_samba_dcerpc_samr == NULL)
16212 0 : goto out;
16213 :
16214 3502 : dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
16215 3502 : if (dep_samba_dcerpc_lsa == NULL)
16216 0 : goto out;
16217 :
16218 3502 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
16219 3502 : if (dep_samba_dcerpc_security == NULL)
16220 0 : goto out;
16221 :
16222 3502 : dep_talloc = PyImport_ImportModule("talloc");
16223 3502 : if (dep_talloc == NULL)
16224 0 : goto out;
16225 :
16226 3502 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
16227 3502 : if (dep_samba_dcerpc_base == NULL)
16228 0 : goto out;
16229 :
16230 3502 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
16231 3502 : if (GUID_Type == NULL)
16232 0 : goto out;
16233 :
16234 3502 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
16235 3502 : if (BaseObject_Type == NULL)
16236 0 : goto out;
16237 :
16238 3502 : drsuapi_DsReplicaCursor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_drsuapi, "DsReplicaCursor");
16239 3502 : if (drsuapi_DsReplicaCursor_Type == NULL)
16240 0 : goto out;
16241 :
16242 3502 : drsuapi_DsReplicaCursor2_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_drsuapi, "DsReplicaCursor2");
16243 3502 : if (drsuapi_DsReplicaCursor2_Type == NULL)
16244 0 : goto out;
16245 :
16246 3502 : drsuapi_DsReplicaHighWaterMark_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_drsuapi, "DsReplicaHighWaterMark");
16247 3502 : if (drsuapi_DsReplicaHighWaterMark_Type == NULL)
16248 0 : goto out;
16249 :
16250 3502 : drsuapi_DsReplicaOIDMapping_Ctr_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_drsuapi, "DsReplicaOIDMapping_Ctr");
16251 3502 : if (drsuapi_DsReplicaOIDMapping_Ctr_Type == NULL)
16252 0 : goto out;
16253 :
16254 3502 : samr_Password_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "Password");
16255 3502 : if (samr_Password_Type == NULL)
16256 0 : goto out;
16257 :
16258 3502 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
16259 3502 : if (dom_sid_Type == NULL)
16260 0 : goto out;
16261 :
16262 3502 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
16263 3502 : if (ClientConnection_Type == NULL)
16264 0 : goto out;
16265 :
16266 3502 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
16267 3502 : if (ndr_syntax_id_Type == NULL)
16268 0 : goto out;
16269 :
16270 3502 : replPropertyMetaData1_Type.tp_base = BaseObject_Type;
16271 3502 : replPropertyMetaData1_Type.tp_basicsize = pytalloc_BaseObject_size();
16272 :
16273 3502 : replPropertyMetaDataCtr1_Type.tp_base = BaseObject_Type;
16274 3502 : replPropertyMetaDataCtr1_Type.tp_basicsize = pytalloc_BaseObject_size();
16275 :
16276 3502 : replPropertyMetaDataCtr_Type.tp_base = BaseObject_Type;
16277 3502 : replPropertyMetaDataCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
16278 :
16279 3502 : replPropertyMetaDataBlob_Type.tp_base = BaseObject_Type;
16280 3502 : replPropertyMetaDataBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16281 :
16282 3502 : replUpToDateVectorCtr1_Type.tp_base = BaseObject_Type;
16283 3502 : replUpToDateVectorCtr1_Type.tp_basicsize = pytalloc_BaseObject_size();
16284 :
16285 3502 : replUpToDateVectorCtr2_Type.tp_base = BaseObject_Type;
16286 3502 : replUpToDateVectorCtr2_Type.tp_basicsize = pytalloc_BaseObject_size();
16287 :
16288 3502 : replUpToDateVectorCtr_Type.tp_base = BaseObject_Type;
16289 3502 : replUpToDateVectorCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
16290 :
16291 3502 : replUpToDateVectorBlob_Type.tp_base = BaseObject_Type;
16292 3502 : replUpToDateVectorBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16293 :
16294 3502 : repsFromTo1OtherInfo_Type.tp_base = BaseObject_Type;
16295 3502 : repsFromTo1OtherInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
16296 :
16297 3502 : repsFromTo1_Type.tp_base = BaseObject_Type;
16298 3502 : repsFromTo1_Type.tp_basicsize = pytalloc_BaseObject_size();
16299 :
16300 3502 : repsFromTo2OtherInfo_Type.tp_base = BaseObject_Type;
16301 3502 : repsFromTo2OtherInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
16302 :
16303 3502 : repsFromTo2_Type.tp_base = BaseObject_Type;
16304 3502 : repsFromTo2_Type.tp_basicsize = pytalloc_BaseObject_size();
16305 :
16306 3502 : repsFromTo_Type.tp_base = BaseObject_Type;
16307 3502 : repsFromTo_Type.tp_basicsize = pytalloc_BaseObject_size();
16308 :
16309 3502 : repsFromToBlob_Type.tp_base = BaseObject_Type;
16310 3502 : repsFromToBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16311 :
16312 3502 : scheduleHeader_Type.tp_base = BaseObject_Type;
16313 3502 : scheduleHeader_Type.tp_basicsize = pytalloc_BaseObject_size();
16314 :
16315 3502 : scheduleSlots_Type.tp_base = BaseObject_Type;
16316 3502 : scheduleSlots_Type.tp_basicsize = pytalloc_BaseObject_size();
16317 :
16318 3502 : schedule_Type.tp_base = BaseObject_Type;
16319 3502 : schedule_Type.tp_basicsize = pytalloc_BaseObject_size();
16320 :
16321 3502 : partialAttributeSetCtr1_Type.tp_base = BaseObject_Type;
16322 3502 : partialAttributeSetCtr1_Type.tp_basicsize = pytalloc_BaseObject_size();
16323 :
16324 3502 : partialAttributeSetCtr_Type.tp_base = BaseObject_Type;
16325 3502 : partialAttributeSetCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
16326 :
16327 3502 : partialAttributeSetBlob_Type.tp_base = BaseObject_Type;
16328 3502 : partialAttributeSetBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16329 :
16330 3502 : schemaInfoBlob_Type.tp_base = BaseObject_Type;
16331 3502 : schemaInfoBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16332 :
16333 3502 : drsuapi_MSPrefixMap_Entry_Type.tp_base = BaseObject_Type;
16334 3502 : drsuapi_MSPrefixMap_Entry_Type.tp_basicsize = pytalloc_BaseObject_size();
16335 :
16336 3502 : drsuapi_MSPrefixMap_Ctr_Type.tp_base = BaseObject_Type;
16337 3502 : drsuapi_MSPrefixMap_Ctr_Type.tp_basicsize = pytalloc_BaseObject_size();
16338 :
16339 3502 : prefixMapCtr_Type.tp_base = BaseObject_Type;
16340 3502 : prefixMapCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
16341 :
16342 3502 : prefixMapBlob_Type.tp_base = BaseObject_Type;
16343 3502 : prefixMapBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16344 :
16345 3502 : ldapControlDirSyncExtra_Type.tp_base = BaseObject_Type;
16346 3502 : ldapControlDirSyncExtra_Type.tp_basicsize = pytalloc_BaseObject_size();
16347 :
16348 3502 : ldapControlDirSyncBlob_Type.tp_base = BaseObject_Type;
16349 3502 : ldapControlDirSyncBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16350 :
16351 3502 : ldapControlDirSyncCookie_Type.tp_base = BaseObject_Type;
16352 3502 : ldapControlDirSyncCookie_Type.tp_basicsize = pytalloc_BaseObject_size();
16353 :
16354 3502 : supplementalCredentialsPackage_Type.tp_base = BaseObject_Type;
16355 3502 : supplementalCredentialsPackage_Type.tp_basicsize = pytalloc_BaseObject_size();
16356 :
16357 3502 : supplementalCredentialsSubBlob_Type.tp_base = BaseObject_Type;
16358 3502 : supplementalCredentialsSubBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16359 :
16360 3502 : supplementalCredentialsBlob_Type.tp_base = BaseObject_Type;
16361 3502 : supplementalCredentialsBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16362 :
16363 3502 : package_PackagesBlob_Type.tp_base = BaseObject_Type;
16364 3502 : package_PackagesBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16365 :
16366 3502 : package_PrimaryKerberosString_Type.tp_base = BaseObject_Type;
16367 3502 : package_PrimaryKerberosString_Type.tp_basicsize = pytalloc_BaseObject_size();
16368 :
16369 3502 : package_PrimaryKerberosKey3_Type.tp_base = BaseObject_Type;
16370 3502 : package_PrimaryKerberosKey3_Type.tp_basicsize = pytalloc_BaseObject_size();
16371 :
16372 3502 : package_PrimaryKerberosCtr3_Type.tp_base = BaseObject_Type;
16373 3502 : package_PrimaryKerberosCtr3_Type.tp_basicsize = pytalloc_BaseObject_size();
16374 :
16375 3502 : package_PrimaryKerberosKey4_Type.tp_base = BaseObject_Type;
16376 3502 : package_PrimaryKerberosKey4_Type.tp_basicsize = pytalloc_BaseObject_size();
16377 :
16378 3502 : package_PrimaryKerberosCtr4_Type.tp_base = BaseObject_Type;
16379 3502 : package_PrimaryKerberosCtr4_Type.tp_basicsize = pytalloc_BaseObject_size();
16380 :
16381 3502 : package_PrimaryKerberosCtr_Type.tp_base = BaseObject_Type;
16382 3502 : package_PrimaryKerberosCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
16383 :
16384 3502 : package_PrimaryKerberosBlob_Type.tp_base = BaseObject_Type;
16385 3502 : package_PrimaryKerberosBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16386 :
16387 3502 : package_PrimaryCLEARTEXTBlob_Type.tp_base = BaseObject_Type;
16388 3502 : package_PrimaryCLEARTEXTBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16389 :
16390 3502 : package_PrimaryWDigestHash_Type.tp_base = BaseObject_Type;
16391 3502 : package_PrimaryWDigestHash_Type.tp_basicsize = pytalloc_BaseObject_size();
16392 :
16393 3502 : package_PrimaryWDigestBlob_Type.tp_base = BaseObject_Type;
16394 3502 : package_PrimaryWDigestBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16395 :
16396 3502 : package_PrimarySambaGPGBlob_Type.tp_base = BaseObject_Type;
16397 3502 : package_PrimarySambaGPGBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16398 :
16399 3502 : package_PrimaryUserPasswordValue_Type.tp_base = BaseObject_Type;
16400 3502 : package_PrimaryUserPasswordValue_Type.tp_basicsize = pytalloc_BaseObject_size();
16401 :
16402 3502 : package_PrimaryUserPasswordBlob_Type.tp_base = BaseObject_Type;
16403 3502 : package_PrimaryUserPasswordBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16404 :
16405 3502 : AuthInfoNone_Type.tp_base = BaseObject_Type;
16406 3502 : AuthInfoNone_Type.tp_basicsize = pytalloc_BaseObject_size();
16407 :
16408 3502 : AuthInfoNT4Owf_Type.tp_base = BaseObject_Type;
16409 3502 : AuthInfoNT4Owf_Type.tp_basicsize = pytalloc_BaseObject_size();
16410 :
16411 3502 : AuthInfoClear_Type.tp_base = BaseObject_Type;
16412 3502 : AuthInfoClear_Type.tp_basicsize = pytalloc_BaseObject_size();
16413 :
16414 3502 : AuthInfoVersion_Type.tp_base = BaseObject_Type;
16415 3502 : AuthInfoVersion_Type.tp_basicsize = pytalloc_BaseObject_size();
16416 :
16417 3502 : AuthInfo_Type.tp_base = BaseObject_Type;
16418 3502 : AuthInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
16419 :
16420 3502 : AuthenticationInformation_Type.tp_base = BaseObject_Type;
16421 3502 : AuthenticationInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
16422 :
16423 3502 : AuthenticationInformationArray_Type.tp_base = BaseObject_Type;
16424 3502 : AuthenticationInformationArray_Type.tp_basicsize = pytalloc_BaseObject_size();
16425 :
16426 3502 : trustAuthInOutBlob_Type.tp_base = BaseObject_Type;
16427 3502 : trustAuthInOutBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16428 :
16429 3502 : trustDomainPasswords_Type.tp_base = BaseObject_Type;
16430 3502 : trustDomainPasswords_Type.tp_basicsize = pytalloc_BaseObject_size();
16431 :
16432 3502 : DsCompressedChunk_Type.tp_base = BaseObject_Type;
16433 3502 : DsCompressedChunk_Type.tp_basicsize = pytalloc_BaseObject_size();
16434 :
16435 3502 : ExtendedErrorAString_Type.tp_base = BaseObject_Type;
16436 3502 : ExtendedErrorAString_Type.tp_basicsize = pytalloc_BaseObject_size();
16437 :
16438 3502 : ExtendedErrorUString_Type.tp_base = BaseObject_Type;
16439 3502 : ExtendedErrorUString_Type.tp_basicsize = pytalloc_BaseObject_size();
16440 :
16441 3502 : ExtendedErrorBlob_Type.tp_base = BaseObject_Type;
16442 3502 : ExtendedErrorBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
16443 :
16444 3502 : ExtendedErrorComputerNameU_Type.tp_base = BaseObject_Type;
16445 3502 : ExtendedErrorComputerNameU_Type.tp_basicsize = pytalloc_BaseObject_size();
16446 :
16447 3502 : ExtendedErrorComputerName_Type.tp_base = BaseObject_Type;
16448 3502 : ExtendedErrorComputerName_Type.tp_basicsize = pytalloc_BaseObject_size();
16449 :
16450 3502 : ExtendedErrorParamU_Type.tp_base = BaseObject_Type;
16451 3502 : ExtendedErrorParamU_Type.tp_basicsize = pytalloc_BaseObject_size();
16452 :
16453 3502 : ExtendedErrorParam_Type.tp_base = BaseObject_Type;
16454 3502 : ExtendedErrorParam_Type.tp_basicsize = pytalloc_BaseObject_size();
16455 :
16456 3502 : ExtendedErrorInfo_Type.tp_base = BaseObject_Type;
16457 3502 : ExtendedErrorInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
16458 :
16459 3502 : ExtendedErrorInfoPtr_Type.tp_base = BaseObject_Type;
16460 3502 : ExtendedErrorInfoPtr_Type.tp_basicsize = pytalloc_BaseObject_size();
16461 :
16462 3502 : ForestTrustString_Type.tp_base = BaseObject_Type;
16463 3502 : ForestTrustString_Type.tp_basicsize = pytalloc_BaseObject_size();
16464 :
16465 3502 : ForestTrustDataDomainInfo_Type.tp_base = BaseObject_Type;
16466 3502 : ForestTrustDataDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
16467 :
16468 3502 : ForestTrustDataBinaryData_Type.tp_base = BaseObject_Type;
16469 3502 : ForestTrustDataBinaryData_Type.tp_basicsize = pytalloc_BaseObject_size();
16470 :
16471 3502 : ForestTrustData_Type.tp_base = BaseObject_Type;
16472 3502 : ForestTrustData_Type.tp_basicsize = pytalloc_BaseObject_size();
16473 :
16474 3502 : ForestTrustInfoRecord_Type.tp_base = BaseObject_Type;
16475 3502 : ForestTrustInfoRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
16476 :
16477 3502 : ForestTrustInfoRecordArmor_Type.tp_base = BaseObject_Type;
16478 3502 : ForestTrustInfoRecordArmor_Type.tp_basicsize = pytalloc_BaseObject_size();
16479 :
16480 3502 : ForestTrustInfo_Type.tp_base = BaseObject_Type;
16481 3502 : ForestTrustInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
16482 :
16483 3502 : PlaintextSecret_Type.tp_base = BaseObject_Type;
16484 3502 : PlaintextSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
16485 :
16486 3502 : EncryptedSecretHeader_Type.tp_base = BaseObject_Type;
16487 3502 : EncryptedSecretHeader_Type.tp_basicsize = pytalloc_BaseObject_size();
16488 :
16489 3502 : EncryptedSecret_Type.tp_base = BaseObject_Type;
16490 3502 : EncryptedSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
16491 :
16492 3502 : drsblobs_InterfaceType.tp_base = ClientConnection_Type;
16493 :
16494 3502 : drsblobs_SyntaxType.tp_base = ndr_syntax_id_Type;
16495 3502 : drsblobs_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
16496 :
16497 3502 : if (PyType_Ready(&replPropertyMetaData1_Type) < 0)
16498 0 : goto out;
16499 3502 : if (PyType_Ready(&replPropertyMetaDataCtr1_Type) < 0)
16500 0 : goto out;
16501 3502 : if (PyType_Ready(&replPropertyMetaDataCtr_Type) < 0)
16502 0 : goto out;
16503 3502 : if (PyType_Ready(&replPropertyMetaDataBlob_Type) < 0)
16504 0 : goto out;
16505 3502 : if (PyType_Ready(&replUpToDateVectorCtr1_Type) < 0)
16506 0 : goto out;
16507 3502 : if (PyType_Ready(&replUpToDateVectorCtr2_Type) < 0)
16508 0 : goto out;
16509 3502 : if (PyType_Ready(&replUpToDateVectorCtr_Type) < 0)
16510 0 : goto out;
16511 3502 : if (PyType_Ready(&replUpToDateVectorBlob_Type) < 0)
16512 0 : goto out;
16513 3502 : if (PyType_Ready(&repsFromTo1OtherInfo_Type) < 0)
16514 0 : goto out;
16515 3502 : if (PyType_Ready(&repsFromTo1_Type) < 0)
16516 0 : goto out;
16517 3502 : if (PyType_Ready(&repsFromTo2OtherInfo_Type) < 0)
16518 0 : goto out;
16519 3502 : if (PyType_Ready(&repsFromTo2_Type) < 0)
16520 0 : goto out;
16521 3502 : if (PyType_Ready(&repsFromTo_Type) < 0)
16522 0 : goto out;
16523 3502 : if (PyType_Ready(&repsFromToBlob_Type) < 0)
16524 0 : goto out;
16525 3502 : if (PyType_Ready(&scheduleHeader_Type) < 0)
16526 0 : goto out;
16527 3502 : if (PyType_Ready(&scheduleSlots_Type) < 0)
16528 0 : goto out;
16529 3502 : if (PyType_Ready(&schedule_Type) < 0)
16530 0 : goto out;
16531 3502 : if (PyType_Ready(&partialAttributeSetCtr1_Type) < 0)
16532 0 : goto out;
16533 3502 : if (PyType_Ready(&partialAttributeSetCtr_Type) < 0)
16534 0 : goto out;
16535 3502 : if (PyType_Ready(&partialAttributeSetBlob_Type) < 0)
16536 0 : goto out;
16537 3502 : if (PyType_Ready(&schemaInfoBlob_Type) < 0)
16538 0 : goto out;
16539 3502 : if (PyType_Ready(&drsuapi_MSPrefixMap_Entry_Type) < 0)
16540 0 : goto out;
16541 3502 : if (PyType_Ready(&drsuapi_MSPrefixMap_Ctr_Type) < 0)
16542 0 : goto out;
16543 3502 : if (PyType_Ready(&prefixMapCtr_Type) < 0)
16544 0 : goto out;
16545 3502 : if (PyType_Ready(&prefixMapBlob_Type) < 0)
16546 0 : goto out;
16547 3502 : if (PyType_Ready(&ldapControlDirSyncExtra_Type) < 0)
16548 0 : goto out;
16549 3502 : if (PyType_Ready(&ldapControlDirSyncBlob_Type) < 0)
16550 0 : goto out;
16551 3502 : if (PyType_Ready(&ldapControlDirSyncCookie_Type) < 0)
16552 0 : goto out;
16553 3502 : if (PyType_Ready(&supplementalCredentialsPackage_Type) < 0)
16554 0 : goto out;
16555 3502 : if (PyType_Ready(&supplementalCredentialsSubBlob_Type) < 0)
16556 0 : goto out;
16557 3502 : if (PyType_Ready(&supplementalCredentialsBlob_Type) < 0)
16558 0 : goto out;
16559 3502 : if (PyType_Ready(&package_PackagesBlob_Type) < 0)
16560 0 : goto out;
16561 3502 : if (PyType_Ready(&package_PrimaryKerberosString_Type) < 0)
16562 0 : goto out;
16563 3502 : if (PyType_Ready(&package_PrimaryKerberosKey3_Type) < 0)
16564 0 : goto out;
16565 3502 : if (PyType_Ready(&package_PrimaryKerberosCtr3_Type) < 0)
16566 0 : goto out;
16567 3502 : if (PyType_Ready(&package_PrimaryKerberosKey4_Type) < 0)
16568 0 : goto out;
16569 3502 : if (PyType_Ready(&package_PrimaryKerberosCtr4_Type) < 0)
16570 0 : goto out;
16571 3502 : if (PyType_Ready(&package_PrimaryKerberosCtr_Type) < 0)
16572 0 : goto out;
16573 3502 : if (PyType_Ready(&package_PrimaryKerberosBlob_Type) < 0)
16574 0 : goto out;
16575 3502 : if (PyType_Ready(&package_PrimaryCLEARTEXTBlob_Type) < 0)
16576 0 : goto out;
16577 3502 : if (PyType_Ready(&package_PrimaryWDigestHash_Type) < 0)
16578 0 : goto out;
16579 3502 : if (PyType_Ready(&package_PrimaryWDigestBlob_Type) < 0)
16580 0 : goto out;
16581 3502 : if (PyType_Ready(&package_PrimarySambaGPGBlob_Type) < 0)
16582 0 : goto out;
16583 3502 : if (PyType_Ready(&package_PrimaryUserPasswordValue_Type) < 0)
16584 0 : goto out;
16585 3502 : if (PyType_Ready(&package_PrimaryUserPasswordBlob_Type) < 0)
16586 0 : goto out;
16587 3502 : if (PyType_Ready(&AuthInfoNone_Type) < 0)
16588 0 : goto out;
16589 3502 : if (PyType_Ready(&AuthInfoNT4Owf_Type) < 0)
16590 0 : goto out;
16591 3502 : if (PyType_Ready(&AuthInfoClear_Type) < 0)
16592 0 : goto out;
16593 3502 : if (PyType_Ready(&AuthInfoVersion_Type) < 0)
16594 0 : goto out;
16595 3502 : if (PyType_Ready(&AuthInfo_Type) < 0)
16596 0 : goto out;
16597 3502 : if (PyType_Ready(&AuthenticationInformation_Type) < 0)
16598 0 : goto out;
16599 3502 : if (PyType_Ready(&AuthenticationInformationArray_Type) < 0)
16600 0 : goto out;
16601 3502 : if (PyType_Ready(&trustAuthInOutBlob_Type) < 0)
16602 0 : goto out;
16603 3502 : if (PyType_Ready(&trustDomainPasswords_Type) < 0)
16604 0 : goto out;
16605 3502 : if (PyType_Ready(&DsCompressedChunk_Type) < 0)
16606 0 : goto out;
16607 3502 : if (PyType_Ready(&ExtendedErrorAString_Type) < 0)
16608 0 : goto out;
16609 3502 : if (PyType_Ready(&ExtendedErrorUString_Type) < 0)
16610 0 : goto out;
16611 3502 : if (PyType_Ready(&ExtendedErrorBlob_Type) < 0)
16612 0 : goto out;
16613 3502 : if (PyType_Ready(&ExtendedErrorComputerNameU_Type) < 0)
16614 0 : goto out;
16615 3502 : if (PyType_Ready(&ExtendedErrorComputerName_Type) < 0)
16616 0 : goto out;
16617 3502 : if (PyType_Ready(&ExtendedErrorParamU_Type) < 0)
16618 0 : goto out;
16619 3502 : if (PyType_Ready(&ExtendedErrorParam_Type) < 0)
16620 0 : goto out;
16621 3502 : if (PyType_Ready(&ExtendedErrorInfo_Type) < 0)
16622 0 : goto out;
16623 3502 : if (PyType_Ready(&ExtendedErrorInfoPtr_Type) < 0)
16624 0 : goto out;
16625 3502 : if (PyType_Ready(&ForestTrustString_Type) < 0)
16626 0 : goto out;
16627 3502 : if (PyType_Ready(&ForestTrustDataDomainInfo_Type) < 0)
16628 0 : goto out;
16629 3502 : if (PyType_Ready(&ForestTrustDataBinaryData_Type) < 0)
16630 0 : goto out;
16631 3502 : if (PyType_Ready(&ForestTrustData_Type) < 0)
16632 0 : goto out;
16633 3502 : if (PyType_Ready(&ForestTrustInfoRecord_Type) < 0)
16634 0 : goto out;
16635 3502 : if (PyType_Ready(&ForestTrustInfoRecordArmor_Type) < 0)
16636 0 : goto out;
16637 3502 : if (PyType_Ready(&ForestTrustInfo_Type) < 0)
16638 0 : goto out;
16639 3502 : if (PyType_Ready(&PlaintextSecret_Type) < 0)
16640 0 : goto out;
16641 3502 : if (PyType_Ready(&EncryptedSecretHeader_Type) < 0)
16642 0 : goto out;
16643 3502 : if (PyType_Ready(&EncryptedSecret_Type) < 0)
16644 0 : goto out;
16645 3502 : if (PyType_Ready(&drsblobs_InterfaceType) < 0)
16646 0 : goto out;
16647 3502 : if (PyType_Ready(&drsblobs_SyntaxType) < 0)
16648 0 : goto out;
16649 3502 : if (!PyInterface_AddNdrRpcMethods(&drsblobs_InterfaceType, py_ndr_drsblobs_methods))
16650 0 : return NULL;
16651 :
16652 : #ifdef PY_REPLPROPERTYMETADATA1_PATCH
16653 : PY_REPLPROPERTYMETADATA1_PATCH(&replPropertyMetaData1_Type);
16654 : #endif
16655 : #ifdef PY_REPLPROPERTYMETADATACTR1_PATCH
16656 : PY_REPLPROPERTYMETADATACTR1_PATCH(&replPropertyMetaDataCtr1_Type);
16657 : #endif
16658 : #ifdef PY_REPLPROPERTYMETADATACTR_PATCH
16659 : PY_REPLPROPERTYMETADATACTR_PATCH(&replPropertyMetaDataCtr_Type);
16660 : #endif
16661 : #ifdef PY_REPLPROPERTYMETADATABLOB_PATCH
16662 : PY_REPLPROPERTYMETADATABLOB_PATCH(&replPropertyMetaDataBlob_Type);
16663 : #endif
16664 : #ifdef PY_REPLUPTODATEVECTORCTR1_PATCH
16665 : PY_REPLUPTODATEVECTORCTR1_PATCH(&replUpToDateVectorCtr1_Type);
16666 : #endif
16667 : #ifdef PY_REPLUPTODATEVECTORCTR2_PATCH
16668 : PY_REPLUPTODATEVECTORCTR2_PATCH(&replUpToDateVectorCtr2_Type);
16669 : #endif
16670 : #ifdef PY_REPLUPTODATEVECTORCTR_PATCH
16671 : PY_REPLUPTODATEVECTORCTR_PATCH(&replUpToDateVectorCtr_Type);
16672 : #endif
16673 : #ifdef PY_REPLUPTODATEVECTORBLOB_PATCH
16674 : PY_REPLUPTODATEVECTORBLOB_PATCH(&replUpToDateVectorBlob_Type);
16675 : #endif
16676 : #ifdef PY_REPSFROMTO1OTHERINFO_PATCH
16677 : PY_REPSFROMTO1OTHERINFO_PATCH(&repsFromTo1OtherInfo_Type);
16678 : #endif
16679 : #ifdef PY_REPSFROMTO1_PATCH
16680 : PY_REPSFROMTO1_PATCH(&repsFromTo1_Type);
16681 : #endif
16682 : #ifdef PY_REPSFROMTO2OTHERINFO_PATCH
16683 : PY_REPSFROMTO2OTHERINFO_PATCH(&repsFromTo2OtherInfo_Type);
16684 : #endif
16685 : #ifdef PY_REPSFROMTO2_PATCH
16686 : PY_REPSFROMTO2_PATCH(&repsFromTo2_Type);
16687 : #endif
16688 : #ifdef PY_REPSFROMTO_PATCH
16689 : PY_REPSFROMTO_PATCH(&repsFromTo_Type);
16690 : #endif
16691 : #ifdef PY_REPSFROMTOBLOB_PATCH
16692 : PY_REPSFROMTOBLOB_PATCH(&repsFromToBlob_Type);
16693 : #endif
16694 : #ifdef PY_SCHEDULEHEADER_PATCH
16695 : PY_SCHEDULEHEADER_PATCH(&scheduleHeader_Type);
16696 : #endif
16697 : #ifdef PY_SCHEDULESLOTS_PATCH
16698 : PY_SCHEDULESLOTS_PATCH(&scheduleSlots_Type);
16699 : #endif
16700 : #ifdef PY_SCHEDULE_PATCH
16701 : PY_SCHEDULE_PATCH(&schedule_Type);
16702 : #endif
16703 : #ifdef PY_PARTIALATTRIBUTESETCTR1_PATCH
16704 : PY_PARTIALATTRIBUTESETCTR1_PATCH(&partialAttributeSetCtr1_Type);
16705 : #endif
16706 : #ifdef PY_PARTIALATTRIBUTESETCTR_PATCH
16707 : PY_PARTIALATTRIBUTESETCTR_PATCH(&partialAttributeSetCtr_Type);
16708 : #endif
16709 : #ifdef PY_PARTIALATTRIBUTESETBLOB_PATCH
16710 : PY_PARTIALATTRIBUTESETBLOB_PATCH(&partialAttributeSetBlob_Type);
16711 : #endif
16712 : #ifdef PY_SCHEMAINFOBLOB_PATCH
16713 : PY_SCHEMAINFOBLOB_PATCH(&schemaInfoBlob_Type);
16714 : #endif
16715 : #ifdef PY_DRSUAPI_MSPREFIXMAP_ENTRY_PATCH
16716 : PY_DRSUAPI_MSPREFIXMAP_ENTRY_PATCH(&drsuapi_MSPrefixMap_Entry_Type);
16717 : #endif
16718 : #ifdef PY_DRSUAPI_MSPREFIXMAP_CTR_PATCH
16719 : PY_DRSUAPI_MSPREFIXMAP_CTR_PATCH(&drsuapi_MSPrefixMap_Ctr_Type);
16720 : #endif
16721 : #ifdef PY_PREFIXMAPCTR_PATCH
16722 : PY_PREFIXMAPCTR_PATCH(&prefixMapCtr_Type);
16723 : #endif
16724 : #ifdef PY_PREFIXMAPBLOB_PATCH
16725 : PY_PREFIXMAPBLOB_PATCH(&prefixMapBlob_Type);
16726 : #endif
16727 : #ifdef PY_LDAPCONTROLDIRSYNCEXTRA_PATCH
16728 : PY_LDAPCONTROLDIRSYNCEXTRA_PATCH(&ldapControlDirSyncExtra_Type);
16729 : #endif
16730 : #ifdef PY_LDAPCONTROLDIRSYNCBLOB_PATCH
16731 : PY_LDAPCONTROLDIRSYNCBLOB_PATCH(&ldapControlDirSyncBlob_Type);
16732 : #endif
16733 : #ifdef PY_LDAPCONTROLDIRSYNCCOOKIE_PATCH
16734 : PY_LDAPCONTROLDIRSYNCCOOKIE_PATCH(&ldapControlDirSyncCookie_Type);
16735 : #endif
16736 : #ifdef PY_SUPPLEMENTALCREDENTIALSPACKAGE_PATCH
16737 : PY_SUPPLEMENTALCREDENTIALSPACKAGE_PATCH(&supplementalCredentialsPackage_Type);
16738 : #endif
16739 : #ifdef PY_SUPPLEMENTALCREDENTIALSSUBBLOB_PATCH
16740 : PY_SUPPLEMENTALCREDENTIALSSUBBLOB_PATCH(&supplementalCredentialsSubBlob_Type);
16741 : #endif
16742 : #ifdef PY_SUPPLEMENTALCREDENTIALSBLOB_PATCH
16743 : PY_SUPPLEMENTALCREDENTIALSBLOB_PATCH(&supplementalCredentialsBlob_Type);
16744 : #endif
16745 : #ifdef PY_PACKAGE_PACKAGESBLOB_PATCH
16746 : PY_PACKAGE_PACKAGESBLOB_PATCH(&package_PackagesBlob_Type);
16747 : #endif
16748 : #ifdef PY_PACKAGE_PRIMARYKERBEROSSTRING_PATCH
16749 : PY_PACKAGE_PRIMARYKERBEROSSTRING_PATCH(&package_PrimaryKerberosString_Type);
16750 : #endif
16751 : #ifdef PY_PACKAGE_PRIMARYKERBEROSKEY3_PATCH
16752 : PY_PACKAGE_PRIMARYKERBEROSKEY3_PATCH(&package_PrimaryKerberosKey3_Type);
16753 : #endif
16754 : #ifdef PY_PACKAGE_PRIMARYKERBEROSCTR3_PATCH
16755 : PY_PACKAGE_PRIMARYKERBEROSCTR3_PATCH(&package_PrimaryKerberosCtr3_Type);
16756 : #endif
16757 : #ifdef PY_PACKAGE_PRIMARYKERBEROSKEY4_PATCH
16758 : PY_PACKAGE_PRIMARYKERBEROSKEY4_PATCH(&package_PrimaryKerberosKey4_Type);
16759 : #endif
16760 : #ifdef PY_PACKAGE_PRIMARYKERBEROSCTR4_PATCH
16761 : PY_PACKAGE_PRIMARYKERBEROSCTR4_PATCH(&package_PrimaryKerberosCtr4_Type);
16762 : #endif
16763 : #ifdef PY_PACKAGE_PRIMARYKERBEROSCTR_PATCH
16764 : PY_PACKAGE_PRIMARYKERBEROSCTR_PATCH(&package_PrimaryKerberosCtr_Type);
16765 : #endif
16766 : #ifdef PY_PACKAGE_PRIMARYKERBEROSBLOB_PATCH
16767 : PY_PACKAGE_PRIMARYKERBEROSBLOB_PATCH(&package_PrimaryKerberosBlob_Type);
16768 : #endif
16769 : #ifdef PY_PACKAGE_PRIMARYCLEARTEXTBLOB_PATCH
16770 : PY_PACKAGE_PRIMARYCLEARTEXTBLOB_PATCH(&package_PrimaryCLEARTEXTBlob_Type);
16771 : #endif
16772 : #ifdef PY_PACKAGE_PRIMARYWDIGESTHASH_PATCH
16773 : PY_PACKAGE_PRIMARYWDIGESTHASH_PATCH(&package_PrimaryWDigestHash_Type);
16774 : #endif
16775 : #ifdef PY_PACKAGE_PRIMARYWDIGESTBLOB_PATCH
16776 : PY_PACKAGE_PRIMARYWDIGESTBLOB_PATCH(&package_PrimaryWDigestBlob_Type);
16777 : #endif
16778 : #ifdef PY_PACKAGE_PRIMARYSAMBAGPGBLOB_PATCH
16779 : PY_PACKAGE_PRIMARYSAMBAGPGBLOB_PATCH(&package_PrimarySambaGPGBlob_Type);
16780 : #endif
16781 : #ifdef PY_PACKAGE_PRIMARYUSERPASSWORDVALUE_PATCH
16782 : PY_PACKAGE_PRIMARYUSERPASSWORDVALUE_PATCH(&package_PrimaryUserPasswordValue_Type);
16783 : #endif
16784 : #ifdef PY_PACKAGE_PRIMARYUSERPASSWORDBLOB_PATCH
16785 : PY_PACKAGE_PRIMARYUSERPASSWORDBLOB_PATCH(&package_PrimaryUserPasswordBlob_Type);
16786 : #endif
16787 : #ifdef PY_AUTHINFONONE_PATCH
16788 : PY_AUTHINFONONE_PATCH(&AuthInfoNone_Type);
16789 : #endif
16790 : #ifdef PY_AUTHINFONT4OWF_PATCH
16791 : PY_AUTHINFONT4OWF_PATCH(&AuthInfoNT4Owf_Type);
16792 : #endif
16793 : #ifdef PY_AUTHINFOCLEAR_PATCH
16794 : PY_AUTHINFOCLEAR_PATCH(&AuthInfoClear_Type);
16795 : #endif
16796 : #ifdef PY_AUTHINFOVERSION_PATCH
16797 : PY_AUTHINFOVERSION_PATCH(&AuthInfoVersion_Type);
16798 : #endif
16799 : #ifdef PY_AUTHINFO_PATCH
16800 : PY_AUTHINFO_PATCH(&AuthInfo_Type);
16801 : #endif
16802 : #ifdef PY_AUTHENTICATIONINFORMATION_PATCH
16803 : PY_AUTHENTICATIONINFORMATION_PATCH(&AuthenticationInformation_Type);
16804 : #endif
16805 : #ifdef PY_AUTHENTICATIONINFORMATIONARRAY_PATCH
16806 : PY_AUTHENTICATIONINFORMATIONARRAY_PATCH(&AuthenticationInformationArray_Type);
16807 : #endif
16808 : #ifdef PY_TRUSTAUTHINOUTBLOB_PATCH
16809 : PY_TRUSTAUTHINOUTBLOB_PATCH(&trustAuthInOutBlob_Type);
16810 : #endif
16811 : #ifdef PY_TRUSTDOMAINPASSWORDS_PATCH
16812 : PY_TRUSTDOMAINPASSWORDS_PATCH(&trustDomainPasswords_Type);
16813 : #endif
16814 : #ifdef PY_DSCOMPRESSEDCHUNK_PATCH
16815 : PY_DSCOMPRESSEDCHUNK_PATCH(&DsCompressedChunk_Type);
16816 : #endif
16817 : #ifdef PY_EXTENDEDERRORASTRING_PATCH
16818 : PY_EXTENDEDERRORASTRING_PATCH(&ExtendedErrorAString_Type);
16819 : #endif
16820 : #ifdef PY_EXTENDEDERRORUSTRING_PATCH
16821 : PY_EXTENDEDERRORUSTRING_PATCH(&ExtendedErrorUString_Type);
16822 : #endif
16823 : #ifdef PY_EXTENDEDERRORBLOB_PATCH
16824 : PY_EXTENDEDERRORBLOB_PATCH(&ExtendedErrorBlob_Type);
16825 : #endif
16826 : #ifdef PY_EXTENDEDERRORCOMPUTERNAMEU_PATCH
16827 : PY_EXTENDEDERRORCOMPUTERNAMEU_PATCH(&ExtendedErrorComputerNameU_Type);
16828 : #endif
16829 : #ifdef PY_EXTENDEDERRORCOMPUTERNAME_PATCH
16830 : PY_EXTENDEDERRORCOMPUTERNAME_PATCH(&ExtendedErrorComputerName_Type);
16831 : #endif
16832 : #ifdef PY_EXTENDEDERRORPARAMU_PATCH
16833 : PY_EXTENDEDERRORPARAMU_PATCH(&ExtendedErrorParamU_Type);
16834 : #endif
16835 : #ifdef PY_EXTENDEDERRORPARAM_PATCH
16836 : PY_EXTENDEDERRORPARAM_PATCH(&ExtendedErrorParam_Type);
16837 : #endif
16838 : #ifdef PY_EXTENDEDERRORINFO_PATCH
16839 : PY_EXTENDEDERRORINFO_PATCH(&ExtendedErrorInfo_Type);
16840 : #endif
16841 : #ifdef PY_EXTENDEDERRORINFOPTR_PATCH
16842 : PY_EXTENDEDERRORINFOPTR_PATCH(&ExtendedErrorInfoPtr_Type);
16843 : #endif
16844 : #ifdef PY_FORESTTRUSTSTRING_PATCH
16845 : PY_FORESTTRUSTSTRING_PATCH(&ForestTrustString_Type);
16846 : #endif
16847 : #ifdef PY_FORESTTRUSTDATADOMAININFO_PATCH
16848 : PY_FORESTTRUSTDATADOMAININFO_PATCH(&ForestTrustDataDomainInfo_Type);
16849 : #endif
16850 : #ifdef PY_FORESTTRUSTDATABINARYDATA_PATCH
16851 : PY_FORESTTRUSTDATABINARYDATA_PATCH(&ForestTrustDataBinaryData_Type);
16852 : #endif
16853 : #ifdef PY_FORESTTRUSTDATA_PATCH
16854 : PY_FORESTTRUSTDATA_PATCH(&ForestTrustData_Type);
16855 : #endif
16856 : #ifdef PY_FORESTTRUSTINFORECORD_PATCH
16857 : PY_FORESTTRUSTINFORECORD_PATCH(&ForestTrustInfoRecord_Type);
16858 : #endif
16859 : #ifdef PY_FORESTTRUSTINFORECORDARMOR_PATCH
16860 : PY_FORESTTRUSTINFORECORDARMOR_PATCH(&ForestTrustInfoRecordArmor_Type);
16861 : #endif
16862 : #ifdef PY_FORESTTRUSTINFO_PATCH
16863 : PY_FORESTTRUSTINFO_PATCH(&ForestTrustInfo_Type);
16864 : #endif
16865 : #ifdef PY_PLAINTEXTSECRET_PATCH
16866 : PY_PLAINTEXTSECRET_PATCH(&PlaintextSecret_Type);
16867 : #endif
16868 : #ifdef PY_ENCRYPTEDSECRETHEADER_PATCH
16869 : PY_ENCRYPTEDSECRETHEADER_PATCH(&EncryptedSecretHeader_Type);
16870 : #endif
16871 : #ifdef PY_ENCRYPTEDSECRET_PATCH
16872 : PY_ENCRYPTEDSECRET_PATCH(&EncryptedSecret_Type);
16873 : #endif
16874 : #ifdef PY_DRSBLOBS_PATCH
16875 : PY_DRSBLOBS_PATCH(&drsblobs_InterfaceType);
16876 : #endif
16877 : #ifdef PY_DRSBLOBS_ABSTRACT_SYNTAX_PATCH
16878 : PY_DRSBLOBS_ABSTRACT_SYNTAX_PATCH(&drsblobs_SyntaxType);
16879 : #endif
16880 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
16881 : PY_ABSTRACT_SYNTAX_PATCH(&drsblobs_SyntaxType);
16882 : #endif
16883 :
16884 3502 : m = PyModule_Create(&moduledef);
16885 3502 : if (m == NULL)
16886 0 : goto out;
16887 :
16888 3502 : PyModule_AddObject(m, "SUPPLEMENTAL_CREDENTIALS_PREFIX", PyUnicode_FromString(" "));
16889 3502 : PyModule_AddObject(m, "ENCRYPTED_SECRET_MAGIC_VALUE", PyLong_FromUnsignedLongLong(0xCA5CADED));
16890 3502 : PyModule_AddObject(m, "PREFIX_MAP_VERSION_DSDB", PyLong_FromUnsignedLongLong((uint32_t)PREFIX_MAP_VERSION_DSDB));
16891 3502 : PyModule_AddObject(m, "SUPPLEMENTAL_CREDENTIALS_SIGNATURE", PyLong_FromLong((uint16_t)SUPPLEMENTAL_CREDENTIALS_SIGNATURE));
16892 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_COMPUTER_NAME_PRESENT", PyLong_FromLong((uint16_t)EXTENDED_ERROR_COMPUTER_NAME_PRESENT));
16893 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT", PyLong_FromLong((uint16_t)EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT));
16894 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING));
16895 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING));
16896 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_UINT32", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_UINT32));
16897 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_UINT16", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_UINT16));
16898 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_UINT64", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_UINT64));
16899 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_NONE", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_NONE));
16900 3502 : PyModule_AddObject(m, "EXTENDED_ERROR_PARAM_TYPE_BLOB", PyLong_FromLong((uint16_t)EXTENDED_ERROR_PARAM_TYPE_BLOB));
16901 3502 : PyModule_AddObject(m, "FOREST_TRUST_TOP_LEVEL_NAME", PyLong_FromLong((uint16_t)FOREST_TRUST_TOP_LEVEL_NAME));
16902 3502 : PyModule_AddObject(m, "FOREST_TRUST_TOP_LEVEL_NAME_EX", PyLong_FromLong((uint16_t)FOREST_TRUST_TOP_LEVEL_NAME_EX));
16903 3502 : PyModule_AddObject(m, "FOREST_TRUST_DOMAIN_INFO", PyLong_FromLong((uint16_t)FOREST_TRUST_DOMAIN_INFO));
16904 3502 : PyModule_AddObject(m, "ENC_SECRET_AES_128_AEAD", PyLong_FromLong((uint16_t)ENC_SECRET_AES_128_AEAD));
16905 3502 : Py_INCREF((PyObject *)(void *)&replPropertyMetaData1_Type);
16906 3502 : PyModule_AddObject(m, "replPropertyMetaData1", (PyObject *)(void *)&replPropertyMetaData1_Type);
16907 3502 : Py_INCREF((PyObject *)(void *)&replPropertyMetaDataCtr1_Type);
16908 3502 : PyModule_AddObject(m, "replPropertyMetaDataCtr1", (PyObject *)(void *)&replPropertyMetaDataCtr1_Type);
16909 3502 : Py_INCREF((PyObject *)(void *)&replPropertyMetaDataCtr_Type);
16910 3502 : PyModule_AddObject(m, "replPropertyMetaDataCtr", (PyObject *)(void *)&replPropertyMetaDataCtr_Type);
16911 3502 : Py_INCREF((PyObject *)(void *)&replPropertyMetaDataBlob_Type);
16912 3502 : PyModule_AddObject(m, "replPropertyMetaDataBlob", (PyObject *)(void *)&replPropertyMetaDataBlob_Type);
16913 3502 : Py_INCREF((PyObject *)(void *)&replUpToDateVectorCtr1_Type);
16914 3502 : PyModule_AddObject(m, "replUpToDateVectorCtr1", (PyObject *)(void *)&replUpToDateVectorCtr1_Type);
16915 3502 : Py_INCREF((PyObject *)(void *)&replUpToDateVectorCtr2_Type);
16916 3502 : PyModule_AddObject(m, "replUpToDateVectorCtr2", (PyObject *)(void *)&replUpToDateVectorCtr2_Type);
16917 3502 : Py_INCREF((PyObject *)(void *)&replUpToDateVectorCtr_Type);
16918 3502 : PyModule_AddObject(m, "replUpToDateVectorCtr", (PyObject *)(void *)&replUpToDateVectorCtr_Type);
16919 3502 : Py_INCREF((PyObject *)(void *)&replUpToDateVectorBlob_Type);
16920 3502 : PyModule_AddObject(m, "replUpToDateVectorBlob", (PyObject *)(void *)&replUpToDateVectorBlob_Type);
16921 3502 : Py_INCREF((PyObject *)(void *)&repsFromTo1OtherInfo_Type);
16922 3502 : PyModule_AddObject(m, "repsFromTo1OtherInfo", (PyObject *)(void *)&repsFromTo1OtherInfo_Type);
16923 3502 : Py_INCREF((PyObject *)(void *)&repsFromTo1_Type);
16924 3502 : PyModule_AddObject(m, "repsFromTo1", (PyObject *)(void *)&repsFromTo1_Type);
16925 3502 : Py_INCREF((PyObject *)(void *)&repsFromTo2OtherInfo_Type);
16926 3502 : PyModule_AddObject(m, "repsFromTo2OtherInfo", (PyObject *)(void *)&repsFromTo2OtherInfo_Type);
16927 3502 : Py_INCREF((PyObject *)(void *)&repsFromTo2_Type);
16928 3502 : PyModule_AddObject(m, "repsFromTo2", (PyObject *)(void *)&repsFromTo2_Type);
16929 3502 : Py_INCREF((PyObject *)(void *)&repsFromTo_Type);
16930 3502 : PyModule_AddObject(m, "repsFromTo", (PyObject *)(void *)&repsFromTo_Type);
16931 3502 : Py_INCREF((PyObject *)(void *)&repsFromToBlob_Type);
16932 3502 : PyModule_AddObject(m, "repsFromToBlob", (PyObject *)(void *)&repsFromToBlob_Type);
16933 3502 : Py_INCREF((PyObject *)(void *)&scheduleHeader_Type);
16934 3502 : PyModule_AddObject(m, "scheduleHeader", (PyObject *)(void *)&scheduleHeader_Type);
16935 3502 : Py_INCREF((PyObject *)(void *)&scheduleSlots_Type);
16936 3502 : PyModule_AddObject(m, "scheduleSlots", (PyObject *)(void *)&scheduleSlots_Type);
16937 3502 : Py_INCREF((PyObject *)(void *)&schedule_Type);
16938 3502 : PyModule_AddObject(m, "schedule", (PyObject *)(void *)&schedule_Type);
16939 3502 : Py_INCREF((PyObject *)(void *)&partialAttributeSetCtr1_Type);
16940 3502 : PyModule_AddObject(m, "partialAttributeSetCtr1", (PyObject *)(void *)&partialAttributeSetCtr1_Type);
16941 3502 : Py_INCREF((PyObject *)(void *)&partialAttributeSetCtr_Type);
16942 3502 : PyModule_AddObject(m, "partialAttributeSetCtr", (PyObject *)(void *)&partialAttributeSetCtr_Type);
16943 3502 : Py_INCREF((PyObject *)(void *)&partialAttributeSetBlob_Type);
16944 3502 : PyModule_AddObject(m, "partialAttributeSetBlob", (PyObject *)(void *)&partialAttributeSetBlob_Type);
16945 3502 : Py_INCREF((PyObject *)(void *)&schemaInfoBlob_Type);
16946 3502 : PyModule_AddObject(m, "schemaInfoBlob", (PyObject *)(void *)&schemaInfoBlob_Type);
16947 3502 : Py_INCREF((PyObject *)(void *)&drsuapi_MSPrefixMap_Entry_Type);
16948 3502 : PyModule_AddObject(m, "drsuapi_MSPrefixMap_Entry", (PyObject *)(void *)&drsuapi_MSPrefixMap_Entry_Type);
16949 3502 : Py_INCREF((PyObject *)(void *)&drsuapi_MSPrefixMap_Ctr_Type);
16950 3502 : PyModule_AddObject(m, "drsuapi_MSPrefixMap_Ctr", (PyObject *)(void *)&drsuapi_MSPrefixMap_Ctr_Type);
16951 3502 : Py_INCREF((PyObject *)(void *)&prefixMapCtr_Type);
16952 3502 : PyModule_AddObject(m, "prefixMapCtr", (PyObject *)(void *)&prefixMapCtr_Type);
16953 3502 : Py_INCREF((PyObject *)(void *)&prefixMapBlob_Type);
16954 3502 : PyModule_AddObject(m, "prefixMapBlob", (PyObject *)(void *)&prefixMapBlob_Type);
16955 3502 : Py_INCREF((PyObject *)(void *)&ldapControlDirSyncExtra_Type);
16956 3502 : PyModule_AddObject(m, "ldapControlDirSyncExtra", (PyObject *)(void *)&ldapControlDirSyncExtra_Type);
16957 3502 : Py_INCREF((PyObject *)(void *)&ldapControlDirSyncBlob_Type);
16958 3502 : PyModule_AddObject(m, "ldapControlDirSyncBlob", (PyObject *)(void *)&ldapControlDirSyncBlob_Type);
16959 3502 : Py_INCREF((PyObject *)(void *)&ldapControlDirSyncCookie_Type);
16960 3502 : PyModule_AddObject(m, "ldapControlDirSyncCookie", (PyObject *)(void *)&ldapControlDirSyncCookie_Type);
16961 3502 : Py_INCREF((PyObject *)(void *)&supplementalCredentialsPackage_Type);
16962 3502 : PyModule_AddObject(m, "supplementalCredentialsPackage", (PyObject *)(void *)&supplementalCredentialsPackage_Type);
16963 3502 : Py_INCREF((PyObject *)(void *)&supplementalCredentialsSubBlob_Type);
16964 3502 : PyModule_AddObject(m, "supplementalCredentialsSubBlob", (PyObject *)(void *)&supplementalCredentialsSubBlob_Type);
16965 3502 : Py_INCREF((PyObject *)(void *)&supplementalCredentialsBlob_Type);
16966 3502 : PyModule_AddObject(m, "supplementalCredentialsBlob", (PyObject *)(void *)&supplementalCredentialsBlob_Type);
16967 3502 : Py_INCREF((PyObject *)(void *)&package_PackagesBlob_Type);
16968 3502 : PyModule_AddObject(m, "package_PackagesBlob", (PyObject *)(void *)&package_PackagesBlob_Type);
16969 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosString_Type);
16970 3502 : PyModule_AddObject(m, "package_PrimaryKerberosString", (PyObject *)(void *)&package_PrimaryKerberosString_Type);
16971 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosKey3_Type);
16972 3502 : PyModule_AddObject(m, "package_PrimaryKerberosKey3", (PyObject *)(void *)&package_PrimaryKerberosKey3_Type);
16973 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosCtr3_Type);
16974 3502 : PyModule_AddObject(m, "package_PrimaryKerberosCtr3", (PyObject *)(void *)&package_PrimaryKerberosCtr3_Type);
16975 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosKey4_Type);
16976 3502 : PyModule_AddObject(m, "package_PrimaryKerberosKey4", (PyObject *)(void *)&package_PrimaryKerberosKey4_Type);
16977 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosCtr4_Type);
16978 3502 : PyModule_AddObject(m, "package_PrimaryKerberosCtr4", (PyObject *)(void *)&package_PrimaryKerberosCtr4_Type);
16979 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosCtr_Type);
16980 3502 : PyModule_AddObject(m, "package_PrimaryKerberosCtr", (PyObject *)(void *)&package_PrimaryKerberosCtr_Type);
16981 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryKerberosBlob_Type);
16982 3502 : PyModule_AddObject(m, "package_PrimaryKerberosBlob", (PyObject *)(void *)&package_PrimaryKerberosBlob_Type);
16983 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryCLEARTEXTBlob_Type);
16984 3502 : PyModule_AddObject(m, "package_PrimaryCLEARTEXTBlob", (PyObject *)(void *)&package_PrimaryCLEARTEXTBlob_Type);
16985 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryWDigestHash_Type);
16986 3502 : PyModule_AddObject(m, "package_PrimaryWDigestHash", (PyObject *)(void *)&package_PrimaryWDigestHash_Type);
16987 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryWDigestBlob_Type);
16988 3502 : PyModule_AddObject(m, "package_PrimaryWDigestBlob", (PyObject *)(void *)&package_PrimaryWDigestBlob_Type);
16989 3502 : Py_INCREF((PyObject *)(void *)&package_PrimarySambaGPGBlob_Type);
16990 3502 : PyModule_AddObject(m, "package_PrimarySambaGPGBlob", (PyObject *)(void *)&package_PrimarySambaGPGBlob_Type);
16991 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryUserPasswordValue_Type);
16992 3502 : PyModule_AddObject(m, "package_PrimaryUserPasswordValue", (PyObject *)(void *)&package_PrimaryUserPasswordValue_Type);
16993 3502 : Py_INCREF((PyObject *)(void *)&package_PrimaryUserPasswordBlob_Type);
16994 3502 : PyModule_AddObject(m, "package_PrimaryUserPasswordBlob", (PyObject *)(void *)&package_PrimaryUserPasswordBlob_Type);
16995 3502 : Py_INCREF((PyObject *)(void *)&AuthInfoNone_Type);
16996 3502 : PyModule_AddObject(m, "AuthInfoNone", (PyObject *)(void *)&AuthInfoNone_Type);
16997 3502 : Py_INCREF((PyObject *)(void *)&AuthInfoNT4Owf_Type);
16998 3502 : PyModule_AddObject(m, "AuthInfoNT4Owf", (PyObject *)(void *)&AuthInfoNT4Owf_Type);
16999 3502 : Py_INCREF((PyObject *)(void *)&AuthInfoClear_Type);
17000 3502 : PyModule_AddObject(m, "AuthInfoClear", (PyObject *)(void *)&AuthInfoClear_Type);
17001 3502 : Py_INCREF((PyObject *)(void *)&AuthInfoVersion_Type);
17002 3502 : PyModule_AddObject(m, "AuthInfoVersion", (PyObject *)(void *)&AuthInfoVersion_Type);
17003 3502 : Py_INCREF((PyObject *)(void *)&AuthInfo_Type);
17004 3502 : PyModule_AddObject(m, "AuthInfo", (PyObject *)(void *)&AuthInfo_Type);
17005 3502 : Py_INCREF((PyObject *)(void *)&AuthenticationInformation_Type);
17006 3502 : PyModule_AddObject(m, "AuthenticationInformation", (PyObject *)(void *)&AuthenticationInformation_Type);
17007 3502 : Py_INCREF((PyObject *)(void *)&AuthenticationInformationArray_Type);
17008 3502 : PyModule_AddObject(m, "AuthenticationInformationArray", (PyObject *)(void *)&AuthenticationInformationArray_Type);
17009 3502 : Py_INCREF((PyObject *)(void *)&trustAuthInOutBlob_Type);
17010 3502 : PyModule_AddObject(m, "trustAuthInOutBlob", (PyObject *)(void *)&trustAuthInOutBlob_Type);
17011 3502 : Py_INCREF((PyObject *)(void *)&trustDomainPasswords_Type);
17012 3502 : PyModule_AddObject(m, "trustDomainPasswords", (PyObject *)(void *)&trustDomainPasswords_Type);
17013 3502 : Py_INCREF((PyObject *)(void *)&DsCompressedChunk_Type);
17014 3502 : PyModule_AddObject(m, "DsCompressedChunk", (PyObject *)(void *)&DsCompressedChunk_Type);
17015 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorAString_Type);
17016 3502 : PyModule_AddObject(m, "ExtendedErrorAString", (PyObject *)(void *)&ExtendedErrorAString_Type);
17017 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorUString_Type);
17018 3502 : PyModule_AddObject(m, "ExtendedErrorUString", (PyObject *)(void *)&ExtendedErrorUString_Type);
17019 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorBlob_Type);
17020 3502 : PyModule_AddObject(m, "ExtendedErrorBlob", (PyObject *)(void *)&ExtendedErrorBlob_Type);
17021 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorComputerNameU_Type);
17022 3502 : PyModule_AddObject(m, "ExtendedErrorComputerNameU", (PyObject *)(void *)&ExtendedErrorComputerNameU_Type);
17023 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorComputerName_Type);
17024 3502 : PyModule_AddObject(m, "ExtendedErrorComputerName", (PyObject *)(void *)&ExtendedErrorComputerName_Type);
17025 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorParamU_Type);
17026 3502 : PyModule_AddObject(m, "ExtendedErrorParamU", (PyObject *)(void *)&ExtendedErrorParamU_Type);
17027 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorParam_Type);
17028 3502 : PyModule_AddObject(m, "ExtendedErrorParam", (PyObject *)(void *)&ExtendedErrorParam_Type);
17029 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorInfo_Type);
17030 3502 : PyModule_AddObject(m, "ExtendedErrorInfo", (PyObject *)(void *)&ExtendedErrorInfo_Type);
17031 3502 : Py_INCREF((PyObject *)(void *)&ExtendedErrorInfoPtr_Type);
17032 3502 : PyModule_AddObject(m, "ExtendedErrorInfoPtr", (PyObject *)(void *)&ExtendedErrorInfoPtr_Type);
17033 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustString_Type);
17034 3502 : PyModule_AddObject(m, "ForestTrustString", (PyObject *)(void *)&ForestTrustString_Type);
17035 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustDataDomainInfo_Type);
17036 3502 : PyModule_AddObject(m, "ForestTrustDataDomainInfo", (PyObject *)(void *)&ForestTrustDataDomainInfo_Type);
17037 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustDataBinaryData_Type);
17038 3502 : PyModule_AddObject(m, "ForestTrustDataBinaryData", (PyObject *)(void *)&ForestTrustDataBinaryData_Type);
17039 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustData_Type);
17040 3502 : PyModule_AddObject(m, "ForestTrustData", (PyObject *)(void *)&ForestTrustData_Type);
17041 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustInfoRecord_Type);
17042 3502 : PyModule_AddObject(m, "ForestTrustInfoRecord", (PyObject *)(void *)&ForestTrustInfoRecord_Type);
17043 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustInfoRecordArmor_Type);
17044 3502 : PyModule_AddObject(m, "ForestTrustInfoRecordArmor", (PyObject *)(void *)&ForestTrustInfoRecordArmor_Type);
17045 3502 : Py_INCREF((PyObject *)(void *)&ForestTrustInfo_Type);
17046 3502 : PyModule_AddObject(m, "ForestTrustInfo", (PyObject *)(void *)&ForestTrustInfo_Type);
17047 3502 : Py_INCREF((PyObject *)(void *)&PlaintextSecret_Type);
17048 3502 : PyModule_AddObject(m, "PlaintextSecret", (PyObject *)(void *)&PlaintextSecret_Type);
17049 3502 : Py_INCREF((PyObject *)(void *)&EncryptedSecretHeader_Type);
17050 3502 : PyModule_AddObject(m, "EncryptedSecretHeader", (PyObject *)(void *)&EncryptedSecretHeader_Type);
17051 3502 : Py_INCREF((PyObject *)(void *)&EncryptedSecret_Type);
17052 3502 : PyModule_AddObject(m, "EncryptedSecret", (PyObject *)(void *)&EncryptedSecret_Type);
17053 3502 : Py_INCREF((PyObject *)(void *)&drsblobs_InterfaceType);
17054 3502 : PyModule_AddObject(m, "drsblobs", (PyObject *)(void *)&drsblobs_InterfaceType);
17055 3502 : Py_INCREF((PyObject *)(void *)&drsblobs_SyntaxType);
17056 3502 : PyModule_AddObject(m, "drsblobs_abstract_syntax", (PyObject *)(void *)&drsblobs_SyntaxType);
17057 3502 : Py_INCREF((PyObject *)(void *)&drsblobs_SyntaxType);
17058 3502 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&drsblobs_SyntaxType);
17059 : #ifdef PY_MOD_DRSBLOBS_PATCH
17060 : PY_MOD_DRSBLOBS_PATCH(m);
17061 : #endif
17062 3502 : out:
17063 3502 : Py_XDECREF(dep_samba_dcerpc_drsuapi);
17064 3502 : Py_XDECREF(dep_samba_dcerpc_misc);
17065 3502 : Py_XDECREF(dep_samba_dcerpc_samr);
17066 3502 : Py_XDECREF(dep_samba_dcerpc_lsa);
17067 3502 : Py_XDECREF(dep_samba_dcerpc_security);
17068 3502 : Py_XDECREF(dep_talloc);
17069 3502 : Py_XDECREF(dep_samba_dcerpc_base);
17070 3502 : return m;
17071 :
17072 : }
|