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