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 "lib/replace/system/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_dnsp.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 57162 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 57162 : switch (var_size) {
35 337 : case 8:
36 337 : return UINT64_MAX;
37 48687 : case 4:
38 48687 : return UINT32_MAX;
39 6740 : case 2:
40 6740 : return UINT16_MAX;
41 1398 : case 1:
42 1398 : 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/misc.h"
65 : static PyTypeObject dnsp_soa_Type;
66 : static PyTypeObject dnsp_mx_Type;
67 : static PyTypeObject dnsp_hinfo_Type;
68 : static PyTypeObject dnsp_srv_Type;
69 : static PyTypeObject dnsp_ip4_array_Type;
70 : static PyTypeObject dnsp_dns_addr_Type;
71 : static PyTypeObject dnsp_dns_addr_array_Type;
72 : static PyTypeObject dnsp_string_list_Type;
73 : static PyTypeObject dnsRecordData_Type;
74 : static PyTypeObject dnsp_DnssrvRpcRecord_Type;
75 : static PyTypeObject dnsPropertyData_Type;
76 : static PyTypeObject dnsp_DnsProperty_Type;
77 : static PyTypeObject dnsp_DnsProperty_short_Type;
78 : static PyTypeObject dnsp_InterfaceType;
79 :
80 : static PyTypeObject *BaseObject_Type;
81 : static PyTypeObject *ClientConnection_Type;
82 : static PyTypeObject *ndr_syntax_id_Type;
83 :
84 0 : static PyObject *py_dnsp_soa_get_serial(PyObject *obj, void *closure)
85 : {
86 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
87 0 : PyObject *py_serial;
88 0 : py_serial = PyLong_FromUnsignedLongLong((uint32_t)(object->serial));
89 0 : return py_serial;
90 : }
91 :
92 255 : static int py_dnsp_soa_set_serial(PyObject *py_obj, PyObject *value, void *closure)
93 : {
94 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
95 255 : if (value == NULL) {
96 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->serial");
97 0 : return -1;
98 : }
99 : {
100 255 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial));
101 255 : if (PyLong_Check(value)) {
102 42 : unsigned long long test_var;
103 255 : test_var = PyLong_AsUnsignedLongLong(value);
104 255 : if (PyErr_Occurred() != NULL) {
105 0 : return -1;
106 : }
107 255 : if (test_var > uint_max) {
108 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
109 : PyLong_Type.tp_name, uint_max, test_var);
110 0 : return -1;
111 : }
112 255 : object->serial = test_var;
113 : } else {
114 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
115 : PyLong_Type.tp_name);
116 0 : return -1;
117 : }
118 : }
119 255 : return 0;
120 : }
121 :
122 0 : static PyObject *py_dnsp_soa_get_refresh(PyObject *obj, void *closure)
123 : {
124 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
125 0 : PyObject *py_refresh;
126 0 : py_refresh = PyLong_FromUnsignedLongLong((uint32_t)(object->refresh));
127 0 : return py_refresh;
128 : }
129 :
130 255 : static int py_dnsp_soa_set_refresh(PyObject *py_obj, PyObject *value, void *closure)
131 : {
132 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
133 255 : if (value == NULL) {
134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->refresh");
135 0 : return -1;
136 : }
137 : {
138 255 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->refresh));
139 255 : if (PyLong_Check(value)) {
140 42 : unsigned long long test_var;
141 255 : test_var = PyLong_AsUnsignedLongLong(value);
142 255 : if (PyErr_Occurred() != NULL) {
143 0 : return -1;
144 : }
145 255 : if (test_var > uint_max) {
146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
147 : PyLong_Type.tp_name, uint_max, test_var);
148 0 : return -1;
149 : }
150 255 : object->refresh = test_var;
151 : } else {
152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
153 : PyLong_Type.tp_name);
154 0 : return -1;
155 : }
156 : }
157 255 : return 0;
158 : }
159 :
160 0 : static PyObject *py_dnsp_soa_get_retry(PyObject *obj, void *closure)
161 : {
162 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
163 0 : PyObject *py_retry;
164 0 : py_retry = PyLong_FromUnsignedLongLong((uint32_t)(object->retry));
165 0 : return py_retry;
166 : }
167 :
168 255 : static int py_dnsp_soa_set_retry(PyObject *py_obj, PyObject *value, void *closure)
169 : {
170 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
171 255 : if (value == NULL) {
172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->retry");
173 0 : return -1;
174 : }
175 : {
176 255 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->retry));
177 255 : if (PyLong_Check(value)) {
178 42 : unsigned long long test_var;
179 255 : test_var = PyLong_AsUnsignedLongLong(value);
180 255 : if (PyErr_Occurred() != NULL) {
181 0 : return -1;
182 : }
183 255 : if (test_var > uint_max) {
184 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
185 : PyLong_Type.tp_name, uint_max, test_var);
186 0 : return -1;
187 : }
188 255 : object->retry = test_var;
189 : } else {
190 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
191 : PyLong_Type.tp_name);
192 0 : return -1;
193 : }
194 : }
195 255 : return 0;
196 : }
197 :
198 0 : static PyObject *py_dnsp_soa_get_expire(PyObject *obj, void *closure)
199 : {
200 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
201 0 : PyObject *py_expire;
202 0 : py_expire = PyLong_FromUnsignedLongLong((uint32_t)(object->expire));
203 0 : return py_expire;
204 : }
205 :
206 255 : static int py_dnsp_soa_set_expire(PyObject *py_obj, PyObject *value, void *closure)
207 : {
208 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
209 255 : if (value == NULL) {
210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->expire");
211 0 : return -1;
212 : }
213 : {
214 255 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->expire));
215 255 : if (PyLong_Check(value)) {
216 42 : unsigned long long test_var;
217 255 : test_var = PyLong_AsUnsignedLongLong(value);
218 255 : if (PyErr_Occurred() != NULL) {
219 0 : return -1;
220 : }
221 255 : if (test_var > uint_max) {
222 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
223 : PyLong_Type.tp_name, uint_max, test_var);
224 0 : return -1;
225 : }
226 255 : object->expire = test_var;
227 : } else {
228 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
229 : PyLong_Type.tp_name);
230 0 : return -1;
231 : }
232 : }
233 255 : return 0;
234 : }
235 :
236 0 : static PyObject *py_dnsp_soa_get_minimum(PyObject *obj, void *closure)
237 : {
238 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
239 0 : PyObject *py_minimum;
240 0 : py_minimum = PyLong_FromUnsignedLongLong((uint32_t)(object->minimum));
241 0 : return py_minimum;
242 : }
243 :
244 255 : static int py_dnsp_soa_set_minimum(PyObject *py_obj, PyObject *value, void *closure)
245 : {
246 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
247 255 : if (value == NULL) {
248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minimum");
249 0 : return -1;
250 : }
251 : {
252 255 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minimum));
253 255 : if (PyLong_Check(value)) {
254 42 : unsigned long long test_var;
255 255 : test_var = PyLong_AsUnsignedLongLong(value);
256 255 : if (PyErr_Occurred() != NULL) {
257 0 : return -1;
258 : }
259 255 : if (test_var > uint_max) {
260 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
261 : PyLong_Type.tp_name, uint_max, test_var);
262 0 : return -1;
263 : }
264 255 : object->minimum = test_var;
265 : } else {
266 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
267 : PyLong_Type.tp_name);
268 0 : return -1;
269 : }
270 : }
271 255 : return 0;
272 : }
273 :
274 0 : static PyObject *py_dnsp_soa_get_mname(PyObject *obj, void *closure)
275 : {
276 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
277 0 : PyObject *py_mname;
278 0 : py_mname = PyString_FromStringOrNULL(object->mname);
279 0 : return py_mname;
280 : }
281 :
282 255 : static int py_dnsp_soa_set_mname(PyObject *py_obj, PyObject *value, void *closure)
283 : {
284 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
285 255 : if (value == NULL) {
286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mname");
287 0 : return -1;
288 : }
289 : {
290 42 : const char *test_str;
291 42 : const char *talloc_str;
292 255 : PyObject *unicode = NULL;
293 255 : if (PyUnicode_Check(value)) {
294 255 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
295 255 : if (unicode == NULL) {
296 0 : return -1;
297 : }
298 255 : test_str = PyBytes_AS_STRING(unicode);
299 0 : } else if (PyBytes_Check(value)) {
300 0 : test_str = PyBytes_AS_STRING(value);
301 : } else {
302 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
303 0 : return -1;
304 : }
305 255 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
306 255 : if (unicode != NULL) {
307 208 : Py_DECREF(unicode);
308 : }
309 255 : if (talloc_str == NULL) {
310 0 : PyErr_NoMemory();
311 0 : return -1;
312 : }
313 255 : object->mname = talloc_str;
314 : }
315 255 : return 0;
316 : }
317 :
318 0 : static PyObject *py_dnsp_soa_get_rname(PyObject *obj, void *closure)
319 : {
320 0 : struct dnsp_soa *object = pytalloc_get_ptr(obj);
321 0 : PyObject *py_rname;
322 0 : py_rname = PyString_FromStringOrNULL(object->rname);
323 0 : return py_rname;
324 : }
325 :
326 255 : static int py_dnsp_soa_set_rname(PyObject *py_obj, PyObject *value, void *closure)
327 : {
328 255 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
329 255 : if (value == NULL) {
330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rname");
331 0 : return -1;
332 : }
333 : {
334 42 : const char *test_str;
335 42 : const char *talloc_str;
336 255 : PyObject *unicode = NULL;
337 255 : if (PyUnicode_Check(value)) {
338 255 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
339 255 : if (unicode == NULL) {
340 0 : return -1;
341 : }
342 255 : test_str = PyBytes_AS_STRING(unicode);
343 0 : } else if (PyBytes_Check(value)) {
344 0 : test_str = PyBytes_AS_STRING(value);
345 : } else {
346 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
347 0 : return -1;
348 : }
349 255 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
350 255 : if (unicode != NULL) {
351 208 : Py_DECREF(unicode);
352 : }
353 255 : if (talloc_str == NULL) {
354 0 : PyErr_NoMemory();
355 0 : return -1;
356 : }
357 255 : object->rname = talloc_str;
358 : }
359 255 : return 0;
360 : }
361 :
362 : static PyGetSetDef py_dnsp_soa_getsetters[] = {
363 : {
364 : .name = discard_const_p(char, "serial"),
365 : .get = py_dnsp_soa_get_serial,
366 : .set = py_dnsp_soa_set_serial,
367 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
368 : },
369 : {
370 : .name = discard_const_p(char, "refresh"),
371 : .get = py_dnsp_soa_get_refresh,
372 : .set = py_dnsp_soa_set_refresh,
373 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
374 : },
375 : {
376 : .name = discard_const_p(char, "retry"),
377 : .get = py_dnsp_soa_get_retry,
378 : .set = py_dnsp_soa_set_retry,
379 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
380 : },
381 : {
382 : .name = discard_const_p(char, "expire"),
383 : .get = py_dnsp_soa_get_expire,
384 : .set = py_dnsp_soa_set_expire,
385 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
386 : },
387 : {
388 : .name = discard_const_p(char, "minimum"),
389 : .get = py_dnsp_soa_get_minimum,
390 : .set = py_dnsp_soa_set_minimum,
391 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
392 : },
393 : {
394 : .name = discard_const_p(char, "mname"),
395 : .get = py_dnsp_soa_get_mname,
396 : .set = py_dnsp_soa_set_mname,
397 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_name")
398 : },
399 : {
400 : .name = discard_const_p(char, "rname"),
401 : .get = py_dnsp_soa_get_rname,
402 : .set = py_dnsp_soa_set_rname,
403 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_name")
404 : },
405 : { .name = NULL }
406 : };
407 :
408 255 : static PyObject *py_dnsp_soa_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
409 : {
410 255 : return pytalloc_new(struct dnsp_soa, type);
411 : }
412 :
413 0 : static PyObject *py_dnsp_soa_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
414 : {
415 0 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
416 0 : PyObject *ret = NULL;
417 0 : DATA_BLOB blob;
418 0 : enum ndr_err_code err;
419 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
420 0 : if (tmp_ctx == NULL) {
421 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
422 0 : return NULL;
423 : }
424 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_soa);
425 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
426 0 : TALLOC_FREE(tmp_ctx);
427 0 : PyErr_SetNdrError(err);
428 0 : return NULL;
429 : }
430 :
431 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
432 0 : TALLOC_FREE(tmp_ctx);
433 0 : return ret;
434 : }
435 :
436 0 : static PyObject *py_dnsp_soa_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
437 : {
438 0 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
439 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
440 0 : Py_ssize_t blob_length = 0;
441 0 : enum ndr_err_code err;
442 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
443 0 : PyObject *allow_remaining_obj = NULL;
444 0 : bool allow_remaining = false;
445 :
446 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
447 : discard_const_p(char *, kwnames),
448 : &blob.data, &blob_length,
449 : &allow_remaining_obj)) {
450 0 : return NULL;
451 : }
452 0 : blob.length = blob_length;
453 :
454 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
455 0 : allow_remaining = true;
456 : }
457 :
458 0 : if (allow_remaining) {
459 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_soa);
460 : } else {
461 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_soa);
462 : }
463 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
464 0 : PyErr_SetNdrError(err);
465 0 : return NULL;
466 : }
467 :
468 0 : Py_RETURN_NONE;
469 : }
470 :
471 0 : static PyObject *py_dnsp_soa_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
472 : {
473 0 : struct dnsp_soa *object = pytalloc_get_ptr(py_obj);
474 0 : PyObject *ret;
475 0 : char *retstr;
476 :
477 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_soa, "dnsp_soa", object);
478 0 : ret = PyUnicode_FromString(retstr);
479 0 : talloc_free(retstr);
480 :
481 0 : return ret;
482 : }
483 :
484 : static PyMethodDef py_dnsp_soa_methods[] = {
485 : { "__ndr_pack__", (PyCFunction)py_dnsp_soa_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
486 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_soa_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
487 : { "__ndr_print__", (PyCFunction)py_dnsp_soa_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
488 : { NULL, NULL, 0, NULL }
489 : };
490 :
491 :
492 : static PyTypeObject dnsp_soa_Type = {
493 : PyVarObject_HEAD_INIT(NULL, 0)
494 : .tp_name = "dnsp.soa",
495 : .tp_getset = py_dnsp_soa_getsetters,
496 : .tp_methods = py_dnsp_soa_methods,
497 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
498 : .tp_new = py_dnsp_soa_new,
499 : };
500 :
501 :
502 0 : static PyObject *py_dnsp_mx_get_wPriority(PyObject *obj, void *closure)
503 : {
504 0 : struct dnsp_mx *object = pytalloc_get_ptr(obj);
505 0 : PyObject *py_wPriority;
506 0 : py_wPriority = PyLong_FromLong((uint16_t)(object->wPriority));
507 0 : return py_wPriority;
508 : }
509 :
510 0 : static int py_dnsp_mx_set_wPriority(PyObject *py_obj, PyObject *value, void *closure)
511 : {
512 0 : struct dnsp_mx *object = pytalloc_get_ptr(py_obj);
513 0 : if (value == NULL) {
514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wPriority");
515 0 : return -1;
516 : }
517 : {
518 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wPriority));
519 0 : if (PyLong_Check(value)) {
520 0 : unsigned long long test_var;
521 0 : test_var = PyLong_AsUnsignedLongLong(value);
522 0 : if (PyErr_Occurred() != NULL) {
523 0 : return -1;
524 : }
525 0 : if (test_var > uint_max) {
526 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
527 : PyLong_Type.tp_name, uint_max, test_var);
528 0 : return -1;
529 : }
530 0 : object->wPriority = test_var;
531 : } else {
532 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
533 : PyLong_Type.tp_name);
534 0 : return -1;
535 : }
536 : }
537 0 : return 0;
538 : }
539 :
540 0 : static PyObject *py_dnsp_mx_get_nameTarget(PyObject *obj, void *closure)
541 : {
542 0 : struct dnsp_mx *object = pytalloc_get_ptr(obj);
543 0 : PyObject *py_nameTarget;
544 0 : py_nameTarget = PyString_FromStringOrNULL(object->nameTarget);
545 0 : return py_nameTarget;
546 : }
547 :
548 0 : static int py_dnsp_mx_set_nameTarget(PyObject *py_obj, PyObject *value, void *closure)
549 : {
550 0 : struct dnsp_mx *object = pytalloc_get_ptr(py_obj);
551 0 : if (value == NULL) {
552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nameTarget");
553 0 : return -1;
554 : }
555 : {
556 0 : const char *test_str;
557 0 : const char *talloc_str;
558 0 : PyObject *unicode = NULL;
559 0 : if (PyUnicode_Check(value)) {
560 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
561 0 : if (unicode == NULL) {
562 0 : return -1;
563 : }
564 0 : test_str = PyBytes_AS_STRING(unicode);
565 0 : } else if (PyBytes_Check(value)) {
566 0 : test_str = PyBytes_AS_STRING(value);
567 : } else {
568 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
569 0 : return -1;
570 : }
571 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
572 0 : if (unicode != NULL) {
573 0 : Py_DECREF(unicode);
574 : }
575 0 : if (talloc_str == NULL) {
576 0 : PyErr_NoMemory();
577 0 : return -1;
578 : }
579 0 : object->nameTarget = talloc_str;
580 : }
581 0 : return 0;
582 : }
583 :
584 : static PyGetSetDef py_dnsp_mx_getsetters[] = {
585 : {
586 : .name = discard_const_p(char, "wPriority"),
587 : .get = py_dnsp_mx_get_wPriority,
588 : .set = py_dnsp_mx_set_wPriority,
589 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
590 : },
591 : {
592 : .name = discard_const_p(char, "nameTarget"),
593 : .get = py_dnsp_mx_get_nameTarget,
594 : .set = py_dnsp_mx_set_nameTarget,
595 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_name")
596 : },
597 : { .name = NULL }
598 : };
599 :
600 0 : static PyObject *py_dnsp_mx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
601 : {
602 0 : return pytalloc_new(struct dnsp_mx, type);
603 : }
604 :
605 0 : static PyObject *py_dnsp_mx_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
606 : {
607 0 : struct dnsp_mx *object = pytalloc_get_ptr(py_obj);
608 0 : PyObject *ret = NULL;
609 0 : DATA_BLOB blob;
610 0 : enum ndr_err_code err;
611 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
612 0 : if (tmp_ctx == NULL) {
613 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
614 0 : return NULL;
615 : }
616 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_mx);
617 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
618 0 : TALLOC_FREE(tmp_ctx);
619 0 : PyErr_SetNdrError(err);
620 0 : return NULL;
621 : }
622 :
623 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
624 0 : TALLOC_FREE(tmp_ctx);
625 0 : return ret;
626 : }
627 :
628 0 : static PyObject *py_dnsp_mx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
629 : {
630 0 : struct dnsp_mx *object = pytalloc_get_ptr(py_obj);
631 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
632 0 : Py_ssize_t blob_length = 0;
633 0 : enum ndr_err_code err;
634 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
635 0 : PyObject *allow_remaining_obj = NULL;
636 0 : bool allow_remaining = false;
637 :
638 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
639 : discard_const_p(char *, kwnames),
640 : &blob.data, &blob_length,
641 : &allow_remaining_obj)) {
642 0 : return NULL;
643 : }
644 0 : blob.length = blob_length;
645 :
646 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
647 0 : allow_remaining = true;
648 : }
649 :
650 0 : if (allow_remaining) {
651 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_mx);
652 : } else {
653 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_mx);
654 : }
655 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
656 0 : PyErr_SetNdrError(err);
657 0 : return NULL;
658 : }
659 :
660 0 : Py_RETURN_NONE;
661 : }
662 :
663 0 : static PyObject *py_dnsp_mx_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
664 : {
665 0 : struct dnsp_mx *object = pytalloc_get_ptr(py_obj);
666 0 : PyObject *ret;
667 0 : char *retstr;
668 :
669 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_mx, "dnsp_mx", object);
670 0 : ret = PyUnicode_FromString(retstr);
671 0 : talloc_free(retstr);
672 :
673 0 : return ret;
674 : }
675 :
676 : static PyMethodDef py_dnsp_mx_methods[] = {
677 : { "__ndr_pack__", (PyCFunction)py_dnsp_mx_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
678 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_mx_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
679 : { "__ndr_print__", (PyCFunction)py_dnsp_mx_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
680 : { NULL, NULL, 0, NULL }
681 : };
682 :
683 :
684 : static PyTypeObject dnsp_mx_Type = {
685 : PyVarObject_HEAD_INIT(NULL, 0)
686 : .tp_name = "dnsp.mx",
687 : .tp_getset = py_dnsp_mx_getsetters,
688 : .tp_methods = py_dnsp_mx_methods,
689 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
690 : .tp_new = py_dnsp_mx_new,
691 : };
692 :
693 :
694 0 : static PyObject *py_dnsp_hinfo_get_cpu(PyObject *obj, void *closure)
695 : {
696 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(obj);
697 0 : PyObject *py_cpu;
698 0 : py_cpu = PyString_FromStringOrNULL(object->cpu);
699 0 : return py_cpu;
700 : }
701 :
702 0 : static int py_dnsp_hinfo_set_cpu(PyObject *py_obj, PyObject *value, void *closure)
703 : {
704 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(py_obj);
705 0 : if (value == NULL) {
706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cpu");
707 0 : return -1;
708 : }
709 : {
710 0 : const char *test_str;
711 0 : const char *talloc_str;
712 0 : PyObject *unicode = NULL;
713 0 : if (PyUnicode_Check(value)) {
714 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
715 0 : if (unicode == NULL) {
716 0 : return -1;
717 : }
718 0 : test_str = PyBytes_AS_STRING(unicode);
719 0 : } else if (PyBytes_Check(value)) {
720 0 : test_str = PyBytes_AS_STRING(value);
721 : } else {
722 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
723 0 : return -1;
724 : }
725 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
726 0 : if (unicode != NULL) {
727 0 : Py_DECREF(unicode);
728 : }
729 0 : if (talloc_str == NULL) {
730 0 : PyErr_NoMemory();
731 0 : return -1;
732 : }
733 0 : object->cpu = talloc_str;
734 : }
735 0 : return 0;
736 : }
737 :
738 0 : static PyObject *py_dnsp_hinfo_get_os(PyObject *obj, void *closure)
739 : {
740 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(obj);
741 0 : PyObject *py_os;
742 0 : py_os = PyString_FromStringOrNULL(object->os);
743 0 : return py_os;
744 : }
745 :
746 0 : static int py_dnsp_hinfo_set_os(PyObject *py_obj, PyObject *value, void *closure)
747 : {
748 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(py_obj);
749 0 : if (value == NULL) {
750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->os");
751 0 : return -1;
752 : }
753 : {
754 0 : const char *test_str;
755 0 : const char *talloc_str;
756 0 : PyObject *unicode = NULL;
757 0 : if (PyUnicode_Check(value)) {
758 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
759 0 : if (unicode == NULL) {
760 0 : return -1;
761 : }
762 0 : test_str = PyBytes_AS_STRING(unicode);
763 0 : } else if (PyBytes_Check(value)) {
764 0 : test_str = PyBytes_AS_STRING(value);
765 : } else {
766 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
767 0 : return -1;
768 : }
769 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
770 0 : if (unicode != NULL) {
771 0 : Py_DECREF(unicode);
772 : }
773 0 : if (talloc_str == NULL) {
774 0 : PyErr_NoMemory();
775 0 : return -1;
776 : }
777 0 : object->os = talloc_str;
778 : }
779 0 : return 0;
780 : }
781 :
782 : static PyGetSetDef py_dnsp_hinfo_getsetters[] = {
783 : {
784 : .name = discard_const_p(char, "cpu"),
785 : .get = py_dnsp_hinfo_get_cpu,
786 : .set = py_dnsp_hinfo_set_cpu,
787 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_string")
788 : },
789 : {
790 : .name = discard_const_p(char, "os"),
791 : .get = py_dnsp_hinfo_get_os,
792 : .set = py_dnsp_hinfo_set_os,
793 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_string")
794 : },
795 : { .name = NULL }
796 : };
797 :
798 0 : static PyObject *py_dnsp_hinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
799 : {
800 0 : return pytalloc_new(struct dnsp_hinfo, type);
801 : }
802 :
803 0 : static PyObject *py_dnsp_hinfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
804 : {
805 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(py_obj);
806 0 : PyObject *ret = NULL;
807 0 : DATA_BLOB blob;
808 0 : enum ndr_err_code err;
809 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
810 0 : if (tmp_ctx == NULL) {
811 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
812 0 : return NULL;
813 : }
814 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_hinfo);
815 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
816 0 : TALLOC_FREE(tmp_ctx);
817 0 : PyErr_SetNdrError(err);
818 0 : return NULL;
819 : }
820 :
821 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
822 0 : TALLOC_FREE(tmp_ctx);
823 0 : return ret;
824 : }
825 :
826 0 : static PyObject *py_dnsp_hinfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
827 : {
828 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(py_obj);
829 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
830 0 : Py_ssize_t blob_length = 0;
831 0 : enum ndr_err_code err;
832 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
833 0 : PyObject *allow_remaining_obj = NULL;
834 0 : bool allow_remaining = false;
835 :
836 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
837 : discard_const_p(char *, kwnames),
838 : &blob.data, &blob_length,
839 : &allow_remaining_obj)) {
840 0 : return NULL;
841 : }
842 0 : blob.length = blob_length;
843 :
844 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
845 0 : allow_remaining = true;
846 : }
847 :
848 0 : if (allow_remaining) {
849 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_hinfo);
850 : } else {
851 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_hinfo);
852 : }
853 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
854 0 : PyErr_SetNdrError(err);
855 0 : return NULL;
856 : }
857 :
858 0 : Py_RETURN_NONE;
859 : }
860 :
861 0 : static PyObject *py_dnsp_hinfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
862 : {
863 0 : struct dnsp_hinfo *object = pytalloc_get_ptr(py_obj);
864 0 : PyObject *ret;
865 0 : char *retstr;
866 :
867 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_hinfo, "dnsp_hinfo", object);
868 0 : ret = PyUnicode_FromString(retstr);
869 0 : talloc_free(retstr);
870 :
871 0 : return ret;
872 : }
873 :
874 : static PyMethodDef py_dnsp_hinfo_methods[] = {
875 : { "__ndr_pack__", (PyCFunction)py_dnsp_hinfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
876 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_hinfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
877 : { "__ndr_print__", (PyCFunction)py_dnsp_hinfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
878 : { NULL, NULL, 0, NULL }
879 : };
880 :
881 :
882 : static PyTypeObject dnsp_hinfo_Type = {
883 : PyVarObject_HEAD_INIT(NULL, 0)
884 : .tp_name = "dnsp.hinfo",
885 : .tp_getset = py_dnsp_hinfo_getsetters,
886 : .tp_methods = py_dnsp_hinfo_methods,
887 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
888 : .tp_new = py_dnsp_hinfo_new,
889 : };
890 :
891 :
892 0 : static PyObject *py_dnsp_srv_get_wPriority(PyObject *obj, void *closure)
893 : {
894 0 : struct dnsp_srv *object = pytalloc_get_ptr(obj);
895 0 : PyObject *py_wPriority;
896 0 : py_wPriority = PyLong_FromLong((uint16_t)(object->wPriority));
897 0 : return py_wPriority;
898 : }
899 :
900 2685 : static int py_dnsp_srv_set_wPriority(PyObject *py_obj, PyObject *value, void *closure)
901 : {
902 2685 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
903 2685 : if (value == NULL) {
904 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wPriority");
905 0 : return -1;
906 : }
907 : {
908 2685 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wPriority));
909 2685 : if (PyLong_Check(value)) {
910 441 : unsigned long long test_var;
911 2685 : test_var = PyLong_AsUnsignedLongLong(value);
912 2685 : if (PyErr_Occurred() != NULL) {
913 0 : return -1;
914 : }
915 2685 : if (test_var > uint_max) {
916 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
917 : PyLong_Type.tp_name, uint_max, test_var);
918 0 : return -1;
919 : }
920 2685 : object->wPriority = test_var;
921 : } else {
922 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
923 : PyLong_Type.tp_name);
924 0 : return -1;
925 : }
926 : }
927 2685 : return 0;
928 : }
929 :
930 0 : static PyObject *py_dnsp_srv_get_wWeight(PyObject *obj, void *closure)
931 : {
932 0 : struct dnsp_srv *object = pytalloc_get_ptr(obj);
933 0 : PyObject *py_wWeight;
934 0 : py_wWeight = PyLong_FromLong((uint16_t)(object->wWeight));
935 0 : return py_wWeight;
936 : }
937 :
938 2685 : static int py_dnsp_srv_set_wWeight(PyObject *py_obj, PyObject *value, void *closure)
939 : {
940 2685 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
941 2685 : if (value == NULL) {
942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wWeight");
943 0 : return -1;
944 : }
945 : {
946 2685 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wWeight));
947 2685 : if (PyLong_Check(value)) {
948 441 : unsigned long long test_var;
949 2685 : test_var = PyLong_AsUnsignedLongLong(value);
950 2685 : if (PyErr_Occurred() != NULL) {
951 0 : return -1;
952 : }
953 2685 : if (test_var > uint_max) {
954 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
955 : PyLong_Type.tp_name, uint_max, test_var);
956 0 : return -1;
957 : }
958 2685 : object->wWeight = test_var;
959 : } else {
960 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
961 : PyLong_Type.tp_name);
962 0 : return -1;
963 : }
964 : }
965 2685 : return 0;
966 : }
967 :
968 0 : static PyObject *py_dnsp_srv_get_wPort(PyObject *obj, void *closure)
969 : {
970 0 : struct dnsp_srv *object = pytalloc_get_ptr(obj);
971 0 : PyObject *py_wPort;
972 0 : py_wPort = PyLong_FromLong((uint16_t)(object->wPort));
973 0 : return py_wPort;
974 : }
975 :
976 2685 : static int py_dnsp_srv_set_wPort(PyObject *py_obj, PyObject *value, void *closure)
977 : {
978 2685 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
979 2685 : if (value == NULL) {
980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wPort");
981 0 : return -1;
982 : }
983 : {
984 2685 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wPort));
985 2685 : if (PyLong_Check(value)) {
986 441 : unsigned long long test_var;
987 2685 : test_var = PyLong_AsUnsignedLongLong(value);
988 2685 : if (PyErr_Occurred() != NULL) {
989 0 : return -1;
990 : }
991 2685 : if (test_var > uint_max) {
992 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
993 : PyLong_Type.tp_name, uint_max, test_var);
994 0 : return -1;
995 : }
996 2685 : object->wPort = test_var;
997 : } else {
998 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
999 : PyLong_Type.tp_name);
1000 0 : return -1;
1001 : }
1002 : }
1003 2685 : return 0;
1004 : }
1005 :
1006 1793 : static PyObject *py_dnsp_srv_get_nameTarget(PyObject *obj, void *closure)
1007 : {
1008 1793 : struct dnsp_srv *object = pytalloc_get_ptr(obj);
1009 21 : PyObject *py_nameTarget;
1010 1793 : py_nameTarget = PyString_FromStringOrNULL(object->nameTarget);
1011 1793 : return py_nameTarget;
1012 : }
1013 :
1014 2685 : static int py_dnsp_srv_set_nameTarget(PyObject *py_obj, PyObject *value, void *closure)
1015 : {
1016 2685 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
1017 2685 : if (value == NULL) {
1018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nameTarget");
1019 0 : return -1;
1020 : }
1021 : {
1022 441 : const char *test_str;
1023 441 : const char *talloc_str;
1024 2685 : PyObject *unicode = NULL;
1025 2685 : if (PyUnicode_Check(value)) {
1026 2685 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1027 2685 : if (unicode == NULL) {
1028 0 : return -1;
1029 : }
1030 2685 : test_str = PyBytes_AS_STRING(unicode);
1031 0 : } else if (PyBytes_Check(value)) {
1032 0 : test_str = PyBytes_AS_STRING(value);
1033 : } else {
1034 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1035 0 : return -1;
1036 : }
1037 2685 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1038 2685 : if (unicode != NULL) {
1039 2189 : Py_DECREF(unicode);
1040 : }
1041 2685 : if (talloc_str == NULL) {
1042 0 : PyErr_NoMemory();
1043 0 : return -1;
1044 : }
1045 2685 : object->nameTarget = talloc_str;
1046 : }
1047 2685 : return 0;
1048 : }
1049 :
1050 : static PyGetSetDef py_dnsp_srv_getsetters[] = {
1051 : {
1052 : .name = discard_const_p(char, "wPriority"),
1053 : .get = py_dnsp_srv_get_wPriority,
1054 : .set = py_dnsp_srv_set_wPriority,
1055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1056 : },
1057 : {
1058 : .name = discard_const_p(char, "wWeight"),
1059 : .get = py_dnsp_srv_get_wWeight,
1060 : .set = py_dnsp_srv_set_wWeight,
1061 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1062 : },
1063 : {
1064 : .name = discard_const_p(char, "wPort"),
1065 : .get = py_dnsp_srv_get_wPort,
1066 : .set = py_dnsp_srv_set_wPort,
1067 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1068 : },
1069 : {
1070 : .name = discard_const_p(char, "nameTarget"),
1071 : .get = py_dnsp_srv_get_nameTarget,
1072 : .set = py_dnsp_srv_set_nameTarget,
1073 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_name")
1074 : },
1075 : { .name = NULL }
1076 : };
1077 :
1078 2685 : static PyObject *py_dnsp_srv_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1079 : {
1080 2685 : return pytalloc_new(struct dnsp_srv, type);
1081 : }
1082 :
1083 0 : static PyObject *py_dnsp_srv_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1084 : {
1085 0 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
1086 0 : PyObject *ret = NULL;
1087 0 : DATA_BLOB blob;
1088 0 : enum ndr_err_code err;
1089 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1090 0 : if (tmp_ctx == NULL) {
1091 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1092 0 : return NULL;
1093 : }
1094 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_srv);
1095 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1096 0 : TALLOC_FREE(tmp_ctx);
1097 0 : PyErr_SetNdrError(err);
1098 0 : return NULL;
1099 : }
1100 :
1101 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1102 0 : TALLOC_FREE(tmp_ctx);
1103 0 : return ret;
1104 : }
1105 :
1106 0 : static PyObject *py_dnsp_srv_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1107 : {
1108 0 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
1109 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1110 0 : Py_ssize_t blob_length = 0;
1111 0 : enum ndr_err_code err;
1112 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1113 0 : PyObject *allow_remaining_obj = NULL;
1114 0 : bool allow_remaining = false;
1115 :
1116 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1117 : discard_const_p(char *, kwnames),
1118 : &blob.data, &blob_length,
1119 : &allow_remaining_obj)) {
1120 0 : return NULL;
1121 : }
1122 0 : blob.length = blob_length;
1123 :
1124 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1125 0 : allow_remaining = true;
1126 : }
1127 :
1128 0 : if (allow_remaining) {
1129 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_srv);
1130 : } else {
1131 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_srv);
1132 : }
1133 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1134 0 : PyErr_SetNdrError(err);
1135 0 : return NULL;
1136 : }
1137 :
1138 0 : Py_RETURN_NONE;
1139 : }
1140 :
1141 0 : static PyObject *py_dnsp_srv_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1142 : {
1143 0 : struct dnsp_srv *object = pytalloc_get_ptr(py_obj);
1144 0 : PyObject *ret;
1145 0 : char *retstr;
1146 :
1147 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_srv, "dnsp_srv", object);
1148 0 : ret = PyUnicode_FromString(retstr);
1149 0 : talloc_free(retstr);
1150 :
1151 0 : return ret;
1152 : }
1153 :
1154 : static PyMethodDef py_dnsp_srv_methods[] = {
1155 : { "__ndr_pack__", (PyCFunction)py_dnsp_srv_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1156 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_srv_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1157 : { "__ndr_print__", (PyCFunction)py_dnsp_srv_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1158 : { NULL, NULL, 0, NULL }
1159 : };
1160 :
1161 :
1162 : static PyTypeObject dnsp_srv_Type = {
1163 : PyVarObject_HEAD_INIT(NULL, 0)
1164 : .tp_name = "dnsp.srv",
1165 : .tp_getset = py_dnsp_srv_getsetters,
1166 : .tp_methods = py_dnsp_srv_methods,
1167 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1168 : .tp_new = py_dnsp_srv_new,
1169 : };
1170 :
1171 :
1172 0 : static PyObject *py_dnsp_ip4_array_get_addrCount(PyObject *obj, void *closure)
1173 : {
1174 0 : struct dnsp_ip4_array *object = pytalloc_get_ptr(obj);
1175 0 : PyObject *py_addrCount;
1176 0 : py_addrCount = PyLong_FromUnsignedLongLong((uint32_t)(object->addrCount));
1177 0 : return py_addrCount;
1178 : }
1179 :
1180 0 : static int py_dnsp_ip4_array_set_addrCount(PyObject *py_obj, PyObject *value, void *closure)
1181 : {
1182 0 : struct dnsp_ip4_array *object = pytalloc_get_ptr(py_obj);
1183 0 : if (value == NULL) {
1184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->addrCount");
1185 0 : return -1;
1186 : }
1187 : {
1188 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addrCount));
1189 0 : if (PyLong_Check(value)) {
1190 0 : unsigned long long test_var;
1191 0 : test_var = PyLong_AsUnsignedLongLong(value);
1192 0 : if (PyErr_Occurred() != NULL) {
1193 0 : return -1;
1194 : }
1195 0 : if (test_var > uint_max) {
1196 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1197 : PyLong_Type.tp_name, uint_max, test_var);
1198 0 : return -1;
1199 : }
1200 0 : object->addrCount = test_var;
1201 : } else {
1202 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1203 : PyLong_Type.tp_name);
1204 0 : return -1;
1205 : }
1206 : }
1207 0 : return 0;
1208 : }
1209 :
1210 0 : static PyObject *py_dnsp_ip4_array_get_addrArray(PyObject *obj, void *closure)
1211 : {
1212 0 : struct dnsp_ip4_array *object = pytalloc_get_ptr(obj);
1213 0 : PyObject *py_addrArray;
1214 0 : py_addrArray = PyList_New(object->addrCount);
1215 0 : if (py_addrArray == NULL) {
1216 0 : return NULL;
1217 : }
1218 : {
1219 : int addrArray_cntr_0;
1220 0 : for (addrArray_cntr_0 = 0; addrArray_cntr_0 < (object->addrCount); addrArray_cntr_0++) {
1221 0 : PyObject *py_addrArray_0;
1222 0 : py_addrArray_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->addrArray)[addrArray_cntr_0]));
1223 0 : PyList_SetItem(py_addrArray, addrArray_cntr_0, py_addrArray_0);
1224 : }
1225 : }
1226 0 : return py_addrArray;
1227 : }
1228 :
1229 0 : static int py_dnsp_ip4_array_set_addrArray(PyObject *py_obj, PyObject *value, void *closure)
1230 : {
1231 0 : struct dnsp_ip4_array *object = pytalloc_get_ptr(py_obj);
1232 0 : if (value == NULL) {
1233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->addrArray");
1234 0 : return -1;
1235 : }
1236 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1237 : {
1238 0 : int addrArray_cntr_0;
1239 0 : object->addrArray = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addrArray, PyList_GET_SIZE(value));
1240 0 : if (!object->addrArray) { return -1; }
1241 0 : talloc_set_name_const(object->addrArray, "ARRAY: object->addrArray");
1242 0 : for (addrArray_cntr_0 = 0; addrArray_cntr_0 < PyList_GET_SIZE(value); addrArray_cntr_0++) {
1243 0 : if (PyList_GET_ITEM(value, addrArray_cntr_0) == NULL) {
1244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->addrArray)[addrArray_cntr_0]");
1245 0 : return -1;
1246 : }
1247 : {
1248 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->addrArray)[addrArray_cntr_0]));
1249 0 : if (PyLong_Check(PyList_GET_ITEM(value, addrArray_cntr_0))) {
1250 0 : unsigned long long test_var;
1251 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, addrArray_cntr_0));
1252 0 : if (PyErr_Occurred() != NULL) {
1253 0 : return -1;
1254 : }
1255 0 : if (test_var > uint_max) {
1256 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1257 : PyLong_Type.tp_name, uint_max, test_var);
1258 0 : return -1;
1259 : }
1260 0 : (object->addrArray)[addrArray_cntr_0] = test_var;
1261 : } else {
1262 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1263 : PyLong_Type.tp_name);
1264 0 : return -1;
1265 : }
1266 : }
1267 : }
1268 : }
1269 0 : return 0;
1270 : }
1271 :
1272 : static PyGetSetDef py_dnsp_ip4_array_getsetters[] = {
1273 : {
1274 : .name = discard_const_p(char, "addrCount"),
1275 : .get = py_dnsp_ip4_array_get_addrCount,
1276 : .set = py_dnsp_ip4_array_set_addrCount,
1277 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1278 : },
1279 : {
1280 : .name = discard_const_p(char, "addrArray"),
1281 : .get = py_dnsp_ip4_array_get_addrArray,
1282 : .set = py_dnsp_ip4_array_set_addrArray,
1283 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1284 : },
1285 : { .name = NULL }
1286 : };
1287 :
1288 0 : static PyObject *py_dnsp_ip4_array_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1289 : {
1290 0 : return pytalloc_new(struct dnsp_ip4_array, type);
1291 : }
1292 :
1293 :
1294 : static PyTypeObject dnsp_ip4_array_Type = {
1295 : PyVarObject_HEAD_INIT(NULL, 0)
1296 : .tp_name = "dnsp.ip4_array",
1297 : .tp_getset = py_dnsp_ip4_array_getsetters,
1298 : .tp_methods = NULL,
1299 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1300 : .tp_new = py_dnsp_ip4_array_new,
1301 : };
1302 :
1303 :
1304 0 : static PyObject *py_dnsp_dns_addr_get_family(PyObject *obj, void *closure)
1305 : {
1306 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(obj);
1307 0 : PyObject *py_family;
1308 0 : py_family = PyLong_FromLong((uint16_t)(object->family));
1309 0 : return py_family;
1310 : }
1311 :
1312 0 : static int py_dnsp_dns_addr_set_family(PyObject *py_obj, PyObject *value, void *closure)
1313 : {
1314 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(py_obj);
1315 0 : if (value == NULL) {
1316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->family");
1317 0 : return -1;
1318 : }
1319 : {
1320 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->family));
1321 0 : if (PyLong_Check(value)) {
1322 0 : unsigned long long test_var;
1323 0 : test_var = PyLong_AsUnsignedLongLong(value);
1324 0 : if (PyErr_Occurred() != NULL) {
1325 0 : return -1;
1326 : }
1327 0 : if (test_var > uint_max) {
1328 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1329 : PyLong_Type.tp_name, uint_max, test_var);
1330 0 : return -1;
1331 : }
1332 0 : object->family = test_var;
1333 : } else {
1334 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1335 : PyLong_Type.tp_name);
1336 0 : return -1;
1337 : }
1338 : }
1339 0 : return 0;
1340 : }
1341 :
1342 0 : static PyObject *py_dnsp_dns_addr_get_port(PyObject *obj, void *closure)
1343 : {
1344 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(obj);
1345 0 : PyObject *py_port;
1346 0 : py_port = PyLong_FromLong((uint16_t)(object->port));
1347 0 : return py_port;
1348 : }
1349 :
1350 0 : static int py_dnsp_dns_addr_set_port(PyObject *py_obj, PyObject *value, void *closure)
1351 : {
1352 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(py_obj);
1353 0 : if (value == NULL) {
1354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port");
1355 0 : return -1;
1356 : }
1357 : {
1358 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
1359 0 : if (PyLong_Check(value)) {
1360 0 : unsigned long long test_var;
1361 0 : test_var = PyLong_AsUnsignedLongLong(value);
1362 0 : if (PyErr_Occurred() != NULL) {
1363 0 : return -1;
1364 : }
1365 0 : if (test_var > uint_max) {
1366 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1367 : PyLong_Type.tp_name, uint_max, test_var);
1368 0 : return -1;
1369 : }
1370 0 : object->port = test_var;
1371 : } else {
1372 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1373 : PyLong_Type.tp_name);
1374 0 : return -1;
1375 : }
1376 : }
1377 0 : return 0;
1378 : }
1379 :
1380 0 : static PyObject *py_dnsp_dns_addr_get_ipv4(PyObject *obj, void *closure)
1381 : {
1382 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(obj);
1383 0 : PyObject *py_ipv4;
1384 0 : py_ipv4 = PyString_FromStringOrNULL(object->ipv4);
1385 0 : return py_ipv4;
1386 : }
1387 :
1388 0 : static int py_dnsp_dns_addr_set_ipv4(PyObject *py_obj, PyObject *value, void *closure)
1389 : {
1390 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(py_obj);
1391 0 : if (value == NULL) {
1392 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ipv4");
1393 0 : return -1;
1394 : }
1395 : {
1396 0 : const char *test_str;
1397 0 : const char *talloc_str;
1398 0 : PyObject *unicode = NULL;
1399 0 : if (PyUnicode_Check(value)) {
1400 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1401 0 : if (unicode == NULL) {
1402 0 : return -1;
1403 : }
1404 0 : test_str = PyBytes_AS_STRING(unicode);
1405 0 : } else if (PyBytes_Check(value)) {
1406 0 : test_str = PyBytes_AS_STRING(value);
1407 : } else {
1408 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1409 0 : return -1;
1410 : }
1411 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1412 0 : if (unicode != NULL) {
1413 0 : Py_DECREF(unicode);
1414 : }
1415 0 : if (talloc_str == NULL) {
1416 0 : PyErr_NoMemory();
1417 0 : return -1;
1418 : }
1419 0 : object->ipv4 = talloc_str;
1420 : }
1421 0 : return 0;
1422 : }
1423 :
1424 0 : static PyObject *py_dnsp_dns_addr_get_ipv6(PyObject *obj, void *closure)
1425 : {
1426 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(obj);
1427 0 : PyObject *py_ipv6;
1428 0 : py_ipv6 = PyString_FromStringOrNULL(object->ipv6);
1429 0 : return py_ipv6;
1430 : }
1431 :
1432 0 : static int py_dnsp_dns_addr_set_ipv6(PyObject *py_obj, PyObject *value, void *closure)
1433 : {
1434 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(py_obj);
1435 0 : if (value == NULL) {
1436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ipv6");
1437 0 : return -1;
1438 : }
1439 : {
1440 0 : const char *test_str;
1441 0 : const char *talloc_str;
1442 0 : PyObject *unicode = NULL;
1443 0 : if (PyUnicode_Check(value)) {
1444 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1445 0 : if (unicode == NULL) {
1446 0 : return -1;
1447 : }
1448 0 : test_str = PyBytes_AS_STRING(unicode);
1449 0 : } else if (PyBytes_Check(value)) {
1450 0 : test_str = PyBytes_AS_STRING(value);
1451 : } else {
1452 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1453 0 : return -1;
1454 : }
1455 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1456 0 : if (unicode != NULL) {
1457 0 : Py_DECREF(unicode);
1458 : }
1459 0 : if (talloc_str == NULL) {
1460 0 : PyErr_NoMemory();
1461 0 : return -1;
1462 : }
1463 0 : object->ipv6 = talloc_str;
1464 : }
1465 0 : return 0;
1466 : }
1467 :
1468 0 : static PyObject *py_dnsp_dns_addr_get_pad(PyObject *obj, void *closure)
1469 : {
1470 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(obj);
1471 0 : PyObject *py_pad;
1472 0 : py_pad = PyList_New(8);
1473 0 : if (py_pad == NULL) {
1474 0 : return NULL;
1475 : }
1476 : {
1477 : int pad_cntr_0;
1478 0 : for (pad_cntr_0 = 0; pad_cntr_0 < (8); pad_cntr_0++) {
1479 0 : PyObject *py_pad_0;
1480 0 : py_pad_0 = PyLong_FromLong((uint16_t)((object->pad)[pad_cntr_0]));
1481 0 : PyList_SetItem(py_pad, pad_cntr_0, py_pad_0);
1482 : }
1483 : }
1484 0 : return py_pad;
1485 : }
1486 :
1487 0 : static int py_dnsp_dns_addr_set_pad(PyObject *py_obj, PyObject *value, void *closure)
1488 : {
1489 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(py_obj);
1490 0 : if (value == NULL) {
1491 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pad");
1492 0 : return -1;
1493 : }
1494 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1495 : {
1496 0 : int pad_cntr_0;
1497 0 : if (ARRAY_SIZE(object->pad) != PyList_GET_SIZE(value)) {
1498 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->pad), PyList_GET_SIZE(value));
1499 0 : return -1;
1500 : }
1501 0 : for (pad_cntr_0 = 0; pad_cntr_0 < PyList_GET_SIZE(value); pad_cntr_0++) {
1502 0 : if (PyList_GET_ITEM(value, pad_cntr_0) == NULL) {
1503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->pad)[pad_cntr_0]");
1504 0 : return -1;
1505 : }
1506 : {
1507 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->pad)[pad_cntr_0]));
1508 0 : if (PyLong_Check(PyList_GET_ITEM(value, pad_cntr_0))) {
1509 0 : unsigned long long test_var;
1510 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pad_cntr_0));
1511 0 : if (PyErr_Occurred() != NULL) {
1512 0 : return -1;
1513 : }
1514 0 : if (test_var > uint_max) {
1515 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1516 : PyLong_Type.tp_name, uint_max, test_var);
1517 0 : return -1;
1518 : }
1519 0 : (object->pad)[pad_cntr_0] = test_var;
1520 : } else {
1521 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1522 : PyLong_Type.tp_name);
1523 0 : return -1;
1524 : }
1525 : }
1526 : }
1527 : }
1528 0 : return 0;
1529 : }
1530 :
1531 0 : static PyObject *py_dnsp_dns_addr_get_unused(PyObject *obj, void *closure)
1532 : {
1533 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(obj);
1534 0 : PyObject *py_unused;
1535 0 : py_unused = PyList_New(8);
1536 0 : if (py_unused == NULL) {
1537 0 : return NULL;
1538 : }
1539 : {
1540 : int unused_cntr_0;
1541 0 : for (unused_cntr_0 = 0; unused_cntr_0 < (8); unused_cntr_0++) {
1542 0 : PyObject *py_unused_0;
1543 0 : py_unused_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->unused)[unused_cntr_0]));
1544 0 : PyList_SetItem(py_unused, unused_cntr_0, py_unused_0);
1545 : }
1546 : }
1547 0 : return py_unused;
1548 : }
1549 :
1550 0 : static int py_dnsp_dns_addr_set_unused(PyObject *py_obj, PyObject *value, void *closure)
1551 : {
1552 0 : struct dnsp_dns_addr *object = pytalloc_get_ptr(py_obj);
1553 0 : if (value == NULL) {
1554 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unused");
1555 0 : return -1;
1556 : }
1557 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1558 : {
1559 0 : int unused_cntr_0;
1560 0 : if (ARRAY_SIZE(object->unused) != PyList_GET_SIZE(value)) {
1561 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unused), PyList_GET_SIZE(value));
1562 0 : return -1;
1563 : }
1564 0 : for (unused_cntr_0 = 0; unused_cntr_0 < PyList_GET_SIZE(value); unused_cntr_0++) {
1565 0 : if (PyList_GET_ITEM(value, unused_cntr_0) == NULL) {
1566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->unused)[unused_cntr_0]");
1567 0 : return -1;
1568 : }
1569 : {
1570 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->unused)[unused_cntr_0]));
1571 0 : if (PyLong_Check(PyList_GET_ITEM(value, unused_cntr_0))) {
1572 0 : unsigned long long test_var;
1573 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unused_cntr_0));
1574 0 : if (PyErr_Occurred() != NULL) {
1575 0 : return -1;
1576 : }
1577 0 : if (test_var > uint_max) {
1578 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1579 : PyLong_Type.tp_name, uint_max, test_var);
1580 0 : return -1;
1581 : }
1582 0 : (object->unused)[unused_cntr_0] = test_var;
1583 : } else {
1584 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1585 : PyLong_Type.tp_name);
1586 0 : return -1;
1587 : }
1588 : }
1589 : }
1590 : }
1591 0 : return 0;
1592 : }
1593 :
1594 : static PyGetSetDef py_dnsp_dns_addr_getsetters[] = {
1595 : {
1596 : .name = discard_const_p(char, "family"),
1597 : .get = py_dnsp_dns_addr_get_family,
1598 : .set = py_dnsp_dns_addr_set_family,
1599 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1600 : },
1601 : {
1602 : .name = discard_const_p(char, "port"),
1603 : .get = py_dnsp_dns_addr_get_port,
1604 : .set = py_dnsp_dns_addr_set_port,
1605 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1606 : },
1607 : {
1608 : .name = discard_const_p(char, "ipv4"),
1609 : .get = py_dnsp_dns_addr_get_ipv4,
1610 : .set = py_dnsp_dns_addr_set_ipv4,
1611 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
1612 : },
1613 : {
1614 : .name = discard_const_p(char, "ipv6"),
1615 : .get = py_dnsp_dns_addr_get_ipv6,
1616 : .set = py_dnsp_dns_addr_set_ipv6,
1617 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv6address")
1618 : },
1619 : {
1620 : .name = discard_const_p(char, "pad"),
1621 : .get = py_dnsp_dns_addr_get_pad,
1622 : .set = py_dnsp_dns_addr_set_pad,
1623 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1624 : },
1625 : {
1626 : .name = discard_const_p(char, "unused"),
1627 : .get = py_dnsp_dns_addr_get_unused,
1628 : .set = py_dnsp_dns_addr_set_unused,
1629 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1630 : },
1631 : { .name = NULL }
1632 : };
1633 :
1634 0 : static PyObject *py_dnsp_dns_addr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1635 : {
1636 0 : return pytalloc_new(struct dnsp_dns_addr, type);
1637 : }
1638 :
1639 :
1640 : static PyTypeObject dnsp_dns_addr_Type = {
1641 : PyVarObject_HEAD_INIT(NULL, 0)
1642 : .tp_name = "dnsp.dns_addr",
1643 : .tp_getset = py_dnsp_dns_addr_getsetters,
1644 : .tp_methods = NULL,
1645 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1646 : .tp_new = py_dnsp_dns_addr_new,
1647 : };
1648 :
1649 :
1650 0 : static PyObject *py_dnsp_dns_addr_array_get_MaxCount(PyObject *obj, void *closure)
1651 : {
1652 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1653 0 : PyObject *py_MaxCount;
1654 0 : py_MaxCount = PyLong_FromUnsignedLongLong((uint32_t)(object->MaxCount));
1655 0 : return py_MaxCount;
1656 : }
1657 :
1658 0 : static int py_dnsp_dns_addr_array_set_MaxCount(PyObject *py_obj, PyObject *value, void *closure)
1659 : {
1660 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1661 0 : if (value == NULL) {
1662 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->MaxCount");
1663 0 : return -1;
1664 : }
1665 : {
1666 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MaxCount));
1667 0 : if (PyLong_Check(value)) {
1668 0 : unsigned long long test_var;
1669 0 : test_var = PyLong_AsUnsignedLongLong(value);
1670 0 : if (PyErr_Occurred() != NULL) {
1671 0 : return -1;
1672 : }
1673 0 : if (test_var > uint_max) {
1674 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1675 : PyLong_Type.tp_name, uint_max, test_var);
1676 0 : return -1;
1677 : }
1678 0 : object->MaxCount = test_var;
1679 : } else {
1680 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1681 : PyLong_Type.tp_name);
1682 0 : return -1;
1683 : }
1684 : }
1685 0 : return 0;
1686 : }
1687 :
1688 0 : static PyObject *py_dnsp_dns_addr_array_get_AddrCount(PyObject *obj, void *closure)
1689 : {
1690 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1691 0 : PyObject *py_AddrCount;
1692 0 : py_AddrCount = PyLong_FromUnsignedLongLong((uint32_t)(object->AddrCount));
1693 0 : return py_AddrCount;
1694 : }
1695 :
1696 0 : static int py_dnsp_dns_addr_array_set_AddrCount(PyObject *py_obj, PyObject *value, void *closure)
1697 : {
1698 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1699 0 : if (value == NULL) {
1700 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->AddrCount");
1701 0 : return -1;
1702 : }
1703 : {
1704 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AddrCount));
1705 0 : if (PyLong_Check(value)) {
1706 0 : unsigned long long test_var;
1707 0 : test_var = PyLong_AsUnsignedLongLong(value);
1708 0 : if (PyErr_Occurred() != NULL) {
1709 0 : return -1;
1710 : }
1711 0 : if (test_var > uint_max) {
1712 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1713 : PyLong_Type.tp_name, uint_max, test_var);
1714 0 : return -1;
1715 : }
1716 0 : object->AddrCount = test_var;
1717 : } else {
1718 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1719 : PyLong_Type.tp_name);
1720 0 : return -1;
1721 : }
1722 : }
1723 0 : return 0;
1724 : }
1725 :
1726 0 : static PyObject *py_dnsp_dns_addr_array_get_Tag(PyObject *obj, void *closure)
1727 : {
1728 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1729 0 : PyObject *py_Tag;
1730 0 : py_Tag = PyLong_FromUnsignedLongLong((uint32_t)(object->Tag));
1731 0 : return py_Tag;
1732 : }
1733 :
1734 0 : static int py_dnsp_dns_addr_array_set_Tag(PyObject *py_obj, PyObject *value, void *closure)
1735 : {
1736 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1737 0 : if (value == NULL) {
1738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Tag");
1739 0 : return -1;
1740 : }
1741 : {
1742 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Tag));
1743 0 : if (PyLong_Check(value)) {
1744 0 : unsigned long long test_var;
1745 0 : test_var = PyLong_AsUnsignedLongLong(value);
1746 0 : if (PyErr_Occurred() != NULL) {
1747 0 : return -1;
1748 : }
1749 0 : if (test_var > uint_max) {
1750 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1751 : PyLong_Type.tp_name, uint_max, test_var);
1752 0 : return -1;
1753 : }
1754 0 : object->Tag = test_var;
1755 : } else {
1756 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1757 : PyLong_Type.tp_name);
1758 0 : return -1;
1759 : }
1760 : }
1761 0 : return 0;
1762 : }
1763 :
1764 0 : static PyObject *py_dnsp_dns_addr_array_get_Family(PyObject *obj, void *closure)
1765 : {
1766 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1767 0 : PyObject *py_Family;
1768 0 : py_Family = PyLong_FromLong((uint16_t)(object->Family));
1769 0 : return py_Family;
1770 : }
1771 :
1772 0 : static int py_dnsp_dns_addr_array_set_Family(PyObject *py_obj, PyObject *value, void *closure)
1773 : {
1774 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1775 0 : if (value == NULL) {
1776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Family");
1777 0 : return -1;
1778 : }
1779 : {
1780 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Family));
1781 0 : if (PyLong_Check(value)) {
1782 0 : unsigned long long test_var;
1783 0 : test_var = PyLong_AsUnsignedLongLong(value);
1784 0 : if (PyErr_Occurred() != NULL) {
1785 0 : return -1;
1786 : }
1787 0 : if (test_var > uint_max) {
1788 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1789 : PyLong_Type.tp_name, uint_max, test_var);
1790 0 : return -1;
1791 : }
1792 0 : object->Family = test_var;
1793 : } else {
1794 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1795 : PyLong_Type.tp_name);
1796 0 : return -1;
1797 : }
1798 : }
1799 0 : return 0;
1800 : }
1801 :
1802 0 : static PyObject *py_dnsp_dns_addr_array_get_Reserved0(PyObject *obj, void *closure)
1803 : {
1804 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1805 0 : PyObject *py_Reserved0;
1806 0 : py_Reserved0 = PyLong_FromLong((uint16_t)(object->Reserved0));
1807 0 : return py_Reserved0;
1808 : }
1809 :
1810 0 : static int py_dnsp_dns_addr_array_set_Reserved0(PyObject *py_obj, PyObject *value, void *closure)
1811 : {
1812 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1813 0 : if (value == NULL) {
1814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Reserved0");
1815 0 : return -1;
1816 : }
1817 : {
1818 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved0));
1819 0 : if (PyLong_Check(value)) {
1820 0 : unsigned long long test_var;
1821 0 : test_var = PyLong_AsUnsignedLongLong(value);
1822 0 : if (PyErr_Occurred() != NULL) {
1823 0 : return -1;
1824 : }
1825 0 : if (test_var > uint_max) {
1826 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1827 : PyLong_Type.tp_name, uint_max, test_var);
1828 0 : return -1;
1829 : }
1830 0 : object->Reserved0 = test_var;
1831 : } else {
1832 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1833 : PyLong_Type.tp_name);
1834 0 : return -1;
1835 : }
1836 : }
1837 0 : return 0;
1838 : }
1839 :
1840 0 : static PyObject *py_dnsp_dns_addr_array_get_Flags(PyObject *obj, void *closure)
1841 : {
1842 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1843 0 : PyObject *py_Flags;
1844 0 : py_Flags = PyLong_FromUnsignedLongLong((uint32_t)(object->Flags));
1845 0 : return py_Flags;
1846 : }
1847 :
1848 0 : static int py_dnsp_dns_addr_array_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
1849 : {
1850 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1851 0 : if (value == NULL) {
1852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Flags");
1853 0 : return -1;
1854 : }
1855 : {
1856 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
1857 0 : if (PyLong_Check(value)) {
1858 0 : unsigned long long test_var;
1859 0 : test_var = PyLong_AsUnsignedLongLong(value);
1860 0 : if (PyErr_Occurred() != NULL) {
1861 0 : return -1;
1862 : }
1863 0 : if (test_var > uint_max) {
1864 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1865 : PyLong_Type.tp_name, uint_max, test_var);
1866 0 : return -1;
1867 : }
1868 0 : object->Flags = test_var;
1869 : } else {
1870 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1871 : PyLong_Type.tp_name);
1872 0 : return -1;
1873 : }
1874 : }
1875 0 : return 0;
1876 : }
1877 :
1878 0 : static PyObject *py_dnsp_dns_addr_array_get_MatchFlag(PyObject *obj, void *closure)
1879 : {
1880 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1881 0 : PyObject *py_MatchFlag;
1882 0 : py_MatchFlag = PyLong_FromUnsignedLongLong((uint32_t)(object->MatchFlag));
1883 0 : return py_MatchFlag;
1884 : }
1885 :
1886 0 : static int py_dnsp_dns_addr_array_set_MatchFlag(PyObject *py_obj, PyObject *value, void *closure)
1887 : {
1888 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1889 0 : if (value == NULL) {
1890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->MatchFlag");
1891 0 : return -1;
1892 : }
1893 : {
1894 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MatchFlag));
1895 0 : if (PyLong_Check(value)) {
1896 0 : unsigned long long test_var;
1897 0 : test_var = PyLong_AsUnsignedLongLong(value);
1898 0 : if (PyErr_Occurred() != NULL) {
1899 0 : return -1;
1900 : }
1901 0 : if (test_var > uint_max) {
1902 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1903 : PyLong_Type.tp_name, uint_max, test_var);
1904 0 : return -1;
1905 : }
1906 0 : object->MatchFlag = test_var;
1907 : } else {
1908 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1909 : PyLong_Type.tp_name);
1910 0 : return -1;
1911 : }
1912 : }
1913 0 : return 0;
1914 : }
1915 :
1916 0 : static PyObject *py_dnsp_dns_addr_array_get_Reserved1(PyObject *obj, void *closure)
1917 : {
1918 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1919 0 : PyObject *py_Reserved1;
1920 0 : py_Reserved1 = PyLong_FromUnsignedLongLong((uint32_t)(object->Reserved1));
1921 0 : return py_Reserved1;
1922 : }
1923 :
1924 0 : static int py_dnsp_dns_addr_array_set_Reserved1(PyObject *py_obj, PyObject *value, void *closure)
1925 : {
1926 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1927 0 : if (value == NULL) {
1928 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Reserved1");
1929 0 : return -1;
1930 : }
1931 : {
1932 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved1));
1933 0 : if (PyLong_Check(value)) {
1934 0 : unsigned long long test_var;
1935 0 : test_var = PyLong_AsUnsignedLongLong(value);
1936 0 : if (PyErr_Occurred() != NULL) {
1937 0 : return -1;
1938 : }
1939 0 : if (test_var > uint_max) {
1940 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1941 : PyLong_Type.tp_name, uint_max, test_var);
1942 0 : return -1;
1943 : }
1944 0 : object->Reserved1 = test_var;
1945 : } else {
1946 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1947 : PyLong_Type.tp_name);
1948 0 : return -1;
1949 : }
1950 : }
1951 0 : return 0;
1952 : }
1953 :
1954 0 : static PyObject *py_dnsp_dns_addr_array_get_Reserved2(PyObject *obj, void *closure)
1955 : {
1956 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1957 0 : PyObject *py_Reserved2;
1958 0 : py_Reserved2 = PyLong_FromUnsignedLongLong((uint32_t)(object->Reserved2));
1959 0 : return py_Reserved2;
1960 : }
1961 :
1962 0 : static int py_dnsp_dns_addr_array_set_Reserved2(PyObject *py_obj, PyObject *value, void *closure)
1963 : {
1964 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
1965 0 : if (value == NULL) {
1966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Reserved2");
1967 0 : return -1;
1968 : }
1969 : {
1970 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved2));
1971 0 : if (PyLong_Check(value)) {
1972 0 : unsigned long long test_var;
1973 0 : test_var = PyLong_AsUnsignedLongLong(value);
1974 0 : if (PyErr_Occurred() != NULL) {
1975 0 : return -1;
1976 : }
1977 0 : if (test_var > uint_max) {
1978 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1979 : PyLong_Type.tp_name, uint_max, test_var);
1980 0 : return -1;
1981 : }
1982 0 : object->Reserved2 = test_var;
1983 : } else {
1984 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1985 : PyLong_Type.tp_name);
1986 0 : return -1;
1987 : }
1988 : }
1989 0 : return 0;
1990 : }
1991 :
1992 0 : static PyObject *py_dnsp_dns_addr_array_get_AddrArray(PyObject *obj, void *closure)
1993 : {
1994 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(obj);
1995 0 : PyObject *py_AddrArray;
1996 0 : py_AddrArray = PyList_New(object->AddrCount);
1997 0 : if (py_AddrArray == NULL) {
1998 0 : return NULL;
1999 : }
2000 : {
2001 : int AddrArray_cntr_0;
2002 0 : for (AddrArray_cntr_0 = 0; AddrArray_cntr_0 < (object->AddrCount); AddrArray_cntr_0++) {
2003 0 : PyObject *py_AddrArray_0;
2004 0 : py_AddrArray_0 = pytalloc_reference_ex(&dnsp_dns_addr_Type, object->AddrArray, &(object->AddrArray)[AddrArray_cntr_0]);
2005 0 : PyList_SetItem(py_AddrArray, AddrArray_cntr_0, py_AddrArray_0);
2006 : }
2007 : }
2008 0 : return py_AddrArray;
2009 : }
2010 :
2011 0 : static int py_dnsp_dns_addr_array_set_AddrArray(PyObject *py_obj, PyObject *value, void *closure)
2012 : {
2013 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
2014 0 : if (value == NULL) {
2015 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->AddrArray");
2016 0 : return -1;
2017 : }
2018 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2019 : {
2020 0 : int AddrArray_cntr_0;
2021 0 : object->AddrArray = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->AddrArray, PyList_GET_SIZE(value));
2022 0 : if (!object->AddrArray) { return -1; }
2023 0 : talloc_set_name_const(object->AddrArray, "ARRAY: object->AddrArray");
2024 0 : for (AddrArray_cntr_0 = 0; AddrArray_cntr_0 < PyList_GET_SIZE(value); AddrArray_cntr_0++) {
2025 0 : if (PyList_GET_ITEM(value, AddrArray_cntr_0) == NULL) {
2026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->AddrArray)[AddrArray_cntr_0]");
2027 0 : return -1;
2028 : }
2029 0 : PY_CHECK_TYPE(&dnsp_dns_addr_Type, PyList_GET_ITEM(value, AddrArray_cntr_0), return -1;);
2030 0 : if (talloc_reference(object->AddrArray, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, AddrArray_cntr_0))) == NULL) {
2031 0 : PyErr_NoMemory();
2032 0 : return -1;
2033 : }
2034 0 : (object->AddrArray)[AddrArray_cntr_0] = *(struct dnsp_dns_addr *)pytalloc_get_ptr(PyList_GET_ITEM(value, AddrArray_cntr_0));
2035 : }
2036 : }
2037 0 : return 0;
2038 : }
2039 :
2040 : static PyGetSetDef py_dnsp_dns_addr_array_getsetters[] = {
2041 : {
2042 : .name = discard_const_p(char, "MaxCount"),
2043 : .get = py_dnsp_dns_addr_array_get_MaxCount,
2044 : .set = py_dnsp_dns_addr_array_set_MaxCount,
2045 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2046 : },
2047 : {
2048 : .name = discard_const_p(char, "AddrCount"),
2049 : .get = py_dnsp_dns_addr_array_get_AddrCount,
2050 : .set = py_dnsp_dns_addr_array_set_AddrCount,
2051 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2052 : },
2053 : {
2054 : .name = discard_const_p(char, "Tag"),
2055 : .get = py_dnsp_dns_addr_array_get_Tag,
2056 : .set = py_dnsp_dns_addr_array_set_Tag,
2057 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2058 : },
2059 : {
2060 : .name = discard_const_p(char, "Family"),
2061 : .get = py_dnsp_dns_addr_array_get_Family,
2062 : .set = py_dnsp_dns_addr_array_set_Family,
2063 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2064 : },
2065 : {
2066 : .name = discard_const_p(char, "Reserved0"),
2067 : .get = py_dnsp_dns_addr_array_get_Reserved0,
2068 : .set = py_dnsp_dns_addr_array_set_Reserved0,
2069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2070 : },
2071 : {
2072 : .name = discard_const_p(char, "Flags"),
2073 : .get = py_dnsp_dns_addr_array_get_Flags,
2074 : .set = py_dnsp_dns_addr_array_set_Flags,
2075 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2076 : },
2077 : {
2078 : .name = discard_const_p(char, "MatchFlag"),
2079 : .get = py_dnsp_dns_addr_array_get_MatchFlag,
2080 : .set = py_dnsp_dns_addr_array_set_MatchFlag,
2081 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2082 : },
2083 : {
2084 : .name = discard_const_p(char, "Reserved1"),
2085 : .get = py_dnsp_dns_addr_array_get_Reserved1,
2086 : .set = py_dnsp_dns_addr_array_set_Reserved1,
2087 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2088 : },
2089 : {
2090 : .name = discard_const_p(char, "Reserved2"),
2091 : .get = py_dnsp_dns_addr_array_get_Reserved2,
2092 : .set = py_dnsp_dns_addr_array_set_Reserved2,
2093 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2094 : },
2095 : {
2096 : .name = discard_const_p(char, "AddrArray"),
2097 : .get = py_dnsp_dns_addr_array_get_AddrArray,
2098 : .set = py_dnsp_dns_addr_array_set_AddrArray,
2099 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_dns_addr")
2100 : },
2101 : { .name = NULL }
2102 : };
2103 :
2104 0 : static PyObject *py_dnsp_dns_addr_array_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2105 : {
2106 0 : return pytalloc_new(struct dnsp_dns_addr_array, type);
2107 : }
2108 :
2109 0 : static PyObject *py_dnsp_dns_addr_array_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2110 : {
2111 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
2112 0 : PyObject *ret = NULL;
2113 0 : DATA_BLOB blob;
2114 0 : enum ndr_err_code err;
2115 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2116 0 : if (tmp_ctx == NULL) {
2117 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2118 0 : return NULL;
2119 : }
2120 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_dns_addr_array);
2121 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2122 0 : TALLOC_FREE(tmp_ctx);
2123 0 : PyErr_SetNdrError(err);
2124 0 : return NULL;
2125 : }
2126 :
2127 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2128 0 : TALLOC_FREE(tmp_ctx);
2129 0 : return ret;
2130 : }
2131 :
2132 0 : static PyObject *py_dnsp_dns_addr_array_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2133 : {
2134 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
2135 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2136 0 : Py_ssize_t blob_length = 0;
2137 0 : enum ndr_err_code err;
2138 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2139 0 : PyObject *allow_remaining_obj = NULL;
2140 0 : bool allow_remaining = false;
2141 :
2142 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2143 : discard_const_p(char *, kwnames),
2144 : &blob.data, &blob_length,
2145 : &allow_remaining_obj)) {
2146 0 : return NULL;
2147 : }
2148 0 : blob.length = blob_length;
2149 :
2150 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2151 0 : allow_remaining = true;
2152 : }
2153 :
2154 0 : if (allow_remaining) {
2155 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_dns_addr_array);
2156 : } else {
2157 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_dns_addr_array);
2158 : }
2159 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2160 0 : PyErr_SetNdrError(err);
2161 0 : return NULL;
2162 : }
2163 :
2164 0 : Py_RETURN_NONE;
2165 : }
2166 :
2167 0 : static PyObject *py_dnsp_dns_addr_array_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2168 : {
2169 0 : struct dnsp_dns_addr_array *object = pytalloc_get_ptr(py_obj);
2170 0 : PyObject *ret;
2171 0 : char *retstr;
2172 :
2173 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_dns_addr_array, "dnsp_dns_addr_array", object);
2174 0 : ret = PyUnicode_FromString(retstr);
2175 0 : talloc_free(retstr);
2176 :
2177 0 : return ret;
2178 : }
2179 :
2180 : static PyMethodDef py_dnsp_dns_addr_array_methods[] = {
2181 : { "__ndr_pack__", (PyCFunction)py_dnsp_dns_addr_array_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2182 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_dns_addr_array_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2183 : { "__ndr_print__", (PyCFunction)py_dnsp_dns_addr_array_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2184 : { NULL, NULL, 0, NULL }
2185 : };
2186 :
2187 :
2188 : static PyTypeObject dnsp_dns_addr_array_Type = {
2189 : PyVarObject_HEAD_INIT(NULL, 0)
2190 : .tp_name = "dnsp.dns_addr_array",
2191 : .tp_getset = py_dnsp_dns_addr_array_getsetters,
2192 : .tp_methods = py_dnsp_dns_addr_array_methods,
2193 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2194 : .tp_new = py_dnsp_dns_addr_array_new,
2195 : };
2196 :
2197 :
2198 0 : static PyObject *py_dnsp_string_list_get_count(PyObject *obj, void *closure)
2199 : {
2200 0 : struct dnsp_string_list *object = pytalloc_get_ptr(obj);
2201 0 : PyObject *py_count;
2202 0 : py_count = PyLong_FromLong((uint16_t)(object->count));
2203 0 : return py_count;
2204 : }
2205 :
2206 1396 : static int py_dnsp_string_list_set_count(PyObject *py_obj, PyObject *value, void *closure)
2207 : {
2208 1396 : struct dnsp_string_list *object = pytalloc_get_ptr(py_obj);
2209 1396 : if (value == NULL) {
2210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
2211 0 : return -1;
2212 : }
2213 : {
2214 1396 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
2215 1396 : if (PyLong_Check(value)) {
2216 0 : unsigned long long test_var;
2217 1396 : test_var = PyLong_AsUnsignedLongLong(value);
2218 1396 : if (PyErr_Occurred() != NULL) {
2219 0 : return -1;
2220 : }
2221 1396 : if (test_var > uint_max) {
2222 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2223 : PyLong_Type.tp_name, uint_max, test_var);
2224 0 : return -1;
2225 : }
2226 1396 : object->count = test_var;
2227 : } else {
2228 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2229 : PyLong_Type.tp_name);
2230 0 : return -1;
2231 : }
2232 : }
2233 1396 : return 0;
2234 : }
2235 :
2236 6043 : static PyObject *py_dnsp_string_list_get_str(PyObject *obj, void *closure)
2237 : {
2238 6043 : struct dnsp_string_list *object = pytalloc_get_ptr(obj);
2239 0 : PyObject *py_str;
2240 6043 : py_str = PyList_New(object->count);
2241 6043 : if (py_str == NULL) {
2242 0 : return NULL;
2243 : }
2244 : {
2245 : int str_cntr_0;
2246 13533 : for (str_cntr_0 = 0; str_cntr_0 < (object->count); str_cntr_0++) {
2247 0 : PyObject *py_str_0;
2248 7490 : py_str_0 = PyString_FromStringOrNULL((object->str)[str_cntr_0]);
2249 7490 : PyList_SetItem(py_str, str_cntr_0, py_str_0);
2250 : }
2251 : }
2252 6043 : return py_str;
2253 : }
2254 :
2255 1396 : static int py_dnsp_string_list_set_str(PyObject *py_obj, PyObject *value, void *closure)
2256 : {
2257 1396 : struct dnsp_string_list *object = pytalloc_get_ptr(py_obj);
2258 1396 : if (value == NULL) {
2259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->str");
2260 0 : return -1;
2261 : }
2262 1396 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2263 : {
2264 0 : int str_cntr_0;
2265 1396 : object->str = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->str, PyList_GET_SIZE(value));
2266 1396 : if (!object->str) { return -1; }
2267 1396 : talloc_set_name_const(object->str, "ARRAY: object->str");
2268 3036 : for (str_cntr_0 = 0; str_cntr_0 < PyList_GET_SIZE(value); str_cntr_0++) {
2269 1640 : if (PyList_GET_ITEM(value, str_cntr_0) == NULL) {
2270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->str)[str_cntr_0]");
2271 0 : return -1;
2272 : }
2273 : {
2274 0 : const char *test_str;
2275 0 : const char *talloc_str;
2276 1640 : PyObject *unicode = NULL;
2277 1640 : if (PyUnicode_Check(PyList_GET_ITEM(value, str_cntr_0))) {
2278 1640 : unicode = PyUnicode_AsEncodedString(PyList_GET_ITEM(value, str_cntr_0), "utf-8", "ignore");
2279 1640 : if (unicode == NULL) {
2280 0 : return -1;
2281 : }
2282 1640 : test_str = PyBytes_AS_STRING(unicode);
2283 0 : } else if (PyBytes_Check(PyList_GET_ITEM(value, str_cntr_0))) {
2284 0 : test_str = PyBytes_AS_STRING(PyList_GET_ITEM(value, str_cntr_0));
2285 : } else {
2286 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(PyList_GET_ITEM(value, str_cntr_0))->tp_name);
2287 0 : return -1;
2288 : }
2289 1640 : talloc_str = talloc_strdup(object->str, test_str);
2290 1640 : if (unicode != NULL) {
2291 836 : Py_DECREF(unicode);
2292 : }
2293 1640 : if (talloc_str == NULL) {
2294 0 : PyErr_NoMemory();
2295 0 : return -1;
2296 : }
2297 1640 : (object->str)[str_cntr_0] = talloc_str;
2298 : }
2299 : }
2300 : }
2301 1396 : return 0;
2302 : }
2303 :
2304 : static PyGetSetDef py_dnsp_string_list_getsetters[] = {
2305 : {
2306 : .name = discard_const_p(char, "count"),
2307 : .get = py_dnsp_string_list_get_count,
2308 : .set = py_dnsp_string_list_set_count,
2309 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2310 : },
2311 : {
2312 : .name = discard_const_p(char, "str"),
2313 : .get = py_dnsp_string_list_get_str,
2314 : .set = py_dnsp_string_list_set_str,
2315 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsp_string")
2316 : },
2317 : { .name = NULL }
2318 : };
2319 :
2320 1396 : static PyObject *py_dnsp_string_list_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2321 : {
2322 1396 : return pytalloc_new(struct dnsp_string_list, type);
2323 : }
2324 :
2325 0 : static PyObject *py_dnsp_string_list_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2326 : {
2327 0 : struct dnsp_string_list *object = pytalloc_get_ptr(py_obj);
2328 0 : PyObject *ret = NULL;
2329 0 : DATA_BLOB blob;
2330 0 : enum ndr_err_code err;
2331 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2332 0 : if (tmp_ctx == NULL) {
2333 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2334 0 : return NULL;
2335 : }
2336 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_string_list);
2337 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2338 0 : TALLOC_FREE(tmp_ctx);
2339 0 : PyErr_SetNdrError(err);
2340 0 : return NULL;
2341 : }
2342 :
2343 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2344 0 : TALLOC_FREE(tmp_ctx);
2345 0 : return ret;
2346 : }
2347 :
2348 0 : static PyObject *py_dnsp_string_list_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2349 : {
2350 0 : struct dnsp_string_list *object = pytalloc_get_ptr(py_obj);
2351 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2352 0 : Py_ssize_t blob_length = 0;
2353 0 : enum ndr_err_code err;
2354 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2355 0 : PyObject *allow_remaining_obj = NULL;
2356 0 : bool allow_remaining = false;
2357 :
2358 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2359 : discard_const_p(char *, kwnames),
2360 : &blob.data, &blob_length,
2361 : &allow_remaining_obj)) {
2362 0 : return NULL;
2363 : }
2364 0 : blob.length = blob_length;
2365 :
2366 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2367 0 : allow_remaining = true;
2368 : }
2369 :
2370 0 : if (allow_remaining) {
2371 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_string_list);
2372 : } else {
2373 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_string_list);
2374 : }
2375 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2376 0 : PyErr_SetNdrError(err);
2377 0 : return NULL;
2378 : }
2379 :
2380 0 : Py_RETURN_NONE;
2381 : }
2382 :
2383 0 : static PyObject *py_dnsp_string_list_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2384 : {
2385 0 : struct dnsp_string_list *object = pytalloc_get_ptr(py_obj);
2386 0 : PyObject *ret;
2387 0 : char *retstr;
2388 :
2389 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_string_list, "dnsp_string_list", object);
2390 0 : ret = PyUnicode_FromString(retstr);
2391 0 : talloc_free(retstr);
2392 :
2393 0 : return ret;
2394 : }
2395 :
2396 : static PyMethodDef py_dnsp_string_list_methods[] = {
2397 : { "__ndr_pack__", (PyCFunction)py_dnsp_string_list_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2398 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_string_list_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2399 : { "__ndr_print__", (PyCFunction)py_dnsp_string_list_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2400 : { NULL, NULL, 0, NULL }
2401 : };
2402 :
2403 :
2404 : static PyTypeObject dnsp_string_list_Type = {
2405 : PyVarObject_HEAD_INIT(NULL, 0)
2406 : .tp_name = "dnsp.string_list",
2407 : .tp_getset = py_dnsp_string_list_getsetters,
2408 : .tp_methods = py_dnsp_string_list_methods,
2409 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2410 : .tp_new = py_dnsp_string_list_new,
2411 : };
2412 :
2413 9840 : static PyObject *py_import_dnsRecordData(TALLOC_CTX *mem_ctx, int level, union dnsRecordData *in)
2414 : {
2415 31 : PyObject *ret;
2416 :
2417 9840 : switch (level) {
2418 17 : case DNS_TYPE_TOMBSTONE:
2419 17 : ret = PyLong_FromUnsignedLongLong(in->EntombedTime);
2420 17 : return ret;
2421 :
2422 1397 : case DNS_TYPE_A:
2423 1397 : ret = PyString_FromStringOrNULL(in->ipv4);
2424 1397 : return ret;
2425 :
2426 254 : case DNS_TYPE_NS:
2427 254 : ret = PyString_FromStringOrNULL(in->ns);
2428 254 : return ret;
2429 :
2430 153 : case DNS_TYPE_CNAME:
2431 153 : ret = PyString_FromStringOrNULL(in->cname);
2432 153 : return ret;
2433 :
2434 0 : case DNS_TYPE_SOA:
2435 0 : ret = pytalloc_reference_ex(&dnsp_soa_Type, mem_ctx, &in->soa);
2436 0 : return ret;
2437 :
2438 0 : case DNS_TYPE_MX:
2439 0 : ret = pytalloc_reference_ex(&dnsp_mx_Type, mem_ctx, &in->mx);
2440 0 : return ret;
2441 :
2442 5758 : case DNS_TYPE_TXT:
2443 5758 : ret = pytalloc_reference_ex(&dnsp_string_list_Type, mem_ctx, &in->txt);
2444 5758 : return ret;
2445 :
2446 8 : case DNS_TYPE_PTR:
2447 8 : ret = PyString_FromStringOrNULL(in->ptr);
2448 8 : return ret;
2449 :
2450 0 : case DNS_TYPE_HINFO:
2451 0 : ret = pytalloc_reference_ex(&dnsp_hinfo_Type, mem_ctx, &in->hinfo);
2452 0 : return ret;
2453 :
2454 460 : case DNS_TYPE_AAAA:
2455 460 : ret = PyString_FromStringOrNULL(in->ipv6);
2456 460 : return ret;
2457 :
2458 1793 : case DNS_TYPE_SRV:
2459 1793 : ret = pytalloc_reference_ex(&dnsp_srv_Type, mem_ctx, &in->srv);
2460 1793 : return ret;
2461 :
2462 0 : default:
2463 0 : ret = PyBytes_FromStringAndSize((char *)(in->data).data, (in->data).length);
2464 0 : return ret;
2465 :
2466 : }
2467 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2468 : return NULL;
2469 : }
2470 :
2471 11571 : static union dnsRecordData *py_export_dnsRecordData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2472 : {
2473 11571 : union dnsRecordData *ret = talloc_zero(mem_ctx, union dnsRecordData);
2474 11571 : switch (level) {
2475 40 : case DNS_TYPE_TOMBSTONE:
2476 40 : if (in == NULL) {
2477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->EntombedTime");
2478 0 : talloc_free(ret); return NULL;
2479 : }
2480 : {
2481 40 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->EntombedTime));
2482 40 : if (PyLong_Check(in)) {
2483 0 : unsigned long long test_var;
2484 40 : test_var = PyLong_AsUnsignedLongLong(in);
2485 40 : if (PyErr_Occurred() != NULL) {
2486 0 : talloc_free(ret); return NULL;
2487 : }
2488 40 : if (test_var > uint_max) {
2489 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2490 : PyLong_Type.tp_name, uint_max, test_var);
2491 0 : talloc_free(ret); return NULL;
2492 : }
2493 40 : ret->EntombedTime = test_var;
2494 : } else {
2495 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2496 : PyLong_Type.tp_name);
2497 0 : talloc_free(ret); return NULL;
2498 : }
2499 : }
2500 40 : break;
2501 :
2502 3714 : case DNS_TYPE_A:
2503 3714 : if (in == NULL) {
2504 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ipv4");
2505 0 : talloc_free(ret); return NULL;
2506 : }
2507 : {
2508 651 : const char *test_str;
2509 651 : const char *talloc_str;
2510 3714 : PyObject *unicode = NULL;
2511 3714 : if (PyUnicode_Check(in)) {
2512 3714 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
2513 3714 : if (unicode == NULL) {
2514 0 : talloc_free(ret); return NULL;
2515 : }
2516 3714 : test_str = PyBytes_AS_STRING(unicode);
2517 0 : } else if (PyBytes_Check(in)) {
2518 0 : test_str = PyBytes_AS_STRING(in);
2519 : } else {
2520 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
2521 0 : talloc_free(ret); return NULL;
2522 : }
2523 3714 : talloc_str = talloc_strdup(mem_ctx, test_str);
2524 3714 : if (unicode != NULL) {
2525 2931 : Py_DECREF(unicode);
2526 : }
2527 3714 : if (talloc_str == NULL) {
2528 0 : PyErr_NoMemory();
2529 0 : talloc_free(ret); return NULL;
2530 : }
2531 3714 : ret->ipv4 = talloc_str;
2532 : }
2533 3714 : break;
2534 :
2535 3387 : case DNS_TYPE_NS:
2536 3387 : if (in == NULL) {
2537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ns");
2538 0 : talloc_free(ret); return NULL;
2539 : }
2540 : {
2541 609 : const char *test_str;
2542 609 : const char *talloc_str;
2543 3387 : PyObject *unicode = NULL;
2544 3387 : if (PyUnicode_Check(in)) {
2545 3387 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
2546 3387 : if (unicode == NULL) {
2547 0 : talloc_free(ret); return NULL;
2548 : }
2549 3387 : test_str = PyBytes_AS_STRING(unicode);
2550 0 : } else if (PyBytes_Check(in)) {
2551 0 : test_str = PyBytes_AS_STRING(in);
2552 : } else {
2553 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
2554 0 : talloc_free(ret); return NULL;
2555 : }
2556 3387 : talloc_str = talloc_strdup(mem_ctx, test_str);
2557 3387 : if (unicode != NULL) {
2558 2705 : Py_DECREF(unicode);
2559 : }
2560 3387 : if (talloc_str == NULL) {
2561 0 : PyErr_NoMemory();
2562 0 : talloc_free(ret); return NULL;
2563 : }
2564 3387 : ret->ns = talloc_str;
2565 : }
2566 3387 : break;
2567 :
2568 126 : case DNS_TYPE_CNAME:
2569 126 : if (in == NULL) {
2570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->cname");
2571 0 : talloc_free(ret); return NULL;
2572 : }
2573 : {
2574 21 : const char *test_str;
2575 21 : const char *talloc_str;
2576 126 : PyObject *unicode = NULL;
2577 126 : if (PyUnicode_Check(in)) {
2578 126 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
2579 126 : if (unicode == NULL) {
2580 0 : talloc_free(ret); return NULL;
2581 : }
2582 126 : test_str = PyBytes_AS_STRING(unicode);
2583 0 : } else if (PyBytes_Check(in)) {
2584 0 : test_str = PyBytes_AS_STRING(in);
2585 : } else {
2586 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
2587 0 : talloc_free(ret); return NULL;
2588 : }
2589 126 : talloc_str = talloc_strdup(mem_ctx, test_str);
2590 126 : if (unicode != NULL) {
2591 103 : Py_DECREF(unicode);
2592 : }
2593 126 : if (talloc_str == NULL) {
2594 0 : PyErr_NoMemory();
2595 0 : talloc_free(ret); return NULL;
2596 : }
2597 126 : ret->cname = talloc_str;
2598 : }
2599 126 : break;
2600 :
2601 255 : case DNS_TYPE_SOA:
2602 255 : if (in == NULL) {
2603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->soa");
2604 0 : talloc_free(ret); return NULL;
2605 : }
2606 255 : PY_CHECK_TYPE(&dnsp_soa_Type, in, talloc_free(ret); return NULL;);
2607 255 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2608 0 : PyErr_NoMemory();
2609 0 : talloc_free(ret); return NULL;
2610 : }
2611 255 : ret->soa = *(struct dnsp_soa *)pytalloc_get_ptr(in);
2612 255 : break;
2613 :
2614 0 : case DNS_TYPE_MX:
2615 0 : if (in == NULL) {
2616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->mx");
2617 0 : talloc_free(ret); return NULL;
2618 : }
2619 0 : PY_CHECK_TYPE(&dnsp_mx_Type, in, talloc_free(ret); return NULL;);
2620 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2621 0 : PyErr_NoMemory();
2622 0 : talloc_free(ret); return NULL;
2623 : }
2624 0 : ret->mx = *(struct dnsp_mx *)pytalloc_get_ptr(in);
2625 0 : break;
2626 :
2627 600 : case DNS_TYPE_TXT:
2628 600 : if (in == NULL) {
2629 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->txt");
2630 0 : talloc_free(ret); return NULL;
2631 : }
2632 600 : PY_CHECK_TYPE(&dnsp_string_list_Type, in, talloc_free(ret); return NULL;);
2633 600 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2634 0 : PyErr_NoMemory();
2635 0 : talloc_free(ret); return NULL;
2636 : }
2637 600 : ret->txt = *(struct dnsp_string_list *)pytalloc_get_ptr(in);
2638 600 : break;
2639 :
2640 0 : case DNS_TYPE_PTR:
2641 0 : if (in == NULL) {
2642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ptr");
2643 0 : talloc_free(ret); return NULL;
2644 : }
2645 : {
2646 0 : const char *test_str;
2647 0 : const char *talloc_str;
2648 0 : PyObject *unicode = NULL;
2649 0 : if (PyUnicode_Check(in)) {
2650 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
2651 0 : if (unicode == NULL) {
2652 0 : talloc_free(ret); return NULL;
2653 : }
2654 0 : test_str = PyBytes_AS_STRING(unicode);
2655 0 : } else if (PyBytes_Check(in)) {
2656 0 : test_str = PyBytes_AS_STRING(in);
2657 : } else {
2658 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
2659 0 : talloc_free(ret); return NULL;
2660 : }
2661 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
2662 0 : if (unicode != NULL) {
2663 0 : Py_DECREF(unicode);
2664 : }
2665 0 : if (talloc_str == NULL) {
2666 0 : PyErr_NoMemory();
2667 0 : talloc_free(ret); return NULL;
2668 : }
2669 0 : ret->ptr = talloc_str;
2670 : }
2671 0 : break;
2672 :
2673 0 : case DNS_TYPE_HINFO:
2674 0 : if (in == NULL) {
2675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->hinfo");
2676 0 : talloc_free(ret); return NULL;
2677 : }
2678 0 : PY_CHECK_TYPE(&dnsp_hinfo_Type, in, talloc_free(ret); return NULL;);
2679 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2680 0 : PyErr_NoMemory();
2681 0 : talloc_free(ret); return NULL;
2682 : }
2683 0 : ret->hinfo = *(struct dnsp_hinfo *)pytalloc_get_ptr(in);
2684 0 : break;
2685 :
2686 764 : case DNS_TYPE_AAAA:
2687 764 : if (in == NULL) {
2688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ipv6");
2689 0 : talloc_free(ret); return NULL;
2690 : }
2691 : {
2692 105 : const char *test_str;
2693 105 : const char *talloc_str;
2694 764 : PyObject *unicode = NULL;
2695 764 : if (PyUnicode_Check(in)) {
2696 764 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
2697 764 : if (unicode == NULL) {
2698 0 : talloc_free(ret); return NULL;
2699 : }
2700 764 : test_str = PyBytes_AS_STRING(unicode);
2701 0 : } else if (PyBytes_Check(in)) {
2702 0 : test_str = PyBytes_AS_STRING(in);
2703 : } else {
2704 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
2705 0 : talloc_free(ret); return NULL;
2706 : }
2707 764 : talloc_str = talloc_strdup(mem_ctx, test_str);
2708 764 : if (unicode != NULL) {
2709 584 : Py_DECREF(unicode);
2710 : }
2711 764 : if (talloc_str == NULL) {
2712 0 : PyErr_NoMemory();
2713 0 : talloc_free(ret); return NULL;
2714 : }
2715 764 : ret->ipv6 = talloc_str;
2716 : }
2717 764 : break;
2718 :
2719 2685 : case DNS_TYPE_SRV:
2720 2685 : if (in == NULL) {
2721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->srv");
2722 0 : talloc_free(ret); return NULL;
2723 : }
2724 2685 : PY_CHECK_TYPE(&dnsp_srv_Type, in, talloc_free(ret); return NULL;);
2725 2685 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2726 0 : PyErr_NoMemory();
2727 0 : talloc_free(ret); return NULL;
2728 : }
2729 2685 : ret->srv = *(struct dnsp_srv *)pytalloc_get_ptr(in);
2730 2685 : break;
2731 :
2732 0 : default:
2733 0 : if (in == NULL) {
2734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->data");
2735 0 : talloc_free(ret); return NULL;
2736 : }
2737 0 : ret->data = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
2738 0 : break;
2739 :
2740 : }
2741 :
2742 9702 : return ret;
2743 : }
2744 :
2745 9840 : static PyObject *py_dnsRecordData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2746 : {
2747 9840 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2748 9840 : PyObject *mem_ctx_obj = NULL;
2749 9840 : TALLOC_CTX *mem_ctx = NULL;
2750 9840 : int level = 0;
2751 9840 : PyObject *in_obj = NULL;
2752 9840 : union dnsRecordData *in = NULL;
2753 :
2754 9840 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2755 : discard_const_p(char *, kwnames),
2756 : &mem_ctx_obj,
2757 : &level,
2758 : &in_obj)) {
2759 0 : return NULL;
2760 : }
2761 9840 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2762 9840 : if (mem_ctx == NULL) {
2763 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2764 0 : return NULL;
2765 : }
2766 9840 : in = (union dnsRecordData *)pytalloc_get_ptr(in_obj);
2767 9840 : if (in == NULL) {
2768 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dnsRecordData!");
2769 0 : return NULL;
2770 : }
2771 :
2772 9840 : return py_import_dnsRecordData(mem_ctx, level, in);
2773 : }
2774 :
2775 11571 : static PyObject *py_dnsRecordData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2776 : {
2777 11571 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2778 11571 : PyObject *mem_ctx_obj = NULL;
2779 11571 : TALLOC_CTX *mem_ctx = NULL;
2780 11571 : int level = 0;
2781 11571 : PyObject *in = NULL;
2782 11571 : union dnsRecordData *out = NULL;
2783 :
2784 11571 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2785 : discard_const_p(char *, kwnames),
2786 : &mem_ctx_obj,
2787 : &level,
2788 : &in)) {
2789 0 : return NULL;
2790 : }
2791 11571 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2792 11571 : if (mem_ctx == NULL) {
2793 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2794 0 : return NULL;
2795 : }
2796 :
2797 11571 : out = py_export_dnsRecordData(mem_ctx, level, in);
2798 11571 : if (out == NULL) {
2799 0 : return NULL;
2800 : }
2801 :
2802 11571 : return pytalloc_GenericObject_reference(out);
2803 : }
2804 :
2805 : static PyMethodDef py_dnsRecordData_methods[] = {
2806 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsRecordData_import),
2807 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2808 : "T.__import__(mem_ctx, level, in) => ret." },
2809 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsRecordData_export),
2810 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2811 : "T.__export__(mem_ctx, level, in) => ret." },
2812 : { NULL, NULL, 0, NULL }
2813 : };
2814 :
2815 0 : static PyObject *py_dnsRecordData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2816 : {
2817 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2818 0 : return NULL;
2819 : }
2820 :
2821 :
2822 : static PyTypeObject dnsRecordData_Type = {
2823 : PyVarObject_HEAD_INIT(NULL, 0)
2824 : .tp_name = "dnsp.dnsRecordData",
2825 : .tp_getset = NULL,
2826 : .tp_methods = py_dnsRecordData_methods,
2827 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2828 : .tp_new = py_dnsRecordData_new,
2829 : };
2830 :
2831 :
2832 18 : static PyObject *py_dnsp_DnssrvRpcRecord_get_wDataLength(PyObject *obj, void *closure)
2833 : {
2834 18 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
2835 0 : PyObject *py_wDataLength;
2836 18 : py_wDataLength = PyLong_FromLong((uint16_t)(object->wDataLength));
2837 18 : return py_wDataLength;
2838 : }
2839 :
2840 0 : static int py_dnsp_DnssrvRpcRecord_set_wDataLength(PyObject *py_obj, PyObject *value, void *closure)
2841 : {
2842 0 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
2843 0 : if (value == NULL) {
2844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wDataLength");
2845 0 : return -1;
2846 : }
2847 : {
2848 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wDataLength));
2849 0 : if (PyLong_Check(value)) {
2850 0 : unsigned long long test_var;
2851 0 : test_var = PyLong_AsUnsignedLongLong(value);
2852 0 : if (PyErr_Occurred() != NULL) {
2853 0 : return -1;
2854 : }
2855 0 : if (test_var > uint_max) {
2856 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2857 : PyLong_Type.tp_name, uint_max, test_var);
2858 0 : return -1;
2859 : }
2860 0 : object->wDataLength = test_var;
2861 : } else {
2862 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2863 : PyLong_Type.tp_name);
2864 0 : return -1;
2865 : }
2866 : }
2867 0 : return 0;
2868 : }
2869 :
2870 22601 : static PyObject *py_dnsp_DnssrvRpcRecord_get_wType(PyObject *obj, void *closure)
2871 : {
2872 22601 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
2873 114 : PyObject *py_wType;
2874 22601 : py_wType = PyLong_FromLong((uint16_t)(object->wType));
2875 22601 : return py_wType;
2876 : }
2877 :
2878 11573 : static int py_dnsp_DnssrvRpcRecord_set_wType(PyObject *py_obj, PyObject *value, void *closure)
2879 : {
2880 11573 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
2881 11573 : if (value == NULL) {
2882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wType");
2883 0 : return -1;
2884 : }
2885 : {
2886 11573 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wType));
2887 11573 : if (PyLong_Check(value)) {
2888 1869 : unsigned long long test_var;
2889 11573 : test_var = PyLong_AsUnsignedLongLong(value);
2890 11573 : if (PyErr_Occurred() != NULL) {
2891 0 : return -1;
2892 : }
2893 11573 : if (test_var > uint_max) {
2894 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2895 : PyLong_Type.tp_name, uint_max, test_var);
2896 0 : return -1;
2897 : }
2898 11573 : object->wType = test_var;
2899 : } else {
2900 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2901 : PyLong_Type.tp_name);
2902 0 : return -1;
2903 : }
2904 : }
2905 11573 : return 0;
2906 : }
2907 :
2908 12 : static PyObject *py_dnsp_DnssrvRpcRecord_get_version(PyObject *obj, void *closure)
2909 : {
2910 12 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
2911 0 : PyObject *py_version;
2912 12 : py_version = PyLong_FromLong((uint16_t)(object->version));
2913 12 : return py_version;
2914 : }
2915 :
2916 2 : static int py_dnsp_DnssrvRpcRecord_set_version(PyObject *py_obj, PyObject *value, void *closure)
2917 : {
2918 2 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
2919 2 : if (value == NULL) {
2920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
2921 0 : return -1;
2922 : }
2923 : {
2924 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
2925 2 : if (PyLong_Check(value)) {
2926 0 : unsigned long long test_var;
2927 2 : test_var = PyLong_AsUnsignedLongLong(value);
2928 2 : if (PyErr_Occurred() != NULL) {
2929 0 : return -1;
2930 : }
2931 2 : if (test_var > uint_max) {
2932 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2933 : PyLong_Type.tp_name, uint_max, test_var);
2934 0 : return -1;
2935 : }
2936 2 : object->version = test_var;
2937 : } else {
2938 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2939 : PyLong_Type.tp_name);
2940 0 : return -1;
2941 : }
2942 : }
2943 2 : return 0;
2944 : }
2945 :
2946 1294 : static PyObject *py_dnsp_DnssrvRpcRecord_get_rank(PyObject *obj, void *closure)
2947 : {
2948 1294 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
2949 0 : PyObject *py_rank;
2950 1294 : py_rank = PyLong_FromLong((uint16_t)(object->rank));
2951 1294 : return py_rank;
2952 : }
2953 :
2954 11341 : static int py_dnsp_DnssrvRpcRecord_set_rank(PyObject *py_obj, PyObject *value, void *closure)
2955 : {
2956 11341 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
2957 11341 : if (value == NULL) {
2958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rank");
2959 0 : return -1;
2960 : }
2961 : {
2962 11341 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rank));
2963 11341 : if (PyLong_Check(value)) {
2964 1869 : unsigned long long test_var;
2965 11341 : test_var = PyLong_AsUnsignedLongLong(value);
2966 11341 : if (PyErr_Occurred() != NULL) {
2967 0 : return -1;
2968 : }
2969 11341 : if (test_var > uint_max) {
2970 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2971 : PyLong_Type.tp_name, uint_max, test_var);
2972 0 : return -1;
2973 : }
2974 11341 : object->rank = test_var;
2975 : } else {
2976 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2977 : PyLong_Type.tp_name);
2978 0 : return -1;
2979 : }
2980 : }
2981 11341 : return 0;
2982 : }
2983 :
2984 42 : static PyObject *py_dnsp_DnssrvRpcRecord_get_flags(PyObject *obj, void *closure)
2985 : {
2986 42 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
2987 0 : PyObject *py_flags;
2988 42 : py_flags = PyLong_FromLong((uint16_t)(object->flags));
2989 42 : return py_flags;
2990 : }
2991 :
2992 8 : static int py_dnsp_DnssrvRpcRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
2993 : {
2994 8 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
2995 8 : if (value == NULL) {
2996 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
2997 0 : return -1;
2998 : }
2999 : {
3000 8 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
3001 8 : if (PyLong_Check(value)) {
3002 0 : unsigned long long test_var;
3003 8 : test_var = PyLong_AsUnsignedLongLong(value);
3004 8 : if (PyErr_Occurred() != NULL) {
3005 0 : return -1;
3006 : }
3007 8 : if (test_var > uint_max) {
3008 2 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3009 : PyLong_Type.tp_name, uint_max, test_var);
3010 2 : return -1;
3011 : }
3012 6 : object->flags = test_var;
3013 : } else {
3014 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3015 : PyLong_Type.tp_name);
3016 0 : return -1;
3017 : }
3018 : }
3019 6 : return 0;
3020 : }
3021 :
3022 32 : static PyObject *py_dnsp_DnssrvRpcRecord_get_dwSerial(PyObject *obj, void *closure)
3023 : {
3024 32 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
3025 0 : PyObject *py_dwSerial;
3026 32 : py_dwSerial = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSerial));
3027 32 : return py_dwSerial;
3028 : }
3029 :
3030 11331 : static int py_dnsp_DnssrvRpcRecord_set_dwSerial(PyObject *py_obj, PyObject *value, void *closure)
3031 : {
3032 11331 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3033 11331 : if (value == NULL) {
3034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSerial");
3035 0 : return -1;
3036 : }
3037 : {
3038 11331 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSerial));
3039 11331 : if (PyLong_Check(value)) {
3040 1869 : unsigned long long test_var;
3041 11331 : test_var = PyLong_AsUnsignedLongLong(value);
3042 11331 : if (PyErr_Occurred() != NULL) {
3043 0 : return -1;
3044 : }
3045 11331 : if (test_var > uint_max) {
3046 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3047 : PyLong_Type.tp_name, uint_max, test_var);
3048 0 : return -1;
3049 : }
3050 11331 : object->dwSerial = test_var;
3051 : } else {
3052 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3053 : PyLong_Type.tp_name);
3054 0 : return -1;
3055 : }
3056 : }
3057 11331 : return 0;
3058 : }
3059 :
3060 1296 : static PyObject *py_dnsp_DnssrvRpcRecord_get_dwTtlSeconds(PyObject *obj, void *closure)
3061 : {
3062 1296 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
3063 0 : PyObject *py_dwTtlSeconds;
3064 1296 : py_dwTtlSeconds = PyLong_FromUnsignedLongLong((uint32_t)(object->dwTtlSeconds));
3065 1296 : return py_dwTtlSeconds;
3066 : }
3067 :
3068 11337 : static int py_dnsp_DnssrvRpcRecord_set_dwTtlSeconds(PyObject *py_obj, PyObject *value, void *closure)
3069 : {
3070 11337 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3071 11337 : if (value == NULL) {
3072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwTtlSeconds");
3073 0 : return -1;
3074 : }
3075 : {
3076 11337 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwTtlSeconds));
3077 11337 : if (PyLong_Check(value)) {
3078 1869 : unsigned long long test_var;
3079 11337 : test_var = PyLong_AsUnsignedLongLong(value);
3080 11337 : if (PyErr_Occurred() != NULL) {
3081 0 : return -1;
3082 : }
3083 11337 : if (test_var > uint_max) {
3084 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3085 : PyLong_Type.tp_name, uint_max, test_var);
3086 0 : return -1;
3087 : }
3088 11337 : object->dwTtlSeconds = test_var;
3089 : } else {
3090 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3091 : PyLong_Type.tp_name);
3092 0 : return -1;
3093 : }
3094 : }
3095 11337 : return 0;
3096 : }
3097 :
3098 38 : static PyObject *py_dnsp_DnssrvRpcRecord_get_dwReserved(PyObject *obj, void *closure)
3099 : {
3100 38 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
3101 0 : PyObject *py_dwReserved;
3102 38 : py_dwReserved = PyLong_FromUnsignedLongLong((uint32_t)(object->dwReserved));
3103 38 : return py_dwReserved;
3104 : }
3105 :
3106 4 : static int py_dnsp_DnssrvRpcRecord_set_dwReserved(PyObject *py_obj, PyObject *value, void *closure)
3107 : {
3108 4 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3109 4 : if (value == NULL) {
3110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReserved");
3111 0 : return -1;
3112 : }
3113 : {
3114 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReserved));
3115 4 : if (PyLong_Check(value)) {
3116 0 : unsigned long long test_var;
3117 4 : test_var = PyLong_AsUnsignedLongLong(value);
3118 4 : if (PyErr_Occurred() != NULL) {
3119 0 : return -1;
3120 : }
3121 4 : if (test_var > uint_max) {
3122 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3123 : PyLong_Type.tp_name, uint_max, test_var);
3124 0 : return -1;
3125 : }
3126 4 : object->dwReserved = test_var;
3127 : } else {
3128 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3129 : PyLong_Type.tp_name);
3130 0 : return -1;
3131 : }
3132 : }
3133 4 : return 0;
3134 : }
3135 :
3136 5246 : static PyObject *py_dnsp_DnssrvRpcRecord_get_dwTimeStamp(PyObject *obj, void *closure)
3137 : {
3138 5246 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
3139 0 : PyObject *py_dwTimeStamp;
3140 5246 : py_dwTimeStamp = PyLong_FromUnsignedLongLong((uint32_t)(object->dwTimeStamp));
3141 5246 : return py_dwTimeStamp;
3142 : }
3143 :
3144 1457 : static int py_dnsp_DnssrvRpcRecord_set_dwTimeStamp(PyObject *py_obj, PyObject *value, void *closure)
3145 : {
3146 1457 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3147 1457 : if (value == NULL) {
3148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwTimeStamp");
3149 0 : return -1;
3150 : }
3151 : {
3152 1457 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwTimeStamp));
3153 1457 : if (PyLong_Check(value)) {
3154 0 : unsigned long long test_var;
3155 1457 : test_var = PyLong_AsUnsignedLongLong(value);
3156 1457 : if (PyErr_Occurred() != NULL) {
3157 0 : return -1;
3158 : }
3159 1457 : if (test_var > uint_max) {
3160 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3161 : PyLong_Type.tp_name, uint_max, test_var);
3162 0 : return -1;
3163 : }
3164 1457 : object->dwTimeStamp = test_var;
3165 : } else {
3166 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3167 : PyLong_Type.tp_name);
3168 0 : return -1;
3169 : }
3170 : }
3171 1457 : return 0;
3172 : }
3173 :
3174 9840 : static PyObject *py_dnsp_DnssrvRpcRecord_get_data(PyObject *obj, void *closure)
3175 : {
3176 9840 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(obj);
3177 31 : PyObject *py_data;
3178 9840 : py_data = pyrpc_import_union(&dnsRecordData_Type, pytalloc_get_mem_ctx(obj), object->wType, &object->data, "union dnsRecordData");
3179 9840 : if (py_data == NULL) {
3180 0 : return NULL;
3181 : }
3182 9809 : return py_data;
3183 : }
3184 :
3185 11571 : static int py_dnsp_DnssrvRpcRecord_set_data(PyObject *py_obj, PyObject *value, void *closure)
3186 : {
3187 11571 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3188 11571 : if (value == NULL) {
3189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
3190 0 : return -1;
3191 : }
3192 : {
3193 1869 : union dnsRecordData *data_switch_0;
3194 11571 : data_switch_0 = (union dnsRecordData *)pyrpc_export_union(&dnsRecordData_Type, pytalloc_get_mem_ctx(py_obj), object->wType, value, "union dnsRecordData");
3195 11571 : if (data_switch_0 == NULL) {
3196 0 : return -1;
3197 : }
3198 11571 : object->data = *data_switch_0;
3199 : }
3200 11571 : return 0;
3201 : }
3202 :
3203 : static PyGetSetDef py_dnsp_DnssrvRpcRecord_getsetters[] = {
3204 : {
3205 : .name = discard_const_p(char, "wDataLength"),
3206 : .get = py_dnsp_DnssrvRpcRecord_get_wDataLength,
3207 : .set = py_dnsp_DnssrvRpcRecord_set_wDataLength,
3208 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3209 : },
3210 : {
3211 : .name = discard_const_p(char, "wType"),
3212 : .get = py_dnsp_DnssrvRpcRecord_get_wType,
3213 : .set = py_dnsp_DnssrvRpcRecord_set_wType,
3214 : .doc = discard_const_p(char, "PIDL-generated element of base type dns_record_type")
3215 : },
3216 : {
3217 : .name = discard_const_p(char, "version"),
3218 : .get = py_dnsp_DnssrvRpcRecord_get_version,
3219 : .set = py_dnsp_DnssrvRpcRecord_set_version,
3220 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3221 : },
3222 : {
3223 : .name = discard_const_p(char, "rank"),
3224 : .get = py_dnsp_DnssrvRpcRecord_get_rank,
3225 : .set = py_dnsp_DnssrvRpcRecord_set_rank,
3226 : .doc = discard_const_p(char, "PIDL-generated element of base type dns_record_rank")
3227 : },
3228 : {
3229 : .name = discard_const_p(char, "flags"),
3230 : .get = py_dnsp_DnssrvRpcRecord_get_flags,
3231 : .set = py_dnsp_DnssrvRpcRecord_set_flags,
3232 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3233 : },
3234 : {
3235 : .name = discard_const_p(char, "dwSerial"),
3236 : .get = py_dnsp_DnssrvRpcRecord_get_dwSerial,
3237 : .set = py_dnsp_DnssrvRpcRecord_set_dwSerial,
3238 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3239 : },
3240 : {
3241 : .name = discard_const_p(char, "dwTtlSeconds"),
3242 : .get = py_dnsp_DnssrvRpcRecord_get_dwTtlSeconds,
3243 : .set = py_dnsp_DnssrvRpcRecord_set_dwTtlSeconds,
3244 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3245 : },
3246 : {
3247 : .name = discard_const_p(char, "dwReserved"),
3248 : .get = py_dnsp_DnssrvRpcRecord_get_dwReserved,
3249 : .set = py_dnsp_DnssrvRpcRecord_set_dwReserved,
3250 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3251 : },
3252 : {
3253 : .name = discard_const_p(char, "dwTimeStamp"),
3254 : .get = py_dnsp_DnssrvRpcRecord_get_dwTimeStamp,
3255 : .set = py_dnsp_DnssrvRpcRecord_set_dwTimeStamp,
3256 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3257 : },
3258 : {
3259 : .name = discard_const_p(char, "data"),
3260 : .get = py_dnsp_DnssrvRpcRecord_get_data,
3261 : .set = py_dnsp_DnssrvRpcRecord_set_data,
3262 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsRecordData")
3263 : },
3264 : { .name = NULL }
3265 : };
3266 :
3267 25212 : static PyObject *py_dnsp_DnssrvRpcRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3268 : {
3269 25212 : return pytalloc_new(struct dnsp_DnssrvRpcRecord, type);
3270 : }
3271 :
3272 12378 : static PyObject *py_dnsp_DnssrvRpcRecord_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3273 : {
3274 12378 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3275 12378 : PyObject *ret = NULL;
3276 1869 : DATA_BLOB blob;
3277 1869 : enum ndr_err_code err;
3278 12378 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3279 12378 : if (tmp_ctx == NULL) {
3280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3281 0 : return NULL;
3282 : }
3283 12378 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_DnssrvRpcRecord);
3284 12378 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3285 0 : TALLOC_FREE(tmp_ctx);
3286 0 : PyErr_SetNdrError(err);
3287 0 : return NULL;
3288 : }
3289 :
3290 12378 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3291 12378 : TALLOC_FREE(tmp_ctx);
3292 12378 : return ret;
3293 : }
3294 :
3295 13645 : static PyObject *py_dnsp_DnssrvRpcRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3296 : {
3297 13645 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3298 13645 : DATA_BLOB blob = {.data = NULL, .length = 0};
3299 13645 : Py_ssize_t blob_length = 0;
3300 31 : enum ndr_err_code err;
3301 13645 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3302 13645 : PyObject *allow_remaining_obj = NULL;
3303 13645 : bool allow_remaining = false;
3304 :
3305 13645 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3306 : discard_const_p(char *, kwnames),
3307 : &blob.data, &blob_length,
3308 : &allow_remaining_obj)) {
3309 0 : return NULL;
3310 : }
3311 13645 : blob.length = blob_length;
3312 :
3313 13645 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3314 0 : allow_remaining = true;
3315 : }
3316 :
3317 13614 : if (allow_remaining) {
3318 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnssrvRpcRecord);
3319 : } else {
3320 13645 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnssrvRpcRecord);
3321 : }
3322 13645 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3323 0 : PyErr_SetNdrError(err);
3324 0 : return NULL;
3325 : }
3326 :
3327 13645 : Py_RETURN_NONE;
3328 : }
3329 :
3330 0 : static PyObject *py_dnsp_DnssrvRpcRecord_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3331 : {
3332 0 : struct dnsp_DnssrvRpcRecord *object = pytalloc_get_ptr(py_obj);
3333 0 : PyObject *ret;
3334 0 : char *retstr;
3335 :
3336 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_DnssrvRpcRecord, "dnsp_DnssrvRpcRecord", object);
3337 0 : ret = PyUnicode_FromString(retstr);
3338 0 : talloc_free(retstr);
3339 :
3340 0 : return ret;
3341 : }
3342 :
3343 : static PyMethodDef py_dnsp_DnssrvRpcRecord_methods[] = {
3344 : { "__ndr_pack__", (PyCFunction)py_dnsp_DnssrvRpcRecord_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3345 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_DnssrvRpcRecord_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3346 : { "__ndr_print__", (PyCFunction)py_dnsp_DnssrvRpcRecord_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3347 : { NULL, NULL, 0, NULL }
3348 : };
3349 :
3350 :
3351 : static PyTypeObject dnsp_DnssrvRpcRecord_Type = {
3352 : PyVarObject_HEAD_INIT(NULL, 0)
3353 : .tp_name = "dnsp.DnssrvRpcRecord",
3354 : .tp_getset = py_dnsp_DnssrvRpcRecord_getsetters,
3355 : .tp_methods = py_dnsp_DnssrvRpcRecord_methods,
3356 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3357 : .tp_new = py_dnsp_DnssrvRpcRecord_new,
3358 : };
3359 :
3360 42 : static PyObject *py_import_dnsPropertyData(TALLOC_CTX *mem_ctx, int level, union dnsPropertyData *in)
3361 : {
3362 0 : PyObject *ret;
3363 :
3364 42 : switch (level) {
3365 0 : case DSPROPERTY_ZONE_EMPTY:
3366 0 : ret = Py_None;
3367 0 : Py_INCREF(ret);
3368 0 : return ret;
3369 :
3370 6 : case DSPROPERTY_ZONE_TYPE:
3371 6 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->zone_type));
3372 6 : return ret;
3373 :
3374 6 : case DSPROPERTY_ZONE_ALLOW_UPDATE:
3375 6 : ret = PyLong_FromLong((uint16_t)(in->allow_update_flag));
3376 6 : return ret;
3377 :
3378 6 : case DSPROPERTY_ZONE_SECURE_TIME:
3379 6 : ret = PyLong_FromUnsignedLongLong(in->zone_secure_time);
3380 6 : return ret;
3381 :
3382 6 : case DSPROPERTY_ZONE_NOREFRESH_INTERVAL:
3383 6 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->norefresh_hours));
3384 6 : return ret;
3385 :
3386 6 : case DSPROPERTY_ZONE_REFRESH_INTERVAL:
3387 6 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->refresh_hours));
3388 6 : return ret;
3389 :
3390 6 : case DSPROPERTY_ZONE_AGING_STATE:
3391 6 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->aging_enabled));
3392 6 : return ret;
3393 :
3394 0 : case DSPROPERTY_ZONE_SCAVENGING_SERVERS:
3395 0 : ret = pytalloc_reference_ex(&dnsp_ip4_array_Type, mem_ctx, &in->servers);
3396 0 : return ret;
3397 :
3398 6 : case DSPROPERTY_ZONE_AGING_ENABLED_TIME:
3399 6 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->next_scavenging_cycle_hours));
3400 6 : return ret;
3401 :
3402 0 : case DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME:
3403 0 : ret = PyString_FromStringOrNULL(in->deleted_by_hostname);
3404 0 : return ret;
3405 :
3406 0 : case DSPROPERTY_ZONE_MASTER_SERVERS:
3407 0 : ret = pytalloc_reference_ex(&dnsp_ip4_array_Type, mem_ctx, &in->master_servers);
3408 0 : return ret;
3409 :
3410 0 : case DSPROPERTY_ZONE_AUTO_NS_SERVERS:
3411 0 : ret = pytalloc_reference_ex(&dnsp_ip4_array_Type, mem_ctx, &in->ns_servers);
3412 0 : return ret;
3413 :
3414 0 : case DSPROPERTY_ZONE_DCPROMO_CONVERT:
3415 0 : ret = PyLong_FromLong((uint16_t)(in->dcpromo_flag));
3416 0 : return ret;
3417 :
3418 0 : case DSPROPERTY_ZONE_SCAVENGING_SERVERS_DA:
3419 0 : ret = pytalloc_reference_ex(&dnsp_dns_addr_array_Type, mem_ctx, &in->s_ns_servers);
3420 0 : return ret;
3421 :
3422 0 : case DSPROPERTY_ZONE_MASTER_SERVERS_DA:
3423 0 : ret = pytalloc_reference_ex(&dnsp_dns_addr_array_Type, mem_ctx, &in->z_master_servers);
3424 0 : return ret;
3425 :
3426 0 : case DSPROPERTY_ZONE_NS_SERVERS_DA:
3427 0 : ret = pytalloc_reference_ex(&dnsp_dns_addr_array_Type, mem_ctx, &in->d_ns_servers);
3428 0 : return ret;
3429 :
3430 0 : case DSPROPERTY_ZONE_NODE_DBFLAGS:
3431 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->flags));
3432 0 : return ret;
3433 :
3434 : }
3435 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
3436 0 : return NULL;
3437 : }
3438 :
3439 2520 : static union dnsPropertyData *py_export_dnsPropertyData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
3440 : {
3441 2520 : union dnsPropertyData *ret = talloc_zero(mem_ctx, union dnsPropertyData);
3442 2520 : switch (level) {
3443 0 : case DSPROPERTY_ZONE_EMPTY:
3444 0 : break;
3445 :
3446 360 : case DSPROPERTY_ZONE_TYPE:
3447 360 : if (in == NULL) {
3448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->zone_type");
3449 0 : talloc_free(ret); return NULL;
3450 : }
3451 : {
3452 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->zone_type));
3453 360 : if (PyLong_Check(in)) {
3454 63 : unsigned long long test_var;
3455 360 : test_var = PyLong_AsUnsignedLongLong(in);
3456 360 : if (PyErr_Occurred() != NULL) {
3457 0 : talloc_free(ret); return NULL;
3458 : }
3459 360 : if (test_var > uint_max) {
3460 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3461 : PyLong_Type.tp_name, uint_max, test_var);
3462 0 : talloc_free(ret); return NULL;
3463 : }
3464 360 : ret->zone_type = test_var;
3465 : } else {
3466 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3467 : PyLong_Type.tp_name);
3468 0 : talloc_free(ret); return NULL;
3469 : }
3470 : }
3471 360 : break;
3472 :
3473 360 : case DSPROPERTY_ZONE_ALLOW_UPDATE:
3474 360 : if (in == NULL) {
3475 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->allow_update_flag");
3476 0 : talloc_free(ret); return NULL;
3477 : }
3478 : {
3479 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->allow_update_flag));
3480 360 : if (PyLong_Check(in)) {
3481 63 : unsigned long long test_var;
3482 360 : test_var = PyLong_AsUnsignedLongLong(in);
3483 360 : if (PyErr_Occurred() != NULL) {
3484 0 : talloc_free(ret); return NULL;
3485 : }
3486 360 : if (test_var > uint_max) {
3487 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3488 : PyLong_Type.tp_name, uint_max, test_var);
3489 0 : talloc_free(ret); return NULL;
3490 : }
3491 360 : ret->allow_update_flag = test_var;
3492 : } else {
3493 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3494 : PyLong_Type.tp_name);
3495 0 : talloc_free(ret); return NULL;
3496 : }
3497 : }
3498 360 : break;
3499 :
3500 360 : case DSPROPERTY_ZONE_SECURE_TIME:
3501 360 : if (in == NULL) {
3502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->zone_secure_time");
3503 0 : talloc_free(ret); return NULL;
3504 : }
3505 : {
3506 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->zone_secure_time));
3507 360 : if (PyLong_Check(in)) {
3508 63 : unsigned long long test_var;
3509 360 : test_var = PyLong_AsUnsignedLongLong(in);
3510 360 : if (PyErr_Occurred() != NULL) {
3511 0 : talloc_free(ret); return NULL;
3512 : }
3513 360 : if (test_var > uint_max) {
3514 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3515 : PyLong_Type.tp_name, uint_max, test_var);
3516 0 : talloc_free(ret); return NULL;
3517 : }
3518 360 : ret->zone_secure_time = test_var;
3519 : } else {
3520 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3521 : PyLong_Type.tp_name);
3522 0 : talloc_free(ret); return NULL;
3523 : }
3524 : }
3525 360 : break;
3526 :
3527 360 : case DSPROPERTY_ZONE_NOREFRESH_INTERVAL:
3528 360 : if (in == NULL) {
3529 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->norefresh_hours");
3530 0 : talloc_free(ret); return NULL;
3531 : }
3532 : {
3533 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->norefresh_hours));
3534 360 : if (PyLong_Check(in)) {
3535 63 : unsigned long long test_var;
3536 360 : test_var = PyLong_AsUnsignedLongLong(in);
3537 360 : if (PyErr_Occurred() != NULL) {
3538 0 : talloc_free(ret); return NULL;
3539 : }
3540 360 : if (test_var > uint_max) {
3541 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3542 : PyLong_Type.tp_name, uint_max, test_var);
3543 0 : talloc_free(ret); return NULL;
3544 : }
3545 360 : ret->norefresh_hours = test_var;
3546 : } else {
3547 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3548 : PyLong_Type.tp_name);
3549 0 : talloc_free(ret); return NULL;
3550 : }
3551 : }
3552 360 : break;
3553 :
3554 360 : case DSPROPERTY_ZONE_REFRESH_INTERVAL:
3555 360 : if (in == NULL) {
3556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->refresh_hours");
3557 0 : talloc_free(ret); return NULL;
3558 : }
3559 : {
3560 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->refresh_hours));
3561 360 : if (PyLong_Check(in)) {
3562 63 : unsigned long long test_var;
3563 360 : test_var = PyLong_AsUnsignedLongLong(in);
3564 360 : if (PyErr_Occurred() != NULL) {
3565 0 : talloc_free(ret); return NULL;
3566 : }
3567 360 : if (test_var > uint_max) {
3568 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3569 : PyLong_Type.tp_name, uint_max, test_var);
3570 0 : talloc_free(ret); return NULL;
3571 : }
3572 360 : ret->refresh_hours = test_var;
3573 : } else {
3574 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3575 : PyLong_Type.tp_name);
3576 0 : talloc_free(ret); return NULL;
3577 : }
3578 : }
3579 360 : break;
3580 :
3581 360 : case DSPROPERTY_ZONE_AGING_STATE:
3582 360 : if (in == NULL) {
3583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->aging_enabled");
3584 0 : talloc_free(ret); return NULL;
3585 : }
3586 : {
3587 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->aging_enabled));
3588 360 : if (PyLong_Check(in)) {
3589 63 : unsigned long long test_var;
3590 360 : test_var = PyLong_AsUnsignedLongLong(in);
3591 360 : if (PyErr_Occurred() != NULL) {
3592 0 : talloc_free(ret); return NULL;
3593 : }
3594 360 : if (test_var > uint_max) {
3595 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3596 : PyLong_Type.tp_name, uint_max, test_var);
3597 0 : talloc_free(ret); return NULL;
3598 : }
3599 360 : ret->aging_enabled = test_var;
3600 : } else {
3601 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3602 : PyLong_Type.tp_name);
3603 0 : talloc_free(ret); return NULL;
3604 : }
3605 : }
3606 360 : break;
3607 :
3608 0 : case DSPROPERTY_ZONE_SCAVENGING_SERVERS:
3609 0 : if (in == NULL) {
3610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->servers");
3611 0 : talloc_free(ret); return NULL;
3612 : }
3613 0 : PY_CHECK_TYPE(&dnsp_ip4_array_Type, in, talloc_free(ret); return NULL;);
3614 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3615 0 : PyErr_NoMemory();
3616 0 : talloc_free(ret); return NULL;
3617 : }
3618 0 : ret->servers = *(struct dnsp_ip4_array *)pytalloc_get_ptr(in);
3619 0 : break;
3620 :
3621 360 : case DSPROPERTY_ZONE_AGING_ENABLED_TIME:
3622 360 : if (in == NULL) {
3623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->next_scavenging_cycle_hours");
3624 0 : talloc_free(ret); return NULL;
3625 : }
3626 : {
3627 360 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->next_scavenging_cycle_hours));
3628 360 : if (PyLong_Check(in)) {
3629 63 : unsigned long long test_var;
3630 360 : test_var = PyLong_AsUnsignedLongLong(in);
3631 360 : if (PyErr_Occurred() != NULL) {
3632 0 : talloc_free(ret); return NULL;
3633 : }
3634 360 : if (test_var > uint_max) {
3635 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3636 : PyLong_Type.tp_name, uint_max, test_var);
3637 0 : talloc_free(ret); return NULL;
3638 : }
3639 360 : ret->next_scavenging_cycle_hours = test_var;
3640 : } else {
3641 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3642 : PyLong_Type.tp_name);
3643 0 : talloc_free(ret); return NULL;
3644 : }
3645 : }
3646 360 : break;
3647 :
3648 0 : case DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME:
3649 0 : if (in == NULL) {
3650 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->deleted_by_hostname");
3651 0 : talloc_free(ret); return NULL;
3652 : }
3653 : {
3654 0 : const char *test_str;
3655 0 : const char *talloc_str;
3656 0 : PyObject *unicode = NULL;
3657 0 : if (PyUnicode_Check(in)) {
3658 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
3659 0 : if (unicode == NULL) {
3660 0 : talloc_free(ret); return NULL;
3661 : }
3662 0 : test_str = PyBytes_AS_STRING(unicode);
3663 0 : } else if (PyBytes_Check(in)) {
3664 0 : test_str = PyBytes_AS_STRING(in);
3665 : } else {
3666 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
3667 0 : talloc_free(ret); return NULL;
3668 : }
3669 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
3670 0 : if (unicode != NULL) {
3671 0 : Py_DECREF(unicode);
3672 : }
3673 0 : if (talloc_str == NULL) {
3674 0 : PyErr_NoMemory();
3675 0 : talloc_free(ret); return NULL;
3676 : }
3677 0 : ret->deleted_by_hostname = talloc_str;
3678 : }
3679 0 : break;
3680 :
3681 0 : case DSPROPERTY_ZONE_MASTER_SERVERS:
3682 0 : if (in == NULL) {
3683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->master_servers");
3684 0 : talloc_free(ret); return NULL;
3685 : }
3686 0 : PY_CHECK_TYPE(&dnsp_ip4_array_Type, in, talloc_free(ret); return NULL;);
3687 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3688 0 : PyErr_NoMemory();
3689 0 : talloc_free(ret); return NULL;
3690 : }
3691 0 : ret->master_servers = *(struct dnsp_ip4_array *)pytalloc_get_ptr(in);
3692 0 : break;
3693 :
3694 0 : case DSPROPERTY_ZONE_AUTO_NS_SERVERS:
3695 0 : if (in == NULL) {
3696 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ns_servers");
3697 0 : talloc_free(ret); return NULL;
3698 : }
3699 0 : PY_CHECK_TYPE(&dnsp_ip4_array_Type, in, talloc_free(ret); return NULL;);
3700 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3701 0 : PyErr_NoMemory();
3702 0 : talloc_free(ret); return NULL;
3703 : }
3704 0 : ret->ns_servers = *(struct dnsp_ip4_array *)pytalloc_get_ptr(in);
3705 0 : break;
3706 :
3707 0 : case DSPROPERTY_ZONE_DCPROMO_CONVERT:
3708 0 : if (in == NULL) {
3709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dcpromo_flag");
3710 0 : talloc_free(ret); return NULL;
3711 : }
3712 : {
3713 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->dcpromo_flag));
3714 0 : if (PyLong_Check(in)) {
3715 0 : unsigned long long test_var;
3716 0 : test_var = PyLong_AsUnsignedLongLong(in);
3717 0 : if (PyErr_Occurred() != NULL) {
3718 0 : talloc_free(ret); return NULL;
3719 : }
3720 0 : if (test_var > uint_max) {
3721 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3722 : PyLong_Type.tp_name, uint_max, test_var);
3723 0 : talloc_free(ret); return NULL;
3724 : }
3725 0 : ret->dcpromo_flag = test_var;
3726 : } else {
3727 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3728 : PyLong_Type.tp_name);
3729 0 : talloc_free(ret); return NULL;
3730 : }
3731 : }
3732 0 : break;
3733 :
3734 0 : case DSPROPERTY_ZONE_SCAVENGING_SERVERS_DA:
3735 0 : if (in == NULL) {
3736 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->s_ns_servers");
3737 0 : talloc_free(ret); return NULL;
3738 : }
3739 0 : PY_CHECK_TYPE(&dnsp_dns_addr_array_Type, in, talloc_free(ret); return NULL;);
3740 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3741 0 : PyErr_NoMemory();
3742 0 : talloc_free(ret); return NULL;
3743 : }
3744 0 : ret->s_ns_servers = *(struct dnsp_dns_addr_array *)pytalloc_get_ptr(in);
3745 0 : break;
3746 :
3747 0 : case DSPROPERTY_ZONE_MASTER_SERVERS_DA:
3748 0 : if (in == NULL) {
3749 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->z_master_servers");
3750 0 : talloc_free(ret); return NULL;
3751 : }
3752 0 : PY_CHECK_TYPE(&dnsp_dns_addr_array_Type, in, talloc_free(ret); return NULL;);
3753 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3754 0 : PyErr_NoMemory();
3755 0 : talloc_free(ret); return NULL;
3756 : }
3757 0 : ret->z_master_servers = *(struct dnsp_dns_addr_array *)pytalloc_get_ptr(in);
3758 0 : break;
3759 :
3760 0 : case DSPROPERTY_ZONE_NS_SERVERS_DA:
3761 0 : if (in == NULL) {
3762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->d_ns_servers");
3763 0 : talloc_free(ret); return NULL;
3764 : }
3765 0 : PY_CHECK_TYPE(&dnsp_dns_addr_array_Type, in, talloc_free(ret); return NULL;);
3766 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3767 0 : PyErr_NoMemory();
3768 0 : talloc_free(ret); return NULL;
3769 : }
3770 0 : ret->d_ns_servers = *(struct dnsp_dns_addr_array *)pytalloc_get_ptr(in);
3771 0 : break;
3772 :
3773 0 : case DSPROPERTY_ZONE_NODE_DBFLAGS:
3774 0 : if (in == NULL) {
3775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->flags");
3776 0 : talloc_free(ret); return NULL;
3777 : }
3778 : {
3779 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->flags));
3780 0 : if (PyLong_Check(in)) {
3781 0 : unsigned long long test_var;
3782 0 : test_var = PyLong_AsUnsignedLongLong(in);
3783 0 : if (PyErr_Occurred() != NULL) {
3784 0 : talloc_free(ret); return NULL;
3785 : }
3786 0 : if (test_var > uint_max) {
3787 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3788 : PyLong_Type.tp_name, uint_max, test_var);
3789 0 : talloc_free(ret); return NULL;
3790 : }
3791 0 : ret->flags = test_var;
3792 : } else {
3793 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3794 : PyLong_Type.tp_name);
3795 0 : talloc_free(ret); return NULL;
3796 : }
3797 : }
3798 0 : break;
3799 :
3800 0 : default:
3801 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
3802 0 : talloc_free(ret);
3803 0 : ret = NULL;
3804 : }
3805 :
3806 2079 : return ret;
3807 : }
3808 :
3809 42 : static PyObject *py_dnsPropertyData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3810 : {
3811 42 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3812 42 : PyObject *mem_ctx_obj = NULL;
3813 42 : TALLOC_CTX *mem_ctx = NULL;
3814 42 : int level = 0;
3815 42 : PyObject *in_obj = NULL;
3816 42 : union dnsPropertyData *in = NULL;
3817 :
3818 42 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
3819 : discard_const_p(char *, kwnames),
3820 : &mem_ctx_obj,
3821 : &level,
3822 : &in_obj)) {
3823 0 : return NULL;
3824 : }
3825 42 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3826 42 : if (mem_ctx == NULL) {
3827 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3828 0 : return NULL;
3829 : }
3830 42 : in = (union dnsPropertyData *)pytalloc_get_ptr(in_obj);
3831 42 : if (in == NULL) {
3832 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dnsPropertyData!");
3833 0 : return NULL;
3834 : }
3835 :
3836 42 : return py_import_dnsPropertyData(mem_ctx, level, in);
3837 : }
3838 :
3839 2520 : static PyObject *py_dnsPropertyData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3840 : {
3841 2520 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3842 2520 : PyObject *mem_ctx_obj = NULL;
3843 2520 : TALLOC_CTX *mem_ctx = NULL;
3844 2520 : int level = 0;
3845 2520 : PyObject *in = NULL;
3846 2520 : union dnsPropertyData *out = NULL;
3847 :
3848 2520 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
3849 : discard_const_p(char *, kwnames),
3850 : &mem_ctx_obj,
3851 : &level,
3852 : &in)) {
3853 0 : return NULL;
3854 : }
3855 2520 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3856 2520 : if (mem_ctx == NULL) {
3857 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3858 0 : return NULL;
3859 : }
3860 :
3861 2520 : out = py_export_dnsPropertyData(mem_ctx, level, in);
3862 2520 : if (out == NULL) {
3863 0 : return NULL;
3864 : }
3865 :
3866 2520 : return pytalloc_GenericObject_reference(out);
3867 : }
3868 :
3869 : static PyMethodDef py_dnsPropertyData_methods[] = {
3870 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsPropertyData_import),
3871 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3872 : "T.__import__(mem_ctx, level, in) => ret." },
3873 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsPropertyData_export),
3874 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3875 : "T.__export__(mem_ctx, level, in) => ret." },
3876 : { NULL, NULL, 0, NULL }
3877 : };
3878 :
3879 0 : static PyObject *py_dnsPropertyData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3880 : {
3881 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
3882 0 : return NULL;
3883 : }
3884 :
3885 :
3886 : static PyTypeObject dnsPropertyData_Type = {
3887 : PyVarObject_HEAD_INIT(NULL, 0)
3888 : .tp_name = "dnsp.dnsPropertyData",
3889 : .tp_getset = NULL,
3890 : .tp_methods = py_dnsPropertyData_methods,
3891 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3892 : .tp_new = py_dnsPropertyData_new,
3893 : };
3894 :
3895 :
3896 0 : static PyObject *py_dnsp_DnsProperty_get_wDataLength(PyObject *obj, void *closure)
3897 : {
3898 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
3899 0 : PyObject *py_wDataLength;
3900 0 : py_wDataLength = PyLong_FromUnsignedLongLong((uint32_t)(object->wDataLength));
3901 0 : return py_wDataLength;
3902 : }
3903 :
3904 2520 : static int py_dnsp_DnsProperty_set_wDataLength(PyObject *py_obj, PyObject *value, void *closure)
3905 : {
3906 2520 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
3907 2520 : if (value == NULL) {
3908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wDataLength");
3909 0 : return -1;
3910 : }
3911 : {
3912 2520 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wDataLength));
3913 2520 : if (PyLong_Check(value)) {
3914 441 : unsigned long long test_var;
3915 2520 : test_var = PyLong_AsUnsignedLongLong(value);
3916 2520 : if (PyErr_Occurred() != NULL) {
3917 0 : return -1;
3918 : }
3919 2520 : if (test_var > uint_max) {
3920 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3921 : PyLong_Type.tp_name, uint_max, test_var);
3922 0 : return -1;
3923 : }
3924 2520 : object->wDataLength = test_var;
3925 : } else {
3926 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3927 : PyLong_Type.tp_name);
3928 0 : return -1;
3929 : }
3930 : }
3931 2520 : return 0;
3932 : }
3933 :
3934 0 : static PyObject *py_dnsp_DnsProperty_get_namelength(PyObject *obj, void *closure)
3935 : {
3936 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
3937 0 : PyObject *py_namelength;
3938 0 : py_namelength = PyLong_FromUnsignedLongLong((uint32_t)(object->namelength));
3939 0 : return py_namelength;
3940 : }
3941 :
3942 0 : static int py_dnsp_DnsProperty_set_namelength(PyObject *py_obj, PyObject *value, void *closure)
3943 : {
3944 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
3945 0 : if (value == NULL) {
3946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->namelength");
3947 0 : return -1;
3948 : }
3949 : {
3950 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->namelength));
3951 0 : if (PyLong_Check(value)) {
3952 0 : unsigned long long test_var;
3953 0 : test_var = PyLong_AsUnsignedLongLong(value);
3954 0 : if (PyErr_Occurred() != NULL) {
3955 0 : return -1;
3956 : }
3957 0 : if (test_var > uint_max) {
3958 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3959 : PyLong_Type.tp_name, uint_max, test_var);
3960 0 : return -1;
3961 : }
3962 0 : object->namelength = test_var;
3963 : } else {
3964 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3965 : PyLong_Type.tp_name);
3966 0 : return -1;
3967 : }
3968 : }
3969 0 : return 0;
3970 : }
3971 :
3972 0 : static PyObject *py_dnsp_DnsProperty_get_flag(PyObject *obj, void *closure)
3973 : {
3974 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
3975 0 : PyObject *py_flag;
3976 0 : py_flag = PyLong_FromUnsignedLongLong((uint32_t)(object->flag));
3977 0 : return py_flag;
3978 : }
3979 :
3980 0 : static int py_dnsp_DnsProperty_set_flag(PyObject *py_obj, PyObject *value, void *closure)
3981 : {
3982 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
3983 0 : if (value == NULL) {
3984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flag");
3985 0 : return -1;
3986 : }
3987 : {
3988 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flag));
3989 0 : if (PyLong_Check(value)) {
3990 0 : unsigned long long test_var;
3991 0 : test_var = PyLong_AsUnsignedLongLong(value);
3992 0 : if (PyErr_Occurred() != NULL) {
3993 0 : return -1;
3994 : }
3995 0 : if (test_var > uint_max) {
3996 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3997 : PyLong_Type.tp_name, uint_max, test_var);
3998 0 : return -1;
3999 : }
4000 0 : object->flag = test_var;
4001 : } else {
4002 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4003 : PyLong_Type.tp_name);
4004 0 : return -1;
4005 : }
4006 : }
4007 0 : return 0;
4008 : }
4009 :
4010 0 : static PyObject *py_dnsp_DnsProperty_get_version(PyObject *obj, void *closure)
4011 : {
4012 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
4013 0 : PyObject *py_version;
4014 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
4015 0 : return py_version;
4016 : }
4017 :
4018 2520 : static int py_dnsp_DnsProperty_set_version(PyObject *py_obj, PyObject *value, void *closure)
4019 : {
4020 2520 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4021 2520 : if (value == NULL) {
4022 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
4023 0 : return -1;
4024 : }
4025 : {
4026 2520 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
4027 2520 : if (PyLong_Check(value)) {
4028 441 : unsigned long long test_var;
4029 2520 : test_var = PyLong_AsUnsignedLongLong(value);
4030 2520 : if (PyErr_Occurred() != NULL) {
4031 0 : return -1;
4032 : }
4033 2520 : if (test_var > uint_max) {
4034 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4035 : PyLong_Type.tp_name, uint_max, test_var);
4036 0 : return -1;
4037 : }
4038 2520 : object->version = test_var;
4039 : } else {
4040 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4041 : PyLong_Type.tp_name);
4042 0 : return -1;
4043 : }
4044 : }
4045 2520 : return 0;
4046 : }
4047 :
4048 126 : static PyObject *py_dnsp_DnsProperty_get_id(PyObject *obj, void *closure)
4049 : {
4050 126 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
4051 0 : PyObject *py_id;
4052 126 : py_id = PyLong_FromUnsignedLongLong((uint32_t)(object->id));
4053 126 : return py_id;
4054 : }
4055 :
4056 2520 : static int py_dnsp_DnsProperty_set_id(PyObject *py_obj, PyObject *value, void *closure)
4057 : {
4058 2520 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4059 2520 : if (value == NULL) {
4060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->id");
4061 0 : return -1;
4062 : }
4063 : {
4064 2520 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id));
4065 2520 : if (PyLong_Check(value)) {
4066 441 : unsigned long long test_var;
4067 2520 : test_var = PyLong_AsUnsignedLongLong(value);
4068 2520 : if (PyErr_Occurred() != NULL) {
4069 0 : return -1;
4070 : }
4071 2520 : if (test_var > uint_max) {
4072 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4073 : PyLong_Type.tp_name, uint_max, test_var);
4074 0 : return -1;
4075 : }
4076 2520 : object->id = test_var;
4077 : } else {
4078 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4079 : PyLong_Type.tp_name);
4080 0 : return -1;
4081 : }
4082 : }
4083 2520 : return 0;
4084 : }
4085 :
4086 42 : static PyObject *py_dnsp_DnsProperty_get_data(PyObject *obj, void *closure)
4087 : {
4088 42 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
4089 0 : PyObject *py_data;
4090 42 : py_data = pyrpc_import_union(&dnsPropertyData_Type, pytalloc_get_mem_ctx(obj), object->id, &object->data, "union dnsPropertyData");
4091 42 : if (py_data == NULL) {
4092 0 : return NULL;
4093 : }
4094 42 : return py_data;
4095 : }
4096 :
4097 2520 : static int py_dnsp_DnsProperty_set_data(PyObject *py_obj, PyObject *value, void *closure)
4098 : {
4099 2520 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4100 2520 : if (value == NULL) {
4101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
4102 0 : return -1;
4103 : }
4104 : {
4105 441 : union dnsPropertyData *data_switch_0;
4106 2520 : data_switch_0 = (union dnsPropertyData *)pyrpc_export_union(&dnsPropertyData_Type, pytalloc_get_mem_ctx(py_obj), object->id, value, "union dnsPropertyData");
4107 2520 : if (data_switch_0 == NULL) {
4108 0 : return -1;
4109 : }
4110 2520 : object->data = *data_switch_0;
4111 : }
4112 2520 : return 0;
4113 : }
4114 :
4115 0 : static PyObject *py_dnsp_DnsProperty_get_name(PyObject *obj, void *closure)
4116 : {
4117 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(obj);
4118 0 : PyObject *py_name;
4119 0 : py_name = PyLong_FromUnsignedLongLong((uint32_t)(object->name));
4120 0 : return py_name;
4121 : }
4122 :
4123 0 : static int py_dnsp_DnsProperty_set_name(PyObject *py_obj, PyObject *value, void *closure)
4124 : {
4125 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4126 0 : if (value == NULL) {
4127 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
4128 0 : return -1;
4129 : }
4130 : {
4131 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name));
4132 0 : if (PyLong_Check(value)) {
4133 0 : unsigned long long test_var;
4134 0 : test_var = PyLong_AsUnsignedLongLong(value);
4135 0 : if (PyErr_Occurred() != NULL) {
4136 0 : return -1;
4137 : }
4138 0 : if (test_var > uint_max) {
4139 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4140 : PyLong_Type.tp_name, uint_max, test_var);
4141 0 : return -1;
4142 : }
4143 0 : object->name = test_var;
4144 : } else {
4145 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4146 : PyLong_Type.tp_name);
4147 0 : return -1;
4148 : }
4149 : }
4150 0 : return 0;
4151 : }
4152 :
4153 : static PyGetSetDef py_dnsp_DnsProperty_getsetters[] = {
4154 : {
4155 : .name = discard_const_p(char, "wDataLength"),
4156 : .get = py_dnsp_DnsProperty_get_wDataLength,
4157 : .set = py_dnsp_DnsProperty_set_wDataLength,
4158 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4159 : },
4160 : {
4161 : .name = discard_const_p(char, "namelength"),
4162 : .get = py_dnsp_DnsProperty_get_namelength,
4163 : .set = py_dnsp_DnsProperty_set_namelength,
4164 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4165 : },
4166 : {
4167 : .name = discard_const_p(char, "flag"),
4168 : .get = py_dnsp_DnsProperty_get_flag,
4169 : .set = py_dnsp_DnsProperty_set_flag,
4170 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4171 : },
4172 : {
4173 : .name = discard_const_p(char, "version"),
4174 : .get = py_dnsp_DnsProperty_get_version,
4175 : .set = py_dnsp_DnsProperty_set_version,
4176 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4177 : },
4178 : {
4179 : .name = discard_const_p(char, "id"),
4180 : .get = py_dnsp_DnsProperty_get_id,
4181 : .set = py_dnsp_DnsProperty_set_id,
4182 : .doc = discard_const_p(char, "PIDL-generated element of base type dns_property_id")
4183 : },
4184 : {
4185 : .name = discard_const_p(char, "data"),
4186 : .get = py_dnsp_DnsProperty_get_data,
4187 : .set = py_dnsp_DnsProperty_set_data,
4188 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsPropertyData")
4189 : },
4190 : {
4191 : .name = discard_const_p(char, "name"),
4192 : .get = py_dnsp_DnsProperty_get_name,
4193 : .set = py_dnsp_DnsProperty_set_name,
4194 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4195 : },
4196 : { .name = NULL }
4197 : };
4198 :
4199 2646 : static PyObject *py_dnsp_DnsProperty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4200 : {
4201 2646 : return pytalloc_new(struct dnsp_DnsProperty, type);
4202 : }
4203 :
4204 2529 : static PyObject *py_dnsp_DnsProperty_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4205 : {
4206 2529 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4207 2529 : PyObject *ret = NULL;
4208 441 : DATA_BLOB blob;
4209 441 : enum ndr_err_code err;
4210 2529 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4211 2529 : if (tmp_ctx == NULL) {
4212 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4213 0 : return NULL;
4214 : }
4215 2529 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_DnsProperty);
4216 2529 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4217 0 : TALLOC_FREE(tmp_ctx);
4218 0 : PyErr_SetNdrError(err);
4219 0 : return NULL;
4220 : }
4221 :
4222 2529 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4223 2529 : TALLOC_FREE(tmp_ctx);
4224 2529 : return ret;
4225 : }
4226 :
4227 126 : static PyObject *py_dnsp_DnsProperty_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4228 : {
4229 126 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4230 126 : DATA_BLOB blob = {.data = NULL, .length = 0};
4231 126 : Py_ssize_t blob_length = 0;
4232 0 : enum ndr_err_code err;
4233 126 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4234 126 : PyObject *allow_remaining_obj = NULL;
4235 126 : bool allow_remaining = false;
4236 :
4237 126 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4238 : discard_const_p(char *, kwnames),
4239 : &blob.data, &blob_length,
4240 : &allow_remaining_obj)) {
4241 0 : return NULL;
4242 : }
4243 126 : blob.length = blob_length;
4244 :
4245 126 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4246 0 : allow_remaining = true;
4247 : }
4248 :
4249 126 : if (allow_remaining) {
4250 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnsProperty);
4251 : } else {
4252 126 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnsProperty);
4253 : }
4254 126 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4255 0 : PyErr_SetNdrError(err);
4256 0 : return NULL;
4257 : }
4258 :
4259 126 : Py_RETURN_NONE;
4260 : }
4261 :
4262 0 : static PyObject *py_dnsp_DnsProperty_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4263 : {
4264 0 : struct dnsp_DnsProperty *object = pytalloc_get_ptr(py_obj);
4265 0 : PyObject *ret;
4266 0 : char *retstr;
4267 :
4268 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_DnsProperty, "dnsp_DnsProperty", object);
4269 0 : ret = PyUnicode_FromString(retstr);
4270 0 : talloc_free(retstr);
4271 :
4272 0 : return ret;
4273 : }
4274 :
4275 : static PyMethodDef py_dnsp_DnsProperty_methods[] = {
4276 : { "__ndr_pack__", (PyCFunction)py_dnsp_DnsProperty_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4277 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_DnsProperty_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4278 : { "__ndr_print__", (PyCFunction)py_dnsp_DnsProperty_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4279 : { NULL, NULL, 0, NULL }
4280 : };
4281 :
4282 :
4283 : static PyTypeObject dnsp_DnsProperty_Type = {
4284 : PyVarObject_HEAD_INIT(NULL, 0)
4285 : .tp_name = "dnsp.DnsProperty",
4286 : .tp_getset = py_dnsp_DnsProperty_getsetters,
4287 : .tp_methods = py_dnsp_DnsProperty_methods,
4288 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4289 : .tp_new = py_dnsp_DnsProperty_new,
4290 : };
4291 :
4292 :
4293 0 : static PyObject *py_dnsp_DnsProperty_short_get_wDataLength(PyObject *obj, void *closure)
4294 : {
4295 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4296 0 : PyObject *py_wDataLength;
4297 0 : py_wDataLength = PyLong_FromUnsignedLongLong((uint32_t)(object->wDataLength));
4298 0 : return py_wDataLength;
4299 : }
4300 :
4301 0 : static int py_dnsp_DnsProperty_short_set_wDataLength(PyObject *py_obj, PyObject *value, void *closure)
4302 : {
4303 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4304 0 : if (value == NULL) {
4305 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wDataLength");
4306 0 : return -1;
4307 : }
4308 : {
4309 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wDataLength));
4310 0 : if (PyLong_Check(value)) {
4311 0 : unsigned long long test_var;
4312 0 : test_var = PyLong_AsUnsignedLongLong(value);
4313 0 : if (PyErr_Occurred() != NULL) {
4314 0 : return -1;
4315 : }
4316 0 : if (test_var > uint_max) {
4317 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4318 : PyLong_Type.tp_name, uint_max, test_var);
4319 0 : return -1;
4320 : }
4321 0 : object->wDataLength = test_var;
4322 : } else {
4323 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4324 : PyLong_Type.tp_name);
4325 0 : return -1;
4326 : }
4327 : }
4328 0 : return 0;
4329 : }
4330 :
4331 0 : static PyObject *py_dnsp_DnsProperty_short_get_namelength(PyObject *obj, void *closure)
4332 : {
4333 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4334 0 : PyObject *py_namelength;
4335 0 : py_namelength = PyLong_FromUnsignedLongLong((uint32_t)(object->namelength));
4336 0 : return py_namelength;
4337 : }
4338 :
4339 12 : static int py_dnsp_DnsProperty_short_set_namelength(PyObject *py_obj, PyObject *value, void *closure)
4340 : {
4341 12 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4342 12 : if (value == NULL) {
4343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->namelength");
4344 0 : return -1;
4345 : }
4346 : {
4347 12 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->namelength));
4348 12 : if (PyLong_Check(value)) {
4349 0 : unsigned long long test_var;
4350 12 : test_var = PyLong_AsUnsignedLongLong(value);
4351 12 : if (PyErr_Occurred() != NULL) {
4352 0 : return -1;
4353 : }
4354 12 : if (test_var > uint_max) {
4355 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4356 : PyLong_Type.tp_name, uint_max, test_var);
4357 0 : return -1;
4358 : }
4359 12 : object->namelength = test_var;
4360 : } else {
4361 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4362 : PyLong_Type.tp_name);
4363 0 : return -1;
4364 : }
4365 : }
4366 12 : return 0;
4367 : }
4368 :
4369 0 : static PyObject *py_dnsp_DnsProperty_short_get_flag(PyObject *obj, void *closure)
4370 : {
4371 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4372 0 : PyObject *py_flag;
4373 0 : py_flag = PyLong_FromUnsignedLongLong((uint32_t)(object->flag));
4374 0 : return py_flag;
4375 : }
4376 :
4377 0 : static int py_dnsp_DnsProperty_short_set_flag(PyObject *py_obj, PyObject *value, void *closure)
4378 : {
4379 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4380 0 : if (value == NULL) {
4381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flag");
4382 0 : return -1;
4383 : }
4384 : {
4385 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flag));
4386 0 : if (PyLong_Check(value)) {
4387 0 : unsigned long long test_var;
4388 0 : test_var = PyLong_AsUnsignedLongLong(value);
4389 0 : if (PyErr_Occurred() != NULL) {
4390 0 : return -1;
4391 : }
4392 0 : if (test_var > uint_max) {
4393 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4394 : PyLong_Type.tp_name, uint_max, test_var);
4395 0 : return -1;
4396 : }
4397 0 : object->flag = test_var;
4398 : } else {
4399 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4400 : PyLong_Type.tp_name);
4401 0 : return -1;
4402 : }
4403 : }
4404 0 : return 0;
4405 : }
4406 :
4407 0 : static PyObject *py_dnsp_DnsProperty_short_get_version(PyObject *obj, void *closure)
4408 : {
4409 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4410 0 : PyObject *py_version;
4411 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
4412 0 : return py_version;
4413 : }
4414 :
4415 0 : static int py_dnsp_DnsProperty_short_set_version(PyObject *py_obj, PyObject *value, void *closure)
4416 : {
4417 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4418 0 : if (value == NULL) {
4419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
4420 0 : return -1;
4421 : }
4422 : {
4423 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
4424 0 : if (PyLong_Check(value)) {
4425 0 : unsigned long long test_var;
4426 0 : test_var = PyLong_AsUnsignedLongLong(value);
4427 0 : if (PyErr_Occurred() != NULL) {
4428 0 : return -1;
4429 : }
4430 0 : if (test_var > uint_max) {
4431 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4432 : PyLong_Type.tp_name, uint_max, test_var);
4433 0 : return -1;
4434 : }
4435 0 : object->version = test_var;
4436 : } else {
4437 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4438 : PyLong_Type.tp_name);
4439 0 : return -1;
4440 : }
4441 : }
4442 0 : return 0;
4443 : }
4444 :
4445 0 : static PyObject *py_dnsp_DnsProperty_short_get_id(PyObject *obj, void *closure)
4446 : {
4447 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4448 0 : PyObject *py_id;
4449 0 : py_id = PyLong_FromUnsignedLongLong((uint32_t)(object->id));
4450 0 : return py_id;
4451 : }
4452 :
4453 12 : static int py_dnsp_DnsProperty_short_set_id(PyObject *py_obj, PyObject *value, void *closure)
4454 : {
4455 12 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4456 12 : if (value == NULL) {
4457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->id");
4458 0 : return -1;
4459 : }
4460 : {
4461 12 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id));
4462 12 : if (PyLong_Check(value)) {
4463 0 : unsigned long long test_var;
4464 12 : test_var = PyLong_AsUnsignedLongLong(value);
4465 12 : if (PyErr_Occurred() != NULL) {
4466 0 : return -1;
4467 : }
4468 12 : if (test_var > uint_max) {
4469 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4470 : PyLong_Type.tp_name, uint_max, test_var);
4471 0 : return -1;
4472 : }
4473 12 : object->id = test_var;
4474 : } else {
4475 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4476 : PyLong_Type.tp_name);
4477 0 : return -1;
4478 : }
4479 : }
4480 12 : return 0;
4481 : }
4482 :
4483 0 : static PyObject *py_dnsp_DnsProperty_short_get_data(PyObject *obj, void *closure)
4484 : {
4485 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4486 0 : PyObject *py_data;
4487 0 : py_data = pyrpc_import_union(&dnsPropertyData_Type, pytalloc_get_mem_ctx(obj), DSPROPERTY_ZONE_EMPTY, &object->data, "union dnsPropertyData");
4488 0 : if (py_data == NULL) {
4489 0 : return NULL;
4490 : }
4491 0 : return py_data;
4492 : }
4493 :
4494 0 : static int py_dnsp_DnsProperty_short_set_data(PyObject *py_obj, PyObject *value, void *closure)
4495 : {
4496 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4497 0 : if (value == NULL) {
4498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
4499 0 : return -1;
4500 : }
4501 : {
4502 0 : union dnsPropertyData *data_switch_0;
4503 0 : data_switch_0 = (union dnsPropertyData *)pyrpc_export_union(&dnsPropertyData_Type, pytalloc_get_mem_ctx(py_obj), DSPROPERTY_ZONE_EMPTY, value, "union dnsPropertyData");
4504 0 : if (data_switch_0 == NULL) {
4505 0 : return -1;
4506 : }
4507 0 : object->data = *data_switch_0;
4508 : }
4509 0 : return 0;
4510 : }
4511 :
4512 0 : static PyObject *py_dnsp_DnsProperty_short_get_name(PyObject *obj, void *closure)
4513 : {
4514 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(obj);
4515 0 : PyObject *py_name;
4516 0 : py_name = PyLong_FromUnsignedLongLong((uint32_t)(object->name));
4517 0 : return py_name;
4518 : }
4519 :
4520 12 : static int py_dnsp_DnsProperty_short_set_name(PyObject *py_obj, PyObject *value, void *closure)
4521 : {
4522 12 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4523 12 : if (value == NULL) {
4524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
4525 0 : return -1;
4526 : }
4527 : {
4528 12 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name));
4529 12 : if (PyLong_Check(value)) {
4530 0 : unsigned long long test_var;
4531 12 : test_var = PyLong_AsUnsignedLongLong(value);
4532 12 : if (PyErr_Occurred() != NULL) {
4533 0 : return -1;
4534 : }
4535 12 : if (test_var > uint_max) {
4536 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4537 : PyLong_Type.tp_name, uint_max, test_var);
4538 0 : return -1;
4539 : }
4540 12 : object->name = test_var;
4541 : } else {
4542 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4543 : PyLong_Type.tp_name);
4544 0 : return -1;
4545 : }
4546 : }
4547 12 : return 0;
4548 : }
4549 :
4550 : static PyGetSetDef py_dnsp_DnsProperty_short_getsetters[] = {
4551 : {
4552 : .name = discard_const_p(char, "wDataLength"),
4553 : .get = py_dnsp_DnsProperty_short_get_wDataLength,
4554 : .set = py_dnsp_DnsProperty_short_set_wDataLength,
4555 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4556 : },
4557 : {
4558 : .name = discard_const_p(char, "namelength"),
4559 : .get = py_dnsp_DnsProperty_short_get_namelength,
4560 : .set = py_dnsp_DnsProperty_short_set_namelength,
4561 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4562 : },
4563 : {
4564 : .name = discard_const_p(char, "flag"),
4565 : .get = py_dnsp_DnsProperty_short_get_flag,
4566 : .set = py_dnsp_DnsProperty_short_set_flag,
4567 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4568 : },
4569 : {
4570 : .name = discard_const_p(char, "version"),
4571 : .get = py_dnsp_DnsProperty_short_get_version,
4572 : .set = py_dnsp_DnsProperty_short_set_version,
4573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4574 : },
4575 : {
4576 : .name = discard_const_p(char, "id"),
4577 : .get = py_dnsp_DnsProperty_short_get_id,
4578 : .set = py_dnsp_DnsProperty_short_set_id,
4579 : .doc = discard_const_p(char, "PIDL-generated element of base type dns_property_id")
4580 : },
4581 : {
4582 : .name = discard_const_p(char, "data"),
4583 : .get = py_dnsp_DnsProperty_short_get_data,
4584 : .set = py_dnsp_DnsProperty_short_set_data,
4585 : .doc = discard_const_p(char, "PIDL-generated element of base type dnsPropertyData")
4586 : },
4587 : {
4588 : .name = discard_const_p(char, "name"),
4589 : .get = py_dnsp_DnsProperty_short_get_name,
4590 : .set = py_dnsp_DnsProperty_short_set_name,
4591 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4592 : },
4593 : { .name = NULL }
4594 : };
4595 :
4596 12 : static PyObject *py_dnsp_DnsProperty_short_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4597 : {
4598 12 : return pytalloc_new(struct dnsp_DnsProperty_short, type);
4599 : }
4600 :
4601 12 : static PyObject *py_dnsp_DnsProperty_short_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4602 : {
4603 12 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4604 12 : PyObject *ret = NULL;
4605 0 : DATA_BLOB blob;
4606 0 : enum ndr_err_code err;
4607 12 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4608 12 : if (tmp_ctx == NULL) {
4609 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4610 0 : return NULL;
4611 : }
4612 12 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dnsp_DnsProperty_short);
4613 12 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4614 0 : TALLOC_FREE(tmp_ctx);
4615 0 : PyErr_SetNdrError(err);
4616 0 : return NULL;
4617 : }
4618 :
4619 12 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4620 12 : TALLOC_FREE(tmp_ctx);
4621 12 : return ret;
4622 : }
4623 :
4624 0 : static PyObject *py_dnsp_DnsProperty_short_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4625 : {
4626 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4627 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4628 0 : Py_ssize_t blob_length = 0;
4629 0 : enum ndr_err_code err;
4630 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4631 0 : PyObject *allow_remaining_obj = NULL;
4632 0 : bool allow_remaining = false;
4633 :
4634 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4635 : discard_const_p(char *, kwnames),
4636 : &blob.data, &blob_length,
4637 : &allow_remaining_obj)) {
4638 0 : return NULL;
4639 : }
4640 0 : blob.length = blob_length;
4641 :
4642 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4643 0 : allow_remaining = true;
4644 : }
4645 :
4646 0 : if (allow_remaining) {
4647 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnsProperty_short);
4648 : } else {
4649 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnsProperty_short);
4650 : }
4651 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4652 0 : PyErr_SetNdrError(err);
4653 0 : return NULL;
4654 : }
4655 :
4656 0 : Py_RETURN_NONE;
4657 : }
4658 :
4659 0 : static PyObject *py_dnsp_DnsProperty_short_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4660 : {
4661 0 : struct dnsp_DnsProperty_short *object = pytalloc_get_ptr(py_obj);
4662 0 : PyObject *ret;
4663 0 : char *retstr;
4664 :
4665 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dnsp_DnsProperty_short, "dnsp_DnsProperty_short", object);
4666 0 : ret = PyUnicode_FromString(retstr);
4667 0 : talloc_free(retstr);
4668 :
4669 0 : return ret;
4670 : }
4671 :
4672 : static PyMethodDef py_dnsp_DnsProperty_short_methods[] = {
4673 : { "__ndr_pack__", (PyCFunction)py_dnsp_DnsProperty_short_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4674 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsp_DnsProperty_short_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4675 : { "__ndr_print__", (PyCFunction)py_dnsp_DnsProperty_short_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4676 : { NULL, NULL, 0, NULL }
4677 : };
4678 :
4679 :
4680 : static PyTypeObject dnsp_DnsProperty_short_Type = {
4681 : PyVarObject_HEAD_INIT(NULL, 0)
4682 : .tp_name = "dnsp.DnsProperty_short",
4683 : .tp_getset = py_dnsp_DnsProperty_short_getsetters,
4684 : .tp_methods = py_dnsp_DnsProperty_short_methods,
4685 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4686 : .tp_new = py_dnsp_DnsProperty_short_new,
4687 : };
4688 :
4689 :
4690 : const struct PyNdrRpcMethodDef py_ndr_dnsp_methods[] = {
4691 : {0}
4692 : };
4693 :
4694 0 : static PyObject *interface_dnsp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4695 : {
4696 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_dnsp);
4697 : }
4698 :
4699 : #define PY_DOC_DNSP "DNSP interfaces"
4700 : static PyTypeObject dnsp_InterfaceType = {
4701 : PyVarObject_HEAD_INIT(NULL, 0)
4702 : .tp_name = "dnsp.dnsp",
4703 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
4704 : .tp_doc = "dnsp(binding, lp_ctx=None, credentials=None) -> connection\n"
4705 : "\n"
4706 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
4707 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
4708 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_DNSP,
4709 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4710 : .tp_new = interface_dnsp_new,
4711 : };
4712 :
4713 0 : static PyObject *syntax_dnsp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4714 : {
4715 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_dnsp.syntax_id);
4716 : }
4717 :
4718 : #define PY_DOC_DNSP_SYNTAX "DNSP interfaces"
4719 : static PyTypeObject dnsp_SyntaxType = {
4720 : PyVarObject_HEAD_INIT(NULL, 0)
4721 : .tp_name = "dnsp.dnsp_abstract_syntax",
4722 : .tp_doc = "dnsp_abstract_syntax()\n"PY_DOC_DNSP_SYNTAX,
4723 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4724 : .tp_new = syntax_dnsp_new,
4725 : };
4726 :
4727 : static PyMethodDef dnsp_methods[] = {
4728 : { NULL, NULL, 0, NULL }
4729 : };
4730 :
4731 : static struct PyModuleDef moduledef = {
4732 : PyModuleDef_HEAD_INIT,
4733 : .m_name = "dnsp",
4734 : .m_doc = "dnsp DCE/RPC",
4735 : .m_size = -1,
4736 : .m_methods = dnsp_methods,
4737 : };
4738 1943 : MODULE_INIT_FUNC(dnsp)
4739 : {
4740 1943 : PyObject *m = NULL;
4741 1943 : PyObject *dep_samba_dcerpc_misc = NULL;
4742 1943 : PyObject *dep_talloc = NULL;
4743 1943 : PyObject *dep_samba_dcerpc_base = NULL;
4744 :
4745 1943 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
4746 1943 : if (dep_samba_dcerpc_misc == NULL)
4747 0 : goto out;
4748 :
4749 1943 : dep_talloc = PyImport_ImportModule("talloc");
4750 1943 : if (dep_talloc == NULL)
4751 0 : goto out;
4752 :
4753 1943 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
4754 1943 : if (dep_samba_dcerpc_base == NULL)
4755 0 : goto out;
4756 :
4757 1943 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
4758 1943 : if (BaseObject_Type == NULL)
4759 0 : goto out;
4760 :
4761 1943 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
4762 1943 : if (ClientConnection_Type == NULL)
4763 0 : goto out;
4764 :
4765 1943 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
4766 1943 : if (ndr_syntax_id_Type == NULL)
4767 0 : goto out;
4768 :
4769 1943 : dnsp_soa_Type.tp_base = BaseObject_Type;
4770 1943 : dnsp_soa_Type.tp_basicsize = pytalloc_BaseObject_size();
4771 :
4772 1943 : dnsp_mx_Type.tp_base = BaseObject_Type;
4773 1943 : dnsp_mx_Type.tp_basicsize = pytalloc_BaseObject_size();
4774 :
4775 1943 : dnsp_hinfo_Type.tp_base = BaseObject_Type;
4776 1943 : dnsp_hinfo_Type.tp_basicsize = pytalloc_BaseObject_size();
4777 :
4778 1943 : dnsp_srv_Type.tp_base = BaseObject_Type;
4779 1943 : dnsp_srv_Type.tp_basicsize = pytalloc_BaseObject_size();
4780 :
4781 1943 : dnsp_ip4_array_Type.tp_base = BaseObject_Type;
4782 1943 : dnsp_ip4_array_Type.tp_basicsize = pytalloc_BaseObject_size();
4783 :
4784 1943 : dnsp_dns_addr_Type.tp_base = BaseObject_Type;
4785 1943 : dnsp_dns_addr_Type.tp_basicsize = pytalloc_BaseObject_size();
4786 :
4787 1943 : dnsp_dns_addr_array_Type.tp_base = BaseObject_Type;
4788 1943 : dnsp_dns_addr_array_Type.tp_basicsize = pytalloc_BaseObject_size();
4789 :
4790 1943 : dnsp_string_list_Type.tp_base = BaseObject_Type;
4791 1943 : dnsp_string_list_Type.tp_basicsize = pytalloc_BaseObject_size();
4792 :
4793 1943 : dnsRecordData_Type.tp_base = BaseObject_Type;
4794 1943 : dnsRecordData_Type.tp_basicsize = pytalloc_BaseObject_size();
4795 :
4796 1943 : dnsp_DnssrvRpcRecord_Type.tp_base = BaseObject_Type;
4797 1943 : dnsp_DnssrvRpcRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
4798 :
4799 1943 : dnsPropertyData_Type.tp_base = BaseObject_Type;
4800 1943 : dnsPropertyData_Type.tp_basicsize = pytalloc_BaseObject_size();
4801 :
4802 1943 : dnsp_DnsProperty_Type.tp_base = BaseObject_Type;
4803 1943 : dnsp_DnsProperty_Type.tp_basicsize = pytalloc_BaseObject_size();
4804 :
4805 1943 : dnsp_DnsProperty_short_Type.tp_base = BaseObject_Type;
4806 1943 : dnsp_DnsProperty_short_Type.tp_basicsize = pytalloc_BaseObject_size();
4807 :
4808 1943 : dnsp_InterfaceType.tp_base = ClientConnection_Type;
4809 :
4810 1943 : dnsp_SyntaxType.tp_base = ndr_syntax_id_Type;
4811 1943 : dnsp_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
4812 :
4813 1943 : if (PyType_Ready(&dnsp_soa_Type) < 0)
4814 0 : goto out;
4815 1943 : if (PyType_Ready(&dnsp_mx_Type) < 0)
4816 0 : goto out;
4817 1943 : if (PyType_Ready(&dnsp_hinfo_Type) < 0)
4818 0 : goto out;
4819 1943 : if (PyType_Ready(&dnsp_srv_Type) < 0)
4820 0 : goto out;
4821 1943 : if (PyType_Ready(&dnsp_ip4_array_Type) < 0)
4822 0 : goto out;
4823 1943 : if (PyType_Ready(&dnsp_dns_addr_Type) < 0)
4824 0 : goto out;
4825 1943 : if (PyType_Ready(&dnsp_dns_addr_array_Type) < 0)
4826 0 : goto out;
4827 1943 : if (PyType_Ready(&dnsp_string_list_Type) < 0)
4828 0 : goto out;
4829 1943 : if (PyType_Ready(&dnsRecordData_Type) < 0)
4830 0 : goto out;
4831 1943 : if (PyType_Ready(&dnsp_DnssrvRpcRecord_Type) < 0)
4832 0 : goto out;
4833 1943 : if (PyType_Ready(&dnsPropertyData_Type) < 0)
4834 0 : goto out;
4835 1943 : if (PyType_Ready(&dnsp_DnsProperty_Type) < 0)
4836 0 : goto out;
4837 1943 : if (PyType_Ready(&dnsp_DnsProperty_short_Type) < 0)
4838 0 : goto out;
4839 1943 : if (PyType_Ready(&dnsp_InterfaceType) < 0)
4840 0 : goto out;
4841 1943 : if (PyType_Ready(&dnsp_SyntaxType) < 0)
4842 0 : goto out;
4843 1943 : if (!PyInterface_AddNdrRpcMethods(&dnsp_InterfaceType, py_ndr_dnsp_methods))
4844 0 : return NULL;
4845 :
4846 : #ifdef PY_SOA_PATCH
4847 : PY_SOA_PATCH(&dnsp_soa_Type);
4848 : #endif
4849 : #ifdef PY_MX_PATCH
4850 : PY_MX_PATCH(&dnsp_mx_Type);
4851 : #endif
4852 : #ifdef PY_HINFO_PATCH
4853 : PY_HINFO_PATCH(&dnsp_hinfo_Type);
4854 : #endif
4855 : #ifdef PY_SRV_PATCH
4856 : PY_SRV_PATCH(&dnsp_srv_Type);
4857 : #endif
4858 : #ifdef PY_IP4_ARRAY_PATCH
4859 : PY_IP4_ARRAY_PATCH(&dnsp_ip4_array_Type);
4860 : #endif
4861 : #ifdef PY_DNS_ADDR_PATCH
4862 : PY_DNS_ADDR_PATCH(&dnsp_dns_addr_Type);
4863 : #endif
4864 : #ifdef PY_DNS_ADDR_ARRAY_PATCH
4865 : PY_DNS_ADDR_ARRAY_PATCH(&dnsp_dns_addr_array_Type);
4866 : #endif
4867 : #ifdef PY_STRING_LIST_PATCH
4868 : PY_STRING_LIST_PATCH(&dnsp_string_list_Type);
4869 : #endif
4870 : #ifdef PY_DNSRECORDDATA_PATCH
4871 : PY_DNSRECORDDATA_PATCH(&dnsRecordData_Type);
4872 : #endif
4873 : #ifdef PY_DNSSRVRPCRECORD_PATCH
4874 : PY_DNSSRVRPCRECORD_PATCH(&dnsp_DnssrvRpcRecord_Type);
4875 : #endif
4876 : #ifdef PY_DNSPROPERTYDATA_PATCH
4877 : PY_DNSPROPERTYDATA_PATCH(&dnsPropertyData_Type);
4878 : #endif
4879 : #ifdef PY_DNSPROPERTY_PATCH
4880 : PY_DNSPROPERTY_PATCH(&dnsp_DnsProperty_Type);
4881 : #endif
4882 : #ifdef PY_DNSPROPERTY_SHORT_PATCH
4883 : PY_DNSPROPERTY_SHORT_PATCH(&dnsp_DnsProperty_short_Type);
4884 : #endif
4885 : #ifdef PY_DNSP_PATCH
4886 : PY_DNSP_PATCH(&dnsp_InterfaceType);
4887 : #endif
4888 : #ifdef PY_DNSP_ABSTRACT_SYNTAX_PATCH
4889 : PY_DNSP_ABSTRACT_SYNTAX_PATCH(&dnsp_SyntaxType);
4890 : #endif
4891 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
4892 : PY_ABSTRACT_SYNTAX_PATCH(&dnsp_SyntaxType);
4893 : #endif
4894 :
4895 1943 : m = PyModule_Create(&moduledef);
4896 1943 : if (m == NULL)
4897 0 : goto out;
4898 :
4899 1943 : PyModule_AddObject(m, "DNS_TYPE_TOMBSTONE", PyLong_FromLong((uint16_t)(DNS_TYPE_TOMBSTONE)));
4900 1943 : PyModule_AddObject(m, "DNS_TYPE_A", PyLong_FromLong((uint16_t)(DNS_TYPE_A)));
4901 1943 : PyModule_AddObject(m, "DNS_TYPE_NS", PyLong_FromLong((uint16_t)(DNS_TYPE_NS)));
4902 1943 : PyModule_AddObject(m, "DNS_TYPE_MD", PyLong_FromLong((uint16_t)(DNS_TYPE_MD)));
4903 1943 : PyModule_AddObject(m, "DNS_TYPE_MF", PyLong_FromLong((uint16_t)(DNS_TYPE_MF)));
4904 1943 : PyModule_AddObject(m, "DNS_TYPE_CNAME", PyLong_FromLong((uint16_t)(DNS_TYPE_CNAME)));
4905 1943 : PyModule_AddObject(m, "DNS_TYPE_SOA", PyLong_FromLong((uint16_t)(DNS_TYPE_SOA)));
4906 1943 : PyModule_AddObject(m, "DNS_TYPE_MB", PyLong_FromLong((uint16_t)(DNS_TYPE_MB)));
4907 1943 : PyModule_AddObject(m, "DNS_TYPE_MG", PyLong_FromLong((uint16_t)(DNS_TYPE_MG)));
4908 1943 : PyModule_AddObject(m, "DNS_TYPE_MR", PyLong_FromLong((uint16_t)(DNS_TYPE_MR)));
4909 1943 : PyModule_AddObject(m, "DNS_TYPE_NULL", PyLong_FromLong((uint16_t)(DNS_TYPE_NULL)));
4910 1943 : PyModule_AddObject(m, "DNS_TYPE_WKS", PyLong_FromLong((uint16_t)(DNS_TYPE_WKS)));
4911 1943 : PyModule_AddObject(m, "DNS_TYPE_PTR", PyLong_FromLong((uint16_t)(DNS_TYPE_PTR)));
4912 1943 : PyModule_AddObject(m, "DNS_TYPE_HINFO", PyLong_FromLong((uint16_t)(DNS_TYPE_HINFO)));
4913 1943 : PyModule_AddObject(m, "DNS_TYPE_MINFO", PyLong_FromLong((uint16_t)(DNS_TYPE_MINFO)));
4914 1943 : PyModule_AddObject(m, "DNS_TYPE_MX", PyLong_FromLong((uint16_t)(DNS_TYPE_MX)));
4915 1943 : PyModule_AddObject(m, "DNS_TYPE_TXT", PyLong_FromLong((uint16_t)(DNS_TYPE_TXT)));
4916 1943 : PyModule_AddObject(m, "DNS_TYPE_RP", PyLong_FromLong((uint16_t)(DNS_TYPE_RP)));
4917 1943 : PyModule_AddObject(m, "DNS_TYPE_AFSDB", PyLong_FromLong((uint16_t)(DNS_TYPE_AFSDB)));
4918 1943 : PyModule_AddObject(m, "DNS_TYPE_X25", PyLong_FromLong((uint16_t)(DNS_TYPE_X25)));
4919 1943 : PyModule_AddObject(m, "DNS_TYPE_ISDN", PyLong_FromLong((uint16_t)(DNS_TYPE_ISDN)));
4920 1943 : PyModule_AddObject(m, "DNS_TYPE_RT", PyLong_FromLong((uint16_t)(DNS_TYPE_RT)));
4921 1943 : PyModule_AddObject(m, "DNS_TYPE_SIG", PyLong_FromLong((uint16_t)(DNS_TYPE_SIG)));
4922 1943 : PyModule_AddObject(m, "DNS_TYPE_KEY", PyLong_FromLong((uint16_t)(DNS_TYPE_KEY)));
4923 1943 : PyModule_AddObject(m, "DNS_TYPE_AAAA", PyLong_FromLong((uint16_t)(DNS_TYPE_AAAA)));
4924 1943 : PyModule_AddObject(m, "DNS_TYPE_LOC", PyLong_FromLong((uint16_t)(DNS_TYPE_LOC)));
4925 1943 : PyModule_AddObject(m, "DNS_TYPE_NXT", PyLong_FromLong((uint16_t)(DNS_TYPE_NXT)));
4926 1943 : PyModule_AddObject(m, "DNS_TYPE_SRV", PyLong_FromLong((uint16_t)(DNS_TYPE_SRV)));
4927 1943 : PyModule_AddObject(m, "DNS_TYPE_ATMA", PyLong_FromLong((uint16_t)(DNS_TYPE_ATMA)));
4928 1943 : PyModule_AddObject(m, "DNS_TYPE_NAPTR", PyLong_FromLong((uint16_t)(DNS_TYPE_NAPTR)));
4929 1943 : PyModule_AddObject(m, "DNS_TYPE_CERT", PyLong_FromLong((uint16_t)(DNS_TYPE_CERT)));
4930 1943 : PyModule_AddObject(m, "DNS_TYPE_DNAME", PyLong_FromLong((uint16_t)(DNS_TYPE_DNAME)));
4931 1943 : PyModule_AddObject(m, "DNS_TYPE_DS", PyLong_FromLong((uint16_t)(DNS_TYPE_DS)));
4932 1943 : PyModule_AddObject(m, "DNS_TYPE_SSHFP", PyLong_FromLong((uint16_t)(DNS_TYPE_SSHFP)));
4933 1943 : PyModule_AddObject(m, "DNS_TYPE_IPSECKEY", PyLong_FromLong((uint16_t)(DNS_TYPE_IPSECKEY)));
4934 1943 : PyModule_AddObject(m, "DNS_TYPE_RRSIG", PyLong_FromLong((uint16_t)(DNS_TYPE_RRSIG)));
4935 1943 : PyModule_AddObject(m, "DNS_TYPE_NSEC", PyLong_FromLong((uint16_t)(DNS_TYPE_NSEC)));
4936 1943 : PyModule_AddObject(m, "DNS_TYPE_DNSKEY", PyLong_FromLong((uint16_t)(DNS_TYPE_DNSKEY)));
4937 1943 : PyModule_AddObject(m, "DNS_TYPE_DHCID", PyLong_FromLong((uint16_t)(DNS_TYPE_DHCID)));
4938 1943 : PyModule_AddObject(m, "DNS_TYPE_NSEC3", PyLong_FromLong((uint16_t)(DNS_TYPE_NSEC3)));
4939 1943 : PyModule_AddObject(m, "DNS_TYPE_NSEC3PARAM", PyLong_FromLong((uint16_t)(DNS_TYPE_NSEC3PARAM)));
4940 1943 : PyModule_AddObject(m, "DNS_TYPE_TLSA", PyLong_FromLong((uint16_t)(DNS_TYPE_TLSA)));
4941 1943 : PyModule_AddObject(m, "DNS_TYPE_CDS", PyLong_FromLong((uint16_t)(DNS_TYPE_CDS)));
4942 1943 : PyModule_AddObject(m, "DNS_TYPE_CDNSKEY", PyLong_FromLong((uint16_t)(DNS_TYPE_CDNSKEY)));
4943 1943 : PyModule_AddObject(m, "DNS_TYPE_SVCB", PyLong_FromLong((uint16_t)(DNS_TYPE_SVCB)));
4944 1943 : PyModule_AddObject(m, "DNS_TYPE_HTTPS", PyLong_FromLong((uint16_t)(DNS_TYPE_HTTPS)));
4945 1943 : PyModule_AddObject(m, "DNS_TYPE_ALL", PyLong_FromLong((uint16_t)(DNS_TYPE_ALL)));
4946 1943 : PyModule_AddObject(m, "DNS_TYPE_URI", PyLong_FromLong((uint16_t)(DNS_TYPE_URI)));
4947 1943 : PyModule_AddObject(m, "DNS_TYPE_CAA", PyLong_FromLong((uint16_t)(DNS_TYPE_CAA)));
4948 1943 : PyModule_AddObject(m, "DNS_TYPE_WINS", PyLong_FromLong((uint16_t)(DNS_TYPE_WINS)));
4949 1943 : PyModule_AddObject(m, "DNS_TYPE_WINSR", PyLong_FromLong((uint16_t)(DNS_TYPE_WINSR)));
4950 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_SUPPRESS_NOTIFY", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_SUPPRESS_NOTIFY)));
4951 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_AGING_ON", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_AGING_ON)));
4952 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_OPEN_ACL", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_OPEN_ACL)));
4953 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_RECORD_WIRE_FORMAT", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_RECORD_WIRE_FORMAT)));
4954 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_SUPPRESS_RECORD_UPDATE_PTR", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_SUPPRESS_RECORD_UPDATE_PTR)));
4955 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_NODE_COMPLETE", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_NODE_COMPLETE)));
4956 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_NODE_STICKY", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_NODE_STICKY)));
4957 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_RECORD_CREATE_PTR", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_RECORD_CREATE_PTR)));
4958 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_RECORD_TTL_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_RECORD_TTL_CHANGE)));
4959 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_RECORD_DEFAULT_TTL", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_RECORD_DEFAULT_TTL)));
4960 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_ZONE_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_ZONE_DELEGATION)));
4961 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_AUTH_ZONE_ROOT", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_AUTH_ZONE_ROOT)));
4962 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_ZONE_ROOT", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_ZONE_ROOT)));
4963 1943 : PyModule_AddObject(m, "DNS_RPC_FLAG_CACHE_DATA", PyLong_FromUnsignedLongLong((uint32_t)(DNS_RPC_FLAG_CACHE_DATA)));
4964 1943 : PyModule_AddObject(m, "DNS_RANK_NONE", PyLong_FromLong((uint16_t)(DNS_RANK_NONE)));
4965 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_BIT", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_BIT)));
4966 1943 : PyModule_AddObject(m, "DNS_RANK_ROOT_HINT", PyLong_FromLong((uint16_t)(DNS_RANK_ROOT_HINT)));
4967 1943 : PyModule_AddObject(m, "DNS_RANK_OUTSIDE_GLUE", PyLong_FromLong((uint16_t)(DNS_RANK_OUTSIDE_GLUE)));
4968 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_NA_ADDITIONAL", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_NA_ADDITIONAL)));
4969 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_NA_AUTHORITY", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_NA_AUTHORITY)));
4970 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_A_ADDITIONAL", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_A_ADDITIONAL)));
4971 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_NA_ANSWER", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_NA_ANSWER)));
4972 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_A_AUTHORITY", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_A_AUTHORITY)));
4973 1943 : PyModule_AddObject(m, "DNS_RANK_GLUE", PyLong_FromLong((uint16_t)(DNS_RANK_GLUE)));
4974 1943 : PyModule_AddObject(m, "DNS_RANK_NS_GLUE", PyLong_FromLong((uint16_t)(DNS_RANK_NS_GLUE)));
4975 1943 : PyModule_AddObject(m, "DNS_RANK_CACHE_A_ANSWER", PyLong_FromLong((uint16_t)(DNS_RANK_CACHE_A_ANSWER)));
4976 1943 : PyModule_AddObject(m, "DNS_RANK_ZONE", PyLong_FromLong((uint16_t)(DNS_RANK_ZONE)));
4977 1943 : PyModule_AddObject(m, "DNS_ZONE_TYPE_CACHE", PyLong_FromUnsignedLongLong((uint32_t)(DNS_ZONE_TYPE_CACHE)));
4978 1943 : PyModule_AddObject(m, "DNS_ZONE_TYPE_PRIMARY", PyLong_FromUnsignedLongLong((uint32_t)(DNS_ZONE_TYPE_PRIMARY)));
4979 1943 : PyModule_AddObject(m, "DNS_ZONE_TYPE_SECONDARY", PyLong_FromUnsignedLongLong((uint32_t)(DNS_ZONE_TYPE_SECONDARY)));
4980 1943 : PyModule_AddObject(m, "DNS_ZONE_TYPE_STUB", PyLong_FromUnsignedLongLong((uint32_t)(DNS_ZONE_TYPE_STUB)));
4981 1943 : PyModule_AddObject(m, "DNS_ZONE_TYPE_FORWARDER", PyLong_FromUnsignedLongLong((uint32_t)(DNS_ZONE_TYPE_FORWARDER)));
4982 1943 : PyModule_AddObject(m, "DNS_ZONE_TYPE_SECONDARY_CACHE", PyLong_FromUnsignedLongLong((uint32_t)(DNS_ZONE_TYPE_SECONDARY_CACHE)));
4983 1943 : PyModule_AddObject(m, "DNS_ZONE_UPDATE_OFF", PyLong_FromLong((uint16_t)(DNS_ZONE_UPDATE_OFF)));
4984 1943 : PyModule_AddObject(m, "DNS_ZONE_UPDATE_UNSECURE", PyLong_FromLong((uint16_t)(DNS_ZONE_UPDATE_UNSECURE)));
4985 1943 : PyModule_AddObject(m, "DNS_ZONE_UPDATE_SECURE", PyLong_FromLong((uint16_t)(DNS_ZONE_UPDATE_SECURE)));
4986 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_EMPTY", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_EMPTY)));
4987 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_TYPE", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_TYPE)));
4988 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_ALLOW_UPDATE", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_ALLOW_UPDATE)));
4989 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_SECURE_TIME", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_SECURE_TIME)));
4990 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_NOREFRESH_INTERVAL", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_NOREFRESH_INTERVAL)));
4991 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_SCAVENGING_SERVERS", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_SCAVENGING_SERVERS)));
4992 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_AGING_ENABLED_TIME", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_AGING_ENABLED_TIME)));
4993 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_REFRESH_INTERVAL", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_REFRESH_INTERVAL)));
4994 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_AGING_STATE", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_AGING_STATE)));
4995 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_DELETED_FROM_HOSTNAME)));
4996 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_MASTER_SERVERS", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_MASTER_SERVERS)));
4997 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_AUTO_NS_SERVERS", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_AUTO_NS_SERVERS)));
4998 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_DCPROMO_CONVERT", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_DCPROMO_CONVERT)));
4999 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_SCAVENGING_SERVERS_DA", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_SCAVENGING_SERVERS_DA)));
5000 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_MASTER_SERVERS_DA", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_MASTER_SERVERS_DA)));
5001 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_NS_SERVERS_DA", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_NS_SERVERS_DA)));
5002 1943 : PyModule_AddObject(m, "DSPROPERTY_ZONE_NODE_DBFLAGS", PyLong_FromUnsignedLongLong((uint32_t)(DSPROPERTY_ZONE_NODE_DBFLAGS)));
5003 1943 : PyModule_AddObject(m, "DCPROMO_CONVERT_NONE", PyLong_FromLong((uint16_t)(DCPROMO_CONVERT_NONE)));
5004 1943 : PyModule_AddObject(m, "DCPROMO_CONVERT_DOMAIN", PyLong_FromLong((uint16_t)(DCPROMO_CONVERT_DOMAIN)));
5005 1943 : PyModule_AddObject(m, "DCPROMO_CONVERT_FOREST", PyLong_FromLong((uint16_t)(DCPROMO_CONVERT_FOREST)));
5006 1572 : Py_INCREF((PyObject *)(void *)&dnsp_soa_Type);
5007 1943 : PyModule_AddObject(m, "soa", (PyObject *)(void *)&dnsp_soa_Type);
5008 1572 : Py_INCREF((PyObject *)(void *)&dnsp_mx_Type);
5009 1943 : PyModule_AddObject(m, "mx", (PyObject *)(void *)&dnsp_mx_Type);
5010 1572 : Py_INCREF((PyObject *)(void *)&dnsp_hinfo_Type);
5011 1943 : PyModule_AddObject(m, "hinfo", (PyObject *)(void *)&dnsp_hinfo_Type);
5012 1572 : Py_INCREF((PyObject *)(void *)&dnsp_srv_Type);
5013 1943 : PyModule_AddObject(m, "srv", (PyObject *)(void *)&dnsp_srv_Type);
5014 1572 : Py_INCREF((PyObject *)(void *)&dnsp_ip4_array_Type);
5015 1943 : PyModule_AddObject(m, "ip4_array", (PyObject *)(void *)&dnsp_ip4_array_Type);
5016 1572 : Py_INCREF((PyObject *)(void *)&dnsp_dns_addr_Type);
5017 1943 : PyModule_AddObject(m, "dns_addr", (PyObject *)(void *)&dnsp_dns_addr_Type);
5018 1572 : Py_INCREF((PyObject *)(void *)&dnsp_dns_addr_array_Type);
5019 1943 : PyModule_AddObject(m, "dns_addr_array", (PyObject *)(void *)&dnsp_dns_addr_array_Type);
5020 1572 : Py_INCREF((PyObject *)(void *)&dnsp_string_list_Type);
5021 1943 : PyModule_AddObject(m, "string_list", (PyObject *)(void *)&dnsp_string_list_Type);
5022 1572 : Py_INCREF((PyObject *)(void *)&dnsRecordData_Type);
5023 1943 : PyModule_AddObject(m, "dnsRecordData", (PyObject *)(void *)&dnsRecordData_Type);
5024 1572 : Py_INCREF((PyObject *)(void *)&dnsp_DnssrvRpcRecord_Type);
5025 1943 : PyModule_AddObject(m, "DnssrvRpcRecord", (PyObject *)(void *)&dnsp_DnssrvRpcRecord_Type);
5026 1572 : Py_INCREF((PyObject *)(void *)&dnsPropertyData_Type);
5027 1943 : PyModule_AddObject(m, "dnsPropertyData", (PyObject *)(void *)&dnsPropertyData_Type);
5028 1572 : Py_INCREF((PyObject *)(void *)&dnsp_DnsProperty_Type);
5029 1943 : PyModule_AddObject(m, "DnsProperty", (PyObject *)(void *)&dnsp_DnsProperty_Type);
5030 1572 : Py_INCREF((PyObject *)(void *)&dnsp_DnsProperty_short_Type);
5031 1943 : PyModule_AddObject(m, "DnsProperty_short", (PyObject *)(void *)&dnsp_DnsProperty_short_Type);
5032 1572 : Py_INCREF((PyObject *)(void *)&dnsp_InterfaceType);
5033 1943 : PyModule_AddObject(m, "dnsp", (PyObject *)(void *)&dnsp_InterfaceType);
5034 1572 : Py_INCREF((PyObject *)(void *)&dnsp_SyntaxType);
5035 1943 : PyModule_AddObject(m, "dnsp_abstract_syntax", (PyObject *)(void *)&dnsp_SyntaxType);
5036 1572 : Py_INCREF((PyObject *)(void *)&dnsp_SyntaxType);
5037 1943 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&dnsp_SyntaxType);
5038 : #ifdef PY_MOD_DNSP_PATCH
5039 : PY_MOD_DNSP_PATCH(m);
5040 : #endif
5041 1943 : out:
5042 1943 : Py_XDECREF(dep_samba_dcerpc_misc);
5043 1943 : Py_XDECREF(dep_talloc);
5044 1943 : Py_XDECREF(dep_samba_dcerpc_base);
5045 1897 : return m;
5046 :
5047 : }
|