Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_nbt.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 0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 0 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 0 : case 4:
38 0 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 0 : case 1:
42 0 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 0 : switch (var_size) {
51 0 : case 8:
52 0 : return INT64_MAX;
53 0 : case 4:
54 0 : return INT32_MAX;
55 0 : case 2:
56 0 : return INT16_MAX;
57 0 : case 1:
58 0 : return INT8_MAX;
59 : }
60 :
61 0 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : #include "librpc/gen_ndr/security.h"
66 : static PyTypeObject nbt_name_Type;
67 : static PyTypeObject nbt_name_question_Type;
68 : static PyTypeObject nbt_rdata_address_Type;
69 : static PyTypeObject nbt_rdata_netbios_Type;
70 : static PyTypeObject nbt_statistics_Type;
71 : static PyTypeObject nbt_status_name_Type;
72 : static PyTypeObject nbt_rdata_status_Type;
73 : static PyTypeObject nbt_rdata_data_Type;
74 : static PyTypeObject nbt_rdata_Type;
75 : static PyTypeObject nbt_res_rec_Type;
76 : static PyTypeObject nbt_name_packet_Type;
77 : static PyTypeObject smb_trans_body_Type;
78 : static PyTypeObject smb_body_Type;
79 : static PyTypeObject dgram_smb_packet_Type;
80 : static PyTypeObject dgram_message_body_Type;
81 : static PyTypeObject dgram_message_Type;
82 : static PyTypeObject dgram_data_Type;
83 : static PyTypeObject nbt_dgram_packet_Type;
84 : static PyTypeObject nbt_sockaddr_Type;
85 : static PyTypeObject NETLOGON_SAM_LOGON_REQUEST_Type;
86 : static PyTypeObject NETLOGON_LOGON_REQUEST_Type;
87 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_NT40_Type;
88 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_Type;
89 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_EX_Type;
90 : static PyTypeObject netlogon_samlogon_response_union_Type;
91 : static PyTypeObject netlogon_samlogon_response_Type;
92 : static PyTypeObject nbt_netlogon_query_for_pdc_Type;
93 : static PyTypeObject nbt_netlogon_response_from_pdc_Type;
94 : static PyTypeObject nbt_netlogon_response2_Type;
95 : static PyTypeObject nbt_db_change_info_Type;
96 : static PyTypeObject NETLOGON_DB_CHANGE_Type;
97 : static PyTypeObject nbt_netlogon_request_Type;
98 : static PyTypeObject nbt_netlogon_packet_Type;
99 : static PyTypeObject nbt_browse_host_announcement_Type;
100 : static PyTypeObject nbt_browse_announcement_request_Type;
101 : static PyTypeObject nbt_browse_election_request_Type;
102 : static PyTypeObject nbt_browse_backup_list_request_Type;
103 : static PyTypeObject nbt_browse_backup_list_response_Type;
104 : static PyTypeObject nbt_browse_become_backup_Type;
105 : static PyTypeObject nbt_browse_domain_announcement_Type;
106 : static PyTypeObject nbt_browse_master_announcement_Type;
107 : static PyTypeObject nbt_browse_reset_state_Type;
108 : static PyTypeObject nbt_browse_local_master_announcement_Type;
109 : static PyTypeObject nbt_browse_payload_Type;
110 : static PyTypeObject nbt_browse_packet_Type;
111 : static PyTypeObject nbt_InterfaceType;
112 :
113 : static PyTypeObject *BaseObject_Type;
114 : static PyTypeObject *dom_sid_Type;
115 : static PyTypeObject *GUID_Type;
116 : static PyTypeObject *ClientConnection_Type;
117 : static PyTypeObject *ndr_syntax_id_Type;
118 :
119 0 : static PyObject *py_nbt_name_get_name(PyObject *obj, void *closure)
120 : {
121 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
122 0 : PyObject *py_name;
123 0 : py_name = PyString_FromStringOrNULL(object->name);
124 0 : return py_name;
125 : }
126 :
127 0 : static int py_nbt_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
128 : {
129 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
130 0 : if (value == NULL) {
131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
132 0 : return -1;
133 : }
134 : {
135 0 : const char *test_str;
136 0 : const char *talloc_str;
137 0 : PyObject *unicode = NULL;
138 0 : if (PyUnicode_Check(value)) {
139 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
140 0 : if (unicode == NULL) {
141 0 : return -1;
142 : }
143 0 : test_str = PyBytes_AS_STRING(unicode);
144 0 : } else if (PyBytes_Check(value)) {
145 0 : test_str = PyBytes_AS_STRING(value);
146 : } else {
147 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
148 0 : return -1;
149 : }
150 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
151 0 : if (unicode != NULL) {
152 0 : Py_DECREF(unicode);
153 : }
154 0 : if (talloc_str == NULL) {
155 0 : PyErr_NoMemory();
156 0 : return -1;
157 : }
158 0 : object->name = talloc_str;
159 : }
160 0 : return 0;
161 : }
162 :
163 0 : static PyObject *py_nbt_name_get_scope(PyObject *obj, void *closure)
164 : {
165 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
166 0 : PyObject *py_scope;
167 0 : py_scope = PyString_FromStringOrNULL(object->scope);
168 0 : return py_scope;
169 : }
170 :
171 0 : static int py_nbt_name_set_scope(PyObject *py_obj, PyObject *value, void *closure)
172 : {
173 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
174 0 : if (value == NULL) {
175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->scope");
176 0 : return -1;
177 : }
178 : {
179 0 : const char *test_str;
180 0 : const char *talloc_str;
181 0 : PyObject *unicode = NULL;
182 0 : if (PyUnicode_Check(value)) {
183 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
184 0 : if (unicode == NULL) {
185 0 : return -1;
186 : }
187 0 : test_str = PyBytes_AS_STRING(unicode);
188 0 : } else if (PyBytes_Check(value)) {
189 0 : test_str = PyBytes_AS_STRING(value);
190 : } else {
191 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
192 0 : return -1;
193 : }
194 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
195 0 : if (unicode != NULL) {
196 0 : Py_DECREF(unicode);
197 : }
198 0 : if (talloc_str == NULL) {
199 0 : PyErr_NoMemory();
200 0 : return -1;
201 : }
202 0 : object->scope = talloc_str;
203 : }
204 0 : return 0;
205 : }
206 :
207 0 : static PyObject *py_nbt_name_get_type(PyObject *obj, void *closure)
208 : {
209 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
210 0 : PyObject *py_type;
211 0 : py_type = PyLong_FromLong((uint16_t)object->type);
212 0 : return py_type;
213 : }
214 :
215 0 : static int py_nbt_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
216 : {
217 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
218 0 : if (value == NULL) {
219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
220 0 : return -1;
221 : }
222 : {
223 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
224 0 : if (PyLong_Check(value)) {
225 0 : unsigned long long test_var;
226 0 : test_var = PyLong_AsUnsignedLongLong(value);
227 0 : if (PyErr_Occurred() != NULL) {
228 0 : return -1;
229 : }
230 0 : if (test_var > uint_max) {
231 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
232 : PyLong_Type.tp_name, uint_max, test_var);
233 0 : return -1;
234 : }
235 0 : object->type = test_var;
236 : } else {
237 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
238 : PyLong_Type.tp_name);
239 0 : return -1;
240 : }
241 : }
242 0 : return 0;
243 : }
244 :
245 : static PyGetSetDef py_nbt_name_getsetters[] = {
246 : {
247 : .name = discard_const_p(char, "name"),
248 : .get = py_nbt_name_get_name,
249 : .set = py_nbt_name_set_name,
250 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
251 : },
252 : {
253 : .name = discard_const_p(char, "scope"),
254 : .get = py_nbt_name_get_scope,
255 : .set = py_nbt_name_set_scope,
256 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
257 : },
258 : {
259 : .name = discard_const_p(char, "type"),
260 : .get = py_nbt_name_get_type,
261 : .set = py_nbt_name_set_type,
262 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
263 : },
264 : { .name = NULL }
265 : };
266 :
267 0 : static PyObject *py_nbt_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
268 : {
269 0 : return pytalloc_new(struct nbt_name, type);
270 : }
271 :
272 0 : static PyObject *py_nbt_name_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
273 : {
274 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
275 0 : PyObject *ret = NULL;
276 0 : DATA_BLOB blob;
277 0 : enum ndr_err_code err;
278 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
279 0 : if (tmp_ctx == NULL) {
280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
281 0 : return NULL;
282 : }
283 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name);
284 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
285 0 : TALLOC_FREE(tmp_ctx);
286 0 : PyErr_SetNdrError(err);
287 0 : return NULL;
288 : }
289 :
290 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
291 0 : TALLOC_FREE(tmp_ctx);
292 0 : return ret;
293 : }
294 :
295 0 : static PyObject *py_nbt_name_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
296 : {
297 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
298 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
299 0 : Py_ssize_t blob_length = 0;
300 0 : enum ndr_err_code err;
301 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
302 0 : PyObject *allow_remaining_obj = NULL;
303 0 : bool allow_remaining = false;
304 :
305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
306 : discard_const_p(char *, kwnames),
307 : &blob.data, &blob_length,
308 : &allow_remaining_obj)) {
309 0 : return NULL;
310 : }
311 0 : blob.length = blob_length;
312 :
313 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
314 0 : allow_remaining = true;
315 : }
316 :
317 0 : if (allow_remaining) {
318 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
319 : } else {
320 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
321 : }
322 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
323 0 : PyErr_SetNdrError(err);
324 0 : return NULL;
325 : }
326 :
327 0 : Py_RETURN_NONE;
328 : }
329 :
330 0 : static PyObject *py_nbt_name_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
331 : {
332 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
333 0 : PyObject *ret;
334 0 : char *retstr;
335 :
336 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name, "nbt_name", object);
337 0 : ret = PyUnicode_FromString(retstr);
338 0 : talloc_free(retstr);
339 :
340 0 : return ret;
341 : }
342 :
343 : static PyMethodDef py_nbt_name_methods[] = {
344 : { "__ndr_pack__", (PyCFunction)py_nbt_name_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
345 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_name_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
346 : { "__ndr_print__", (PyCFunction)py_nbt_name_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
347 : { NULL, NULL, 0, NULL }
348 : };
349 :
350 :
351 : static PyTypeObject nbt_name_Type = {
352 : PyVarObject_HEAD_INIT(NULL, 0)
353 : .tp_name = "nbt.name",
354 : .tp_getset = py_nbt_name_getsetters,
355 : .tp_methods = py_nbt_name_methods,
356 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
357 : .tp_new = py_nbt_name_new,
358 : };
359 :
360 :
361 0 : static PyObject *py_nbt_name_question_get_name(PyObject *obj, void *closure)
362 : {
363 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
364 0 : PyObject *py_name;
365 0 : py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
366 0 : return py_name;
367 : }
368 :
369 0 : static int py_nbt_name_question_set_name(PyObject *py_obj, PyObject *value, void *closure)
370 : {
371 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
372 0 : if (value == NULL) {
373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
374 0 : return -1;
375 : }
376 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
377 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
378 0 : PyErr_NoMemory();
379 0 : return -1;
380 : }
381 0 : object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
382 0 : return 0;
383 : }
384 :
385 0 : static PyObject *py_nbt_name_question_get_question_type(PyObject *obj, void *closure)
386 : {
387 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
388 0 : PyObject *py_question_type;
389 0 : py_question_type = PyLong_FromLong((uint16_t)object->question_type);
390 0 : return py_question_type;
391 : }
392 :
393 0 : static int py_nbt_name_question_set_question_type(PyObject *py_obj, PyObject *value, void *closure)
394 : {
395 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
396 0 : if (value == NULL) {
397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->question_type");
398 0 : return -1;
399 : }
400 : {
401 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_type));
402 0 : if (PyLong_Check(value)) {
403 0 : unsigned long long test_var;
404 0 : test_var = PyLong_AsUnsignedLongLong(value);
405 0 : if (PyErr_Occurred() != NULL) {
406 0 : return -1;
407 : }
408 0 : if (test_var > uint_max) {
409 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
410 : PyLong_Type.tp_name, uint_max, test_var);
411 0 : return -1;
412 : }
413 0 : object->question_type = test_var;
414 : } else {
415 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
416 : PyLong_Type.tp_name);
417 0 : return -1;
418 : }
419 : }
420 0 : return 0;
421 : }
422 :
423 0 : static PyObject *py_nbt_name_question_get_question_class(PyObject *obj, void *closure)
424 : {
425 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
426 0 : PyObject *py_question_class;
427 0 : py_question_class = PyLong_FromLong((uint16_t)object->question_class);
428 0 : return py_question_class;
429 : }
430 :
431 0 : static int py_nbt_name_question_set_question_class(PyObject *py_obj, PyObject *value, void *closure)
432 : {
433 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
434 0 : if (value == NULL) {
435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->question_class");
436 0 : return -1;
437 : }
438 : {
439 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_class));
440 0 : if (PyLong_Check(value)) {
441 0 : unsigned long long test_var;
442 0 : test_var = PyLong_AsUnsignedLongLong(value);
443 0 : if (PyErr_Occurred() != NULL) {
444 0 : return -1;
445 : }
446 0 : if (test_var > uint_max) {
447 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
448 : PyLong_Type.tp_name, uint_max, test_var);
449 0 : return -1;
450 : }
451 0 : object->question_class = test_var;
452 : } else {
453 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
454 : PyLong_Type.tp_name);
455 0 : return -1;
456 : }
457 : }
458 0 : return 0;
459 : }
460 :
461 : static PyGetSetDef py_nbt_name_question_getsetters[] = {
462 : {
463 : .name = discard_const_p(char, "name"),
464 : .get = py_nbt_name_question_get_name,
465 : .set = py_nbt_name_question_set_name,
466 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
467 : },
468 : {
469 : .name = discard_const_p(char, "question_type"),
470 : .get = py_nbt_name_question_get_question_type,
471 : .set = py_nbt_name_question_set_question_type,
472 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
473 : },
474 : {
475 : .name = discard_const_p(char, "question_class"),
476 : .get = py_nbt_name_question_get_question_class,
477 : .set = py_nbt_name_question_set_question_class,
478 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
479 : },
480 : { .name = NULL }
481 : };
482 :
483 0 : static PyObject *py_nbt_name_question_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
484 : {
485 0 : return pytalloc_new(struct nbt_name_question, type);
486 : }
487 :
488 :
489 : static PyTypeObject nbt_name_question_Type = {
490 : PyVarObject_HEAD_INIT(NULL, 0)
491 : .tp_name = "nbt.name_question",
492 : .tp_getset = py_nbt_name_question_getsetters,
493 : .tp_methods = NULL,
494 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
495 : .tp_new = py_nbt_name_question_new,
496 : };
497 :
498 :
499 0 : static PyObject *py_nbt_rdata_address_get_nb_flags(PyObject *obj, void *closure)
500 : {
501 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(obj);
502 0 : PyObject *py_nb_flags;
503 0 : py_nb_flags = PyLong_FromLong((uint16_t)object->nb_flags);
504 0 : return py_nb_flags;
505 : }
506 :
507 0 : static int py_nbt_rdata_address_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
508 : {
509 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(py_obj);
510 0 : if (value == NULL) {
511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nb_flags");
512 0 : return -1;
513 : }
514 : {
515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
516 0 : if (PyLong_Check(value)) {
517 0 : unsigned long long test_var;
518 0 : test_var = PyLong_AsUnsignedLongLong(value);
519 0 : if (PyErr_Occurred() != NULL) {
520 0 : return -1;
521 : }
522 0 : if (test_var > uint_max) {
523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
524 : PyLong_Type.tp_name, uint_max, test_var);
525 0 : return -1;
526 : }
527 0 : object->nb_flags = test_var;
528 : } else {
529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
530 : PyLong_Type.tp_name);
531 0 : return -1;
532 : }
533 : }
534 0 : return 0;
535 : }
536 :
537 0 : static PyObject *py_nbt_rdata_address_get_ipaddr(PyObject *obj, void *closure)
538 : {
539 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(obj);
540 0 : PyObject *py_ipaddr;
541 0 : py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
542 0 : return py_ipaddr;
543 : }
544 :
545 0 : static int py_nbt_rdata_address_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
546 : {
547 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(py_obj);
548 0 : if (value == NULL) {
549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipaddr");
550 0 : return -1;
551 : }
552 : {
553 0 : const char *test_str;
554 0 : const char *talloc_str;
555 0 : PyObject *unicode = NULL;
556 0 : if (PyUnicode_Check(value)) {
557 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
558 0 : if (unicode == NULL) {
559 0 : return -1;
560 : }
561 0 : test_str = PyBytes_AS_STRING(unicode);
562 0 : } else if (PyBytes_Check(value)) {
563 0 : test_str = PyBytes_AS_STRING(value);
564 : } else {
565 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
566 0 : return -1;
567 : }
568 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
569 0 : if (unicode != NULL) {
570 0 : Py_DECREF(unicode);
571 : }
572 0 : if (talloc_str == NULL) {
573 0 : PyErr_NoMemory();
574 0 : return -1;
575 : }
576 0 : object->ipaddr = talloc_str;
577 : }
578 0 : return 0;
579 : }
580 :
581 : static PyGetSetDef py_nbt_rdata_address_getsetters[] = {
582 : {
583 : .name = discard_const_p(char, "nb_flags"),
584 : .get = py_nbt_rdata_address_get_nb_flags,
585 : .set = py_nbt_rdata_address_set_nb_flags,
586 : .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
587 : },
588 : {
589 : .name = discard_const_p(char, "ipaddr"),
590 : .get = py_nbt_rdata_address_get_ipaddr,
591 : .set = py_nbt_rdata_address_set_ipaddr,
592 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
593 : },
594 : { .name = NULL }
595 : };
596 :
597 0 : static PyObject *py_nbt_rdata_address_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
598 : {
599 0 : return pytalloc_new(struct nbt_rdata_address, type);
600 : }
601 :
602 :
603 : static PyTypeObject nbt_rdata_address_Type = {
604 : PyVarObject_HEAD_INIT(NULL, 0)
605 : .tp_name = "nbt.rdata_address",
606 : .tp_getset = py_nbt_rdata_address_getsetters,
607 : .tp_methods = NULL,
608 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
609 : .tp_new = py_nbt_rdata_address_new,
610 : };
611 :
612 :
613 0 : static PyObject *py_nbt_rdata_netbios_get_length(PyObject *obj, void *closure)
614 : {
615 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(obj);
616 0 : PyObject *py_length;
617 0 : py_length = PyLong_FromLong((uint16_t)object->length);
618 0 : return py_length;
619 : }
620 :
621 0 : static int py_nbt_rdata_netbios_set_length(PyObject *py_obj, PyObject *value, void *closure)
622 : {
623 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(py_obj);
624 0 : if (value == NULL) {
625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
626 0 : return -1;
627 : }
628 : {
629 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
630 0 : if (PyLong_Check(value)) {
631 0 : unsigned long long test_var;
632 0 : test_var = PyLong_AsUnsignedLongLong(value);
633 0 : if (PyErr_Occurred() != NULL) {
634 0 : return -1;
635 : }
636 0 : if (test_var > uint_max) {
637 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
638 : PyLong_Type.tp_name, uint_max, test_var);
639 0 : return -1;
640 : }
641 0 : object->length = test_var;
642 : } else {
643 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
644 : PyLong_Type.tp_name);
645 0 : return -1;
646 : }
647 : }
648 0 : return 0;
649 : }
650 :
651 0 : static PyObject *py_nbt_rdata_netbios_get_addresses(PyObject *obj, void *closure)
652 : {
653 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(obj);
654 0 : PyObject *py_addresses;
655 0 : py_addresses = PyList_New(object->length / 6);
656 0 : if (py_addresses == NULL) {
657 0 : return NULL;
658 : }
659 : {
660 : int addresses_cntr_0;
661 0 : for (addresses_cntr_0 = 0; addresses_cntr_0 < (object->length / 6); addresses_cntr_0++) {
662 0 : PyObject *py_addresses_0;
663 0 : py_addresses_0 = pytalloc_reference_ex(&nbt_rdata_address_Type, object->addresses, &object->addresses[addresses_cntr_0]);
664 0 : PyList_SetItem(py_addresses, addresses_cntr_0, py_addresses_0);
665 : }
666 : }
667 0 : return py_addresses;
668 : }
669 :
670 0 : static int py_nbt_rdata_netbios_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
671 : {
672 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(py_obj);
673 0 : if (value == NULL) {
674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses");
675 0 : return -1;
676 : }
677 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
678 : {
679 0 : int addresses_cntr_0;
680 0 : object->addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addresses, PyList_GET_SIZE(value));
681 0 : if (!object->addresses) { return -1; }
682 0 : talloc_set_name_const(object->addresses, "ARRAY: object->addresses");
683 0 : for (addresses_cntr_0 = 0; addresses_cntr_0 < PyList_GET_SIZE(value); addresses_cntr_0++) {
684 0 : if (PyList_GET_ITEM(value, addresses_cntr_0) == NULL) {
685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses[addresses_cntr_0]");
686 0 : return -1;
687 : }
688 0 : PY_CHECK_TYPE(&nbt_rdata_address_Type, PyList_GET_ITEM(value, addresses_cntr_0), return -1;);
689 0 : if (talloc_reference(object->addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_0))) == NULL) {
690 0 : PyErr_NoMemory();
691 0 : return -1;
692 : }
693 0 : object->addresses[addresses_cntr_0] = *(struct nbt_rdata_address *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_0));
694 : }
695 : }
696 0 : return 0;
697 : }
698 :
699 : static PyGetSetDef py_nbt_rdata_netbios_getsetters[] = {
700 : {
701 : .name = discard_const_p(char, "length"),
702 : .get = py_nbt_rdata_netbios_get_length,
703 : .set = py_nbt_rdata_netbios_set_length,
704 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
705 : },
706 : {
707 : .name = discard_const_p(char, "addresses"),
708 : .get = py_nbt_rdata_netbios_get_addresses,
709 : .set = py_nbt_rdata_netbios_set_addresses,
710 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata_address")
711 : },
712 : { .name = NULL }
713 : };
714 :
715 0 : static PyObject *py_nbt_rdata_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
716 : {
717 0 : return pytalloc_new(struct nbt_rdata_netbios, type);
718 : }
719 :
720 :
721 : static PyTypeObject nbt_rdata_netbios_Type = {
722 : PyVarObject_HEAD_INIT(NULL, 0)
723 : .tp_name = "nbt.rdata_netbios",
724 : .tp_getset = py_nbt_rdata_netbios_getsetters,
725 : .tp_methods = NULL,
726 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
727 : .tp_new = py_nbt_rdata_netbios_new,
728 : };
729 :
730 :
731 0 : static PyObject *py_nbt_statistics_get_unit_id(PyObject *obj, void *closure)
732 : {
733 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
734 0 : PyObject *py_unit_id;
735 0 : py_unit_id = PyList_New(6);
736 0 : if (py_unit_id == NULL) {
737 0 : return NULL;
738 : }
739 : {
740 : int unit_id_cntr_0;
741 0 : for (unit_id_cntr_0 = 0; unit_id_cntr_0 < (6); unit_id_cntr_0++) {
742 0 : PyObject *py_unit_id_0;
743 0 : py_unit_id_0 = PyLong_FromLong((uint16_t)object->unit_id[unit_id_cntr_0]);
744 0 : PyList_SetItem(py_unit_id, unit_id_cntr_0, py_unit_id_0);
745 : }
746 : }
747 0 : return py_unit_id;
748 : }
749 :
750 0 : static int py_nbt_statistics_set_unit_id(PyObject *py_obj, PyObject *value, void *closure)
751 : {
752 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
753 0 : if (value == NULL) {
754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unit_id");
755 0 : return -1;
756 : }
757 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
758 : {
759 0 : int unit_id_cntr_0;
760 0 : if (ARRAY_SIZE(object->unit_id) != PyList_GET_SIZE(value)) {
761 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unit_id), PyList_GET_SIZE(value));
762 0 : return -1;
763 : }
764 0 : for (unit_id_cntr_0 = 0; unit_id_cntr_0 < PyList_GET_SIZE(value); unit_id_cntr_0++) {
765 0 : if (PyList_GET_ITEM(value, unit_id_cntr_0) == NULL) {
766 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unit_id[unit_id_cntr_0]");
767 0 : return -1;
768 : }
769 : {
770 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unit_id[unit_id_cntr_0]));
771 0 : if (PyLong_Check(PyList_GET_ITEM(value, unit_id_cntr_0))) {
772 0 : unsigned long long test_var;
773 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unit_id_cntr_0));
774 0 : if (PyErr_Occurred() != NULL) {
775 0 : return -1;
776 : }
777 0 : if (test_var > uint_max) {
778 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
779 : PyLong_Type.tp_name, uint_max, test_var);
780 0 : return -1;
781 : }
782 0 : object->unit_id[unit_id_cntr_0] = test_var;
783 : } else {
784 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
785 : PyLong_Type.tp_name);
786 0 : return -1;
787 : }
788 : }
789 : }
790 : }
791 0 : return 0;
792 : }
793 :
794 0 : static PyObject *py_nbt_statistics_get_jumpers(PyObject *obj, void *closure)
795 : {
796 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
797 0 : PyObject *py_jumpers;
798 0 : py_jumpers = PyLong_FromLong((uint16_t)object->jumpers);
799 0 : return py_jumpers;
800 : }
801 :
802 0 : static int py_nbt_statistics_set_jumpers(PyObject *py_obj, PyObject *value, void *closure)
803 : {
804 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
805 0 : if (value == NULL) {
806 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->jumpers");
807 0 : return -1;
808 : }
809 : {
810 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->jumpers));
811 0 : if (PyLong_Check(value)) {
812 0 : unsigned long long test_var;
813 0 : test_var = PyLong_AsUnsignedLongLong(value);
814 0 : if (PyErr_Occurred() != NULL) {
815 0 : return -1;
816 : }
817 0 : if (test_var > uint_max) {
818 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
819 : PyLong_Type.tp_name, uint_max, test_var);
820 0 : return -1;
821 : }
822 0 : object->jumpers = test_var;
823 : } else {
824 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
825 : PyLong_Type.tp_name);
826 0 : return -1;
827 : }
828 : }
829 0 : return 0;
830 : }
831 :
832 0 : static PyObject *py_nbt_statistics_get_test_result(PyObject *obj, void *closure)
833 : {
834 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
835 0 : PyObject *py_test_result;
836 0 : py_test_result = PyLong_FromLong((uint16_t)object->test_result);
837 0 : return py_test_result;
838 : }
839 :
840 0 : static int py_nbt_statistics_set_test_result(PyObject *py_obj, PyObject *value, void *closure)
841 : {
842 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
843 0 : if (value == NULL) {
844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->test_result");
845 0 : return -1;
846 : }
847 : {
848 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->test_result));
849 0 : if (PyLong_Check(value)) {
850 0 : unsigned long long test_var;
851 0 : test_var = PyLong_AsUnsignedLongLong(value);
852 0 : if (PyErr_Occurred() != NULL) {
853 0 : return -1;
854 : }
855 0 : if (test_var > uint_max) {
856 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
857 : PyLong_Type.tp_name, uint_max, test_var);
858 0 : return -1;
859 : }
860 0 : object->test_result = test_var;
861 : } else {
862 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
863 : PyLong_Type.tp_name);
864 0 : return -1;
865 : }
866 : }
867 0 : return 0;
868 : }
869 :
870 0 : static PyObject *py_nbt_statistics_get_version_number(PyObject *obj, void *closure)
871 : {
872 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
873 0 : PyObject *py_version_number;
874 0 : py_version_number = PyLong_FromLong((uint16_t)object->version_number);
875 0 : return py_version_number;
876 : }
877 :
878 0 : static int py_nbt_statistics_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
879 : {
880 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
881 0 : if (value == NULL) {
882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version_number");
883 0 : return -1;
884 : }
885 : {
886 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_number));
887 0 : if (PyLong_Check(value)) {
888 0 : unsigned long long test_var;
889 0 : test_var = PyLong_AsUnsignedLongLong(value);
890 0 : if (PyErr_Occurred() != NULL) {
891 0 : return -1;
892 : }
893 0 : if (test_var > uint_max) {
894 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
895 : PyLong_Type.tp_name, uint_max, test_var);
896 0 : return -1;
897 : }
898 0 : object->version_number = test_var;
899 : } else {
900 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
901 : PyLong_Type.tp_name);
902 0 : return -1;
903 : }
904 : }
905 0 : return 0;
906 : }
907 :
908 0 : static PyObject *py_nbt_statistics_get_period_of_statistics(PyObject *obj, void *closure)
909 : {
910 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
911 0 : PyObject *py_period_of_statistics;
912 0 : py_period_of_statistics = PyLong_FromLong((uint16_t)object->period_of_statistics);
913 0 : return py_period_of_statistics;
914 : }
915 :
916 0 : static int py_nbt_statistics_set_period_of_statistics(PyObject *py_obj, PyObject *value, void *closure)
917 : {
918 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
919 0 : if (value == NULL) {
920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->period_of_statistics");
921 0 : return -1;
922 : }
923 : {
924 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->period_of_statistics));
925 0 : if (PyLong_Check(value)) {
926 0 : unsigned long long test_var;
927 0 : test_var = PyLong_AsUnsignedLongLong(value);
928 0 : if (PyErr_Occurred() != NULL) {
929 0 : return -1;
930 : }
931 0 : if (test_var > uint_max) {
932 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
933 : PyLong_Type.tp_name, uint_max, test_var);
934 0 : return -1;
935 : }
936 0 : object->period_of_statistics = test_var;
937 : } else {
938 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
939 : PyLong_Type.tp_name);
940 0 : return -1;
941 : }
942 : }
943 0 : return 0;
944 : }
945 :
946 0 : static PyObject *py_nbt_statistics_get_number_of_crcs(PyObject *obj, void *closure)
947 : {
948 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
949 0 : PyObject *py_number_of_crcs;
950 0 : py_number_of_crcs = PyLong_FromLong((uint16_t)object->number_of_crcs);
951 0 : return py_number_of_crcs;
952 : }
953 :
954 0 : static int py_nbt_statistics_set_number_of_crcs(PyObject *py_obj, PyObject *value, void *closure)
955 : {
956 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
957 0 : if (value == NULL) {
958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_of_crcs");
959 0 : return -1;
960 : }
961 : {
962 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_crcs));
963 0 : if (PyLong_Check(value)) {
964 0 : unsigned long long test_var;
965 0 : test_var = PyLong_AsUnsignedLongLong(value);
966 0 : if (PyErr_Occurred() != NULL) {
967 0 : return -1;
968 : }
969 0 : if (test_var > uint_max) {
970 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
971 : PyLong_Type.tp_name, uint_max, test_var);
972 0 : return -1;
973 : }
974 0 : object->number_of_crcs = test_var;
975 : } else {
976 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
977 : PyLong_Type.tp_name);
978 0 : return -1;
979 : }
980 : }
981 0 : return 0;
982 : }
983 :
984 0 : static PyObject *py_nbt_statistics_get_number_alignment_errors(PyObject *obj, void *closure)
985 : {
986 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
987 0 : PyObject *py_number_alignment_errors;
988 0 : py_number_alignment_errors = PyLong_FromLong((uint16_t)object->number_alignment_errors);
989 0 : return py_number_alignment_errors;
990 : }
991 :
992 0 : static int py_nbt_statistics_set_number_alignment_errors(PyObject *py_obj, PyObject *value, void *closure)
993 : {
994 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
995 0 : if (value == NULL) {
996 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_alignment_errors");
997 0 : return -1;
998 : }
999 : {
1000 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_alignment_errors));
1001 0 : if (PyLong_Check(value)) {
1002 0 : unsigned long long test_var;
1003 0 : test_var = PyLong_AsUnsignedLongLong(value);
1004 0 : if (PyErr_Occurred() != NULL) {
1005 0 : return -1;
1006 : }
1007 0 : if (test_var > uint_max) {
1008 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1009 : PyLong_Type.tp_name, uint_max, test_var);
1010 0 : return -1;
1011 : }
1012 0 : object->number_alignment_errors = test_var;
1013 : } else {
1014 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1015 : PyLong_Type.tp_name);
1016 0 : return -1;
1017 : }
1018 : }
1019 0 : return 0;
1020 : }
1021 :
1022 0 : static PyObject *py_nbt_statistics_get_number_of_collisions(PyObject *obj, void *closure)
1023 : {
1024 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1025 0 : PyObject *py_number_of_collisions;
1026 0 : py_number_of_collisions = PyLong_FromLong((uint16_t)object->number_of_collisions);
1027 0 : return py_number_of_collisions;
1028 : }
1029 :
1030 0 : static int py_nbt_statistics_set_number_of_collisions(PyObject *py_obj, PyObject *value, void *closure)
1031 : {
1032 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1033 0 : if (value == NULL) {
1034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_of_collisions");
1035 0 : return -1;
1036 : }
1037 : {
1038 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_collisions));
1039 0 : if (PyLong_Check(value)) {
1040 0 : unsigned long long test_var;
1041 0 : test_var = PyLong_AsUnsignedLongLong(value);
1042 0 : if (PyErr_Occurred() != NULL) {
1043 0 : return -1;
1044 : }
1045 0 : if (test_var > uint_max) {
1046 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1047 : PyLong_Type.tp_name, uint_max, test_var);
1048 0 : return -1;
1049 : }
1050 0 : object->number_of_collisions = test_var;
1051 : } else {
1052 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1053 : PyLong_Type.tp_name);
1054 0 : return -1;
1055 : }
1056 : }
1057 0 : return 0;
1058 : }
1059 :
1060 0 : static PyObject *py_nbt_statistics_get_number_send_aborts(PyObject *obj, void *closure)
1061 : {
1062 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1063 0 : PyObject *py_number_send_aborts;
1064 0 : py_number_send_aborts = PyLong_FromLong((uint16_t)object->number_send_aborts);
1065 0 : return py_number_send_aborts;
1066 : }
1067 :
1068 0 : static int py_nbt_statistics_set_number_send_aborts(PyObject *py_obj, PyObject *value, void *closure)
1069 : {
1070 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1071 0 : if (value == NULL) {
1072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_send_aborts");
1073 0 : return -1;
1074 : }
1075 : {
1076 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_send_aborts));
1077 0 : if (PyLong_Check(value)) {
1078 0 : unsigned long long test_var;
1079 0 : test_var = PyLong_AsUnsignedLongLong(value);
1080 0 : if (PyErr_Occurred() != NULL) {
1081 0 : return -1;
1082 : }
1083 0 : if (test_var > uint_max) {
1084 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1085 : PyLong_Type.tp_name, uint_max, test_var);
1086 0 : return -1;
1087 : }
1088 0 : object->number_send_aborts = test_var;
1089 : } else {
1090 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1091 : PyLong_Type.tp_name);
1092 0 : return -1;
1093 : }
1094 : }
1095 0 : return 0;
1096 : }
1097 :
1098 0 : static PyObject *py_nbt_statistics_get_number_good_sends(PyObject *obj, void *closure)
1099 : {
1100 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1101 0 : PyObject *py_number_good_sends;
1102 0 : py_number_good_sends = PyLong_FromUnsignedLongLong((uint32_t)object->number_good_sends);
1103 0 : return py_number_good_sends;
1104 : }
1105 :
1106 0 : static int py_nbt_statistics_set_number_good_sends(PyObject *py_obj, PyObject *value, void *closure)
1107 : {
1108 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1109 0 : if (value == NULL) {
1110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_good_sends");
1111 0 : return -1;
1112 : }
1113 : {
1114 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_sends));
1115 0 : if (PyLong_Check(value)) {
1116 0 : unsigned long long test_var;
1117 0 : test_var = PyLong_AsUnsignedLongLong(value);
1118 0 : if (PyErr_Occurred() != NULL) {
1119 0 : return -1;
1120 : }
1121 0 : if (test_var > uint_max) {
1122 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1123 : PyLong_Type.tp_name, uint_max, test_var);
1124 0 : return -1;
1125 : }
1126 0 : object->number_good_sends = test_var;
1127 : } else {
1128 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1129 : PyLong_Type.tp_name);
1130 0 : return -1;
1131 : }
1132 : }
1133 0 : return 0;
1134 : }
1135 :
1136 0 : static PyObject *py_nbt_statistics_get_number_good_receives(PyObject *obj, void *closure)
1137 : {
1138 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1139 0 : PyObject *py_number_good_receives;
1140 0 : py_number_good_receives = PyLong_FromUnsignedLongLong((uint32_t)object->number_good_receives);
1141 0 : return py_number_good_receives;
1142 : }
1143 :
1144 0 : static int py_nbt_statistics_set_number_good_receives(PyObject *py_obj, PyObject *value, void *closure)
1145 : {
1146 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1147 0 : if (value == NULL) {
1148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_good_receives");
1149 0 : return -1;
1150 : }
1151 : {
1152 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_receives));
1153 0 : if (PyLong_Check(value)) {
1154 0 : unsigned long long test_var;
1155 0 : test_var = PyLong_AsUnsignedLongLong(value);
1156 0 : if (PyErr_Occurred() != NULL) {
1157 0 : return -1;
1158 : }
1159 0 : if (test_var > uint_max) {
1160 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1161 : PyLong_Type.tp_name, uint_max, test_var);
1162 0 : return -1;
1163 : }
1164 0 : object->number_good_receives = test_var;
1165 : } else {
1166 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1167 : PyLong_Type.tp_name);
1168 0 : return -1;
1169 : }
1170 : }
1171 0 : return 0;
1172 : }
1173 :
1174 0 : static PyObject *py_nbt_statistics_get_number_retransmits(PyObject *obj, void *closure)
1175 : {
1176 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1177 0 : PyObject *py_number_retransmits;
1178 0 : py_number_retransmits = PyLong_FromLong((uint16_t)object->number_retransmits);
1179 0 : return py_number_retransmits;
1180 : }
1181 :
1182 0 : static int py_nbt_statistics_set_number_retransmits(PyObject *py_obj, PyObject *value, void *closure)
1183 : {
1184 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1185 0 : if (value == NULL) {
1186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_retransmits");
1187 0 : return -1;
1188 : }
1189 : {
1190 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_retransmits));
1191 0 : if (PyLong_Check(value)) {
1192 0 : unsigned long long test_var;
1193 0 : test_var = PyLong_AsUnsignedLongLong(value);
1194 0 : if (PyErr_Occurred() != NULL) {
1195 0 : return -1;
1196 : }
1197 0 : if (test_var > uint_max) {
1198 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1199 : PyLong_Type.tp_name, uint_max, test_var);
1200 0 : return -1;
1201 : }
1202 0 : object->number_retransmits = test_var;
1203 : } else {
1204 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1205 : PyLong_Type.tp_name);
1206 0 : return -1;
1207 : }
1208 : }
1209 0 : return 0;
1210 : }
1211 :
1212 0 : static PyObject *py_nbt_statistics_get_number_no_resource_conditions(PyObject *obj, void *closure)
1213 : {
1214 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1215 0 : PyObject *py_number_no_resource_conditions;
1216 0 : py_number_no_resource_conditions = PyLong_FromLong((uint16_t)object->number_no_resource_conditions);
1217 0 : return py_number_no_resource_conditions;
1218 : }
1219 :
1220 0 : static int py_nbt_statistics_set_number_no_resource_conditions(PyObject *py_obj, PyObject *value, void *closure)
1221 : {
1222 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1223 0 : if (value == NULL) {
1224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_no_resource_conditions");
1225 0 : return -1;
1226 : }
1227 : {
1228 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_no_resource_conditions));
1229 0 : if (PyLong_Check(value)) {
1230 0 : unsigned long long test_var;
1231 0 : test_var = PyLong_AsUnsignedLongLong(value);
1232 0 : if (PyErr_Occurred() != NULL) {
1233 0 : return -1;
1234 : }
1235 0 : if (test_var > uint_max) {
1236 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1237 : PyLong_Type.tp_name, uint_max, test_var);
1238 0 : return -1;
1239 : }
1240 0 : object->number_no_resource_conditions = test_var;
1241 : } else {
1242 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1243 : PyLong_Type.tp_name);
1244 0 : return -1;
1245 : }
1246 : }
1247 0 : return 0;
1248 : }
1249 :
1250 0 : static PyObject *py_nbt_statistics_get_number_free_command_blocks(PyObject *obj, void *closure)
1251 : {
1252 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1253 0 : PyObject *py_number_free_command_blocks;
1254 0 : py_number_free_command_blocks = PyLong_FromLong((uint16_t)object->number_free_command_blocks);
1255 0 : return py_number_free_command_blocks;
1256 : }
1257 :
1258 0 : static int py_nbt_statistics_set_number_free_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1259 : {
1260 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1261 0 : if (value == NULL) {
1262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_free_command_blocks");
1263 0 : return -1;
1264 : }
1265 : {
1266 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_free_command_blocks));
1267 0 : if (PyLong_Check(value)) {
1268 0 : unsigned long long test_var;
1269 0 : test_var = PyLong_AsUnsignedLongLong(value);
1270 0 : if (PyErr_Occurred() != NULL) {
1271 0 : return -1;
1272 : }
1273 0 : if (test_var > uint_max) {
1274 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1275 : PyLong_Type.tp_name, uint_max, test_var);
1276 0 : return -1;
1277 : }
1278 0 : object->number_free_command_blocks = test_var;
1279 : } else {
1280 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1281 : PyLong_Type.tp_name);
1282 0 : return -1;
1283 : }
1284 : }
1285 0 : return 0;
1286 : }
1287 :
1288 0 : static PyObject *py_nbt_statistics_get_total_number_command_blocks(PyObject *obj, void *closure)
1289 : {
1290 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1291 0 : PyObject *py_total_number_command_blocks;
1292 0 : py_total_number_command_blocks = PyLong_FromLong((uint16_t)object->total_number_command_blocks);
1293 0 : return py_total_number_command_blocks;
1294 : }
1295 :
1296 0 : static int py_nbt_statistics_set_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1297 : {
1298 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1299 0 : if (value == NULL) {
1300 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_number_command_blocks");
1301 0 : return -1;
1302 : }
1303 : {
1304 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_number_command_blocks));
1305 0 : if (PyLong_Check(value)) {
1306 0 : unsigned long long test_var;
1307 0 : test_var = PyLong_AsUnsignedLongLong(value);
1308 0 : if (PyErr_Occurred() != NULL) {
1309 0 : return -1;
1310 : }
1311 0 : if (test_var > uint_max) {
1312 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1313 : PyLong_Type.tp_name, uint_max, test_var);
1314 0 : return -1;
1315 : }
1316 0 : object->total_number_command_blocks = test_var;
1317 : } else {
1318 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1319 : PyLong_Type.tp_name);
1320 0 : return -1;
1321 : }
1322 : }
1323 0 : return 0;
1324 : }
1325 :
1326 0 : static PyObject *py_nbt_statistics_get_max_total_number_command_blocks(PyObject *obj, void *closure)
1327 : {
1328 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1329 0 : PyObject *py_max_total_number_command_blocks;
1330 0 : py_max_total_number_command_blocks = PyLong_FromLong((uint16_t)object->max_total_number_command_blocks);
1331 0 : return py_max_total_number_command_blocks;
1332 : }
1333 :
1334 0 : static int py_nbt_statistics_set_max_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1335 : {
1336 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1337 0 : if (value == NULL) {
1338 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_total_number_command_blocks");
1339 0 : return -1;
1340 : }
1341 : {
1342 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_number_command_blocks));
1343 0 : if (PyLong_Check(value)) {
1344 0 : unsigned long long test_var;
1345 0 : test_var = PyLong_AsUnsignedLongLong(value);
1346 0 : if (PyErr_Occurred() != NULL) {
1347 0 : return -1;
1348 : }
1349 0 : if (test_var > uint_max) {
1350 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1351 : PyLong_Type.tp_name, uint_max, test_var);
1352 0 : return -1;
1353 : }
1354 0 : object->max_total_number_command_blocks = test_var;
1355 : } else {
1356 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1357 : PyLong_Type.tp_name);
1358 0 : return -1;
1359 : }
1360 : }
1361 0 : return 0;
1362 : }
1363 :
1364 0 : static PyObject *py_nbt_statistics_get_number_pending_sessions(PyObject *obj, void *closure)
1365 : {
1366 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1367 0 : PyObject *py_number_pending_sessions;
1368 0 : py_number_pending_sessions = PyLong_FromLong((uint16_t)object->number_pending_sessions);
1369 0 : return py_number_pending_sessions;
1370 : }
1371 :
1372 0 : static int py_nbt_statistics_set_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
1373 : {
1374 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1375 0 : if (value == NULL) {
1376 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_pending_sessions");
1377 0 : return -1;
1378 : }
1379 : {
1380 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_pending_sessions));
1381 0 : if (PyLong_Check(value)) {
1382 0 : unsigned long long test_var;
1383 0 : test_var = PyLong_AsUnsignedLongLong(value);
1384 0 : if (PyErr_Occurred() != NULL) {
1385 0 : return -1;
1386 : }
1387 0 : if (test_var > uint_max) {
1388 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1389 : PyLong_Type.tp_name, uint_max, test_var);
1390 0 : return -1;
1391 : }
1392 0 : object->number_pending_sessions = test_var;
1393 : } else {
1394 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1395 : PyLong_Type.tp_name);
1396 0 : return -1;
1397 : }
1398 : }
1399 0 : return 0;
1400 : }
1401 :
1402 0 : static PyObject *py_nbt_statistics_get_max_number_pending_sessions(PyObject *obj, void *closure)
1403 : {
1404 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1405 0 : PyObject *py_max_number_pending_sessions;
1406 0 : py_max_number_pending_sessions = PyLong_FromLong((uint16_t)object->max_number_pending_sessions);
1407 0 : return py_max_number_pending_sessions;
1408 : }
1409 :
1410 0 : static int py_nbt_statistics_set_max_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
1411 : {
1412 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1413 0 : if (value == NULL) {
1414 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_number_pending_sessions");
1415 0 : return -1;
1416 : }
1417 : {
1418 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_number_pending_sessions));
1419 0 : if (PyLong_Check(value)) {
1420 0 : unsigned long long test_var;
1421 0 : test_var = PyLong_AsUnsignedLongLong(value);
1422 0 : if (PyErr_Occurred() != NULL) {
1423 0 : return -1;
1424 : }
1425 0 : if (test_var > uint_max) {
1426 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1427 : PyLong_Type.tp_name, uint_max, test_var);
1428 0 : return -1;
1429 : }
1430 0 : object->max_number_pending_sessions = test_var;
1431 : } else {
1432 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1433 : PyLong_Type.tp_name);
1434 0 : return -1;
1435 : }
1436 : }
1437 0 : return 0;
1438 : }
1439 :
1440 0 : static PyObject *py_nbt_statistics_get_max_total_sessions_possible(PyObject *obj, void *closure)
1441 : {
1442 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1443 0 : PyObject *py_max_total_sessions_possible;
1444 0 : py_max_total_sessions_possible = PyLong_FromLong((uint16_t)object->max_total_sessions_possible);
1445 0 : return py_max_total_sessions_possible;
1446 : }
1447 :
1448 0 : static int py_nbt_statistics_set_max_total_sessions_possible(PyObject *py_obj, PyObject *value, void *closure)
1449 : {
1450 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1451 0 : if (value == NULL) {
1452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_total_sessions_possible");
1453 0 : return -1;
1454 : }
1455 : {
1456 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_sessions_possible));
1457 0 : if (PyLong_Check(value)) {
1458 0 : unsigned long long test_var;
1459 0 : test_var = PyLong_AsUnsignedLongLong(value);
1460 0 : if (PyErr_Occurred() != NULL) {
1461 0 : return -1;
1462 : }
1463 0 : if (test_var > uint_max) {
1464 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1465 : PyLong_Type.tp_name, uint_max, test_var);
1466 0 : return -1;
1467 : }
1468 0 : object->max_total_sessions_possible = test_var;
1469 : } else {
1470 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1471 : PyLong_Type.tp_name);
1472 0 : return -1;
1473 : }
1474 : }
1475 0 : return 0;
1476 : }
1477 :
1478 0 : static PyObject *py_nbt_statistics_get_session_data_packet_size(PyObject *obj, void *closure)
1479 : {
1480 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1481 0 : PyObject *py_session_data_packet_size;
1482 0 : py_session_data_packet_size = PyLong_FromLong((uint16_t)object->session_data_packet_size);
1483 0 : return py_session_data_packet_size;
1484 : }
1485 :
1486 0 : static int py_nbt_statistics_set_session_data_packet_size(PyObject *py_obj, PyObject *value, void *closure)
1487 : {
1488 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1489 0 : if (value == NULL) {
1490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->session_data_packet_size");
1491 0 : return -1;
1492 : }
1493 : {
1494 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->session_data_packet_size));
1495 0 : if (PyLong_Check(value)) {
1496 0 : unsigned long long test_var;
1497 0 : test_var = PyLong_AsUnsignedLongLong(value);
1498 0 : if (PyErr_Occurred() != NULL) {
1499 0 : return -1;
1500 : }
1501 0 : if (test_var > uint_max) {
1502 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1503 : PyLong_Type.tp_name, uint_max, test_var);
1504 0 : return -1;
1505 : }
1506 0 : object->session_data_packet_size = test_var;
1507 : } else {
1508 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1509 : PyLong_Type.tp_name);
1510 0 : return -1;
1511 : }
1512 : }
1513 0 : return 0;
1514 : }
1515 :
1516 : static PyGetSetDef py_nbt_statistics_getsetters[] = {
1517 : {
1518 : .name = discard_const_p(char, "unit_id"),
1519 : .get = py_nbt_statistics_get_unit_id,
1520 : .set = py_nbt_statistics_set_unit_id,
1521 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1522 : },
1523 : {
1524 : .name = discard_const_p(char, "jumpers"),
1525 : .get = py_nbt_statistics_get_jumpers,
1526 : .set = py_nbt_statistics_set_jumpers,
1527 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1528 : },
1529 : {
1530 : .name = discard_const_p(char, "test_result"),
1531 : .get = py_nbt_statistics_get_test_result,
1532 : .set = py_nbt_statistics_set_test_result,
1533 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1534 : },
1535 : {
1536 : .name = discard_const_p(char, "version_number"),
1537 : .get = py_nbt_statistics_get_version_number,
1538 : .set = py_nbt_statistics_set_version_number,
1539 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1540 : },
1541 : {
1542 : .name = discard_const_p(char, "period_of_statistics"),
1543 : .get = py_nbt_statistics_get_period_of_statistics,
1544 : .set = py_nbt_statistics_set_period_of_statistics,
1545 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1546 : },
1547 : {
1548 : .name = discard_const_p(char, "number_of_crcs"),
1549 : .get = py_nbt_statistics_get_number_of_crcs,
1550 : .set = py_nbt_statistics_set_number_of_crcs,
1551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1552 : },
1553 : {
1554 : .name = discard_const_p(char, "number_alignment_errors"),
1555 : .get = py_nbt_statistics_get_number_alignment_errors,
1556 : .set = py_nbt_statistics_set_number_alignment_errors,
1557 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1558 : },
1559 : {
1560 : .name = discard_const_p(char, "number_of_collisions"),
1561 : .get = py_nbt_statistics_get_number_of_collisions,
1562 : .set = py_nbt_statistics_set_number_of_collisions,
1563 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1564 : },
1565 : {
1566 : .name = discard_const_p(char, "number_send_aborts"),
1567 : .get = py_nbt_statistics_get_number_send_aborts,
1568 : .set = py_nbt_statistics_set_number_send_aborts,
1569 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1570 : },
1571 : {
1572 : .name = discard_const_p(char, "number_good_sends"),
1573 : .get = py_nbt_statistics_get_number_good_sends,
1574 : .set = py_nbt_statistics_set_number_good_sends,
1575 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1576 : },
1577 : {
1578 : .name = discard_const_p(char, "number_good_receives"),
1579 : .get = py_nbt_statistics_get_number_good_receives,
1580 : .set = py_nbt_statistics_set_number_good_receives,
1581 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1582 : },
1583 : {
1584 : .name = discard_const_p(char, "number_retransmits"),
1585 : .get = py_nbt_statistics_get_number_retransmits,
1586 : .set = py_nbt_statistics_set_number_retransmits,
1587 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1588 : },
1589 : {
1590 : .name = discard_const_p(char, "number_no_resource_conditions"),
1591 : .get = py_nbt_statistics_get_number_no_resource_conditions,
1592 : .set = py_nbt_statistics_set_number_no_resource_conditions,
1593 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1594 : },
1595 : {
1596 : .name = discard_const_p(char, "number_free_command_blocks"),
1597 : .get = py_nbt_statistics_get_number_free_command_blocks,
1598 : .set = py_nbt_statistics_set_number_free_command_blocks,
1599 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1600 : },
1601 : {
1602 : .name = discard_const_p(char, "total_number_command_blocks"),
1603 : .get = py_nbt_statistics_get_total_number_command_blocks,
1604 : .set = py_nbt_statistics_set_total_number_command_blocks,
1605 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1606 : },
1607 : {
1608 : .name = discard_const_p(char, "max_total_number_command_blocks"),
1609 : .get = py_nbt_statistics_get_max_total_number_command_blocks,
1610 : .set = py_nbt_statistics_set_max_total_number_command_blocks,
1611 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1612 : },
1613 : {
1614 : .name = discard_const_p(char, "number_pending_sessions"),
1615 : .get = py_nbt_statistics_get_number_pending_sessions,
1616 : .set = py_nbt_statistics_set_number_pending_sessions,
1617 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1618 : },
1619 : {
1620 : .name = discard_const_p(char, "max_number_pending_sessions"),
1621 : .get = py_nbt_statistics_get_max_number_pending_sessions,
1622 : .set = py_nbt_statistics_set_max_number_pending_sessions,
1623 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1624 : },
1625 : {
1626 : .name = discard_const_p(char, "max_total_sessions_possible"),
1627 : .get = py_nbt_statistics_get_max_total_sessions_possible,
1628 : .set = py_nbt_statistics_set_max_total_sessions_possible,
1629 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1630 : },
1631 : {
1632 : .name = discard_const_p(char, "session_data_packet_size"),
1633 : .get = py_nbt_statistics_get_session_data_packet_size,
1634 : .set = py_nbt_statistics_set_session_data_packet_size,
1635 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1636 : },
1637 : { .name = NULL }
1638 : };
1639 :
1640 0 : static PyObject *py_nbt_statistics_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1641 : {
1642 0 : return pytalloc_new(struct nbt_statistics, type);
1643 : }
1644 :
1645 :
1646 : static PyTypeObject nbt_statistics_Type = {
1647 : PyVarObject_HEAD_INIT(NULL, 0)
1648 : .tp_name = "nbt.statistics",
1649 : .tp_getset = py_nbt_statistics_getsetters,
1650 : .tp_methods = NULL,
1651 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1652 : .tp_new = py_nbt_statistics_new,
1653 : };
1654 :
1655 :
1656 0 : static PyObject *py_nbt_status_name_get_name(PyObject *obj, void *closure)
1657 : {
1658 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
1659 0 : PyObject *py_name;
1660 0 : if (object->name == NULL) {
1661 0 : py_name = Py_None;
1662 0 : Py_INCREF(py_name);
1663 : } else {
1664 0 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
1665 : }
1666 0 : return py_name;
1667 : }
1668 :
1669 0 : static int py_nbt_status_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
1670 : {
1671 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
1672 0 : if (value == NULL) {
1673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
1674 0 : return -1;
1675 : }
1676 : {
1677 0 : const char *test_str;
1678 0 : const char *talloc_str;
1679 0 : PyObject *unicode = NULL;
1680 0 : if (PyUnicode_Check(value)) {
1681 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1682 0 : if (unicode == NULL) {
1683 0 : return -1;
1684 : }
1685 0 : test_str = PyBytes_AS_STRING(unicode);
1686 0 : } else if (PyBytes_Check(value)) {
1687 0 : test_str = PyBytes_AS_STRING(value);
1688 : } else {
1689 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1690 0 : return -1;
1691 : }
1692 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1693 0 : if (unicode != NULL) {
1694 0 : Py_DECREF(unicode);
1695 : }
1696 0 : if (talloc_str == NULL) {
1697 0 : PyErr_NoMemory();
1698 0 : return -1;
1699 : }
1700 0 : object->name = talloc_str;
1701 : }
1702 0 : return 0;
1703 : }
1704 :
1705 0 : static PyObject *py_nbt_status_name_get_type(PyObject *obj, void *closure)
1706 : {
1707 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
1708 0 : PyObject *py_type;
1709 0 : py_type = PyLong_FromLong((uint16_t)object->type);
1710 0 : return py_type;
1711 : }
1712 :
1713 0 : static int py_nbt_status_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
1714 : {
1715 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
1716 0 : if (value == NULL) {
1717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
1718 0 : return -1;
1719 : }
1720 : {
1721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1722 0 : if (PyLong_Check(value)) {
1723 0 : unsigned long long test_var;
1724 0 : test_var = PyLong_AsUnsignedLongLong(value);
1725 0 : if (PyErr_Occurred() != NULL) {
1726 0 : return -1;
1727 : }
1728 0 : if (test_var > uint_max) {
1729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1730 : PyLong_Type.tp_name, uint_max, test_var);
1731 0 : return -1;
1732 : }
1733 0 : object->type = test_var;
1734 : } else {
1735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1736 : PyLong_Type.tp_name);
1737 0 : return -1;
1738 : }
1739 : }
1740 0 : return 0;
1741 : }
1742 :
1743 0 : static PyObject *py_nbt_status_name_get_nb_flags(PyObject *obj, void *closure)
1744 : {
1745 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
1746 0 : PyObject *py_nb_flags;
1747 0 : py_nb_flags = PyLong_FromLong((uint16_t)object->nb_flags);
1748 0 : return py_nb_flags;
1749 : }
1750 :
1751 0 : static int py_nbt_status_name_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
1752 : {
1753 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
1754 0 : if (value == NULL) {
1755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nb_flags");
1756 0 : return -1;
1757 : }
1758 : {
1759 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
1760 0 : if (PyLong_Check(value)) {
1761 0 : unsigned long long test_var;
1762 0 : test_var = PyLong_AsUnsignedLongLong(value);
1763 0 : if (PyErr_Occurred() != NULL) {
1764 0 : return -1;
1765 : }
1766 0 : if (test_var > uint_max) {
1767 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1768 : PyLong_Type.tp_name, uint_max, test_var);
1769 0 : return -1;
1770 : }
1771 0 : object->nb_flags = test_var;
1772 : } else {
1773 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1774 : PyLong_Type.tp_name);
1775 0 : return -1;
1776 : }
1777 : }
1778 0 : return 0;
1779 : }
1780 :
1781 : static PyGetSetDef py_nbt_status_name_getsetters[] = {
1782 : {
1783 : .name = discard_const_p(char, "name"),
1784 : .get = py_nbt_status_name_get_name,
1785 : .set = py_nbt_status_name_set_name,
1786 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1787 : },
1788 : {
1789 : .name = discard_const_p(char, "type"),
1790 : .get = py_nbt_status_name_get_type,
1791 : .set = py_nbt_status_name_set_type,
1792 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
1793 : },
1794 : {
1795 : .name = discard_const_p(char, "nb_flags"),
1796 : .get = py_nbt_status_name_get_nb_flags,
1797 : .set = py_nbt_status_name_set_nb_flags,
1798 : .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
1799 : },
1800 : { .name = NULL }
1801 : };
1802 :
1803 0 : static PyObject *py_nbt_status_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1804 : {
1805 0 : return pytalloc_new(struct nbt_status_name, type);
1806 : }
1807 :
1808 :
1809 : static PyTypeObject nbt_status_name_Type = {
1810 : PyVarObject_HEAD_INIT(NULL, 0)
1811 : .tp_name = "nbt.status_name",
1812 : .tp_getset = py_nbt_status_name_getsetters,
1813 : .tp_methods = NULL,
1814 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1815 : .tp_new = py_nbt_status_name_new,
1816 : };
1817 :
1818 :
1819 0 : static PyObject *py_nbt_rdata_status_get_length(PyObject *obj, void *closure)
1820 : {
1821 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1822 0 : PyObject *py_length;
1823 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1824 0 : return py_length;
1825 : }
1826 :
1827 0 : static int py_nbt_rdata_status_set_length(PyObject *py_obj, PyObject *value, void *closure)
1828 : {
1829 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1830 0 : if (value == NULL) {
1831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1832 0 : return -1;
1833 : }
1834 : {
1835 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1836 0 : if (PyLong_Check(value)) {
1837 0 : unsigned long long test_var;
1838 0 : test_var = PyLong_AsUnsignedLongLong(value);
1839 0 : if (PyErr_Occurred() != NULL) {
1840 0 : return -1;
1841 : }
1842 0 : if (test_var > uint_max) {
1843 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1844 : PyLong_Type.tp_name, uint_max, test_var);
1845 0 : return -1;
1846 : }
1847 0 : object->length = test_var;
1848 : } else {
1849 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1850 : PyLong_Type.tp_name);
1851 0 : return -1;
1852 : }
1853 : }
1854 0 : return 0;
1855 : }
1856 :
1857 0 : static PyObject *py_nbt_rdata_status_get_num_names(PyObject *obj, void *closure)
1858 : {
1859 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1860 0 : PyObject *py_num_names;
1861 0 : py_num_names = PyLong_FromLong((uint16_t)object->num_names);
1862 0 : return py_num_names;
1863 : }
1864 :
1865 0 : static int py_nbt_rdata_status_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
1866 : {
1867 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1868 0 : if (value == NULL) {
1869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_names");
1870 0 : return -1;
1871 : }
1872 : {
1873 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_names));
1874 0 : if (PyLong_Check(value)) {
1875 0 : unsigned long long test_var;
1876 0 : test_var = PyLong_AsUnsignedLongLong(value);
1877 0 : if (PyErr_Occurred() != NULL) {
1878 0 : return -1;
1879 : }
1880 0 : if (test_var > uint_max) {
1881 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1882 : PyLong_Type.tp_name, uint_max, test_var);
1883 0 : return -1;
1884 : }
1885 0 : object->num_names = test_var;
1886 : } else {
1887 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1888 : PyLong_Type.tp_name);
1889 0 : return -1;
1890 : }
1891 : }
1892 0 : return 0;
1893 : }
1894 :
1895 0 : static PyObject *py_nbt_rdata_status_get_names(PyObject *obj, void *closure)
1896 : {
1897 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1898 0 : PyObject *py_names;
1899 0 : py_names = PyList_New(object->num_names);
1900 0 : if (py_names == NULL) {
1901 0 : return NULL;
1902 : }
1903 : {
1904 : int names_cntr_0;
1905 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->num_names); names_cntr_0++) {
1906 0 : PyObject *py_names_0;
1907 0 : py_names_0 = pytalloc_reference_ex(&nbt_status_name_Type, object->names, &object->names[names_cntr_0]);
1908 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
1909 : }
1910 : }
1911 0 : return py_names;
1912 : }
1913 :
1914 0 : static int py_nbt_rdata_status_set_names(PyObject *py_obj, PyObject *value, void *closure)
1915 : {
1916 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1917 0 : if (value == NULL) {
1918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
1919 0 : return -1;
1920 : }
1921 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1922 : {
1923 0 : int names_cntr_0;
1924 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
1925 0 : if (!object->names) { return -1; }
1926 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
1927 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
1928 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
1929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_0]");
1930 0 : return -1;
1931 : }
1932 0 : PY_CHECK_TYPE(&nbt_status_name_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
1933 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
1934 0 : PyErr_NoMemory();
1935 0 : return -1;
1936 : }
1937 0 : object->names[names_cntr_0] = *(struct nbt_status_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
1938 : }
1939 : }
1940 0 : return 0;
1941 : }
1942 :
1943 0 : static PyObject *py_nbt_rdata_status_get_statistics(PyObject *obj, void *closure)
1944 : {
1945 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1946 0 : PyObject *py_statistics;
1947 0 : py_statistics = pytalloc_reference_ex(&nbt_statistics_Type, pytalloc_get_mem_ctx(obj), &object->statistics);
1948 0 : return py_statistics;
1949 : }
1950 :
1951 0 : static int py_nbt_rdata_status_set_statistics(PyObject *py_obj, PyObject *value, void *closure)
1952 : {
1953 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1954 0 : if (value == NULL) {
1955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->statistics");
1956 0 : return -1;
1957 : }
1958 0 : PY_CHECK_TYPE(&nbt_statistics_Type, value, return -1;);
1959 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1960 0 : PyErr_NoMemory();
1961 0 : return -1;
1962 : }
1963 0 : object->statistics = *(struct nbt_statistics *)pytalloc_get_ptr(value);
1964 0 : return 0;
1965 : }
1966 :
1967 : static PyGetSetDef py_nbt_rdata_status_getsetters[] = {
1968 : {
1969 : .name = discard_const_p(char, "length"),
1970 : .get = py_nbt_rdata_status_get_length,
1971 : .set = py_nbt_rdata_status_set_length,
1972 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1973 : },
1974 : {
1975 : .name = discard_const_p(char, "num_names"),
1976 : .get = py_nbt_rdata_status_get_num_names,
1977 : .set = py_nbt_rdata_status_set_num_names,
1978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1979 : },
1980 : {
1981 : .name = discard_const_p(char, "names"),
1982 : .get = py_nbt_rdata_status_get_names,
1983 : .set = py_nbt_rdata_status_set_names,
1984 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_status_name")
1985 : },
1986 : {
1987 : .name = discard_const_p(char, "statistics"),
1988 : .get = py_nbt_rdata_status_get_statistics,
1989 : .set = py_nbt_rdata_status_set_statistics,
1990 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_statistics")
1991 : },
1992 : { .name = NULL }
1993 : };
1994 :
1995 0 : static PyObject *py_nbt_rdata_status_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1996 : {
1997 0 : return pytalloc_new(struct nbt_rdata_status, type);
1998 : }
1999 :
2000 :
2001 : static PyTypeObject nbt_rdata_status_Type = {
2002 : PyVarObject_HEAD_INIT(NULL, 0)
2003 : .tp_name = "nbt.rdata_status",
2004 : .tp_getset = py_nbt_rdata_status_getsetters,
2005 : .tp_methods = NULL,
2006 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2007 : .tp_new = py_nbt_rdata_status_new,
2008 : };
2009 :
2010 :
2011 0 : static PyObject *py_nbt_rdata_data_get_length(PyObject *obj, void *closure)
2012 : {
2013 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(obj);
2014 0 : PyObject *py_length;
2015 0 : py_length = PyLong_FromLong((uint16_t)object->length);
2016 0 : return py_length;
2017 : }
2018 :
2019 0 : static int py_nbt_rdata_data_set_length(PyObject *py_obj, PyObject *value, void *closure)
2020 : {
2021 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(py_obj);
2022 0 : if (value == NULL) {
2023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
2024 0 : return -1;
2025 : }
2026 : {
2027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
2028 0 : if (PyLong_Check(value)) {
2029 0 : unsigned long long test_var;
2030 0 : test_var = PyLong_AsUnsignedLongLong(value);
2031 0 : if (PyErr_Occurred() != NULL) {
2032 0 : return -1;
2033 : }
2034 0 : if (test_var > uint_max) {
2035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2036 : PyLong_Type.tp_name, uint_max, test_var);
2037 0 : return -1;
2038 : }
2039 0 : object->length = test_var;
2040 : } else {
2041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2042 : PyLong_Type.tp_name);
2043 0 : return -1;
2044 : }
2045 : }
2046 0 : return 0;
2047 : }
2048 :
2049 0 : static PyObject *py_nbt_rdata_data_get_data(PyObject *obj, void *closure)
2050 : {
2051 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(obj);
2052 0 : PyObject *py_data;
2053 0 : py_data = PyList_New(object->length);
2054 0 : if (py_data == NULL) {
2055 0 : return NULL;
2056 : }
2057 : {
2058 : int data_cntr_0;
2059 0 : for (data_cntr_0 = 0; data_cntr_0 < (object->length); data_cntr_0++) {
2060 0 : PyObject *py_data_0;
2061 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
2062 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
2063 : }
2064 : }
2065 0 : return py_data;
2066 : }
2067 :
2068 0 : static int py_nbt_rdata_data_set_data(PyObject *py_obj, PyObject *value, void *closure)
2069 : {
2070 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(py_obj);
2071 0 : if (value == NULL) {
2072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
2073 0 : return -1;
2074 : }
2075 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2076 : {
2077 0 : int data_cntr_0;
2078 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
2079 0 : if (!object->data) { return -1; }
2080 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
2081 0 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
2082 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
2083 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
2084 0 : return -1;
2085 : }
2086 : {
2087 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
2088 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
2089 0 : unsigned long long test_var;
2090 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
2091 0 : if (PyErr_Occurred() != NULL) {
2092 0 : return -1;
2093 : }
2094 0 : if (test_var > uint_max) {
2095 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2096 : PyLong_Type.tp_name, uint_max, test_var);
2097 0 : return -1;
2098 : }
2099 0 : object->data[data_cntr_0] = test_var;
2100 : } else {
2101 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2102 : PyLong_Type.tp_name);
2103 0 : return -1;
2104 : }
2105 : }
2106 : }
2107 : }
2108 0 : return 0;
2109 : }
2110 :
2111 : static PyGetSetDef py_nbt_rdata_data_getsetters[] = {
2112 : {
2113 : .name = discard_const_p(char, "length"),
2114 : .get = py_nbt_rdata_data_get_length,
2115 : .set = py_nbt_rdata_data_set_length,
2116 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2117 : },
2118 : {
2119 : .name = discard_const_p(char, "data"),
2120 : .get = py_nbt_rdata_data_get_data,
2121 : .set = py_nbt_rdata_data_set_data,
2122 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2123 : },
2124 : { .name = NULL }
2125 : };
2126 :
2127 0 : static PyObject *py_nbt_rdata_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2128 : {
2129 0 : return pytalloc_new(struct nbt_rdata_data, type);
2130 : }
2131 :
2132 :
2133 : static PyTypeObject nbt_rdata_data_Type = {
2134 : PyVarObject_HEAD_INIT(NULL, 0)
2135 : .tp_name = "nbt.rdata_data",
2136 : .tp_getset = py_nbt_rdata_data_getsetters,
2137 : .tp_methods = NULL,
2138 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2139 : .tp_new = py_nbt_rdata_data_new,
2140 : };
2141 :
2142 0 : static PyObject *py_import_nbt_rdata(TALLOC_CTX *mem_ctx, int level, union nbt_rdata *in)
2143 : {
2144 0 : PyObject *ret;
2145 :
2146 0 : switch (level) {
2147 0 : case NBT_QTYPE_NETBIOS:
2148 0 : ret = pytalloc_reference_ex(&nbt_rdata_netbios_Type, mem_ctx, &in->netbios);
2149 0 : return ret;
2150 :
2151 0 : case NBT_QTYPE_STATUS:
2152 0 : ret = pytalloc_reference_ex(&nbt_rdata_status_Type, mem_ctx, &in->status);
2153 0 : return ret;
2154 :
2155 0 : default:
2156 0 : ret = pytalloc_reference_ex(&nbt_rdata_data_Type, mem_ctx, &in->data);
2157 0 : return ret;
2158 :
2159 : }
2160 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2161 : return NULL;
2162 : }
2163 :
2164 0 : static union nbt_rdata *py_export_nbt_rdata(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2165 : {
2166 0 : union nbt_rdata *ret = talloc_zero(mem_ctx, union nbt_rdata);
2167 0 : switch (level) {
2168 0 : case NBT_QTYPE_NETBIOS:
2169 0 : if (in == NULL) {
2170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->netbios");
2171 0 : talloc_free(ret); return NULL;
2172 : }
2173 0 : PY_CHECK_TYPE(&nbt_rdata_netbios_Type, in, talloc_free(ret); return NULL;);
2174 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2175 0 : PyErr_NoMemory();
2176 0 : talloc_free(ret); return NULL;
2177 : }
2178 0 : ret->netbios = *(struct nbt_rdata_netbios *)pytalloc_get_ptr(in);
2179 0 : break;
2180 :
2181 0 : case NBT_QTYPE_STATUS:
2182 0 : if (in == NULL) {
2183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->status");
2184 0 : talloc_free(ret); return NULL;
2185 : }
2186 0 : PY_CHECK_TYPE(&nbt_rdata_status_Type, in, talloc_free(ret); return NULL;);
2187 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2188 0 : PyErr_NoMemory();
2189 0 : talloc_free(ret); return NULL;
2190 : }
2191 0 : ret->status = *(struct nbt_rdata_status *)pytalloc_get_ptr(in);
2192 0 : break;
2193 :
2194 0 : default:
2195 0 : if (in == NULL) {
2196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
2197 0 : talloc_free(ret); return NULL;
2198 : }
2199 0 : PY_CHECK_TYPE(&nbt_rdata_data_Type, in, talloc_free(ret); return NULL;);
2200 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2201 0 : PyErr_NoMemory();
2202 0 : talloc_free(ret); return NULL;
2203 : }
2204 0 : ret->data = *(struct nbt_rdata_data *)pytalloc_get_ptr(in);
2205 0 : break;
2206 :
2207 : }
2208 :
2209 0 : return ret;
2210 : }
2211 :
2212 0 : static PyObject *py_nbt_rdata_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2213 : {
2214 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2215 0 : PyObject *mem_ctx_obj = NULL;
2216 0 : TALLOC_CTX *mem_ctx = NULL;
2217 0 : int level = 0;
2218 0 : PyObject *in_obj = NULL;
2219 0 : union nbt_rdata *in = NULL;
2220 :
2221 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2222 : discard_const_p(char *, kwnames),
2223 : &mem_ctx_obj,
2224 : &level,
2225 : &in_obj)) {
2226 0 : return NULL;
2227 : }
2228 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2229 0 : if (mem_ctx == NULL) {
2230 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2231 0 : return NULL;
2232 : }
2233 0 : in = (union nbt_rdata *)pytalloc_get_ptr(in_obj);
2234 0 : if (in == NULL) {
2235 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_rdata!");
2236 0 : return NULL;
2237 : }
2238 :
2239 0 : return py_import_nbt_rdata(mem_ctx, level, in);
2240 : }
2241 :
2242 0 : static PyObject *py_nbt_rdata_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2243 : {
2244 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2245 0 : PyObject *mem_ctx_obj = NULL;
2246 0 : TALLOC_CTX *mem_ctx = NULL;
2247 0 : int level = 0;
2248 0 : PyObject *in = NULL;
2249 0 : union nbt_rdata *out = NULL;
2250 :
2251 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2252 : discard_const_p(char *, kwnames),
2253 : &mem_ctx_obj,
2254 : &level,
2255 : &in)) {
2256 0 : return NULL;
2257 : }
2258 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2259 0 : if (mem_ctx == NULL) {
2260 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2261 0 : return NULL;
2262 : }
2263 :
2264 0 : out = py_export_nbt_rdata(mem_ctx, level, in);
2265 0 : if (out == NULL) {
2266 0 : return NULL;
2267 : }
2268 :
2269 0 : return pytalloc_GenericObject_reference(out);
2270 : }
2271 :
2272 : static PyMethodDef py_nbt_rdata_methods[] = {
2273 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_import),
2274 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2275 : "T.__import__(mem_ctx, level, in) => ret." },
2276 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_export),
2277 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2278 : "T.__export__(mem_ctx, level, in) => ret." },
2279 : { NULL, NULL, 0, NULL }
2280 : };
2281 :
2282 0 : static PyObject *py_nbt_rdata_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2283 : {
2284 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2285 0 : return NULL;
2286 : }
2287 :
2288 :
2289 : static PyTypeObject nbt_rdata_Type = {
2290 : PyVarObject_HEAD_INIT(NULL, 0)
2291 : .tp_name = "nbt.rdata",
2292 : .tp_getset = NULL,
2293 : .tp_methods = py_nbt_rdata_methods,
2294 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2295 : .tp_new = py_nbt_rdata_new,
2296 : };
2297 :
2298 :
2299 0 : static PyObject *py_nbt_res_rec_get_name(PyObject *obj, void *closure)
2300 : {
2301 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2302 0 : PyObject *py_name;
2303 0 : py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
2304 0 : return py_name;
2305 : }
2306 :
2307 0 : static int py_nbt_res_rec_set_name(PyObject *py_obj, PyObject *value, void *closure)
2308 : {
2309 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2310 0 : if (value == NULL) {
2311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
2312 0 : return -1;
2313 : }
2314 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
2315 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2316 0 : PyErr_NoMemory();
2317 0 : return -1;
2318 : }
2319 0 : object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
2320 0 : return 0;
2321 : }
2322 :
2323 0 : static PyObject *py_nbt_res_rec_get_rr_type(PyObject *obj, void *closure)
2324 : {
2325 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2326 0 : PyObject *py_rr_type;
2327 0 : py_rr_type = PyLong_FromLong((uint16_t)object->rr_type);
2328 0 : return py_rr_type;
2329 : }
2330 :
2331 0 : static int py_nbt_res_rec_set_rr_type(PyObject *py_obj, PyObject *value, void *closure)
2332 : {
2333 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2334 0 : if (value == NULL) {
2335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rr_type");
2336 0 : return -1;
2337 : }
2338 : {
2339 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_type));
2340 0 : if (PyLong_Check(value)) {
2341 0 : unsigned long long test_var;
2342 0 : test_var = PyLong_AsUnsignedLongLong(value);
2343 0 : if (PyErr_Occurred() != NULL) {
2344 0 : return -1;
2345 : }
2346 0 : if (test_var > uint_max) {
2347 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2348 : PyLong_Type.tp_name, uint_max, test_var);
2349 0 : return -1;
2350 : }
2351 0 : object->rr_type = test_var;
2352 : } else {
2353 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2354 : PyLong_Type.tp_name);
2355 0 : return -1;
2356 : }
2357 : }
2358 0 : return 0;
2359 : }
2360 :
2361 0 : static PyObject *py_nbt_res_rec_get_rr_class(PyObject *obj, void *closure)
2362 : {
2363 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2364 0 : PyObject *py_rr_class;
2365 0 : py_rr_class = PyLong_FromLong((uint16_t)object->rr_class);
2366 0 : return py_rr_class;
2367 : }
2368 :
2369 0 : static int py_nbt_res_rec_set_rr_class(PyObject *py_obj, PyObject *value, void *closure)
2370 : {
2371 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2372 0 : if (value == NULL) {
2373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rr_class");
2374 0 : return -1;
2375 : }
2376 : {
2377 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_class));
2378 0 : if (PyLong_Check(value)) {
2379 0 : unsigned long long test_var;
2380 0 : test_var = PyLong_AsUnsignedLongLong(value);
2381 0 : if (PyErr_Occurred() != NULL) {
2382 0 : return -1;
2383 : }
2384 0 : if (test_var > uint_max) {
2385 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2386 : PyLong_Type.tp_name, uint_max, test_var);
2387 0 : return -1;
2388 : }
2389 0 : object->rr_class = test_var;
2390 : } else {
2391 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2392 : PyLong_Type.tp_name);
2393 0 : return -1;
2394 : }
2395 : }
2396 0 : return 0;
2397 : }
2398 :
2399 0 : static PyObject *py_nbt_res_rec_get_ttl(PyObject *obj, void *closure)
2400 : {
2401 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2402 0 : PyObject *py_ttl;
2403 0 : py_ttl = PyLong_FromUnsignedLongLong((uint32_t)object->ttl);
2404 0 : return py_ttl;
2405 : }
2406 :
2407 0 : static int py_nbt_res_rec_set_ttl(PyObject *py_obj, PyObject *value, void *closure)
2408 : {
2409 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2410 0 : if (value == NULL) {
2411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ttl");
2412 0 : return -1;
2413 : }
2414 : {
2415 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ttl));
2416 0 : if (PyLong_Check(value)) {
2417 0 : unsigned long long test_var;
2418 0 : test_var = PyLong_AsUnsignedLongLong(value);
2419 0 : if (PyErr_Occurred() != NULL) {
2420 0 : return -1;
2421 : }
2422 0 : if (test_var > uint_max) {
2423 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2424 : PyLong_Type.tp_name, uint_max, test_var);
2425 0 : return -1;
2426 : }
2427 0 : object->ttl = test_var;
2428 : } else {
2429 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2430 : PyLong_Type.tp_name);
2431 0 : return -1;
2432 : }
2433 : }
2434 0 : return 0;
2435 : }
2436 :
2437 0 : static PyObject *py_nbt_res_rec_get_rdata(PyObject *obj, void *closure)
2438 : {
2439 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2440 0 : PyObject *py_rdata;
2441 0 : py_rdata = pyrpc_import_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(obj), object->rr_type, &object->rdata, "union nbt_rdata");
2442 0 : if (py_rdata == NULL) {
2443 0 : return NULL;
2444 : }
2445 0 : return py_rdata;
2446 : }
2447 :
2448 0 : static int py_nbt_res_rec_set_rdata(PyObject *py_obj, PyObject *value, void *closure)
2449 : {
2450 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2451 0 : if (value == NULL) {
2452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rdata");
2453 0 : return -1;
2454 : }
2455 : {
2456 0 : union nbt_rdata *rdata_switch_0;
2457 0 : rdata_switch_0 = (union nbt_rdata *)pyrpc_export_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(py_obj), object->rr_type, value, "union nbt_rdata");
2458 0 : if (rdata_switch_0 == NULL) {
2459 0 : return -1;
2460 : }
2461 0 : object->rdata = *rdata_switch_0;
2462 : }
2463 0 : return 0;
2464 : }
2465 :
2466 : static PyGetSetDef py_nbt_res_rec_getsetters[] = {
2467 : {
2468 : .name = discard_const_p(char, "name"),
2469 : .get = py_nbt_res_rec_get_name,
2470 : .set = py_nbt_res_rec_set_name,
2471 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
2472 : },
2473 : {
2474 : .name = discard_const_p(char, "rr_type"),
2475 : .get = py_nbt_res_rec_get_rr_type,
2476 : .set = py_nbt_res_rec_set_rr_type,
2477 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
2478 : },
2479 : {
2480 : .name = discard_const_p(char, "rr_class"),
2481 : .get = py_nbt_res_rec_get_rr_class,
2482 : .set = py_nbt_res_rec_set_rr_class,
2483 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
2484 : },
2485 : {
2486 : .name = discard_const_p(char, "ttl"),
2487 : .get = py_nbt_res_rec_get_ttl,
2488 : .set = py_nbt_res_rec_set_ttl,
2489 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2490 : },
2491 : {
2492 : .name = discard_const_p(char, "rdata"),
2493 : .get = py_nbt_res_rec_get_rdata,
2494 : .set = py_nbt_res_rec_set_rdata,
2495 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata")
2496 : },
2497 : { .name = NULL }
2498 : };
2499 :
2500 0 : static PyObject *py_nbt_res_rec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2501 : {
2502 0 : return pytalloc_new(struct nbt_res_rec, type);
2503 : }
2504 :
2505 :
2506 : static PyTypeObject nbt_res_rec_Type = {
2507 : PyVarObject_HEAD_INIT(NULL, 0)
2508 : .tp_name = "nbt.res_rec",
2509 : .tp_getset = py_nbt_res_rec_getsetters,
2510 : .tp_methods = NULL,
2511 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2512 : .tp_new = py_nbt_res_rec_new,
2513 : };
2514 :
2515 :
2516 0 : static PyObject *py_nbt_name_packet_get_name_trn_id(PyObject *obj, void *closure)
2517 : {
2518 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2519 0 : PyObject *py_name_trn_id;
2520 0 : py_name_trn_id = PyLong_FromLong((uint16_t)object->name_trn_id);
2521 0 : return py_name_trn_id;
2522 : }
2523 :
2524 0 : static int py_nbt_name_packet_set_name_trn_id(PyObject *py_obj, PyObject *value, void *closure)
2525 : {
2526 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2527 0 : if (value == NULL) {
2528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name_trn_id");
2529 0 : return -1;
2530 : }
2531 : {
2532 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_trn_id));
2533 0 : if (PyLong_Check(value)) {
2534 0 : unsigned long long test_var;
2535 0 : test_var = PyLong_AsUnsignedLongLong(value);
2536 0 : if (PyErr_Occurred() != NULL) {
2537 0 : return -1;
2538 : }
2539 0 : if (test_var > uint_max) {
2540 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2541 : PyLong_Type.tp_name, uint_max, test_var);
2542 0 : return -1;
2543 : }
2544 0 : object->name_trn_id = test_var;
2545 : } else {
2546 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2547 : PyLong_Type.tp_name);
2548 0 : return -1;
2549 : }
2550 : }
2551 0 : return 0;
2552 : }
2553 :
2554 0 : static PyObject *py_nbt_name_packet_get_operation(PyObject *obj, void *closure)
2555 : {
2556 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2557 0 : PyObject *py_operation;
2558 0 : py_operation = PyLong_FromLong((uint16_t)object->operation);
2559 0 : return py_operation;
2560 : }
2561 :
2562 0 : static int py_nbt_name_packet_set_operation(PyObject *py_obj, PyObject *value, void *closure)
2563 : {
2564 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2565 0 : if (value == NULL) {
2566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->operation");
2567 0 : return -1;
2568 : }
2569 : {
2570 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->operation));
2571 0 : if (PyLong_Check(value)) {
2572 0 : unsigned long long test_var;
2573 0 : test_var = PyLong_AsUnsignedLongLong(value);
2574 0 : if (PyErr_Occurred() != NULL) {
2575 0 : return -1;
2576 : }
2577 0 : if (test_var > uint_max) {
2578 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2579 : PyLong_Type.tp_name, uint_max, test_var);
2580 0 : return -1;
2581 : }
2582 0 : object->operation = test_var;
2583 : } else {
2584 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2585 : PyLong_Type.tp_name);
2586 0 : return -1;
2587 : }
2588 : }
2589 0 : return 0;
2590 : }
2591 :
2592 0 : static PyObject *py_nbt_name_packet_get_qdcount(PyObject *obj, void *closure)
2593 : {
2594 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2595 0 : PyObject *py_qdcount;
2596 0 : py_qdcount = PyLong_FromLong((uint16_t)object->qdcount);
2597 0 : return py_qdcount;
2598 : }
2599 :
2600 0 : static int py_nbt_name_packet_set_qdcount(PyObject *py_obj, PyObject *value, void *closure)
2601 : {
2602 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2603 0 : if (value == NULL) {
2604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->qdcount");
2605 0 : return -1;
2606 : }
2607 : {
2608 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->qdcount));
2609 0 : if (PyLong_Check(value)) {
2610 0 : unsigned long long test_var;
2611 0 : test_var = PyLong_AsUnsignedLongLong(value);
2612 0 : if (PyErr_Occurred() != NULL) {
2613 0 : return -1;
2614 : }
2615 0 : if (test_var > uint_max) {
2616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2617 : PyLong_Type.tp_name, uint_max, test_var);
2618 0 : return -1;
2619 : }
2620 0 : object->qdcount = test_var;
2621 : } else {
2622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2623 : PyLong_Type.tp_name);
2624 0 : return -1;
2625 : }
2626 : }
2627 0 : return 0;
2628 : }
2629 :
2630 0 : static PyObject *py_nbt_name_packet_get_ancount(PyObject *obj, void *closure)
2631 : {
2632 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2633 0 : PyObject *py_ancount;
2634 0 : py_ancount = PyLong_FromLong((uint16_t)object->ancount);
2635 0 : return py_ancount;
2636 : }
2637 :
2638 0 : static int py_nbt_name_packet_set_ancount(PyObject *py_obj, PyObject *value, void *closure)
2639 : {
2640 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2641 0 : if (value == NULL) {
2642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ancount");
2643 0 : return -1;
2644 : }
2645 : {
2646 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ancount));
2647 0 : if (PyLong_Check(value)) {
2648 0 : unsigned long long test_var;
2649 0 : test_var = PyLong_AsUnsignedLongLong(value);
2650 0 : if (PyErr_Occurred() != NULL) {
2651 0 : return -1;
2652 : }
2653 0 : if (test_var > uint_max) {
2654 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2655 : PyLong_Type.tp_name, uint_max, test_var);
2656 0 : return -1;
2657 : }
2658 0 : object->ancount = test_var;
2659 : } else {
2660 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2661 : PyLong_Type.tp_name);
2662 0 : return -1;
2663 : }
2664 : }
2665 0 : return 0;
2666 : }
2667 :
2668 0 : static PyObject *py_nbt_name_packet_get_nscount(PyObject *obj, void *closure)
2669 : {
2670 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2671 0 : PyObject *py_nscount;
2672 0 : py_nscount = PyLong_FromLong((uint16_t)object->nscount);
2673 0 : return py_nscount;
2674 : }
2675 :
2676 0 : static int py_nbt_name_packet_set_nscount(PyObject *py_obj, PyObject *value, void *closure)
2677 : {
2678 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2679 0 : if (value == NULL) {
2680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nscount");
2681 0 : return -1;
2682 : }
2683 : {
2684 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nscount));
2685 0 : if (PyLong_Check(value)) {
2686 0 : unsigned long long test_var;
2687 0 : test_var = PyLong_AsUnsignedLongLong(value);
2688 0 : if (PyErr_Occurred() != NULL) {
2689 0 : return -1;
2690 : }
2691 0 : if (test_var > uint_max) {
2692 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2693 : PyLong_Type.tp_name, uint_max, test_var);
2694 0 : return -1;
2695 : }
2696 0 : object->nscount = test_var;
2697 : } else {
2698 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2699 : PyLong_Type.tp_name);
2700 0 : return -1;
2701 : }
2702 : }
2703 0 : return 0;
2704 : }
2705 :
2706 0 : static PyObject *py_nbt_name_packet_get_arcount(PyObject *obj, void *closure)
2707 : {
2708 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2709 0 : PyObject *py_arcount;
2710 0 : py_arcount = PyLong_FromLong((uint16_t)object->arcount);
2711 0 : return py_arcount;
2712 : }
2713 :
2714 0 : static int py_nbt_name_packet_set_arcount(PyObject *py_obj, PyObject *value, void *closure)
2715 : {
2716 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2717 0 : if (value == NULL) {
2718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->arcount");
2719 0 : return -1;
2720 : }
2721 : {
2722 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->arcount));
2723 0 : if (PyLong_Check(value)) {
2724 0 : unsigned long long test_var;
2725 0 : test_var = PyLong_AsUnsignedLongLong(value);
2726 0 : if (PyErr_Occurred() != NULL) {
2727 0 : return -1;
2728 : }
2729 0 : if (test_var > uint_max) {
2730 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2731 : PyLong_Type.tp_name, uint_max, test_var);
2732 0 : return -1;
2733 : }
2734 0 : object->arcount = test_var;
2735 : } else {
2736 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2737 : PyLong_Type.tp_name);
2738 0 : return -1;
2739 : }
2740 : }
2741 0 : return 0;
2742 : }
2743 :
2744 0 : static PyObject *py_nbt_name_packet_get_questions(PyObject *obj, void *closure)
2745 : {
2746 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2747 0 : PyObject *py_questions;
2748 0 : py_questions = PyList_New(object->qdcount);
2749 0 : if (py_questions == NULL) {
2750 0 : return NULL;
2751 : }
2752 : {
2753 : int questions_cntr_0;
2754 0 : for (questions_cntr_0 = 0; questions_cntr_0 < (object->qdcount); questions_cntr_0++) {
2755 0 : PyObject *py_questions_0;
2756 0 : py_questions_0 = pytalloc_reference_ex(&nbt_name_question_Type, object->questions, &object->questions[questions_cntr_0]);
2757 0 : PyList_SetItem(py_questions, questions_cntr_0, py_questions_0);
2758 : }
2759 : }
2760 0 : return py_questions;
2761 : }
2762 :
2763 0 : static int py_nbt_name_packet_set_questions(PyObject *py_obj, PyObject *value, void *closure)
2764 : {
2765 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2766 0 : if (value == NULL) {
2767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->questions");
2768 0 : return -1;
2769 : }
2770 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2771 : {
2772 0 : int questions_cntr_0;
2773 0 : object->questions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->questions, PyList_GET_SIZE(value));
2774 0 : if (!object->questions) { return -1; }
2775 0 : talloc_set_name_const(object->questions, "ARRAY: object->questions");
2776 0 : for (questions_cntr_0 = 0; questions_cntr_0 < PyList_GET_SIZE(value); questions_cntr_0++) {
2777 0 : if (PyList_GET_ITEM(value, questions_cntr_0) == NULL) {
2778 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->questions[questions_cntr_0]");
2779 0 : return -1;
2780 : }
2781 0 : PY_CHECK_TYPE(&nbt_name_question_Type, PyList_GET_ITEM(value, questions_cntr_0), return -1;);
2782 0 : if (talloc_reference(object->questions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, questions_cntr_0))) == NULL) {
2783 0 : PyErr_NoMemory();
2784 0 : return -1;
2785 : }
2786 0 : object->questions[questions_cntr_0] = *(struct nbt_name_question *)pytalloc_get_ptr(PyList_GET_ITEM(value, questions_cntr_0));
2787 : }
2788 : }
2789 0 : return 0;
2790 : }
2791 :
2792 0 : static PyObject *py_nbt_name_packet_get_answers(PyObject *obj, void *closure)
2793 : {
2794 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2795 0 : PyObject *py_answers;
2796 0 : py_answers = PyList_New(object->ancount);
2797 0 : if (py_answers == NULL) {
2798 0 : return NULL;
2799 : }
2800 : {
2801 : int answers_cntr_0;
2802 0 : for (answers_cntr_0 = 0; answers_cntr_0 < (object->ancount); answers_cntr_0++) {
2803 0 : PyObject *py_answers_0;
2804 0 : py_answers_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->answers, &object->answers[answers_cntr_0]);
2805 0 : PyList_SetItem(py_answers, answers_cntr_0, py_answers_0);
2806 : }
2807 : }
2808 0 : return py_answers;
2809 : }
2810 :
2811 0 : static int py_nbt_name_packet_set_answers(PyObject *py_obj, PyObject *value, void *closure)
2812 : {
2813 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2814 0 : if (value == NULL) {
2815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->answers");
2816 0 : return -1;
2817 : }
2818 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2819 : {
2820 0 : int answers_cntr_0;
2821 0 : object->answers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->answers, PyList_GET_SIZE(value));
2822 0 : if (!object->answers) { return -1; }
2823 0 : talloc_set_name_const(object->answers, "ARRAY: object->answers");
2824 0 : for (answers_cntr_0 = 0; answers_cntr_0 < PyList_GET_SIZE(value); answers_cntr_0++) {
2825 0 : if (PyList_GET_ITEM(value, answers_cntr_0) == NULL) {
2826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->answers[answers_cntr_0]");
2827 0 : return -1;
2828 : }
2829 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, answers_cntr_0), return -1;);
2830 0 : if (talloc_reference(object->answers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, answers_cntr_0))) == NULL) {
2831 0 : PyErr_NoMemory();
2832 0 : return -1;
2833 : }
2834 0 : object->answers[answers_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, answers_cntr_0));
2835 : }
2836 : }
2837 0 : return 0;
2838 : }
2839 :
2840 0 : static PyObject *py_nbt_name_packet_get_nsrecs(PyObject *obj, void *closure)
2841 : {
2842 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2843 0 : PyObject *py_nsrecs;
2844 0 : py_nsrecs = PyList_New(object->nscount);
2845 0 : if (py_nsrecs == NULL) {
2846 0 : return NULL;
2847 : }
2848 : {
2849 : int nsrecs_cntr_0;
2850 0 : for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < (object->nscount); nsrecs_cntr_0++) {
2851 0 : PyObject *py_nsrecs_0;
2852 0 : py_nsrecs_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->nsrecs, &object->nsrecs[nsrecs_cntr_0]);
2853 0 : PyList_SetItem(py_nsrecs, nsrecs_cntr_0, py_nsrecs_0);
2854 : }
2855 : }
2856 0 : return py_nsrecs;
2857 : }
2858 :
2859 0 : static int py_nbt_name_packet_set_nsrecs(PyObject *py_obj, PyObject *value, void *closure)
2860 : {
2861 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2862 0 : if (value == NULL) {
2863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nsrecs");
2864 0 : return -1;
2865 : }
2866 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2867 : {
2868 0 : int nsrecs_cntr_0;
2869 0 : object->nsrecs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nsrecs, PyList_GET_SIZE(value));
2870 0 : if (!object->nsrecs) { return -1; }
2871 0 : talloc_set_name_const(object->nsrecs, "ARRAY: object->nsrecs");
2872 0 : for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < PyList_GET_SIZE(value); nsrecs_cntr_0++) {
2873 0 : if (PyList_GET_ITEM(value, nsrecs_cntr_0) == NULL) {
2874 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nsrecs[nsrecs_cntr_0]");
2875 0 : return -1;
2876 : }
2877 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, nsrecs_cntr_0), return -1;);
2878 0 : if (talloc_reference(object->nsrecs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, nsrecs_cntr_0))) == NULL) {
2879 0 : PyErr_NoMemory();
2880 0 : return -1;
2881 : }
2882 0 : object->nsrecs[nsrecs_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, nsrecs_cntr_0));
2883 : }
2884 : }
2885 0 : return 0;
2886 : }
2887 :
2888 0 : static PyObject *py_nbt_name_packet_get_additional(PyObject *obj, void *closure)
2889 : {
2890 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2891 0 : PyObject *py_additional;
2892 0 : py_additional = PyList_New(object->arcount);
2893 0 : if (py_additional == NULL) {
2894 0 : return NULL;
2895 : }
2896 : {
2897 : int additional_cntr_0;
2898 0 : for (additional_cntr_0 = 0; additional_cntr_0 < (object->arcount); additional_cntr_0++) {
2899 0 : PyObject *py_additional_0;
2900 0 : py_additional_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->additional, &object->additional[additional_cntr_0]);
2901 0 : PyList_SetItem(py_additional, additional_cntr_0, py_additional_0);
2902 : }
2903 : }
2904 0 : return py_additional;
2905 : }
2906 :
2907 0 : static int py_nbt_name_packet_set_additional(PyObject *py_obj, PyObject *value, void *closure)
2908 : {
2909 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2910 0 : if (value == NULL) {
2911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->additional");
2912 0 : return -1;
2913 : }
2914 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2915 : {
2916 0 : int additional_cntr_0;
2917 0 : object->additional = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->additional, PyList_GET_SIZE(value));
2918 0 : if (!object->additional) { return -1; }
2919 0 : talloc_set_name_const(object->additional, "ARRAY: object->additional");
2920 0 : for (additional_cntr_0 = 0; additional_cntr_0 < PyList_GET_SIZE(value); additional_cntr_0++) {
2921 0 : if (PyList_GET_ITEM(value, additional_cntr_0) == NULL) {
2922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->additional[additional_cntr_0]");
2923 0 : return -1;
2924 : }
2925 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, additional_cntr_0), return -1;);
2926 0 : if (talloc_reference(object->additional, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, additional_cntr_0))) == NULL) {
2927 0 : PyErr_NoMemory();
2928 0 : return -1;
2929 : }
2930 0 : object->additional[additional_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, additional_cntr_0));
2931 : }
2932 : }
2933 0 : return 0;
2934 : }
2935 :
2936 0 : static PyObject *py_nbt_name_packet_get_padding(PyObject *obj, void *closure)
2937 : {
2938 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2939 0 : PyObject *py_padding;
2940 0 : py_padding = PyBytes_FromStringAndSize((char *)(object->padding).data, (object->padding).length);
2941 0 : return py_padding;
2942 : }
2943 :
2944 0 : static int py_nbt_name_packet_set_padding(PyObject *py_obj, PyObject *value, void *closure)
2945 : {
2946 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2947 0 : if (value == NULL) {
2948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding");
2949 0 : return -1;
2950 : }
2951 0 : object->padding = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2952 0 : return 0;
2953 : }
2954 :
2955 : static PyGetSetDef py_nbt_name_packet_getsetters[] = {
2956 : {
2957 : .name = discard_const_p(char, "name_trn_id"),
2958 : .get = py_nbt_name_packet_get_name_trn_id,
2959 : .set = py_nbt_name_packet_set_name_trn_id,
2960 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2961 : },
2962 : {
2963 : .name = discard_const_p(char, "operation"),
2964 : .get = py_nbt_name_packet_get_operation,
2965 : .set = py_nbt_name_packet_set_operation,
2966 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_operation")
2967 : },
2968 : {
2969 : .name = discard_const_p(char, "qdcount"),
2970 : .get = py_nbt_name_packet_get_qdcount,
2971 : .set = py_nbt_name_packet_set_qdcount,
2972 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2973 : },
2974 : {
2975 : .name = discard_const_p(char, "ancount"),
2976 : .get = py_nbt_name_packet_get_ancount,
2977 : .set = py_nbt_name_packet_set_ancount,
2978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2979 : },
2980 : {
2981 : .name = discard_const_p(char, "nscount"),
2982 : .get = py_nbt_name_packet_get_nscount,
2983 : .set = py_nbt_name_packet_set_nscount,
2984 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2985 : },
2986 : {
2987 : .name = discard_const_p(char, "arcount"),
2988 : .get = py_nbt_name_packet_get_arcount,
2989 : .set = py_nbt_name_packet_set_arcount,
2990 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2991 : },
2992 : {
2993 : .name = discard_const_p(char, "questions"),
2994 : .get = py_nbt_name_packet_get_questions,
2995 : .set = py_nbt_name_packet_set_questions,
2996 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_question")
2997 : },
2998 : {
2999 : .name = discard_const_p(char, "answers"),
3000 : .get = py_nbt_name_packet_get_answers,
3001 : .set = py_nbt_name_packet_set_answers,
3002 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3003 : },
3004 : {
3005 : .name = discard_const_p(char, "nsrecs"),
3006 : .get = py_nbt_name_packet_get_nsrecs,
3007 : .set = py_nbt_name_packet_set_nsrecs,
3008 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3009 : },
3010 : {
3011 : .name = discard_const_p(char, "additional"),
3012 : .get = py_nbt_name_packet_get_additional,
3013 : .set = py_nbt_name_packet_set_additional,
3014 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3015 : },
3016 : {
3017 : .name = discard_const_p(char, "padding"),
3018 : .get = py_nbt_name_packet_get_padding,
3019 : .set = py_nbt_name_packet_set_padding,
3020 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
3021 : },
3022 : { .name = NULL }
3023 : };
3024 :
3025 0 : static PyObject *py_nbt_name_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3026 : {
3027 0 : return pytalloc_new(struct nbt_name_packet, type);
3028 : }
3029 :
3030 0 : static PyObject *py_nbt_name_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3031 : {
3032 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
3033 0 : PyObject *ret = NULL;
3034 0 : DATA_BLOB blob;
3035 0 : enum ndr_err_code err;
3036 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3037 0 : if (tmp_ctx == NULL) {
3038 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3039 0 : return NULL;
3040 : }
3041 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name_packet);
3042 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3043 0 : TALLOC_FREE(tmp_ctx);
3044 0 : PyErr_SetNdrError(err);
3045 0 : return NULL;
3046 : }
3047 :
3048 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3049 0 : TALLOC_FREE(tmp_ctx);
3050 0 : return ret;
3051 : }
3052 :
3053 0 : static PyObject *py_nbt_name_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3054 : {
3055 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
3056 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3057 0 : Py_ssize_t blob_length = 0;
3058 0 : enum ndr_err_code err;
3059 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3060 0 : PyObject *allow_remaining_obj = NULL;
3061 0 : bool allow_remaining = false;
3062 :
3063 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3064 : discard_const_p(char *, kwnames),
3065 : &blob.data, &blob_length,
3066 : &allow_remaining_obj)) {
3067 0 : return NULL;
3068 : }
3069 0 : blob.length = blob_length;
3070 :
3071 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3072 0 : allow_remaining = true;
3073 : }
3074 :
3075 0 : if (allow_remaining) {
3076 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
3077 : } else {
3078 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
3079 : }
3080 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3081 0 : PyErr_SetNdrError(err);
3082 0 : return NULL;
3083 : }
3084 :
3085 0 : Py_RETURN_NONE;
3086 : }
3087 :
3088 0 : static PyObject *py_nbt_name_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3089 : {
3090 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
3091 0 : PyObject *ret;
3092 0 : char *retstr;
3093 :
3094 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name_packet, "nbt_name_packet", object);
3095 0 : ret = PyUnicode_FromString(retstr);
3096 0 : talloc_free(retstr);
3097 :
3098 0 : return ret;
3099 : }
3100 :
3101 : static PyMethodDef py_nbt_name_packet_methods[] = {
3102 : { "__ndr_pack__", (PyCFunction)py_nbt_name_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3103 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_name_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3104 : { "__ndr_print__", (PyCFunction)py_nbt_name_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3105 : { NULL, NULL, 0, NULL }
3106 : };
3107 :
3108 :
3109 : static PyTypeObject nbt_name_packet_Type = {
3110 : PyVarObject_HEAD_INIT(NULL, 0)
3111 : .tp_name = "nbt.name_packet",
3112 : .tp_getset = py_nbt_name_packet_getsetters,
3113 : .tp_methods = py_nbt_name_packet_methods,
3114 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3115 : .tp_new = py_nbt_name_packet_new,
3116 : };
3117 :
3118 :
3119 0 : static PyObject *py_smb_trans_body_get_wct(PyObject *obj, void *closure)
3120 : {
3121 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3122 0 : PyObject *py_wct;
3123 0 : py_wct = PyLong_FromLong((uint16_t)object->wct);
3124 0 : return py_wct;
3125 : }
3126 :
3127 0 : static int py_smb_trans_body_set_wct(PyObject *py_obj, PyObject *value, void *closure)
3128 : {
3129 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3130 0 : if (value == NULL) {
3131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->wct");
3132 0 : return -1;
3133 : }
3134 : {
3135 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wct));
3136 0 : if (PyLong_Check(value)) {
3137 0 : unsigned long long test_var;
3138 0 : test_var = PyLong_AsUnsignedLongLong(value);
3139 0 : if (PyErr_Occurred() != NULL) {
3140 0 : return -1;
3141 : }
3142 0 : if (test_var > uint_max) {
3143 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3144 : PyLong_Type.tp_name, uint_max, test_var);
3145 0 : return -1;
3146 : }
3147 0 : object->wct = test_var;
3148 : } else {
3149 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3150 : PyLong_Type.tp_name);
3151 0 : return -1;
3152 : }
3153 : }
3154 0 : return 0;
3155 : }
3156 :
3157 0 : static PyObject *py_smb_trans_body_get_total_param_count(PyObject *obj, void *closure)
3158 : {
3159 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3160 0 : PyObject *py_total_param_count;
3161 0 : py_total_param_count = PyLong_FromLong((uint16_t)object->total_param_count);
3162 0 : return py_total_param_count;
3163 : }
3164 :
3165 0 : static int py_smb_trans_body_set_total_param_count(PyObject *py_obj, PyObject *value, void *closure)
3166 : {
3167 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3168 0 : if (value == NULL) {
3169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_param_count");
3170 0 : return -1;
3171 : }
3172 : {
3173 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_param_count));
3174 0 : if (PyLong_Check(value)) {
3175 0 : unsigned long long test_var;
3176 0 : test_var = PyLong_AsUnsignedLongLong(value);
3177 0 : if (PyErr_Occurred() != NULL) {
3178 0 : return -1;
3179 : }
3180 0 : if (test_var > uint_max) {
3181 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3182 : PyLong_Type.tp_name, uint_max, test_var);
3183 0 : return -1;
3184 : }
3185 0 : object->total_param_count = test_var;
3186 : } else {
3187 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3188 : PyLong_Type.tp_name);
3189 0 : return -1;
3190 : }
3191 : }
3192 0 : return 0;
3193 : }
3194 :
3195 0 : static PyObject *py_smb_trans_body_get_total_data_count(PyObject *obj, void *closure)
3196 : {
3197 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3198 0 : PyObject *py_total_data_count;
3199 0 : py_total_data_count = PyLong_FromLong((uint16_t)object->total_data_count);
3200 0 : return py_total_data_count;
3201 : }
3202 :
3203 0 : static int py_smb_trans_body_set_total_data_count(PyObject *py_obj, PyObject *value, void *closure)
3204 : {
3205 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3206 0 : if (value == NULL) {
3207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_data_count");
3208 0 : return -1;
3209 : }
3210 : {
3211 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_data_count));
3212 0 : if (PyLong_Check(value)) {
3213 0 : unsigned long long test_var;
3214 0 : test_var = PyLong_AsUnsignedLongLong(value);
3215 0 : if (PyErr_Occurred() != NULL) {
3216 0 : return -1;
3217 : }
3218 0 : if (test_var > uint_max) {
3219 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3220 : PyLong_Type.tp_name, uint_max, test_var);
3221 0 : return -1;
3222 : }
3223 0 : object->total_data_count = test_var;
3224 : } else {
3225 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3226 : PyLong_Type.tp_name);
3227 0 : return -1;
3228 : }
3229 : }
3230 0 : return 0;
3231 : }
3232 :
3233 0 : static PyObject *py_smb_trans_body_get_max_param_count(PyObject *obj, void *closure)
3234 : {
3235 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3236 0 : PyObject *py_max_param_count;
3237 0 : py_max_param_count = PyLong_FromLong((uint16_t)object->max_param_count);
3238 0 : return py_max_param_count;
3239 : }
3240 :
3241 0 : static int py_smb_trans_body_set_max_param_count(PyObject *py_obj, PyObject *value, void *closure)
3242 : {
3243 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3244 0 : if (value == NULL) {
3245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_param_count");
3246 0 : return -1;
3247 : }
3248 : {
3249 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_param_count));
3250 0 : if (PyLong_Check(value)) {
3251 0 : unsigned long long test_var;
3252 0 : test_var = PyLong_AsUnsignedLongLong(value);
3253 0 : if (PyErr_Occurred() != NULL) {
3254 0 : return -1;
3255 : }
3256 0 : if (test_var > uint_max) {
3257 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3258 : PyLong_Type.tp_name, uint_max, test_var);
3259 0 : return -1;
3260 : }
3261 0 : object->max_param_count = test_var;
3262 : } else {
3263 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3264 : PyLong_Type.tp_name);
3265 0 : return -1;
3266 : }
3267 : }
3268 0 : return 0;
3269 : }
3270 :
3271 0 : static PyObject *py_smb_trans_body_get_max_data_count(PyObject *obj, void *closure)
3272 : {
3273 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3274 0 : PyObject *py_max_data_count;
3275 0 : py_max_data_count = PyLong_FromLong((uint16_t)object->max_data_count);
3276 0 : return py_max_data_count;
3277 : }
3278 :
3279 0 : static int py_smb_trans_body_set_max_data_count(PyObject *py_obj, PyObject *value, void *closure)
3280 : {
3281 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3282 0 : if (value == NULL) {
3283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_data_count");
3284 0 : return -1;
3285 : }
3286 : {
3287 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_data_count));
3288 0 : if (PyLong_Check(value)) {
3289 0 : unsigned long long test_var;
3290 0 : test_var = PyLong_AsUnsignedLongLong(value);
3291 0 : if (PyErr_Occurred() != NULL) {
3292 0 : return -1;
3293 : }
3294 0 : if (test_var > uint_max) {
3295 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3296 : PyLong_Type.tp_name, uint_max, test_var);
3297 0 : return -1;
3298 : }
3299 0 : object->max_data_count = test_var;
3300 : } else {
3301 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3302 : PyLong_Type.tp_name);
3303 0 : return -1;
3304 : }
3305 : }
3306 0 : return 0;
3307 : }
3308 :
3309 0 : static PyObject *py_smb_trans_body_get_max_setup_count(PyObject *obj, void *closure)
3310 : {
3311 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3312 0 : PyObject *py_max_setup_count;
3313 0 : py_max_setup_count = PyLong_FromLong((uint16_t)object->max_setup_count);
3314 0 : return py_max_setup_count;
3315 : }
3316 :
3317 0 : static int py_smb_trans_body_set_max_setup_count(PyObject *py_obj, PyObject *value, void *closure)
3318 : {
3319 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3320 0 : if (value == NULL) {
3321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_setup_count");
3322 0 : return -1;
3323 : }
3324 : {
3325 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_setup_count));
3326 0 : if (PyLong_Check(value)) {
3327 0 : unsigned long long test_var;
3328 0 : test_var = PyLong_AsUnsignedLongLong(value);
3329 0 : if (PyErr_Occurred() != NULL) {
3330 0 : return -1;
3331 : }
3332 0 : if (test_var > uint_max) {
3333 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3334 : PyLong_Type.tp_name, uint_max, test_var);
3335 0 : return -1;
3336 : }
3337 0 : object->max_setup_count = test_var;
3338 : } else {
3339 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3340 : PyLong_Type.tp_name);
3341 0 : return -1;
3342 : }
3343 : }
3344 0 : return 0;
3345 : }
3346 :
3347 0 : static PyObject *py_smb_trans_body_get_pad(PyObject *obj, void *closure)
3348 : {
3349 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3350 0 : PyObject *py_pad;
3351 0 : py_pad = PyLong_FromLong((uint16_t)object->pad);
3352 0 : return py_pad;
3353 : }
3354 :
3355 0 : static int py_smb_trans_body_set_pad(PyObject *py_obj, PyObject *value, void *closure)
3356 : {
3357 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3358 0 : if (value == NULL) {
3359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad");
3360 0 : return -1;
3361 : }
3362 : {
3363 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
3364 0 : if (PyLong_Check(value)) {
3365 0 : unsigned long long test_var;
3366 0 : test_var = PyLong_AsUnsignedLongLong(value);
3367 0 : if (PyErr_Occurred() != NULL) {
3368 0 : return -1;
3369 : }
3370 0 : if (test_var > uint_max) {
3371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3372 : PyLong_Type.tp_name, uint_max, test_var);
3373 0 : return -1;
3374 : }
3375 0 : object->pad = test_var;
3376 : } else {
3377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3378 : PyLong_Type.tp_name);
3379 0 : return -1;
3380 : }
3381 : }
3382 0 : return 0;
3383 : }
3384 :
3385 0 : static PyObject *py_smb_trans_body_get_trans_flags(PyObject *obj, void *closure)
3386 : {
3387 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3388 0 : PyObject *py_trans_flags;
3389 0 : py_trans_flags = PyLong_FromLong((uint16_t)object->trans_flags);
3390 0 : return py_trans_flags;
3391 : }
3392 :
3393 0 : static int py_smb_trans_body_set_trans_flags(PyObject *py_obj, PyObject *value, void *closure)
3394 : {
3395 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3396 0 : if (value == NULL) {
3397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trans_flags");
3398 0 : return -1;
3399 : }
3400 : {
3401 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trans_flags));
3402 0 : if (PyLong_Check(value)) {
3403 0 : unsigned long long test_var;
3404 0 : test_var = PyLong_AsUnsignedLongLong(value);
3405 0 : if (PyErr_Occurred() != NULL) {
3406 0 : return -1;
3407 : }
3408 0 : if (test_var > uint_max) {
3409 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3410 : PyLong_Type.tp_name, uint_max, test_var);
3411 0 : return -1;
3412 : }
3413 0 : object->trans_flags = test_var;
3414 : } else {
3415 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3416 : PyLong_Type.tp_name);
3417 0 : return -1;
3418 : }
3419 : }
3420 0 : return 0;
3421 : }
3422 :
3423 0 : static PyObject *py_smb_trans_body_get_timeout(PyObject *obj, void *closure)
3424 : {
3425 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3426 0 : PyObject *py_timeout;
3427 0 : py_timeout = PyLong_FromUnsignedLongLong((uint32_t)object->timeout);
3428 0 : return py_timeout;
3429 : }
3430 :
3431 0 : static int py_smb_trans_body_set_timeout(PyObject *py_obj, PyObject *value, void *closure)
3432 : {
3433 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3434 0 : if (value == NULL) {
3435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timeout");
3436 0 : return -1;
3437 : }
3438 : {
3439 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timeout));
3440 0 : if (PyLong_Check(value)) {
3441 0 : unsigned long long test_var;
3442 0 : test_var = PyLong_AsUnsignedLongLong(value);
3443 0 : if (PyErr_Occurred() != NULL) {
3444 0 : return -1;
3445 : }
3446 0 : if (test_var > uint_max) {
3447 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3448 : PyLong_Type.tp_name, uint_max, test_var);
3449 0 : return -1;
3450 : }
3451 0 : object->timeout = test_var;
3452 : } else {
3453 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3454 : PyLong_Type.tp_name);
3455 0 : return -1;
3456 : }
3457 : }
3458 0 : return 0;
3459 : }
3460 :
3461 0 : static PyObject *py_smb_trans_body_get_reserved(PyObject *obj, void *closure)
3462 : {
3463 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3464 0 : PyObject *py_reserved;
3465 0 : py_reserved = PyLong_FromLong((uint16_t)object->reserved);
3466 0 : return py_reserved;
3467 : }
3468 :
3469 0 : static int py_smb_trans_body_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3470 : {
3471 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3472 0 : if (value == NULL) {
3473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
3474 0 : return -1;
3475 : }
3476 : {
3477 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
3478 0 : if (PyLong_Check(value)) {
3479 0 : unsigned long long test_var;
3480 0 : test_var = PyLong_AsUnsignedLongLong(value);
3481 0 : if (PyErr_Occurred() != NULL) {
3482 0 : return -1;
3483 : }
3484 0 : if (test_var > uint_max) {
3485 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3486 : PyLong_Type.tp_name, uint_max, test_var);
3487 0 : return -1;
3488 : }
3489 0 : object->reserved = test_var;
3490 : } else {
3491 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3492 : PyLong_Type.tp_name);
3493 0 : return -1;
3494 : }
3495 : }
3496 0 : return 0;
3497 : }
3498 :
3499 0 : static PyObject *py_smb_trans_body_get_param_count(PyObject *obj, void *closure)
3500 : {
3501 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3502 0 : PyObject *py_param_count;
3503 0 : py_param_count = PyLong_FromLong((uint16_t)object->param_count);
3504 0 : return py_param_count;
3505 : }
3506 :
3507 0 : static int py_smb_trans_body_set_param_count(PyObject *py_obj, PyObject *value, void *closure)
3508 : {
3509 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3510 0 : if (value == NULL) {
3511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->param_count");
3512 0 : return -1;
3513 : }
3514 : {
3515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_count));
3516 0 : if (PyLong_Check(value)) {
3517 0 : unsigned long long test_var;
3518 0 : test_var = PyLong_AsUnsignedLongLong(value);
3519 0 : if (PyErr_Occurred() != NULL) {
3520 0 : return -1;
3521 : }
3522 0 : if (test_var > uint_max) {
3523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3524 : PyLong_Type.tp_name, uint_max, test_var);
3525 0 : return -1;
3526 : }
3527 0 : object->param_count = test_var;
3528 : } else {
3529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3530 : PyLong_Type.tp_name);
3531 0 : return -1;
3532 : }
3533 : }
3534 0 : return 0;
3535 : }
3536 :
3537 0 : static PyObject *py_smb_trans_body_get_param_offset(PyObject *obj, void *closure)
3538 : {
3539 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3540 0 : PyObject *py_param_offset;
3541 0 : py_param_offset = PyLong_FromLong((uint16_t)object->param_offset);
3542 0 : return py_param_offset;
3543 : }
3544 :
3545 0 : static int py_smb_trans_body_set_param_offset(PyObject *py_obj, PyObject *value, void *closure)
3546 : {
3547 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3548 0 : if (value == NULL) {
3549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->param_offset");
3550 0 : return -1;
3551 : }
3552 : {
3553 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_offset));
3554 0 : if (PyLong_Check(value)) {
3555 0 : unsigned long long test_var;
3556 0 : test_var = PyLong_AsUnsignedLongLong(value);
3557 0 : if (PyErr_Occurred() != NULL) {
3558 0 : return -1;
3559 : }
3560 0 : if (test_var > uint_max) {
3561 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3562 : PyLong_Type.tp_name, uint_max, test_var);
3563 0 : return -1;
3564 : }
3565 0 : object->param_offset = test_var;
3566 : } else {
3567 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3568 : PyLong_Type.tp_name);
3569 0 : return -1;
3570 : }
3571 : }
3572 0 : return 0;
3573 : }
3574 :
3575 0 : static PyObject *py_smb_trans_body_get_data_count(PyObject *obj, void *closure)
3576 : {
3577 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3578 0 : PyObject *py_data_count;
3579 0 : py_data_count = PyLong_FromLong((uint16_t)object->data_count);
3580 0 : return py_data_count;
3581 : }
3582 :
3583 0 : static int py_smb_trans_body_set_data_count(PyObject *py_obj, PyObject *value, void *closure)
3584 : {
3585 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3586 0 : if (value == NULL) {
3587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_count");
3588 0 : return -1;
3589 : }
3590 : {
3591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_count));
3592 0 : if (PyLong_Check(value)) {
3593 0 : unsigned long long test_var;
3594 0 : test_var = PyLong_AsUnsignedLongLong(value);
3595 0 : if (PyErr_Occurred() != NULL) {
3596 0 : return -1;
3597 : }
3598 0 : if (test_var > uint_max) {
3599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3600 : PyLong_Type.tp_name, uint_max, test_var);
3601 0 : return -1;
3602 : }
3603 0 : object->data_count = test_var;
3604 : } else {
3605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3606 : PyLong_Type.tp_name);
3607 0 : return -1;
3608 : }
3609 : }
3610 0 : return 0;
3611 : }
3612 :
3613 0 : static PyObject *py_smb_trans_body_get_data_offset(PyObject *obj, void *closure)
3614 : {
3615 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3616 0 : PyObject *py_data_offset;
3617 0 : py_data_offset = PyLong_FromLong((uint16_t)object->data_offset);
3618 0 : return py_data_offset;
3619 : }
3620 :
3621 0 : static int py_smb_trans_body_set_data_offset(PyObject *py_obj, PyObject *value, void *closure)
3622 : {
3623 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3624 0 : if (value == NULL) {
3625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_offset");
3626 0 : return -1;
3627 : }
3628 : {
3629 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_offset));
3630 0 : if (PyLong_Check(value)) {
3631 0 : unsigned long long test_var;
3632 0 : test_var = PyLong_AsUnsignedLongLong(value);
3633 0 : if (PyErr_Occurred() != NULL) {
3634 0 : return -1;
3635 : }
3636 0 : if (test_var > uint_max) {
3637 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3638 : PyLong_Type.tp_name, uint_max, test_var);
3639 0 : return -1;
3640 : }
3641 0 : object->data_offset = test_var;
3642 : } else {
3643 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3644 : PyLong_Type.tp_name);
3645 0 : return -1;
3646 : }
3647 : }
3648 0 : return 0;
3649 : }
3650 :
3651 0 : static PyObject *py_smb_trans_body_get_setup_count(PyObject *obj, void *closure)
3652 : {
3653 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3654 0 : PyObject *py_setup_count;
3655 0 : py_setup_count = PyLong_FromLong((uint16_t)object->setup_count);
3656 0 : return py_setup_count;
3657 : }
3658 :
3659 0 : static int py_smb_trans_body_set_setup_count(PyObject *py_obj, PyObject *value, void *closure)
3660 : {
3661 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3662 0 : if (value == NULL) {
3663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->setup_count");
3664 0 : return -1;
3665 : }
3666 : {
3667 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->setup_count));
3668 0 : if (PyLong_Check(value)) {
3669 0 : unsigned long long test_var;
3670 0 : test_var = PyLong_AsUnsignedLongLong(value);
3671 0 : if (PyErr_Occurred() != NULL) {
3672 0 : return -1;
3673 : }
3674 0 : if (test_var > uint_max) {
3675 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3676 : PyLong_Type.tp_name, uint_max, test_var);
3677 0 : return -1;
3678 : }
3679 0 : object->setup_count = test_var;
3680 : } else {
3681 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3682 : PyLong_Type.tp_name);
3683 0 : return -1;
3684 : }
3685 : }
3686 0 : return 0;
3687 : }
3688 :
3689 0 : static PyObject *py_smb_trans_body_get_pad2(PyObject *obj, void *closure)
3690 : {
3691 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3692 0 : PyObject *py_pad2;
3693 0 : py_pad2 = PyLong_FromLong((uint16_t)object->pad2);
3694 0 : return py_pad2;
3695 : }
3696 :
3697 0 : static int py_smb_trans_body_set_pad2(PyObject *py_obj, PyObject *value, void *closure)
3698 : {
3699 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3700 0 : if (value == NULL) {
3701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad2");
3702 0 : return -1;
3703 : }
3704 : {
3705 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad2));
3706 0 : if (PyLong_Check(value)) {
3707 0 : unsigned long long test_var;
3708 0 : test_var = PyLong_AsUnsignedLongLong(value);
3709 0 : if (PyErr_Occurred() != NULL) {
3710 0 : return -1;
3711 : }
3712 0 : if (test_var > uint_max) {
3713 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3714 : PyLong_Type.tp_name, uint_max, test_var);
3715 0 : return -1;
3716 : }
3717 0 : object->pad2 = test_var;
3718 : } else {
3719 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3720 : PyLong_Type.tp_name);
3721 0 : return -1;
3722 : }
3723 : }
3724 0 : return 0;
3725 : }
3726 :
3727 0 : static PyObject *py_smb_trans_body_get_opcode(PyObject *obj, void *closure)
3728 : {
3729 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3730 0 : PyObject *py_opcode;
3731 0 : py_opcode = PyLong_FromLong((uint16_t)object->opcode);
3732 0 : return py_opcode;
3733 : }
3734 :
3735 0 : static int py_smb_trans_body_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
3736 : {
3737 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3738 0 : if (value == NULL) {
3739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->opcode");
3740 0 : return -1;
3741 : }
3742 : {
3743 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
3744 0 : if (PyLong_Check(value)) {
3745 0 : unsigned long long test_var;
3746 0 : test_var = PyLong_AsUnsignedLongLong(value);
3747 0 : if (PyErr_Occurred() != NULL) {
3748 0 : return -1;
3749 : }
3750 0 : if (test_var > uint_max) {
3751 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3752 : PyLong_Type.tp_name, uint_max, test_var);
3753 0 : return -1;
3754 : }
3755 0 : object->opcode = test_var;
3756 : } else {
3757 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3758 : PyLong_Type.tp_name);
3759 0 : return -1;
3760 : }
3761 : }
3762 0 : return 0;
3763 : }
3764 :
3765 0 : static PyObject *py_smb_trans_body_get_priority(PyObject *obj, void *closure)
3766 : {
3767 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3768 0 : PyObject *py_priority;
3769 0 : py_priority = PyLong_FromLong((uint16_t)object->priority);
3770 0 : return py_priority;
3771 : }
3772 :
3773 0 : static int py_smb_trans_body_set_priority(PyObject *py_obj, PyObject *value, void *closure)
3774 : {
3775 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3776 0 : if (value == NULL) {
3777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priority");
3778 0 : return -1;
3779 : }
3780 : {
3781 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
3782 0 : if (PyLong_Check(value)) {
3783 0 : unsigned long long test_var;
3784 0 : test_var = PyLong_AsUnsignedLongLong(value);
3785 0 : if (PyErr_Occurred() != NULL) {
3786 0 : return -1;
3787 : }
3788 0 : if (test_var > uint_max) {
3789 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3790 : PyLong_Type.tp_name, uint_max, test_var);
3791 0 : return -1;
3792 : }
3793 0 : object->priority = test_var;
3794 : } else {
3795 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3796 : PyLong_Type.tp_name);
3797 0 : return -1;
3798 : }
3799 : }
3800 0 : return 0;
3801 : }
3802 :
3803 0 : static PyObject *py_smb_trans_body_get__class(PyObject *obj, void *closure)
3804 : {
3805 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3806 0 : PyObject *py__class;
3807 0 : py__class = PyLong_FromLong((uint16_t)object->_class);
3808 0 : return py__class;
3809 : }
3810 :
3811 0 : static int py_smb_trans_body_set__class(PyObject *py_obj, PyObject *value, void *closure)
3812 : {
3813 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3814 0 : if (value == NULL) {
3815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_class");
3816 0 : return -1;
3817 : }
3818 : {
3819 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_class));
3820 0 : if (PyLong_Check(value)) {
3821 0 : unsigned long long test_var;
3822 0 : test_var = PyLong_AsUnsignedLongLong(value);
3823 0 : if (PyErr_Occurred() != NULL) {
3824 0 : return -1;
3825 : }
3826 0 : if (test_var > uint_max) {
3827 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3828 : PyLong_Type.tp_name, uint_max, test_var);
3829 0 : return -1;
3830 : }
3831 0 : object->_class = test_var;
3832 : } else {
3833 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3834 : PyLong_Type.tp_name);
3835 0 : return -1;
3836 : }
3837 : }
3838 0 : return 0;
3839 : }
3840 :
3841 0 : static PyObject *py_smb_trans_body_get_byte_count(PyObject *obj, void *closure)
3842 : {
3843 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3844 0 : PyObject *py_byte_count;
3845 0 : py_byte_count = PyLong_FromLong((uint16_t)object->byte_count);
3846 0 : return py_byte_count;
3847 : }
3848 :
3849 0 : static int py_smb_trans_body_set_byte_count(PyObject *py_obj, PyObject *value, void *closure)
3850 : {
3851 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3852 0 : if (value == NULL) {
3853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->byte_count");
3854 0 : return -1;
3855 : }
3856 : {
3857 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->byte_count));
3858 0 : if (PyLong_Check(value)) {
3859 0 : unsigned long long test_var;
3860 0 : test_var = PyLong_AsUnsignedLongLong(value);
3861 0 : if (PyErr_Occurred() != NULL) {
3862 0 : return -1;
3863 : }
3864 0 : if (test_var > uint_max) {
3865 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3866 : PyLong_Type.tp_name, uint_max, test_var);
3867 0 : return -1;
3868 : }
3869 0 : object->byte_count = test_var;
3870 : } else {
3871 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3872 : PyLong_Type.tp_name);
3873 0 : return -1;
3874 : }
3875 : }
3876 0 : return 0;
3877 : }
3878 :
3879 0 : static PyObject *py_smb_trans_body_get_mailslot_name(PyObject *obj, void *closure)
3880 : {
3881 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3882 0 : PyObject *py_mailslot_name;
3883 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
3884 0 : return py_mailslot_name;
3885 : }
3886 :
3887 0 : static int py_smb_trans_body_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
3888 : {
3889 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3890 0 : if (value == NULL) {
3891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
3892 0 : return -1;
3893 : }
3894 : {
3895 0 : const char *test_str;
3896 0 : const char *talloc_str;
3897 0 : PyObject *unicode = NULL;
3898 0 : if (PyUnicode_Check(value)) {
3899 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3900 0 : if (unicode == NULL) {
3901 0 : return -1;
3902 : }
3903 0 : test_str = PyBytes_AS_STRING(unicode);
3904 0 : } else if (PyBytes_Check(value)) {
3905 0 : test_str = PyBytes_AS_STRING(value);
3906 : } else {
3907 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3908 0 : return -1;
3909 : }
3910 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3911 0 : if (unicode != NULL) {
3912 0 : Py_DECREF(unicode);
3913 : }
3914 0 : if (talloc_str == NULL) {
3915 0 : PyErr_NoMemory();
3916 0 : return -1;
3917 : }
3918 0 : object->mailslot_name = talloc_str;
3919 : }
3920 0 : return 0;
3921 : }
3922 :
3923 0 : static PyObject *py_smb_trans_body_get_data(PyObject *obj, void *closure)
3924 : {
3925 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3926 0 : PyObject *py_data;
3927 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
3928 0 : return py_data;
3929 : }
3930 :
3931 0 : static int py_smb_trans_body_set_data(PyObject *py_obj, PyObject *value, void *closure)
3932 : {
3933 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3934 0 : if (value == NULL) {
3935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
3936 0 : return -1;
3937 : }
3938 0 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
3939 0 : return 0;
3940 : }
3941 :
3942 : static PyGetSetDef py_smb_trans_body_getsetters[] = {
3943 : {
3944 : .name = discard_const_p(char, "wct"),
3945 : .get = py_smb_trans_body_get_wct,
3946 : .set = py_smb_trans_body_set_wct,
3947 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3948 : },
3949 : {
3950 : .name = discard_const_p(char, "total_param_count"),
3951 : .get = py_smb_trans_body_get_total_param_count,
3952 : .set = py_smb_trans_body_set_total_param_count,
3953 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3954 : },
3955 : {
3956 : .name = discard_const_p(char, "total_data_count"),
3957 : .get = py_smb_trans_body_get_total_data_count,
3958 : .set = py_smb_trans_body_set_total_data_count,
3959 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3960 : },
3961 : {
3962 : .name = discard_const_p(char, "max_param_count"),
3963 : .get = py_smb_trans_body_get_max_param_count,
3964 : .set = py_smb_trans_body_set_max_param_count,
3965 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3966 : },
3967 : {
3968 : .name = discard_const_p(char, "max_data_count"),
3969 : .get = py_smb_trans_body_get_max_data_count,
3970 : .set = py_smb_trans_body_set_max_data_count,
3971 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3972 : },
3973 : {
3974 : .name = discard_const_p(char, "max_setup_count"),
3975 : .get = py_smb_trans_body_get_max_setup_count,
3976 : .set = py_smb_trans_body_set_max_setup_count,
3977 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3978 : },
3979 : {
3980 : .name = discard_const_p(char, "pad"),
3981 : .get = py_smb_trans_body_get_pad,
3982 : .set = py_smb_trans_body_set_pad,
3983 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3984 : },
3985 : {
3986 : .name = discard_const_p(char, "trans_flags"),
3987 : .get = py_smb_trans_body_get_trans_flags,
3988 : .set = py_smb_trans_body_set_trans_flags,
3989 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3990 : },
3991 : {
3992 : .name = discard_const_p(char, "timeout"),
3993 : .get = py_smb_trans_body_get_timeout,
3994 : .set = py_smb_trans_body_set_timeout,
3995 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3996 : },
3997 : {
3998 : .name = discard_const_p(char, "reserved"),
3999 : .get = py_smb_trans_body_get_reserved,
4000 : .set = py_smb_trans_body_set_reserved,
4001 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4002 : },
4003 : {
4004 : .name = discard_const_p(char, "param_count"),
4005 : .get = py_smb_trans_body_get_param_count,
4006 : .set = py_smb_trans_body_set_param_count,
4007 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4008 : },
4009 : {
4010 : .name = discard_const_p(char, "param_offset"),
4011 : .get = py_smb_trans_body_get_param_offset,
4012 : .set = py_smb_trans_body_set_param_offset,
4013 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4014 : },
4015 : {
4016 : .name = discard_const_p(char, "data_count"),
4017 : .get = py_smb_trans_body_get_data_count,
4018 : .set = py_smb_trans_body_set_data_count,
4019 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4020 : },
4021 : {
4022 : .name = discard_const_p(char, "data_offset"),
4023 : .get = py_smb_trans_body_get_data_offset,
4024 : .set = py_smb_trans_body_set_data_offset,
4025 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4026 : },
4027 : {
4028 : .name = discard_const_p(char, "setup_count"),
4029 : .get = py_smb_trans_body_get_setup_count,
4030 : .set = py_smb_trans_body_set_setup_count,
4031 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4032 : },
4033 : {
4034 : .name = discard_const_p(char, "pad2"),
4035 : .get = py_smb_trans_body_get_pad2,
4036 : .set = py_smb_trans_body_set_pad2,
4037 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4038 : },
4039 : {
4040 : .name = discard_const_p(char, "opcode"),
4041 : .get = py_smb_trans_body_get_opcode,
4042 : .set = py_smb_trans_body_set_opcode,
4043 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4044 : },
4045 : {
4046 : .name = discard_const_p(char, "priority"),
4047 : .get = py_smb_trans_body_get_priority,
4048 : .set = py_smb_trans_body_set_priority,
4049 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4050 : },
4051 : {
4052 : .name = discard_const_p(char, "_class"),
4053 : .get = py_smb_trans_body_get__class,
4054 : .set = py_smb_trans_body_set__class,
4055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4056 : },
4057 : {
4058 : .name = discard_const_p(char, "byte_count"),
4059 : .get = py_smb_trans_body_get_byte_count,
4060 : .set = py_smb_trans_body_set_byte_count,
4061 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4062 : },
4063 : {
4064 : .name = discard_const_p(char, "mailslot_name"),
4065 : .get = py_smb_trans_body_get_mailslot_name,
4066 : .set = py_smb_trans_body_set_mailslot_name,
4067 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
4068 : },
4069 : {
4070 : .name = discard_const_p(char, "data"),
4071 : .get = py_smb_trans_body_get_data,
4072 : .set = py_smb_trans_body_set_data,
4073 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
4074 : },
4075 : { .name = NULL }
4076 : };
4077 :
4078 0 : static PyObject *py_smb_trans_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4079 : {
4080 0 : return pytalloc_new(struct smb_trans_body, type);
4081 : }
4082 :
4083 :
4084 : static PyTypeObject smb_trans_body_Type = {
4085 : PyVarObject_HEAD_INIT(NULL, 0)
4086 : .tp_name = "nbt.smb_trans_body",
4087 : .tp_getset = py_smb_trans_body_getsetters,
4088 : .tp_methods = NULL,
4089 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4090 : .tp_new = py_smb_trans_body_new,
4091 : };
4092 :
4093 0 : static PyObject *py_import_smb_body(TALLOC_CTX *mem_ctx, int level, union smb_body *in)
4094 : {
4095 0 : PyObject *ret;
4096 :
4097 0 : switch (level) {
4098 0 : case SMB_TRANSACTION:
4099 0 : ret = pytalloc_reference_ex(&smb_trans_body_Type, mem_ctx, &in->trans);
4100 0 : return ret;
4101 :
4102 : }
4103 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4104 0 : return NULL;
4105 : }
4106 :
4107 0 : static union smb_body *py_export_smb_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4108 : {
4109 0 : union smb_body *ret = talloc_zero(mem_ctx, union smb_body);
4110 0 : switch (level) {
4111 0 : case SMB_TRANSACTION:
4112 0 : if (in == NULL) {
4113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->trans");
4114 0 : talloc_free(ret); return NULL;
4115 : }
4116 0 : PY_CHECK_TYPE(&smb_trans_body_Type, in, talloc_free(ret); return NULL;);
4117 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4118 0 : PyErr_NoMemory();
4119 0 : talloc_free(ret); return NULL;
4120 : }
4121 0 : ret->trans = *(struct smb_trans_body *)pytalloc_get_ptr(in);
4122 0 : break;
4123 :
4124 0 : default:
4125 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4126 0 : talloc_free(ret);
4127 0 : ret = NULL;
4128 : }
4129 :
4130 0 : return ret;
4131 : }
4132 :
4133 0 : static PyObject *py_smb_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4134 : {
4135 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4136 0 : PyObject *mem_ctx_obj = NULL;
4137 0 : TALLOC_CTX *mem_ctx = NULL;
4138 0 : int level = 0;
4139 0 : PyObject *in_obj = NULL;
4140 0 : union smb_body *in = NULL;
4141 :
4142 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4143 : discard_const_p(char *, kwnames),
4144 : &mem_ctx_obj,
4145 : &level,
4146 : &in_obj)) {
4147 0 : return NULL;
4148 : }
4149 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4150 0 : if (mem_ctx == NULL) {
4151 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4152 0 : return NULL;
4153 : }
4154 0 : in = (union smb_body *)pytalloc_get_ptr(in_obj);
4155 0 : if (in == NULL) {
4156 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union smb_body!");
4157 0 : return NULL;
4158 : }
4159 :
4160 0 : return py_import_smb_body(mem_ctx, level, in);
4161 : }
4162 :
4163 0 : static PyObject *py_smb_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4164 : {
4165 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4166 0 : PyObject *mem_ctx_obj = NULL;
4167 0 : TALLOC_CTX *mem_ctx = NULL;
4168 0 : int level = 0;
4169 0 : PyObject *in = NULL;
4170 0 : union smb_body *out = NULL;
4171 :
4172 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4173 : discard_const_p(char *, kwnames),
4174 : &mem_ctx_obj,
4175 : &level,
4176 : &in)) {
4177 0 : return NULL;
4178 : }
4179 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4180 0 : if (mem_ctx == NULL) {
4181 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4182 0 : return NULL;
4183 : }
4184 :
4185 0 : out = py_export_smb_body(mem_ctx, level, in);
4186 0 : if (out == NULL) {
4187 0 : return NULL;
4188 : }
4189 :
4190 0 : return pytalloc_GenericObject_reference(out);
4191 : }
4192 :
4193 : static PyMethodDef py_smb_body_methods[] = {
4194 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_import),
4195 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4196 : "T.__import__(mem_ctx, level, in) => ret." },
4197 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_export),
4198 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4199 : "T.__export__(mem_ctx, level, in) => ret." },
4200 : { NULL, NULL, 0, NULL }
4201 : };
4202 :
4203 0 : static PyObject *py_smb_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4204 : {
4205 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4206 0 : return NULL;
4207 : }
4208 :
4209 :
4210 : static PyTypeObject smb_body_Type = {
4211 : PyVarObject_HEAD_INIT(NULL, 0)
4212 : .tp_name = "nbt.smb_body",
4213 : .tp_getset = NULL,
4214 : .tp_methods = py_smb_body_methods,
4215 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4216 : .tp_new = py_smb_body_new,
4217 : };
4218 :
4219 :
4220 0 : static PyObject *py_dgram_smb_packet_get_smb_command(PyObject *obj, void *closure)
4221 : {
4222 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4223 0 : PyObject *py_smb_command;
4224 0 : py_smb_command = PyLong_FromLong((uint16_t)object->smb_command);
4225 0 : return py_smb_command;
4226 : }
4227 :
4228 0 : static int py_dgram_smb_packet_set_smb_command(PyObject *py_obj, PyObject *value, void *closure)
4229 : {
4230 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4231 0 : if (value == NULL) {
4232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->smb_command");
4233 0 : return -1;
4234 : }
4235 : {
4236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->smb_command));
4237 0 : if (PyLong_Check(value)) {
4238 0 : unsigned long long test_var;
4239 0 : test_var = PyLong_AsUnsignedLongLong(value);
4240 0 : if (PyErr_Occurred() != NULL) {
4241 0 : return -1;
4242 : }
4243 0 : if (test_var > uint_max) {
4244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4245 : PyLong_Type.tp_name, uint_max, test_var);
4246 0 : return -1;
4247 : }
4248 0 : object->smb_command = test_var;
4249 : } else {
4250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4251 : PyLong_Type.tp_name);
4252 0 : return -1;
4253 : }
4254 : }
4255 0 : return 0;
4256 : }
4257 :
4258 0 : static PyObject *py_dgram_smb_packet_get_err_class(PyObject *obj, void *closure)
4259 : {
4260 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4261 0 : PyObject *py_err_class;
4262 0 : py_err_class = PyLong_FromLong((uint16_t)object->err_class);
4263 0 : return py_err_class;
4264 : }
4265 :
4266 0 : static int py_dgram_smb_packet_set_err_class(PyObject *py_obj, PyObject *value, void *closure)
4267 : {
4268 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4269 0 : if (value == NULL) {
4270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->err_class");
4271 0 : return -1;
4272 : }
4273 : {
4274 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_class));
4275 0 : if (PyLong_Check(value)) {
4276 0 : unsigned long long test_var;
4277 0 : test_var = PyLong_AsUnsignedLongLong(value);
4278 0 : if (PyErr_Occurred() != NULL) {
4279 0 : return -1;
4280 : }
4281 0 : if (test_var > uint_max) {
4282 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4283 : PyLong_Type.tp_name, uint_max, test_var);
4284 0 : return -1;
4285 : }
4286 0 : object->err_class = test_var;
4287 : } else {
4288 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4289 : PyLong_Type.tp_name);
4290 0 : return -1;
4291 : }
4292 : }
4293 0 : return 0;
4294 : }
4295 :
4296 0 : static PyObject *py_dgram_smb_packet_get_pad(PyObject *obj, void *closure)
4297 : {
4298 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4299 0 : PyObject *py_pad;
4300 0 : py_pad = PyLong_FromLong((uint16_t)object->pad);
4301 0 : return py_pad;
4302 : }
4303 :
4304 0 : static int py_dgram_smb_packet_set_pad(PyObject *py_obj, PyObject *value, void *closure)
4305 : {
4306 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4307 0 : if (value == NULL) {
4308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad");
4309 0 : return -1;
4310 : }
4311 : {
4312 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
4313 0 : if (PyLong_Check(value)) {
4314 0 : unsigned long long test_var;
4315 0 : test_var = PyLong_AsUnsignedLongLong(value);
4316 0 : if (PyErr_Occurred() != NULL) {
4317 0 : return -1;
4318 : }
4319 0 : if (test_var > uint_max) {
4320 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4321 : PyLong_Type.tp_name, uint_max, test_var);
4322 0 : return -1;
4323 : }
4324 0 : object->pad = test_var;
4325 : } else {
4326 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4327 : PyLong_Type.tp_name);
4328 0 : return -1;
4329 : }
4330 : }
4331 0 : return 0;
4332 : }
4333 :
4334 0 : static PyObject *py_dgram_smb_packet_get_err_code(PyObject *obj, void *closure)
4335 : {
4336 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4337 0 : PyObject *py_err_code;
4338 0 : py_err_code = PyLong_FromLong((uint16_t)object->err_code);
4339 0 : return py_err_code;
4340 : }
4341 :
4342 0 : static int py_dgram_smb_packet_set_err_code(PyObject *py_obj, PyObject *value, void *closure)
4343 : {
4344 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4345 0 : if (value == NULL) {
4346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->err_code");
4347 0 : return -1;
4348 : }
4349 : {
4350 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_code));
4351 0 : if (PyLong_Check(value)) {
4352 0 : unsigned long long test_var;
4353 0 : test_var = PyLong_AsUnsignedLongLong(value);
4354 0 : if (PyErr_Occurred() != NULL) {
4355 0 : return -1;
4356 : }
4357 0 : if (test_var > uint_max) {
4358 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4359 : PyLong_Type.tp_name, uint_max, test_var);
4360 0 : return -1;
4361 : }
4362 0 : object->err_code = test_var;
4363 : } else {
4364 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4365 : PyLong_Type.tp_name);
4366 0 : return -1;
4367 : }
4368 : }
4369 0 : return 0;
4370 : }
4371 :
4372 0 : static PyObject *py_dgram_smb_packet_get_flags(PyObject *obj, void *closure)
4373 : {
4374 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4375 0 : PyObject *py_flags;
4376 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
4377 0 : return py_flags;
4378 : }
4379 :
4380 0 : static int py_dgram_smb_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
4381 : {
4382 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4383 0 : if (value == NULL) {
4384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
4385 0 : return -1;
4386 : }
4387 : {
4388 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
4389 0 : if (PyLong_Check(value)) {
4390 0 : unsigned long long test_var;
4391 0 : test_var = PyLong_AsUnsignedLongLong(value);
4392 0 : if (PyErr_Occurred() != NULL) {
4393 0 : return -1;
4394 : }
4395 0 : if (test_var > uint_max) {
4396 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4397 : PyLong_Type.tp_name, uint_max, test_var);
4398 0 : return -1;
4399 : }
4400 0 : object->flags = test_var;
4401 : } else {
4402 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4403 : PyLong_Type.tp_name);
4404 0 : return -1;
4405 : }
4406 : }
4407 0 : return 0;
4408 : }
4409 :
4410 0 : static PyObject *py_dgram_smb_packet_get_flags2(PyObject *obj, void *closure)
4411 : {
4412 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4413 0 : PyObject *py_flags2;
4414 0 : py_flags2 = PyLong_FromLong((uint16_t)object->flags2);
4415 0 : return py_flags2;
4416 : }
4417 :
4418 0 : static int py_dgram_smb_packet_set_flags2(PyObject *py_obj, PyObject *value, void *closure)
4419 : {
4420 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4421 0 : if (value == NULL) {
4422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags2");
4423 0 : return -1;
4424 : }
4425 : {
4426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags2));
4427 0 : if (PyLong_Check(value)) {
4428 0 : unsigned long long test_var;
4429 0 : test_var = PyLong_AsUnsignedLongLong(value);
4430 0 : if (PyErr_Occurred() != NULL) {
4431 0 : return -1;
4432 : }
4433 0 : if (test_var > uint_max) {
4434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4435 : PyLong_Type.tp_name, uint_max, test_var);
4436 0 : return -1;
4437 : }
4438 0 : object->flags2 = test_var;
4439 : } else {
4440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4441 : PyLong_Type.tp_name);
4442 0 : return -1;
4443 : }
4444 : }
4445 0 : return 0;
4446 : }
4447 :
4448 0 : static PyObject *py_dgram_smb_packet_get_pid_high(PyObject *obj, void *closure)
4449 : {
4450 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4451 0 : PyObject *py_pid_high;
4452 0 : py_pid_high = PyLong_FromLong((uint16_t)object->pid_high);
4453 0 : return py_pid_high;
4454 : }
4455 :
4456 0 : static int py_dgram_smb_packet_set_pid_high(PyObject *py_obj, PyObject *value, void *closure)
4457 : {
4458 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4459 0 : if (value == NULL) {
4460 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid_high");
4461 0 : return -1;
4462 : }
4463 : {
4464 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid_high));
4465 0 : if (PyLong_Check(value)) {
4466 0 : unsigned long long test_var;
4467 0 : test_var = PyLong_AsUnsignedLongLong(value);
4468 0 : if (PyErr_Occurred() != NULL) {
4469 0 : return -1;
4470 : }
4471 0 : if (test_var > uint_max) {
4472 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4473 : PyLong_Type.tp_name, uint_max, test_var);
4474 0 : return -1;
4475 : }
4476 0 : object->pid_high = test_var;
4477 : } else {
4478 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4479 : PyLong_Type.tp_name);
4480 0 : return -1;
4481 : }
4482 : }
4483 0 : return 0;
4484 : }
4485 :
4486 0 : static PyObject *py_dgram_smb_packet_get_signature(PyObject *obj, void *closure)
4487 : {
4488 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4489 0 : PyObject *py_signature;
4490 0 : py_signature = PyList_New(8);
4491 0 : if (py_signature == NULL) {
4492 0 : return NULL;
4493 : }
4494 : {
4495 : int signature_cntr_0;
4496 0 : for (signature_cntr_0 = 0; signature_cntr_0 < (8); signature_cntr_0++) {
4497 0 : PyObject *py_signature_0;
4498 0 : py_signature_0 = PyLong_FromLong((uint16_t)object->signature[signature_cntr_0]);
4499 0 : PyList_SetItem(py_signature, signature_cntr_0, py_signature_0);
4500 : }
4501 : }
4502 0 : return py_signature;
4503 : }
4504 :
4505 0 : static int py_dgram_smb_packet_set_signature(PyObject *py_obj, PyObject *value, void *closure)
4506 : {
4507 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4508 0 : if (value == NULL) {
4509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature");
4510 0 : return -1;
4511 : }
4512 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4513 : {
4514 0 : int signature_cntr_0;
4515 0 : if (ARRAY_SIZE(object->signature) != PyList_GET_SIZE(value)) {
4516 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->signature), PyList_GET_SIZE(value));
4517 0 : return -1;
4518 : }
4519 0 : for (signature_cntr_0 = 0; signature_cntr_0 < PyList_GET_SIZE(value); signature_cntr_0++) {
4520 0 : if (PyList_GET_ITEM(value, signature_cntr_0) == NULL) {
4521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature[signature_cntr_0]");
4522 0 : return -1;
4523 : }
4524 : {
4525 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->signature[signature_cntr_0]));
4526 0 : if (PyLong_Check(PyList_GET_ITEM(value, signature_cntr_0))) {
4527 0 : unsigned long long test_var;
4528 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, signature_cntr_0));
4529 0 : if (PyErr_Occurred() != NULL) {
4530 0 : return -1;
4531 : }
4532 0 : if (test_var > uint_max) {
4533 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4534 : PyLong_Type.tp_name, uint_max, test_var);
4535 0 : return -1;
4536 : }
4537 0 : object->signature[signature_cntr_0] = test_var;
4538 : } else {
4539 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4540 : PyLong_Type.tp_name);
4541 0 : return -1;
4542 : }
4543 : }
4544 : }
4545 : }
4546 0 : return 0;
4547 : }
4548 :
4549 0 : static PyObject *py_dgram_smb_packet_get_reserved(PyObject *obj, void *closure)
4550 : {
4551 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4552 0 : PyObject *py_reserved;
4553 0 : py_reserved = PyLong_FromLong((uint16_t)object->reserved);
4554 0 : return py_reserved;
4555 : }
4556 :
4557 0 : static int py_dgram_smb_packet_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
4558 : {
4559 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4560 0 : if (value == NULL) {
4561 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
4562 0 : return -1;
4563 : }
4564 : {
4565 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
4566 0 : if (PyLong_Check(value)) {
4567 0 : unsigned long long test_var;
4568 0 : test_var = PyLong_AsUnsignedLongLong(value);
4569 0 : if (PyErr_Occurred() != NULL) {
4570 0 : return -1;
4571 : }
4572 0 : if (test_var > uint_max) {
4573 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4574 : PyLong_Type.tp_name, uint_max, test_var);
4575 0 : return -1;
4576 : }
4577 0 : object->reserved = test_var;
4578 : } else {
4579 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4580 : PyLong_Type.tp_name);
4581 0 : return -1;
4582 : }
4583 : }
4584 0 : return 0;
4585 : }
4586 :
4587 0 : static PyObject *py_dgram_smb_packet_get_tid(PyObject *obj, void *closure)
4588 : {
4589 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4590 0 : PyObject *py_tid;
4591 0 : py_tid = PyLong_FromLong((uint16_t)object->tid);
4592 0 : return py_tid;
4593 : }
4594 :
4595 0 : static int py_dgram_smb_packet_set_tid(PyObject *py_obj, PyObject *value, void *closure)
4596 : {
4597 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4598 0 : if (value == NULL) {
4599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tid");
4600 0 : return -1;
4601 : }
4602 : {
4603 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tid));
4604 0 : if (PyLong_Check(value)) {
4605 0 : unsigned long long test_var;
4606 0 : test_var = PyLong_AsUnsignedLongLong(value);
4607 0 : if (PyErr_Occurred() != NULL) {
4608 0 : return -1;
4609 : }
4610 0 : if (test_var > uint_max) {
4611 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4612 : PyLong_Type.tp_name, uint_max, test_var);
4613 0 : return -1;
4614 : }
4615 0 : object->tid = test_var;
4616 : } else {
4617 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4618 : PyLong_Type.tp_name);
4619 0 : return -1;
4620 : }
4621 : }
4622 0 : return 0;
4623 : }
4624 :
4625 0 : static PyObject *py_dgram_smb_packet_get_pid(PyObject *obj, void *closure)
4626 : {
4627 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4628 0 : PyObject *py_pid;
4629 0 : py_pid = PyLong_FromLong((uint16_t)object->pid);
4630 0 : return py_pid;
4631 : }
4632 :
4633 0 : static int py_dgram_smb_packet_set_pid(PyObject *py_obj, PyObject *value, void *closure)
4634 : {
4635 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4636 0 : if (value == NULL) {
4637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid");
4638 0 : return -1;
4639 : }
4640 : {
4641 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid));
4642 0 : if (PyLong_Check(value)) {
4643 0 : unsigned long long test_var;
4644 0 : test_var = PyLong_AsUnsignedLongLong(value);
4645 0 : if (PyErr_Occurred() != NULL) {
4646 0 : return -1;
4647 : }
4648 0 : if (test_var > uint_max) {
4649 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4650 : PyLong_Type.tp_name, uint_max, test_var);
4651 0 : return -1;
4652 : }
4653 0 : object->pid = test_var;
4654 : } else {
4655 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4656 : PyLong_Type.tp_name);
4657 0 : return -1;
4658 : }
4659 : }
4660 0 : return 0;
4661 : }
4662 :
4663 0 : static PyObject *py_dgram_smb_packet_get_vuid(PyObject *obj, void *closure)
4664 : {
4665 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4666 0 : PyObject *py_vuid;
4667 0 : py_vuid = PyLong_FromLong((uint16_t)object->vuid);
4668 0 : return py_vuid;
4669 : }
4670 :
4671 0 : static int py_dgram_smb_packet_set_vuid(PyObject *py_obj, PyObject *value, void *closure)
4672 : {
4673 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4674 0 : if (value == NULL) {
4675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->vuid");
4676 0 : return -1;
4677 : }
4678 : {
4679 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vuid));
4680 0 : if (PyLong_Check(value)) {
4681 0 : unsigned long long test_var;
4682 0 : test_var = PyLong_AsUnsignedLongLong(value);
4683 0 : if (PyErr_Occurred() != NULL) {
4684 0 : return -1;
4685 : }
4686 0 : if (test_var > uint_max) {
4687 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4688 : PyLong_Type.tp_name, uint_max, test_var);
4689 0 : return -1;
4690 : }
4691 0 : object->vuid = test_var;
4692 : } else {
4693 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4694 : PyLong_Type.tp_name);
4695 0 : return -1;
4696 : }
4697 : }
4698 0 : return 0;
4699 : }
4700 :
4701 0 : static PyObject *py_dgram_smb_packet_get_mid(PyObject *obj, void *closure)
4702 : {
4703 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4704 0 : PyObject *py_mid;
4705 0 : py_mid = PyLong_FromLong((uint16_t)object->mid);
4706 0 : return py_mid;
4707 : }
4708 :
4709 0 : static int py_dgram_smb_packet_set_mid(PyObject *py_obj, PyObject *value, void *closure)
4710 : {
4711 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4712 0 : if (value == NULL) {
4713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mid");
4714 0 : return -1;
4715 : }
4716 : {
4717 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mid));
4718 0 : if (PyLong_Check(value)) {
4719 0 : unsigned long long test_var;
4720 0 : test_var = PyLong_AsUnsignedLongLong(value);
4721 0 : if (PyErr_Occurred() != NULL) {
4722 0 : return -1;
4723 : }
4724 0 : if (test_var > uint_max) {
4725 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4726 : PyLong_Type.tp_name, uint_max, test_var);
4727 0 : return -1;
4728 : }
4729 0 : object->mid = test_var;
4730 : } else {
4731 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4732 : PyLong_Type.tp_name);
4733 0 : return -1;
4734 : }
4735 : }
4736 0 : return 0;
4737 : }
4738 :
4739 0 : static PyObject *py_dgram_smb_packet_get_body(PyObject *obj, void *closure)
4740 : {
4741 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4742 0 : PyObject *py_body;
4743 0 : py_body = pyrpc_import_union(&smb_body_Type, pytalloc_get_mem_ctx(obj), object->smb_command, &object->body, "union smb_body");
4744 0 : if (py_body == NULL) {
4745 0 : return NULL;
4746 : }
4747 0 : return py_body;
4748 : }
4749 :
4750 0 : static int py_dgram_smb_packet_set_body(PyObject *py_obj, PyObject *value, void *closure)
4751 : {
4752 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4753 0 : if (value == NULL) {
4754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->body");
4755 0 : return -1;
4756 : }
4757 : {
4758 0 : union smb_body *body_switch_0;
4759 0 : body_switch_0 = (union smb_body *)pyrpc_export_union(&smb_body_Type, pytalloc_get_mem_ctx(py_obj), object->smb_command, value, "union smb_body");
4760 0 : if (body_switch_0 == NULL) {
4761 0 : return -1;
4762 : }
4763 0 : object->body = *body_switch_0;
4764 : }
4765 0 : return 0;
4766 : }
4767 :
4768 : static PyGetSetDef py_dgram_smb_packet_getsetters[] = {
4769 : {
4770 : .name = discard_const_p(char, "smb_command"),
4771 : .get = py_dgram_smb_packet_get_smb_command,
4772 : .set = py_dgram_smb_packet_set_smb_command,
4773 : .doc = discard_const_p(char, "PIDL-generated element of base type smb_command")
4774 : },
4775 : {
4776 : .name = discard_const_p(char, "err_class"),
4777 : .get = py_dgram_smb_packet_get_err_class,
4778 : .set = py_dgram_smb_packet_set_err_class,
4779 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4780 : },
4781 : {
4782 : .name = discard_const_p(char, "pad"),
4783 : .get = py_dgram_smb_packet_get_pad,
4784 : .set = py_dgram_smb_packet_set_pad,
4785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4786 : },
4787 : {
4788 : .name = discard_const_p(char, "err_code"),
4789 : .get = py_dgram_smb_packet_get_err_code,
4790 : .set = py_dgram_smb_packet_set_err_code,
4791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4792 : },
4793 : {
4794 : .name = discard_const_p(char, "flags"),
4795 : .get = py_dgram_smb_packet_get_flags,
4796 : .set = py_dgram_smb_packet_set_flags,
4797 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4798 : },
4799 : {
4800 : .name = discard_const_p(char, "flags2"),
4801 : .get = py_dgram_smb_packet_get_flags2,
4802 : .set = py_dgram_smb_packet_set_flags2,
4803 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4804 : },
4805 : {
4806 : .name = discard_const_p(char, "pid_high"),
4807 : .get = py_dgram_smb_packet_get_pid_high,
4808 : .set = py_dgram_smb_packet_set_pid_high,
4809 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4810 : },
4811 : {
4812 : .name = discard_const_p(char, "signature"),
4813 : .get = py_dgram_smb_packet_get_signature,
4814 : .set = py_dgram_smb_packet_set_signature,
4815 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4816 : },
4817 : {
4818 : .name = discard_const_p(char, "reserved"),
4819 : .get = py_dgram_smb_packet_get_reserved,
4820 : .set = py_dgram_smb_packet_set_reserved,
4821 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4822 : },
4823 : {
4824 : .name = discard_const_p(char, "tid"),
4825 : .get = py_dgram_smb_packet_get_tid,
4826 : .set = py_dgram_smb_packet_set_tid,
4827 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4828 : },
4829 : {
4830 : .name = discard_const_p(char, "pid"),
4831 : .get = py_dgram_smb_packet_get_pid,
4832 : .set = py_dgram_smb_packet_set_pid,
4833 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4834 : },
4835 : {
4836 : .name = discard_const_p(char, "vuid"),
4837 : .get = py_dgram_smb_packet_get_vuid,
4838 : .set = py_dgram_smb_packet_set_vuid,
4839 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4840 : },
4841 : {
4842 : .name = discard_const_p(char, "mid"),
4843 : .get = py_dgram_smb_packet_get_mid,
4844 : .set = py_dgram_smb_packet_set_mid,
4845 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4846 : },
4847 : {
4848 : .name = discard_const_p(char, "body"),
4849 : .get = py_dgram_smb_packet_get_body,
4850 : .set = py_dgram_smb_packet_set_body,
4851 : .doc = discard_const_p(char, "PIDL-generated element of base type smb_body")
4852 : },
4853 : { .name = NULL }
4854 : };
4855 :
4856 0 : static PyObject *py_dgram_smb_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4857 : {
4858 0 : return pytalloc_new(struct dgram_smb_packet, type);
4859 : }
4860 :
4861 0 : static PyObject *py_dgram_smb_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4862 : {
4863 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4864 0 : PyObject *ret = NULL;
4865 0 : DATA_BLOB blob;
4866 0 : enum ndr_err_code err;
4867 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4868 0 : if (tmp_ctx == NULL) {
4869 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4870 0 : return NULL;
4871 : }
4872 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dgram_smb_packet);
4873 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4874 0 : TALLOC_FREE(tmp_ctx);
4875 0 : PyErr_SetNdrError(err);
4876 0 : return NULL;
4877 : }
4878 :
4879 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4880 0 : TALLOC_FREE(tmp_ctx);
4881 0 : return ret;
4882 : }
4883 :
4884 0 : static PyObject *py_dgram_smb_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4885 : {
4886 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4887 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4888 0 : Py_ssize_t blob_length = 0;
4889 0 : enum ndr_err_code err;
4890 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4891 0 : PyObject *allow_remaining_obj = NULL;
4892 0 : bool allow_remaining = false;
4893 :
4894 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4895 : discard_const_p(char *, kwnames),
4896 : &blob.data, &blob_length,
4897 : &allow_remaining_obj)) {
4898 0 : return NULL;
4899 : }
4900 0 : blob.length = blob_length;
4901 :
4902 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4903 0 : allow_remaining = true;
4904 : }
4905 :
4906 0 : if (allow_remaining) {
4907 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
4908 : } else {
4909 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
4910 : }
4911 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4912 0 : PyErr_SetNdrError(err);
4913 0 : return NULL;
4914 : }
4915 :
4916 0 : Py_RETURN_NONE;
4917 : }
4918 :
4919 0 : static PyObject *py_dgram_smb_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4920 : {
4921 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4922 0 : PyObject *ret;
4923 0 : char *retstr;
4924 :
4925 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dgram_smb_packet, "dgram_smb_packet", object);
4926 0 : ret = PyUnicode_FromString(retstr);
4927 0 : talloc_free(retstr);
4928 :
4929 0 : return ret;
4930 : }
4931 :
4932 : static PyMethodDef py_dgram_smb_packet_methods[] = {
4933 : { "__ndr_pack__", (PyCFunction)py_dgram_smb_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4934 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_smb_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4935 : { "__ndr_print__", (PyCFunction)py_dgram_smb_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4936 : { NULL, NULL, 0, NULL }
4937 : };
4938 :
4939 :
4940 : static PyTypeObject dgram_smb_packet_Type = {
4941 : PyVarObject_HEAD_INIT(NULL, 0)
4942 : .tp_name = "nbt.dgram_smb_packet",
4943 : .tp_getset = py_dgram_smb_packet_getsetters,
4944 : .tp_methods = py_dgram_smb_packet_methods,
4945 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4946 : .tp_new = py_dgram_smb_packet_new,
4947 : };
4948 :
4949 0 : static PyObject *py_import_dgram_message_body(TALLOC_CTX *mem_ctx, int level, union dgram_message_body *in)
4950 : {
4951 0 : PyObject *ret;
4952 :
4953 0 : switch (level) {
4954 0 : case DGRAM_SMB:
4955 0 : ret = pytalloc_reference_ex(&dgram_smb_packet_Type, mem_ctx, &in->smb);
4956 0 : return ret;
4957 :
4958 : }
4959 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4960 0 : return NULL;
4961 : }
4962 :
4963 0 : static union dgram_message_body *py_export_dgram_message_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4964 : {
4965 0 : union dgram_message_body *ret = talloc_zero(mem_ctx, union dgram_message_body);
4966 0 : switch (level) {
4967 0 : case DGRAM_SMB:
4968 0 : if (in == NULL) {
4969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->smb");
4970 0 : talloc_free(ret); return NULL;
4971 : }
4972 0 : PY_CHECK_TYPE(&dgram_smb_packet_Type, in, talloc_free(ret); return NULL;);
4973 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4974 0 : PyErr_NoMemory();
4975 0 : talloc_free(ret); return NULL;
4976 : }
4977 0 : ret->smb = *(struct dgram_smb_packet *)pytalloc_get_ptr(in);
4978 0 : break;
4979 :
4980 0 : default:
4981 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4982 0 : talloc_free(ret);
4983 0 : ret = NULL;
4984 : }
4985 :
4986 0 : return ret;
4987 : }
4988 :
4989 0 : static PyObject *py_dgram_message_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4990 : {
4991 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4992 0 : PyObject *mem_ctx_obj = NULL;
4993 0 : TALLOC_CTX *mem_ctx = NULL;
4994 0 : int level = 0;
4995 0 : PyObject *in_obj = NULL;
4996 0 : union dgram_message_body *in = NULL;
4997 :
4998 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4999 : discard_const_p(char *, kwnames),
5000 : &mem_ctx_obj,
5001 : &level,
5002 : &in_obj)) {
5003 0 : return NULL;
5004 : }
5005 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5006 0 : if (mem_ctx == NULL) {
5007 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5008 0 : return NULL;
5009 : }
5010 0 : in = (union dgram_message_body *)pytalloc_get_ptr(in_obj);
5011 0 : if (in == NULL) {
5012 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_message_body!");
5013 0 : return NULL;
5014 : }
5015 :
5016 0 : return py_import_dgram_message_body(mem_ctx, level, in);
5017 : }
5018 :
5019 0 : static PyObject *py_dgram_message_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5020 : {
5021 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5022 0 : PyObject *mem_ctx_obj = NULL;
5023 0 : TALLOC_CTX *mem_ctx = NULL;
5024 0 : int level = 0;
5025 0 : PyObject *in = NULL;
5026 0 : union dgram_message_body *out = NULL;
5027 :
5028 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5029 : discard_const_p(char *, kwnames),
5030 : &mem_ctx_obj,
5031 : &level,
5032 : &in)) {
5033 0 : return NULL;
5034 : }
5035 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5036 0 : if (mem_ctx == NULL) {
5037 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5038 0 : return NULL;
5039 : }
5040 :
5041 0 : out = py_export_dgram_message_body(mem_ctx, level, in);
5042 0 : if (out == NULL) {
5043 0 : return NULL;
5044 : }
5045 :
5046 0 : return pytalloc_GenericObject_reference(out);
5047 : }
5048 :
5049 : static PyMethodDef py_dgram_message_body_methods[] = {
5050 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_import),
5051 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5052 : "T.__import__(mem_ctx, level, in) => ret." },
5053 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_export),
5054 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5055 : "T.__export__(mem_ctx, level, in) => ret." },
5056 : { NULL, NULL, 0, NULL }
5057 : };
5058 :
5059 0 : static PyObject *py_dgram_message_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5060 : {
5061 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5062 0 : return NULL;
5063 : }
5064 :
5065 :
5066 : static PyTypeObject dgram_message_body_Type = {
5067 : PyVarObject_HEAD_INIT(NULL, 0)
5068 : .tp_name = "nbt.dgram_message_body",
5069 : .tp_getset = NULL,
5070 : .tp_methods = py_dgram_message_body_methods,
5071 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5072 : .tp_new = py_dgram_message_body_new,
5073 : };
5074 :
5075 :
5076 0 : static PyObject *py_dgram_message_get_length(PyObject *obj, void *closure)
5077 : {
5078 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5079 0 : PyObject *py_length;
5080 0 : py_length = PyLong_FromLong((uint16_t)object->length);
5081 0 : return py_length;
5082 : }
5083 :
5084 0 : static int py_dgram_message_set_length(PyObject *py_obj, PyObject *value, void *closure)
5085 : {
5086 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5087 0 : if (value == NULL) {
5088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
5089 0 : return -1;
5090 : }
5091 : {
5092 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
5093 0 : if (PyLong_Check(value)) {
5094 0 : unsigned long long test_var;
5095 0 : test_var = PyLong_AsUnsignedLongLong(value);
5096 0 : if (PyErr_Occurred() != NULL) {
5097 0 : return -1;
5098 : }
5099 0 : if (test_var > uint_max) {
5100 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5101 : PyLong_Type.tp_name, uint_max, test_var);
5102 0 : return -1;
5103 : }
5104 0 : object->length = test_var;
5105 : } else {
5106 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5107 : PyLong_Type.tp_name);
5108 0 : return -1;
5109 : }
5110 : }
5111 0 : return 0;
5112 : }
5113 :
5114 0 : static PyObject *py_dgram_message_get_offset(PyObject *obj, void *closure)
5115 : {
5116 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5117 0 : PyObject *py_offset;
5118 0 : py_offset = PyLong_FromLong((uint16_t)object->offset);
5119 0 : return py_offset;
5120 : }
5121 :
5122 0 : static int py_dgram_message_set_offset(PyObject *py_obj, PyObject *value, void *closure)
5123 : {
5124 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5125 0 : if (value == NULL) {
5126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->offset");
5127 0 : return -1;
5128 : }
5129 : {
5130 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->offset));
5131 0 : if (PyLong_Check(value)) {
5132 0 : unsigned long long test_var;
5133 0 : test_var = PyLong_AsUnsignedLongLong(value);
5134 0 : if (PyErr_Occurred() != NULL) {
5135 0 : return -1;
5136 : }
5137 0 : if (test_var > uint_max) {
5138 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5139 : PyLong_Type.tp_name, uint_max, test_var);
5140 0 : return -1;
5141 : }
5142 0 : object->offset = test_var;
5143 : } else {
5144 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5145 : PyLong_Type.tp_name);
5146 0 : return -1;
5147 : }
5148 : }
5149 0 : return 0;
5150 : }
5151 :
5152 0 : static PyObject *py_dgram_message_get_source_name(PyObject *obj, void *closure)
5153 : {
5154 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5155 0 : PyObject *py_source_name;
5156 0 : py_source_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->source_name);
5157 0 : return py_source_name;
5158 : }
5159 :
5160 0 : static int py_dgram_message_set_source_name(PyObject *py_obj, PyObject *value, void *closure)
5161 : {
5162 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5163 0 : if (value == NULL) {
5164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_name");
5165 0 : return -1;
5166 : }
5167 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
5168 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5169 0 : PyErr_NoMemory();
5170 0 : return -1;
5171 : }
5172 0 : object->source_name = *(struct nbt_name *)pytalloc_get_ptr(value);
5173 0 : return 0;
5174 : }
5175 :
5176 0 : static PyObject *py_dgram_message_get_dest_name(PyObject *obj, void *closure)
5177 : {
5178 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5179 0 : PyObject *py_dest_name;
5180 0 : py_dest_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->dest_name);
5181 0 : return py_dest_name;
5182 : }
5183 :
5184 0 : static int py_dgram_message_set_dest_name(PyObject *py_obj, PyObject *value, void *closure)
5185 : {
5186 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5187 0 : if (value == NULL) {
5188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dest_name");
5189 0 : return -1;
5190 : }
5191 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
5192 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5193 0 : PyErr_NoMemory();
5194 0 : return -1;
5195 : }
5196 0 : object->dest_name = *(struct nbt_name *)pytalloc_get_ptr(value);
5197 0 : return 0;
5198 : }
5199 :
5200 0 : static PyObject *py_dgram_message_get_dgram_body_type(PyObject *obj, void *closure)
5201 : {
5202 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5203 0 : PyObject *py_dgram_body_type;
5204 0 : py_dgram_body_type = PyLong_FromUnsignedLongLong((uint32_t)object->dgram_body_type);
5205 0 : return py_dgram_body_type;
5206 : }
5207 :
5208 0 : static int py_dgram_message_set_dgram_body_type(PyObject *py_obj, PyObject *value, void *closure)
5209 : {
5210 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5211 0 : if (value == NULL) {
5212 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dgram_body_type");
5213 0 : return -1;
5214 : }
5215 : {
5216 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_body_type));
5217 0 : if (PyLong_Check(value)) {
5218 0 : unsigned long long test_var;
5219 0 : test_var = PyLong_AsUnsignedLongLong(value);
5220 0 : if (PyErr_Occurred() != NULL) {
5221 0 : return -1;
5222 : }
5223 0 : if (test_var > uint_max) {
5224 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5225 : PyLong_Type.tp_name, uint_max, test_var);
5226 0 : return -1;
5227 : }
5228 0 : object->dgram_body_type = test_var;
5229 : } else {
5230 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5231 : PyLong_Type.tp_name);
5232 0 : return -1;
5233 : }
5234 : }
5235 0 : return 0;
5236 : }
5237 :
5238 0 : static PyObject *py_dgram_message_get_body(PyObject *obj, void *closure)
5239 : {
5240 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5241 0 : PyObject *py_body;
5242 0 : py_body = pyrpc_import_union(&dgram_message_body_Type, pytalloc_get_mem_ctx(obj), object->dgram_body_type, &object->body, "union dgram_message_body");
5243 0 : if (py_body == NULL) {
5244 0 : return NULL;
5245 : }
5246 0 : return py_body;
5247 : }
5248 :
5249 0 : static int py_dgram_message_set_body(PyObject *py_obj, PyObject *value, void *closure)
5250 : {
5251 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5252 0 : if (value == NULL) {
5253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->body");
5254 0 : return -1;
5255 : }
5256 : {
5257 0 : union dgram_message_body *body_switch_0;
5258 0 : body_switch_0 = (union dgram_message_body *)pyrpc_export_union(&dgram_message_body_Type, pytalloc_get_mem_ctx(py_obj), object->dgram_body_type, value, "union dgram_message_body");
5259 0 : if (body_switch_0 == NULL) {
5260 0 : return -1;
5261 : }
5262 0 : object->body = *body_switch_0;
5263 : }
5264 0 : return 0;
5265 : }
5266 :
5267 : static PyGetSetDef py_dgram_message_getsetters[] = {
5268 : {
5269 : .name = discard_const_p(char, "length"),
5270 : .get = py_dgram_message_get_length,
5271 : .set = py_dgram_message_set_length,
5272 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5273 : },
5274 : {
5275 : .name = discard_const_p(char, "offset"),
5276 : .get = py_dgram_message_get_offset,
5277 : .set = py_dgram_message_set_offset,
5278 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5279 : },
5280 : {
5281 : .name = discard_const_p(char, "source_name"),
5282 : .get = py_dgram_message_get_source_name,
5283 : .set = py_dgram_message_set_source_name,
5284 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
5285 : },
5286 : {
5287 : .name = discard_const_p(char, "dest_name"),
5288 : .get = py_dgram_message_get_dest_name,
5289 : .set = py_dgram_message_set_dest_name,
5290 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
5291 : },
5292 : {
5293 : .name = discard_const_p(char, "dgram_body_type"),
5294 : .get = py_dgram_message_get_dgram_body_type,
5295 : .set = py_dgram_message_set_dgram_body_type,
5296 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5297 : },
5298 : {
5299 : .name = discard_const_p(char, "body"),
5300 : .get = py_dgram_message_get_body,
5301 : .set = py_dgram_message_set_body,
5302 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_message_body")
5303 : },
5304 : { .name = NULL }
5305 : };
5306 :
5307 0 : static PyObject *py_dgram_message_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5308 : {
5309 0 : return pytalloc_new(struct dgram_message, type);
5310 : }
5311 :
5312 :
5313 : static PyTypeObject dgram_message_Type = {
5314 : PyVarObject_HEAD_INIT(NULL, 0)
5315 : .tp_name = "nbt.dgram_message",
5316 : .tp_getset = py_dgram_message_getsetters,
5317 : .tp_methods = NULL,
5318 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5319 : .tp_new = py_dgram_message_new,
5320 : };
5321 :
5322 0 : static PyObject *py_import_dgram_data(TALLOC_CTX *mem_ctx, int level, union dgram_data *in)
5323 : {
5324 0 : PyObject *ret;
5325 :
5326 0 : switch (level) {
5327 0 : case DGRAM_DIRECT_UNIQUE:
5328 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5329 0 : return ret;
5330 :
5331 0 : case DGRAM_DIRECT_GROUP:
5332 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5333 0 : return ret;
5334 :
5335 0 : case DGRAM_BCAST:
5336 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5337 0 : return ret;
5338 :
5339 0 : case DGRAM_ERROR:
5340 0 : ret = PyLong_FromLong((uint16_t)in->error);
5341 0 : return ret;
5342 :
5343 0 : case DGRAM_QUERY:
5344 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5345 0 : return ret;
5346 :
5347 0 : case DGRAM_QUERY_POSITIVE:
5348 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5349 0 : return ret;
5350 :
5351 0 : case DGRAM_QUERY_NEGATIVE:
5352 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5353 0 : return ret;
5354 :
5355 : }
5356 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
5357 0 : return NULL;
5358 : }
5359 :
5360 0 : static union dgram_data *py_export_dgram_data(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5361 : {
5362 0 : union dgram_data *ret = talloc_zero(mem_ctx, union dgram_data);
5363 0 : switch (level) {
5364 0 : case DGRAM_DIRECT_UNIQUE:
5365 0 : if (in == NULL) {
5366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
5367 0 : talloc_free(ret); return NULL;
5368 : }
5369 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5370 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5371 0 : PyErr_NoMemory();
5372 0 : talloc_free(ret); return NULL;
5373 : }
5374 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5375 0 : break;
5376 :
5377 0 : case DGRAM_DIRECT_GROUP:
5378 0 : if (in == NULL) {
5379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
5380 0 : talloc_free(ret); return NULL;
5381 : }
5382 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5383 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5384 0 : PyErr_NoMemory();
5385 0 : talloc_free(ret); return NULL;
5386 : }
5387 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5388 0 : break;
5389 :
5390 0 : case DGRAM_BCAST:
5391 0 : if (in == NULL) {
5392 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
5393 0 : talloc_free(ret); return NULL;
5394 : }
5395 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5396 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5397 0 : PyErr_NoMemory();
5398 0 : talloc_free(ret); return NULL;
5399 : }
5400 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5401 0 : break;
5402 :
5403 0 : case DGRAM_ERROR:
5404 0 : if (in == NULL) {
5405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->error");
5406 0 : talloc_free(ret); return NULL;
5407 : }
5408 : {
5409 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->error));
5410 0 : if (PyLong_Check(in)) {
5411 0 : unsigned long long test_var;
5412 0 : test_var = PyLong_AsUnsignedLongLong(in);
5413 0 : if (PyErr_Occurred() != NULL) {
5414 0 : talloc_free(ret); return NULL;
5415 : }
5416 0 : if (test_var > uint_max) {
5417 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5418 : PyLong_Type.tp_name, uint_max, test_var);
5419 0 : talloc_free(ret); return NULL;
5420 : }
5421 0 : ret->error = test_var;
5422 : } else {
5423 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5424 : PyLong_Type.tp_name);
5425 0 : talloc_free(ret); return NULL;
5426 : }
5427 : }
5428 0 : break;
5429 :
5430 0 : case DGRAM_QUERY:
5431 0 : if (in == NULL) {
5432 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
5433 0 : talloc_free(ret); return NULL;
5434 : }
5435 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5436 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5437 0 : PyErr_NoMemory();
5438 0 : talloc_free(ret); return NULL;
5439 : }
5440 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5441 0 : break;
5442 :
5443 0 : case DGRAM_QUERY_POSITIVE:
5444 0 : if (in == NULL) {
5445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
5446 0 : talloc_free(ret); return NULL;
5447 : }
5448 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5449 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5450 0 : PyErr_NoMemory();
5451 0 : talloc_free(ret); return NULL;
5452 : }
5453 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5454 0 : break;
5455 :
5456 0 : case DGRAM_QUERY_NEGATIVE:
5457 0 : if (in == NULL) {
5458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
5459 0 : talloc_free(ret); return NULL;
5460 : }
5461 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5462 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5463 0 : PyErr_NoMemory();
5464 0 : talloc_free(ret); return NULL;
5465 : }
5466 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5467 0 : break;
5468 :
5469 0 : default:
5470 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
5471 0 : talloc_free(ret);
5472 0 : ret = NULL;
5473 : }
5474 :
5475 0 : return ret;
5476 : }
5477 :
5478 0 : static PyObject *py_dgram_data_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5479 : {
5480 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5481 0 : PyObject *mem_ctx_obj = NULL;
5482 0 : TALLOC_CTX *mem_ctx = NULL;
5483 0 : int level = 0;
5484 0 : PyObject *in_obj = NULL;
5485 0 : union dgram_data *in = NULL;
5486 :
5487 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
5488 : discard_const_p(char *, kwnames),
5489 : &mem_ctx_obj,
5490 : &level,
5491 : &in_obj)) {
5492 0 : return NULL;
5493 : }
5494 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5495 0 : if (mem_ctx == NULL) {
5496 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5497 0 : return NULL;
5498 : }
5499 0 : in = (union dgram_data *)pytalloc_get_ptr(in_obj);
5500 0 : if (in == NULL) {
5501 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_data!");
5502 0 : return NULL;
5503 : }
5504 :
5505 0 : return py_import_dgram_data(mem_ctx, level, in);
5506 : }
5507 :
5508 0 : static PyObject *py_dgram_data_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5509 : {
5510 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5511 0 : PyObject *mem_ctx_obj = NULL;
5512 0 : TALLOC_CTX *mem_ctx = NULL;
5513 0 : int level = 0;
5514 0 : PyObject *in = NULL;
5515 0 : union dgram_data *out = NULL;
5516 :
5517 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5518 : discard_const_p(char *, kwnames),
5519 : &mem_ctx_obj,
5520 : &level,
5521 : &in)) {
5522 0 : return NULL;
5523 : }
5524 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5525 0 : if (mem_ctx == NULL) {
5526 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5527 0 : return NULL;
5528 : }
5529 :
5530 0 : out = py_export_dgram_data(mem_ctx, level, in);
5531 0 : if (out == NULL) {
5532 0 : return NULL;
5533 : }
5534 :
5535 0 : return pytalloc_GenericObject_reference(out);
5536 : }
5537 :
5538 : static PyMethodDef py_dgram_data_methods[] = {
5539 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_import),
5540 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5541 : "T.__import__(mem_ctx, level, in) => ret." },
5542 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_export),
5543 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5544 : "T.__export__(mem_ctx, level, in) => ret." },
5545 : { NULL, NULL, 0, NULL }
5546 : };
5547 :
5548 0 : static PyObject *py_dgram_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5549 : {
5550 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5551 0 : return NULL;
5552 : }
5553 :
5554 :
5555 : static PyTypeObject dgram_data_Type = {
5556 : PyVarObject_HEAD_INIT(NULL, 0)
5557 : .tp_name = "nbt.dgram_data",
5558 : .tp_getset = NULL,
5559 : .tp_methods = py_dgram_data_methods,
5560 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5561 : .tp_new = py_dgram_data_new,
5562 : };
5563 :
5564 :
5565 0 : static PyObject *py_nbt_dgram_packet_get_msg_type(PyObject *obj, void *closure)
5566 : {
5567 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5568 0 : PyObject *py_msg_type;
5569 0 : py_msg_type = PyLong_FromLong((uint16_t)object->msg_type);
5570 0 : return py_msg_type;
5571 : }
5572 :
5573 0 : static int py_nbt_dgram_packet_set_msg_type(PyObject *py_obj, PyObject *value, void *closure)
5574 : {
5575 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5576 0 : if (value == NULL) {
5577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->msg_type");
5578 0 : return -1;
5579 : }
5580 : {
5581 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->msg_type));
5582 0 : if (PyLong_Check(value)) {
5583 0 : unsigned long long test_var;
5584 0 : test_var = PyLong_AsUnsignedLongLong(value);
5585 0 : if (PyErr_Occurred() != NULL) {
5586 0 : return -1;
5587 : }
5588 0 : if (test_var > uint_max) {
5589 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5590 : PyLong_Type.tp_name, uint_max, test_var);
5591 0 : return -1;
5592 : }
5593 0 : object->msg_type = test_var;
5594 : } else {
5595 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5596 : PyLong_Type.tp_name);
5597 0 : return -1;
5598 : }
5599 : }
5600 0 : return 0;
5601 : }
5602 :
5603 0 : static PyObject *py_nbt_dgram_packet_get_flags(PyObject *obj, void *closure)
5604 : {
5605 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5606 0 : PyObject *py_flags;
5607 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
5608 0 : return py_flags;
5609 : }
5610 :
5611 0 : static int py_nbt_dgram_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
5612 : {
5613 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5614 0 : if (value == NULL) {
5615 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
5616 0 : return -1;
5617 : }
5618 : {
5619 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
5620 0 : if (PyLong_Check(value)) {
5621 0 : unsigned long long test_var;
5622 0 : test_var = PyLong_AsUnsignedLongLong(value);
5623 0 : if (PyErr_Occurred() != NULL) {
5624 0 : return -1;
5625 : }
5626 0 : if (test_var > uint_max) {
5627 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5628 : PyLong_Type.tp_name, uint_max, test_var);
5629 0 : return -1;
5630 : }
5631 0 : object->flags = test_var;
5632 : } else {
5633 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5634 : PyLong_Type.tp_name);
5635 0 : return -1;
5636 : }
5637 : }
5638 0 : return 0;
5639 : }
5640 :
5641 0 : static PyObject *py_nbt_dgram_packet_get_dgram_id(PyObject *obj, void *closure)
5642 : {
5643 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5644 0 : PyObject *py_dgram_id;
5645 0 : py_dgram_id = PyLong_FromLong((uint16_t)object->dgram_id);
5646 0 : return py_dgram_id;
5647 : }
5648 :
5649 0 : static int py_nbt_dgram_packet_set_dgram_id(PyObject *py_obj, PyObject *value, void *closure)
5650 : {
5651 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5652 0 : if (value == NULL) {
5653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dgram_id");
5654 0 : return -1;
5655 : }
5656 : {
5657 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_id));
5658 0 : if (PyLong_Check(value)) {
5659 0 : unsigned long long test_var;
5660 0 : test_var = PyLong_AsUnsignedLongLong(value);
5661 0 : if (PyErr_Occurred() != NULL) {
5662 0 : return -1;
5663 : }
5664 0 : if (test_var > uint_max) {
5665 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5666 : PyLong_Type.tp_name, uint_max, test_var);
5667 0 : return -1;
5668 : }
5669 0 : object->dgram_id = test_var;
5670 : } else {
5671 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5672 : PyLong_Type.tp_name);
5673 0 : return -1;
5674 : }
5675 : }
5676 0 : return 0;
5677 : }
5678 :
5679 0 : static PyObject *py_nbt_dgram_packet_get_src_addr(PyObject *obj, void *closure)
5680 : {
5681 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5682 0 : PyObject *py_src_addr;
5683 0 : py_src_addr = PyString_FromStringOrNULL(object->src_addr);
5684 0 : return py_src_addr;
5685 : }
5686 :
5687 0 : static int py_nbt_dgram_packet_set_src_addr(PyObject *py_obj, PyObject *value, void *closure)
5688 : {
5689 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5690 0 : if (value == NULL) {
5691 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->src_addr");
5692 0 : return -1;
5693 : }
5694 : {
5695 0 : const char *test_str;
5696 0 : const char *talloc_str;
5697 0 : PyObject *unicode = NULL;
5698 0 : if (PyUnicode_Check(value)) {
5699 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5700 0 : if (unicode == NULL) {
5701 0 : return -1;
5702 : }
5703 0 : test_str = PyBytes_AS_STRING(unicode);
5704 0 : } else if (PyBytes_Check(value)) {
5705 0 : test_str = PyBytes_AS_STRING(value);
5706 : } else {
5707 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5708 0 : return -1;
5709 : }
5710 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5711 0 : if (unicode != NULL) {
5712 0 : Py_DECREF(unicode);
5713 : }
5714 0 : if (talloc_str == NULL) {
5715 0 : PyErr_NoMemory();
5716 0 : return -1;
5717 : }
5718 0 : object->src_addr = talloc_str;
5719 : }
5720 0 : return 0;
5721 : }
5722 :
5723 0 : static PyObject *py_nbt_dgram_packet_get_src_port(PyObject *obj, void *closure)
5724 : {
5725 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5726 0 : PyObject *py_src_port;
5727 0 : py_src_port = PyLong_FromLong((uint16_t)object->src_port);
5728 0 : return py_src_port;
5729 : }
5730 :
5731 0 : static int py_nbt_dgram_packet_set_src_port(PyObject *py_obj, PyObject *value, void *closure)
5732 : {
5733 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5734 0 : if (value == NULL) {
5735 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->src_port");
5736 0 : return -1;
5737 : }
5738 : {
5739 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->src_port));
5740 0 : if (PyLong_Check(value)) {
5741 0 : unsigned long long test_var;
5742 0 : test_var = PyLong_AsUnsignedLongLong(value);
5743 0 : if (PyErr_Occurred() != NULL) {
5744 0 : return -1;
5745 : }
5746 0 : if (test_var > uint_max) {
5747 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5748 : PyLong_Type.tp_name, uint_max, test_var);
5749 0 : return -1;
5750 : }
5751 0 : object->src_port = test_var;
5752 : } else {
5753 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5754 : PyLong_Type.tp_name);
5755 0 : return -1;
5756 : }
5757 : }
5758 0 : return 0;
5759 : }
5760 :
5761 0 : static PyObject *py_nbt_dgram_packet_get_data(PyObject *obj, void *closure)
5762 : {
5763 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5764 0 : PyObject *py_data;
5765 0 : py_data = pyrpc_import_union(&dgram_data_Type, pytalloc_get_mem_ctx(obj), object->msg_type, &object->data, "union dgram_data");
5766 0 : if (py_data == NULL) {
5767 0 : return NULL;
5768 : }
5769 0 : return py_data;
5770 : }
5771 :
5772 0 : static int py_nbt_dgram_packet_set_data(PyObject *py_obj, PyObject *value, void *closure)
5773 : {
5774 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5775 0 : if (value == NULL) {
5776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
5777 0 : return -1;
5778 : }
5779 : {
5780 0 : union dgram_data *data_switch_0;
5781 0 : data_switch_0 = (union dgram_data *)pyrpc_export_union(&dgram_data_Type, pytalloc_get_mem_ctx(py_obj), object->msg_type, value, "union dgram_data");
5782 0 : if (data_switch_0 == NULL) {
5783 0 : return -1;
5784 : }
5785 0 : object->data = *data_switch_0;
5786 : }
5787 0 : return 0;
5788 : }
5789 :
5790 : static PyGetSetDef py_nbt_dgram_packet_getsetters[] = {
5791 : {
5792 : .name = discard_const_p(char, "msg_type"),
5793 : .get = py_nbt_dgram_packet_get_msg_type,
5794 : .set = py_nbt_dgram_packet_set_msg_type,
5795 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_msg_type")
5796 : },
5797 : {
5798 : .name = discard_const_p(char, "flags"),
5799 : .get = py_nbt_dgram_packet_get_flags,
5800 : .set = py_nbt_dgram_packet_set_flags,
5801 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_flags")
5802 : },
5803 : {
5804 : .name = discard_const_p(char, "dgram_id"),
5805 : .get = py_nbt_dgram_packet_get_dgram_id,
5806 : .set = py_nbt_dgram_packet_set_dgram_id,
5807 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5808 : },
5809 : {
5810 : .name = discard_const_p(char, "src_addr"),
5811 : .get = py_nbt_dgram_packet_get_src_addr,
5812 : .set = py_nbt_dgram_packet_set_src_addr,
5813 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
5814 : },
5815 : {
5816 : .name = discard_const_p(char, "src_port"),
5817 : .get = py_nbt_dgram_packet_get_src_port,
5818 : .set = py_nbt_dgram_packet_set_src_port,
5819 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5820 : },
5821 : {
5822 : .name = discard_const_p(char, "data"),
5823 : .get = py_nbt_dgram_packet_get_data,
5824 : .set = py_nbt_dgram_packet_set_data,
5825 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_data")
5826 : },
5827 : { .name = NULL }
5828 : };
5829 :
5830 0 : static PyObject *py_nbt_dgram_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5831 : {
5832 0 : return pytalloc_new(struct nbt_dgram_packet, type);
5833 : }
5834 :
5835 0 : static PyObject *py_nbt_dgram_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5836 : {
5837 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5838 0 : PyObject *ret = NULL;
5839 0 : DATA_BLOB blob;
5840 0 : enum ndr_err_code err;
5841 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5842 0 : if (tmp_ctx == NULL) {
5843 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5844 0 : return NULL;
5845 : }
5846 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_dgram_packet);
5847 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5848 0 : TALLOC_FREE(tmp_ctx);
5849 0 : PyErr_SetNdrError(err);
5850 0 : return NULL;
5851 : }
5852 :
5853 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5854 0 : TALLOC_FREE(tmp_ctx);
5855 0 : return ret;
5856 : }
5857 :
5858 0 : static PyObject *py_nbt_dgram_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5859 : {
5860 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5861 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5862 0 : Py_ssize_t blob_length = 0;
5863 0 : enum ndr_err_code err;
5864 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5865 0 : PyObject *allow_remaining_obj = NULL;
5866 0 : bool allow_remaining = false;
5867 :
5868 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5869 : discard_const_p(char *, kwnames),
5870 : &blob.data, &blob_length,
5871 : &allow_remaining_obj)) {
5872 0 : return NULL;
5873 : }
5874 0 : blob.length = blob_length;
5875 :
5876 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5877 0 : allow_remaining = true;
5878 : }
5879 :
5880 0 : if (allow_remaining) {
5881 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
5882 : } else {
5883 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
5884 : }
5885 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5886 0 : PyErr_SetNdrError(err);
5887 0 : return NULL;
5888 : }
5889 :
5890 0 : Py_RETURN_NONE;
5891 : }
5892 :
5893 0 : static PyObject *py_nbt_dgram_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5894 : {
5895 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5896 0 : PyObject *ret;
5897 0 : char *retstr;
5898 :
5899 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_dgram_packet, "nbt_dgram_packet", object);
5900 0 : ret = PyUnicode_FromString(retstr);
5901 0 : talloc_free(retstr);
5902 :
5903 0 : return ret;
5904 : }
5905 :
5906 : static PyMethodDef py_nbt_dgram_packet_methods[] = {
5907 : { "__ndr_pack__", (PyCFunction)py_nbt_dgram_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5908 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_dgram_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5909 : { "__ndr_print__", (PyCFunction)py_nbt_dgram_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5910 : { NULL, NULL, 0, NULL }
5911 : };
5912 :
5913 :
5914 : static PyTypeObject nbt_dgram_packet_Type = {
5915 : PyVarObject_HEAD_INIT(NULL, 0)
5916 : .tp_name = "nbt.dgram_packet",
5917 : .tp_getset = py_nbt_dgram_packet_getsetters,
5918 : .tp_methods = py_nbt_dgram_packet_methods,
5919 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5920 : .tp_new = py_nbt_dgram_packet_new,
5921 : };
5922 :
5923 :
5924 0 : static PyObject *py_nbt_sockaddr_get_sockaddr_family(PyObject *obj, void *closure)
5925 : {
5926 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
5927 0 : PyObject *py_sockaddr_family;
5928 0 : py_sockaddr_family = PyLong_FromUnsignedLongLong((uint32_t)object->sockaddr_family);
5929 0 : return py_sockaddr_family;
5930 : }
5931 :
5932 0 : static int py_nbt_sockaddr_set_sockaddr_family(PyObject *py_obj, PyObject *value, void *closure)
5933 : {
5934 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
5935 0 : if (value == NULL) {
5936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr_family");
5937 0 : return -1;
5938 : }
5939 : {
5940 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_family));
5941 0 : if (PyLong_Check(value)) {
5942 0 : unsigned long long test_var;
5943 0 : test_var = PyLong_AsUnsignedLongLong(value);
5944 0 : if (PyErr_Occurred() != NULL) {
5945 0 : return -1;
5946 : }
5947 0 : if (test_var > uint_max) {
5948 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5949 : PyLong_Type.tp_name, uint_max, test_var);
5950 0 : return -1;
5951 : }
5952 0 : object->sockaddr_family = test_var;
5953 : } else {
5954 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5955 : PyLong_Type.tp_name);
5956 0 : return -1;
5957 : }
5958 : }
5959 0 : return 0;
5960 : }
5961 :
5962 0 : static PyObject *py_nbt_sockaddr_get_pdc_ip(PyObject *obj, void *closure)
5963 : {
5964 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
5965 0 : PyObject *py_pdc_ip;
5966 0 : py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
5967 0 : return py_pdc_ip;
5968 : }
5969 :
5970 0 : static int py_nbt_sockaddr_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
5971 : {
5972 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
5973 0 : if (value == NULL) {
5974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_ip");
5975 0 : return -1;
5976 : }
5977 : {
5978 0 : const char *test_str;
5979 0 : const char *talloc_str;
5980 0 : PyObject *unicode = NULL;
5981 0 : if (PyUnicode_Check(value)) {
5982 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5983 0 : if (unicode == NULL) {
5984 0 : return -1;
5985 : }
5986 0 : test_str = PyBytes_AS_STRING(unicode);
5987 0 : } else if (PyBytes_Check(value)) {
5988 0 : test_str = PyBytes_AS_STRING(value);
5989 : } else {
5990 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5991 0 : return -1;
5992 : }
5993 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5994 0 : if (unicode != NULL) {
5995 0 : Py_DECREF(unicode);
5996 : }
5997 0 : if (talloc_str == NULL) {
5998 0 : PyErr_NoMemory();
5999 0 : return -1;
6000 : }
6001 0 : object->pdc_ip = talloc_str;
6002 : }
6003 0 : return 0;
6004 : }
6005 :
6006 0 : static PyObject *py_nbt_sockaddr_get_remaining(PyObject *obj, void *closure)
6007 : {
6008 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
6009 0 : PyObject *py_remaining;
6010 0 : py_remaining = PyBytes_FromStringAndSize((char *)(object->remaining).data, (object->remaining).length);
6011 0 : return py_remaining;
6012 : }
6013 :
6014 0 : static int py_nbt_sockaddr_set_remaining(PyObject *py_obj, PyObject *value, void *closure)
6015 : {
6016 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6017 0 : if (value == NULL) {
6018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->remaining");
6019 0 : return -1;
6020 : }
6021 0 : object->remaining = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
6022 0 : return 0;
6023 : }
6024 :
6025 : static PyGetSetDef py_nbt_sockaddr_getsetters[] = {
6026 : {
6027 : .name = discard_const_p(char, "sockaddr_family"),
6028 : .get = py_nbt_sockaddr_get_sockaddr_family,
6029 : .set = py_nbt_sockaddr_set_sockaddr_family,
6030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6031 : },
6032 : {
6033 : .name = discard_const_p(char, "pdc_ip"),
6034 : .get = py_nbt_sockaddr_get_pdc_ip,
6035 : .set = py_nbt_sockaddr_set_pdc_ip,
6036 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
6037 : },
6038 : {
6039 : .name = discard_const_p(char, "remaining"),
6040 : .get = py_nbt_sockaddr_get_remaining,
6041 : .set = py_nbt_sockaddr_set_remaining,
6042 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
6043 : },
6044 : { .name = NULL }
6045 : };
6046 :
6047 0 : static PyObject *py_nbt_sockaddr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6048 : {
6049 0 : return pytalloc_new(struct nbt_sockaddr, type);
6050 : }
6051 :
6052 0 : static PyObject *py_nbt_sockaddr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6053 : {
6054 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6055 0 : PyObject *ret = NULL;
6056 0 : DATA_BLOB blob;
6057 0 : enum ndr_err_code err;
6058 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6059 0 : if (tmp_ctx == NULL) {
6060 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6061 0 : return NULL;
6062 : }
6063 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr);
6064 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6065 0 : TALLOC_FREE(tmp_ctx);
6066 0 : PyErr_SetNdrError(err);
6067 0 : return NULL;
6068 : }
6069 :
6070 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6071 0 : TALLOC_FREE(tmp_ctx);
6072 0 : return ret;
6073 : }
6074 :
6075 0 : static PyObject *py_nbt_sockaddr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6076 : {
6077 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6078 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6079 0 : Py_ssize_t blob_length = 0;
6080 0 : enum ndr_err_code err;
6081 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6082 0 : PyObject *allow_remaining_obj = NULL;
6083 0 : bool allow_remaining = false;
6084 :
6085 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6086 : discard_const_p(char *, kwnames),
6087 : &blob.data, &blob_length,
6088 : &allow_remaining_obj)) {
6089 0 : return NULL;
6090 : }
6091 0 : blob.length = blob_length;
6092 :
6093 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6094 0 : allow_remaining = true;
6095 : }
6096 :
6097 0 : if (allow_remaining) {
6098 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
6099 : } else {
6100 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
6101 : }
6102 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6103 0 : PyErr_SetNdrError(err);
6104 0 : return NULL;
6105 : }
6106 :
6107 0 : Py_RETURN_NONE;
6108 : }
6109 :
6110 0 : static PyObject *py_nbt_sockaddr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6111 : {
6112 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6113 0 : PyObject *ret;
6114 0 : char *retstr;
6115 :
6116 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_sockaddr, "nbt_sockaddr", object);
6117 0 : ret = PyUnicode_FromString(retstr);
6118 0 : talloc_free(retstr);
6119 :
6120 0 : return ret;
6121 : }
6122 :
6123 : static PyMethodDef py_nbt_sockaddr_methods[] = {
6124 : { "__ndr_pack__", (PyCFunction)py_nbt_sockaddr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6125 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_sockaddr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6126 : { "__ndr_print__", (PyCFunction)py_nbt_sockaddr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6127 : { NULL, NULL, 0, NULL }
6128 : };
6129 :
6130 :
6131 : static PyTypeObject nbt_sockaddr_Type = {
6132 : PyVarObject_HEAD_INIT(NULL, 0)
6133 : .tp_name = "nbt.sockaddr",
6134 : .tp_getset = py_nbt_sockaddr_getsetters,
6135 : .tp_methods = py_nbt_sockaddr_methods,
6136 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6137 : .tp_new = py_nbt_sockaddr_new,
6138 : };
6139 :
6140 :
6141 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
6142 : {
6143 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6144 0 : PyObject *py_request_count;
6145 0 : py_request_count = PyLong_FromLong((uint16_t)object->request_count);
6146 0 : return py_request_count;
6147 : }
6148 :
6149 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
6150 : {
6151 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6152 0 : if (value == NULL) {
6153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->request_count");
6154 0 : return -1;
6155 : }
6156 : {
6157 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
6158 0 : if (PyLong_Check(value)) {
6159 0 : unsigned long long test_var;
6160 0 : test_var = PyLong_AsUnsignedLongLong(value);
6161 0 : if (PyErr_Occurred() != NULL) {
6162 0 : return -1;
6163 : }
6164 0 : if (test_var > uint_max) {
6165 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6166 : PyLong_Type.tp_name, uint_max, test_var);
6167 0 : return -1;
6168 : }
6169 0 : object->request_count = test_var;
6170 : } else {
6171 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6172 : PyLong_Type.tp_name);
6173 0 : return -1;
6174 : }
6175 : }
6176 0 : return 0;
6177 : }
6178 :
6179 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
6180 : {
6181 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6182 0 : PyObject *py_computer_name;
6183 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
6184 0 : return py_computer_name;
6185 : }
6186 :
6187 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
6188 : {
6189 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6190 0 : if (value == NULL) {
6191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
6192 0 : return -1;
6193 : }
6194 : {
6195 0 : const char *test_str;
6196 0 : const char *talloc_str;
6197 0 : PyObject *unicode = NULL;
6198 0 : if (PyUnicode_Check(value)) {
6199 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6200 0 : if (unicode == NULL) {
6201 0 : return -1;
6202 : }
6203 0 : test_str = PyBytes_AS_STRING(unicode);
6204 0 : } else if (PyBytes_Check(value)) {
6205 0 : test_str = PyBytes_AS_STRING(value);
6206 : } else {
6207 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6208 0 : return -1;
6209 : }
6210 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6211 0 : if (unicode != NULL) {
6212 0 : Py_DECREF(unicode);
6213 : }
6214 0 : if (talloc_str == NULL) {
6215 0 : PyErr_NoMemory();
6216 0 : return -1;
6217 : }
6218 0 : object->computer_name = talloc_str;
6219 : }
6220 0 : return 0;
6221 : }
6222 :
6223 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
6224 : {
6225 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6226 0 : PyObject *py_user_name;
6227 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
6228 0 : return py_user_name;
6229 : }
6230 :
6231 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
6232 : {
6233 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6234 0 : if (value == NULL) {
6235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
6236 0 : return -1;
6237 : }
6238 : {
6239 0 : const char *test_str;
6240 0 : const char *talloc_str;
6241 0 : PyObject *unicode = NULL;
6242 0 : if (PyUnicode_Check(value)) {
6243 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6244 0 : if (unicode == NULL) {
6245 0 : return -1;
6246 : }
6247 0 : test_str = PyBytes_AS_STRING(unicode);
6248 0 : } else if (PyBytes_Check(value)) {
6249 0 : test_str = PyBytes_AS_STRING(value);
6250 : } else {
6251 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6252 0 : return -1;
6253 : }
6254 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6255 0 : if (unicode != NULL) {
6256 0 : Py_DECREF(unicode);
6257 : }
6258 0 : if (talloc_str == NULL) {
6259 0 : PyErr_NoMemory();
6260 0 : return -1;
6261 : }
6262 0 : object->user_name = talloc_str;
6263 : }
6264 0 : return 0;
6265 : }
6266 :
6267 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
6268 : {
6269 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6270 0 : PyObject *py_mailslot_name;
6271 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
6272 0 : return py_mailslot_name;
6273 : }
6274 :
6275 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
6276 : {
6277 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6278 0 : if (value == NULL) {
6279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
6280 0 : return -1;
6281 : }
6282 : {
6283 0 : const char *test_str;
6284 0 : const char *talloc_str;
6285 0 : PyObject *unicode = NULL;
6286 0 : if (PyUnicode_Check(value)) {
6287 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6288 0 : if (unicode == NULL) {
6289 0 : return -1;
6290 : }
6291 0 : test_str = PyBytes_AS_STRING(unicode);
6292 0 : } else if (PyBytes_Check(value)) {
6293 0 : test_str = PyBytes_AS_STRING(value);
6294 : } else {
6295 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6296 0 : return -1;
6297 : }
6298 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6299 0 : if (unicode != NULL) {
6300 0 : Py_DECREF(unicode);
6301 : }
6302 0 : if (talloc_str == NULL) {
6303 0 : PyErr_NoMemory();
6304 0 : return -1;
6305 : }
6306 0 : object->mailslot_name = talloc_str;
6307 : }
6308 0 : return 0;
6309 : }
6310 :
6311 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control(PyObject *obj, void *closure)
6312 : {
6313 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6314 0 : PyObject *py_acct_control;
6315 0 : py_acct_control = PyLong_FromUnsignedLongLong((uint32_t)object->acct_control);
6316 0 : return py_acct_control;
6317 : }
6318 :
6319 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control(PyObject *py_obj, PyObject *value, void *closure)
6320 : {
6321 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6322 0 : if (value == NULL) {
6323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_control");
6324 0 : return -1;
6325 : }
6326 : {
6327 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_control));
6328 0 : if (PyLong_Check(value)) {
6329 0 : unsigned long long test_var;
6330 0 : test_var = PyLong_AsUnsignedLongLong(value);
6331 0 : if (PyErr_Occurred() != NULL) {
6332 0 : return -1;
6333 : }
6334 0 : if (test_var > uint_max) {
6335 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6336 : PyLong_Type.tp_name, uint_max, test_var);
6337 0 : return -1;
6338 : }
6339 0 : object->acct_control = test_var;
6340 : } else {
6341 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6342 : PyLong_Type.tp_name);
6343 0 : return -1;
6344 : }
6345 : }
6346 0 : return 0;
6347 : }
6348 :
6349 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size(PyObject *obj, void *closure)
6350 : {
6351 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6352 0 : PyObject *py_sid_size;
6353 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)object->sid_size);
6354 0 : return py_sid_size;
6355 : }
6356 :
6357 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
6358 : {
6359 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6360 0 : if (value == NULL) {
6361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_size");
6362 0 : return -1;
6363 : }
6364 : {
6365 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
6366 0 : if (PyLong_Check(value)) {
6367 0 : unsigned long long test_var;
6368 0 : test_var = PyLong_AsUnsignedLongLong(value);
6369 0 : if (PyErr_Occurred() != NULL) {
6370 0 : return -1;
6371 : }
6372 0 : if (test_var > uint_max) {
6373 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6374 : PyLong_Type.tp_name, uint_max, test_var);
6375 0 : return -1;
6376 : }
6377 0 : object->sid_size = test_var;
6378 : } else {
6379 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6380 : PyLong_Type.tp_name);
6381 0 : return -1;
6382 : }
6383 : }
6384 0 : return 0;
6385 : }
6386 :
6387 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get__pad(PyObject *obj, void *closure)
6388 : {
6389 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6390 0 : PyObject *py__pad;
6391 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
6392 0 : return py__pad;
6393 : }
6394 :
6395 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set__pad(PyObject *py_obj, PyObject *value, void *closure)
6396 : {
6397 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6398 0 : if (value == NULL) {
6399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
6400 0 : return -1;
6401 : }
6402 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
6403 0 : return 0;
6404 : }
6405 :
6406 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid(PyObject *obj, void *closure)
6407 : {
6408 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6409 0 : PyObject *py_sid;
6410 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
6411 0 : return py_sid;
6412 : }
6413 :
6414 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6415 : {
6416 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6417 0 : if (value == NULL) {
6418 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
6419 0 : return -1;
6420 : }
6421 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6422 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6423 0 : PyErr_NoMemory();
6424 0 : return -1;
6425 : }
6426 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
6427 0 : return 0;
6428 : }
6429 :
6430 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version(PyObject *obj, void *closure)
6431 : {
6432 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6433 0 : PyObject *py_nt_version;
6434 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
6435 0 : return py_nt_version;
6436 : }
6437 :
6438 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
6439 : {
6440 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6441 0 : if (value == NULL) {
6442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
6443 0 : return -1;
6444 : }
6445 : {
6446 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
6447 0 : if (PyLong_Check(value)) {
6448 0 : unsigned long long test_var;
6449 0 : test_var = PyLong_AsUnsignedLongLong(value);
6450 0 : if (PyErr_Occurred() != NULL) {
6451 0 : return -1;
6452 : }
6453 0 : if (test_var > uint_max) {
6454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6455 : PyLong_Type.tp_name, uint_max, test_var);
6456 0 : return -1;
6457 : }
6458 0 : object->nt_version = test_var;
6459 : } else {
6460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6461 : PyLong_Type.tp_name);
6462 0 : return -1;
6463 : }
6464 : }
6465 0 : return 0;
6466 : }
6467 :
6468 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
6469 : {
6470 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6471 0 : PyObject *py_lmnt_token;
6472 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
6473 0 : return py_lmnt_token;
6474 : }
6475 :
6476 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
6477 : {
6478 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6479 0 : if (value == NULL) {
6480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
6481 0 : return -1;
6482 : }
6483 : {
6484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
6485 0 : if (PyLong_Check(value)) {
6486 0 : unsigned long long test_var;
6487 0 : test_var = PyLong_AsUnsignedLongLong(value);
6488 0 : if (PyErr_Occurred() != NULL) {
6489 0 : return -1;
6490 : }
6491 0 : if (test_var > uint_max) {
6492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6493 : PyLong_Type.tp_name, uint_max, test_var);
6494 0 : return -1;
6495 : }
6496 0 : object->lmnt_token = test_var;
6497 : } else {
6498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6499 : PyLong_Type.tp_name);
6500 0 : return -1;
6501 : }
6502 : }
6503 0 : return 0;
6504 : }
6505 :
6506 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
6507 : {
6508 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6509 0 : PyObject *py_lm20_token;
6510 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
6511 0 : return py_lm20_token;
6512 : }
6513 :
6514 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
6515 : {
6516 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6517 0 : if (value == NULL) {
6518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
6519 0 : return -1;
6520 : }
6521 : {
6522 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
6523 0 : if (PyLong_Check(value)) {
6524 0 : unsigned long long test_var;
6525 0 : test_var = PyLong_AsUnsignedLongLong(value);
6526 0 : if (PyErr_Occurred() != NULL) {
6527 0 : return -1;
6528 : }
6529 0 : if (test_var > uint_max) {
6530 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6531 : PyLong_Type.tp_name, uint_max, test_var);
6532 0 : return -1;
6533 : }
6534 0 : object->lm20_token = test_var;
6535 : } else {
6536 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6537 : PyLong_Type.tp_name);
6538 0 : return -1;
6539 : }
6540 : }
6541 0 : return 0;
6542 : }
6543 :
6544 : static PyGetSetDef py_NETLOGON_SAM_LOGON_REQUEST_getsetters[] = {
6545 : {
6546 : .name = discard_const_p(char, "request_count"),
6547 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_request_count,
6548 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_request_count,
6549 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6550 : },
6551 : {
6552 : .name = discard_const_p(char, "computer_name"),
6553 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name,
6554 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name,
6555 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6556 : },
6557 : {
6558 : .name = discard_const_p(char, "user_name"),
6559 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_user_name,
6560 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_user_name,
6561 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6562 : },
6563 : {
6564 : .name = discard_const_p(char, "mailslot_name"),
6565 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name,
6566 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name,
6567 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6568 : },
6569 : {
6570 : .name = discard_const_p(char, "acct_control"),
6571 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control,
6572 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control,
6573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6574 : },
6575 : {
6576 : .name = discard_const_p(char, "sid_size"),
6577 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size,
6578 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size,
6579 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6580 : },
6581 : {
6582 : .name = discard_const_p(char, "_pad"),
6583 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get__pad,
6584 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set__pad,
6585 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
6586 : },
6587 : {
6588 : .name = discard_const_p(char, "sid"),
6589 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid,
6590 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid,
6591 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
6592 : },
6593 : {
6594 : .name = discard_const_p(char, "nt_version"),
6595 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version,
6596 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version,
6597 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
6598 : },
6599 : {
6600 : .name = discard_const_p(char, "lmnt_token"),
6601 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token,
6602 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token,
6603 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6604 : },
6605 : {
6606 : .name = discard_const_p(char, "lm20_token"),
6607 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token,
6608 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token,
6609 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6610 : },
6611 : { .name = NULL }
6612 : };
6613 :
6614 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6615 : {
6616 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_REQUEST, type);
6617 : }
6618 :
6619 :
6620 : static PyTypeObject NETLOGON_SAM_LOGON_REQUEST_Type = {
6621 : PyVarObject_HEAD_INIT(NULL, 0)
6622 : .tp_name = "nbt.NETLOGON_SAM_LOGON_REQUEST",
6623 : .tp_getset = py_NETLOGON_SAM_LOGON_REQUEST_getsetters,
6624 : .tp_methods = NULL,
6625 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6626 : .tp_new = py_NETLOGON_SAM_LOGON_REQUEST_new,
6627 : };
6628 :
6629 :
6630 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
6631 : {
6632 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6633 0 : PyObject *py_computer_name;
6634 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
6635 0 : return py_computer_name;
6636 : }
6637 :
6638 0 : static int py_NETLOGON_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
6639 : {
6640 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6641 0 : if (value == NULL) {
6642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
6643 0 : return -1;
6644 : }
6645 : {
6646 0 : const char *test_str;
6647 0 : const char *talloc_str;
6648 0 : PyObject *unicode = NULL;
6649 0 : if (PyUnicode_Check(value)) {
6650 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6651 0 : if (unicode == NULL) {
6652 0 : return -1;
6653 : }
6654 0 : test_str = PyBytes_AS_STRING(unicode);
6655 0 : } else if (PyBytes_Check(value)) {
6656 0 : test_str = PyBytes_AS_STRING(value);
6657 : } else {
6658 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6659 0 : return -1;
6660 : }
6661 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6662 0 : if (unicode != NULL) {
6663 0 : Py_DECREF(unicode);
6664 : }
6665 0 : if (talloc_str == NULL) {
6666 0 : PyErr_NoMemory();
6667 0 : return -1;
6668 : }
6669 0 : object->computer_name = talloc_str;
6670 : }
6671 0 : return 0;
6672 : }
6673 :
6674 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
6675 : {
6676 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6677 0 : PyObject *py_user_name;
6678 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
6679 0 : return py_user_name;
6680 : }
6681 :
6682 0 : static int py_NETLOGON_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
6683 : {
6684 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6685 0 : if (value == NULL) {
6686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
6687 0 : return -1;
6688 : }
6689 : {
6690 0 : const char *test_str;
6691 0 : const char *talloc_str;
6692 0 : PyObject *unicode = NULL;
6693 0 : if (PyUnicode_Check(value)) {
6694 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6695 0 : if (unicode == NULL) {
6696 0 : return -1;
6697 : }
6698 0 : test_str = PyBytes_AS_STRING(unicode);
6699 0 : } else if (PyBytes_Check(value)) {
6700 0 : test_str = PyBytes_AS_STRING(value);
6701 : } else {
6702 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6703 0 : return -1;
6704 : }
6705 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6706 0 : if (unicode != NULL) {
6707 0 : Py_DECREF(unicode);
6708 : }
6709 0 : if (talloc_str == NULL) {
6710 0 : PyErr_NoMemory();
6711 0 : return -1;
6712 : }
6713 0 : object->user_name = talloc_str;
6714 : }
6715 0 : return 0;
6716 : }
6717 :
6718 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
6719 : {
6720 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6721 0 : PyObject *py_mailslot_name;
6722 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
6723 0 : return py_mailslot_name;
6724 : }
6725 :
6726 0 : static int py_NETLOGON_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
6727 : {
6728 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6729 0 : if (value == NULL) {
6730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
6731 0 : return -1;
6732 : }
6733 : {
6734 0 : const char *test_str;
6735 0 : const char *talloc_str;
6736 0 : PyObject *unicode = NULL;
6737 0 : if (PyUnicode_Check(value)) {
6738 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6739 0 : if (unicode == NULL) {
6740 0 : return -1;
6741 : }
6742 0 : test_str = PyBytes_AS_STRING(unicode);
6743 0 : } else if (PyBytes_Check(value)) {
6744 0 : test_str = PyBytes_AS_STRING(value);
6745 : } else {
6746 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6747 0 : return -1;
6748 : }
6749 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6750 0 : if (unicode != NULL) {
6751 0 : Py_DECREF(unicode);
6752 : }
6753 0 : if (talloc_str == NULL) {
6754 0 : PyErr_NoMemory();
6755 0 : return -1;
6756 : }
6757 0 : object->mailslot_name = talloc_str;
6758 : }
6759 0 : return 0;
6760 : }
6761 :
6762 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
6763 : {
6764 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6765 0 : PyObject *py_request_count;
6766 0 : py_request_count = PyLong_FromLong((uint16_t)object->request_count);
6767 0 : return py_request_count;
6768 : }
6769 :
6770 0 : static int py_NETLOGON_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
6771 : {
6772 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6773 0 : if (value == NULL) {
6774 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->request_count");
6775 0 : return -1;
6776 : }
6777 : {
6778 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
6779 0 : if (PyLong_Check(value)) {
6780 0 : unsigned long long test_var;
6781 0 : test_var = PyLong_AsUnsignedLongLong(value);
6782 0 : if (PyErr_Occurred() != NULL) {
6783 0 : return -1;
6784 : }
6785 0 : if (test_var > uint_max) {
6786 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6787 : PyLong_Type.tp_name, uint_max, test_var);
6788 0 : return -1;
6789 : }
6790 0 : object->request_count = test_var;
6791 : } else {
6792 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6793 : PyLong_Type.tp_name);
6794 0 : return -1;
6795 : }
6796 : }
6797 0 : return 0;
6798 : }
6799 :
6800 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
6801 : {
6802 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6803 0 : PyObject *py_lmnt_token;
6804 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
6805 0 : return py_lmnt_token;
6806 : }
6807 :
6808 0 : static int py_NETLOGON_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
6809 : {
6810 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6811 0 : if (value == NULL) {
6812 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
6813 0 : return -1;
6814 : }
6815 : {
6816 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
6817 0 : if (PyLong_Check(value)) {
6818 0 : unsigned long long test_var;
6819 0 : test_var = PyLong_AsUnsignedLongLong(value);
6820 0 : if (PyErr_Occurred() != NULL) {
6821 0 : return -1;
6822 : }
6823 0 : if (test_var > uint_max) {
6824 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6825 : PyLong_Type.tp_name, uint_max, test_var);
6826 0 : return -1;
6827 : }
6828 0 : object->lmnt_token = test_var;
6829 : } else {
6830 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6831 : PyLong_Type.tp_name);
6832 0 : return -1;
6833 : }
6834 : }
6835 0 : return 0;
6836 : }
6837 :
6838 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
6839 : {
6840 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6841 0 : PyObject *py_lm20_token;
6842 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
6843 0 : return py_lm20_token;
6844 : }
6845 :
6846 0 : static int py_NETLOGON_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
6847 : {
6848 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6849 0 : if (value == NULL) {
6850 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
6851 0 : return -1;
6852 : }
6853 : {
6854 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
6855 0 : if (PyLong_Check(value)) {
6856 0 : unsigned long long test_var;
6857 0 : test_var = PyLong_AsUnsignedLongLong(value);
6858 0 : if (PyErr_Occurred() != NULL) {
6859 0 : return -1;
6860 : }
6861 0 : if (test_var > uint_max) {
6862 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6863 : PyLong_Type.tp_name, uint_max, test_var);
6864 0 : return -1;
6865 : }
6866 0 : object->lm20_token = test_var;
6867 : } else {
6868 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6869 : PyLong_Type.tp_name);
6870 0 : return -1;
6871 : }
6872 : }
6873 0 : return 0;
6874 : }
6875 :
6876 : static PyGetSetDef py_NETLOGON_LOGON_REQUEST_getsetters[] = {
6877 : {
6878 : .name = discard_const_p(char, "computer_name"),
6879 : .get = py_NETLOGON_LOGON_REQUEST_get_computer_name,
6880 : .set = py_NETLOGON_LOGON_REQUEST_set_computer_name,
6881 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6882 : },
6883 : {
6884 : .name = discard_const_p(char, "user_name"),
6885 : .get = py_NETLOGON_LOGON_REQUEST_get_user_name,
6886 : .set = py_NETLOGON_LOGON_REQUEST_set_user_name,
6887 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6888 : },
6889 : {
6890 : .name = discard_const_p(char, "mailslot_name"),
6891 : .get = py_NETLOGON_LOGON_REQUEST_get_mailslot_name,
6892 : .set = py_NETLOGON_LOGON_REQUEST_set_mailslot_name,
6893 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6894 : },
6895 : {
6896 : .name = discard_const_p(char, "request_count"),
6897 : .get = py_NETLOGON_LOGON_REQUEST_get_request_count,
6898 : .set = py_NETLOGON_LOGON_REQUEST_set_request_count,
6899 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6900 : },
6901 : {
6902 : .name = discard_const_p(char, "lmnt_token"),
6903 : .get = py_NETLOGON_LOGON_REQUEST_get_lmnt_token,
6904 : .set = py_NETLOGON_LOGON_REQUEST_set_lmnt_token,
6905 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6906 : },
6907 : {
6908 : .name = discard_const_p(char, "lm20_token"),
6909 : .get = py_NETLOGON_LOGON_REQUEST_get_lm20_token,
6910 : .set = py_NETLOGON_LOGON_REQUEST_set_lm20_token,
6911 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6912 : },
6913 : { .name = NULL }
6914 : };
6915 :
6916 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6917 : {
6918 0 : return pytalloc_new(struct NETLOGON_LOGON_REQUEST, type);
6919 : }
6920 :
6921 :
6922 : static PyTypeObject NETLOGON_LOGON_REQUEST_Type = {
6923 : PyVarObject_HEAD_INIT(NULL, 0)
6924 : .tp_name = "nbt.NETLOGON_LOGON_REQUEST",
6925 : .tp_getset = py_NETLOGON_LOGON_REQUEST_getsetters,
6926 : .tp_methods = NULL,
6927 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6928 : .tp_new = py_NETLOGON_LOGON_REQUEST_new,
6929 : };
6930 :
6931 :
6932 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command(PyObject *obj, void *closure)
6933 : {
6934 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
6935 0 : PyObject *py_command;
6936 0 : py_command = PyLong_FromLong((uint16_t)object->command);
6937 0 : return py_command;
6938 : }
6939 :
6940 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command(PyObject *py_obj, PyObject *value, void *closure)
6941 : {
6942 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
6943 0 : if (value == NULL) {
6944 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
6945 0 : return -1;
6946 : }
6947 : {
6948 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
6949 0 : if (PyLong_Check(value)) {
6950 0 : unsigned long long test_var;
6951 0 : test_var = PyLong_AsUnsignedLongLong(value);
6952 0 : if (PyErr_Occurred() != NULL) {
6953 0 : return -1;
6954 : }
6955 0 : if (test_var > uint_max) {
6956 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6957 : PyLong_Type.tp_name, uint_max, test_var);
6958 0 : return -1;
6959 : }
6960 0 : object->command = test_var;
6961 : } else {
6962 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6963 : PyLong_Type.tp_name);
6964 0 : return -1;
6965 : }
6966 : }
6967 0 : return 0;
6968 : }
6969 :
6970 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name(PyObject *obj, void *closure)
6971 : {
6972 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
6973 0 : PyObject *py_pdc_name;
6974 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
6975 0 : return py_pdc_name;
6976 : }
6977 :
6978 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
6979 : {
6980 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
6981 0 : if (value == NULL) {
6982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
6983 0 : return -1;
6984 : }
6985 : {
6986 0 : const char *test_str;
6987 0 : const char *talloc_str;
6988 0 : PyObject *unicode = NULL;
6989 0 : if (PyUnicode_Check(value)) {
6990 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6991 0 : if (unicode == NULL) {
6992 0 : return -1;
6993 : }
6994 0 : test_str = PyBytes_AS_STRING(unicode);
6995 0 : } else if (PyBytes_Check(value)) {
6996 0 : test_str = PyBytes_AS_STRING(value);
6997 : } else {
6998 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6999 0 : return -1;
7000 : }
7001 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7002 0 : if (unicode != NULL) {
7003 0 : Py_DECREF(unicode);
7004 : }
7005 0 : if (talloc_str == NULL) {
7006 0 : PyErr_NoMemory();
7007 0 : return -1;
7008 : }
7009 0 : object->pdc_name = talloc_str;
7010 : }
7011 0 : return 0;
7012 : }
7013 :
7014 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name(PyObject *obj, void *closure)
7015 : {
7016 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7017 0 : PyObject *py_user_name;
7018 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
7019 0 : return py_user_name;
7020 : }
7021 :
7022 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
7023 : {
7024 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7025 0 : if (value == NULL) {
7026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
7027 0 : return -1;
7028 : }
7029 : {
7030 0 : const char *test_str;
7031 0 : const char *talloc_str;
7032 0 : PyObject *unicode = NULL;
7033 0 : if (PyUnicode_Check(value)) {
7034 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7035 0 : if (unicode == NULL) {
7036 0 : return -1;
7037 : }
7038 0 : test_str = PyBytes_AS_STRING(unicode);
7039 0 : } else if (PyBytes_Check(value)) {
7040 0 : test_str = PyBytes_AS_STRING(value);
7041 : } else {
7042 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7043 0 : return -1;
7044 : }
7045 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7046 0 : if (unicode != NULL) {
7047 0 : Py_DECREF(unicode);
7048 : }
7049 0 : if (talloc_str == NULL) {
7050 0 : PyErr_NoMemory();
7051 0 : return -1;
7052 : }
7053 0 : object->user_name = talloc_str;
7054 : }
7055 0 : return 0;
7056 : }
7057 :
7058 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name(PyObject *obj, void *closure)
7059 : {
7060 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7061 0 : PyObject *py_domain_name;
7062 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
7063 0 : return py_domain_name;
7064 : }
7065 :
7066 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
7067 : {
7068 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7069 0 : if (value == NULL) {
7070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
7071 0 : return -1;
7072 : }
7073 : {
7074 0 : const char *test_str;
7075 0 : const char *talloc_str;
7076 0 : PyObject *unicode = NULL;
7077 0 : if (PyUnicode_Check(value)) {
7078 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7079 0 : if (unicode == NULL) {
7080 0 : return -1;
7081 : }
7082 0 : test_str = PyBytes_AS_STRING(unicode);
7083 0 : } else if (PyBytes_Check(value)) {
7084 0 : test_str = PyBytes_AS_STRING(value);
7085 : } else {
7086 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7087 0 : return -1;
7088 : }
7089 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7090 0 : if (unicode != NULL) {
7091 0 : Py_DECREF(unicode);
7092 : }
7093 0 : if (talloc_str == NULL) {
7094 0 : PyErr_NoMemory();
7095 0 : return -1;
7096 : }
7097 0 : object->domain_name = talloc_str;
7098 : }
7099 0 : return 0;
7100 : }
7101 :
7102 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version(PyObject *obj, void *closure)
7103 : {
7104 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7105 0 : PyObject *py_nt_version;
7106 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
7107 0 : return py_nt_version;
7108 : }
7109 :
7110 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
7111 : {
7112 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7113 0 : if (value == NULL) {
7114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
7115 0 : return -1;
7116 : }
7117 : {
7118 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
7119 0 : if (PyLong_Check(value)) {
7120 0 : unsigned long long test_var;
7121 0 : test_var = PyLong_AsUnsignedLongLong(value);
7122 0 : if (PyErr_Occurred() != NULL) {
7123 0 : return -1;
7124 : }
7125 0 : if (test_var > uint_max) {
7126 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7127 : PyLong_Type.tp_name, uint_max, test_var);
7128 0 : return -1;
7129 : }
7130 0 : object->nt_version = test_var;
7131 : } else {
7132 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7133 : PyLong_Type.tp_name);
7134 0 : return -1;
7135 : }
7136 : }
7137 0 : return 0;
7138 : }
7139 :
7140 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token(PyObject *obj, void *closure)
7141 : {
7142 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7143 0 : PyObject *py_lmnt_token;
7144 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
7145 0 : return py_lmnt_token;
7146 : }
7147 :
7148 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
7149 : {
7150 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7151 0 : if (value == NULL) {
7152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
7153 0 : return -1;
7154 : }
7155 : {
7156 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
7157 0 : if (PyLong_Check(value)) {
7158 0 : unsigned long long test_var;
7159 0 : test_var = PyLong_AsUnsignedLongLong(value);
7160 0 : if (PyErr_Occurred() != NULL) {
7161 0 : return -1;
7162 : }
7163 0 : if (test_var > uint_max) {
7164 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7165 : PyLong_Type.tp_name, uint_max, test_var);
7166 0 : return -1;
7167 : }
7168 0 : object->lmnt_token = test_var;
7169 : } else {
7170 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7171 : PyLong_Type.tp_name);
7172 0 : return -1;
7173 : }
7174 : }
7175 0 : return 0;
7176 : }
7177 :
7178 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token(PyObject *obj, void *closure)
7179 : {
7180 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7181 0 : PyObject *py_lm20_token;
7182 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
7183 0 : return py_lm20_token;
7184 : }
7185 :
7186 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
7187 : {
7188 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7189 0 : if (value == NULL) {
7190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
7191 0 : return -1;
7192 : }
7193 : {
7194 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
7195 0 : if (PyLong_Check(value)) {
7196 0 : unsigned long long test_var;
7197 0 : test_var = PyLong_AsUnsignedLongLong(value);
7198 0 : if (PyErr_Occurred() != NULL) {
7199 0 : return -1;
7200 : }
7201 0 : if (test_var > uint_max) {
7202 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7203 : PyLong_Type.tp_name, uint_max, test_var);
7204 0 : return -1;
7205 : }
7206 0 : object->lm20_token = test_var;
7207 : } else {
7208 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7209 : PyLong_Type.tp_name);
7210 0 : return -1;
7211 : }
7212 : }
7213 0 : return 0;
7214 : }
7215 :
7216 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters[] = {
7217 : {
7218 : .name = discard_const_p(char, "command"),
7219 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command,
7220 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command,
7221 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
7222 : },
7223 : {
7224 : .name = discard_const_p(char, "pdc_name"),
7225 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name,
7226 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name,
7227 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7228 : },
7229 : {
7230 : .name = discard_const_p(char, "user_name"),
7231 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name,
7232 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name,
7233 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7234 : },
7235 : {
7236 : .name = discard_const_p(char, "domain_name"),
7237 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name,
7238 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name,
7239 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7240 : },
7241 : {
7242 : .name = discard_const_p(char, "nt_version"),
7243 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version,
7244 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version,
7245 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
7246 : },
7247 : {
7248 : .name = discard_const_p(char, "lmnt_token"),
7249 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token,
7250 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token,
7251 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7252 : },
7253 : {
7254 : .name = discard_const_p(char, "lm20_token"),
7255 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token,
7256 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token,
7257 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7258 : },
7259 : { .name = NULL }
7260 : };
7261 :
7262 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7263 : {
7264 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_NT40, type);
7265 : }
7266 :
7267 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7268 : {
7269 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7270 0 : PyObject *ret = NULL;
7271 0 : DATA_BLOB blob;
7272 0 : enum ndr_err_code err;
7273 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7274 0 : if (tmp_ctx == NULL) {
7275 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7276 0 : return NULL;
7277 : }
7278 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7279 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7280 0 : TALLOC_FREE(tmp_ctx);
7281 0 : PyErr_SetNdrError(err);
7282 0 : return NULL;
7283 : }
7284 :
7285 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7286 0 : TALLOC_FREE(tmp_ctx);
7287 0 : return ret;
7288 : }
7289 :
7290 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7291 : {
7292 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7293 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7294 0 : Py_ssize_t blob_length = 0;
7295 0 : enum ndr_err_code err;
7296 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7297 0 : PyObject *allow_remaining_obj = NULL;
7298 0 : bool allow_remaining = false;
7299 :
7300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7301 : discard_const_p(char *, kwnames),
7302 : &blob.data, &blob_length,
7303 : &allow_remaining_obj)) {
7304 0 : return NULL;
7305 : }
7306 0 : blob.length = blob_length;
7307 :
7308 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7309 0 : allow_remaining = true;
7310 : }
7311 :
7312 0 : if (allow_remaining) {
7313 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7314 : } else {
7315 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7316 : }
7317 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7318 0 : PyErr_SetNdrError(err);
7319 0 : return NULL;
7320 : }
7321 :
7322 0 : Py_RETURN_NONE;
7323 : }
7324 :
7325 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7326 : {
7327 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7328 0 : PyObject *ret;
7329 0 : char *retstr;
7330 :
7331 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40, "NETLOGON_SAM_LOGON_RESPONSE_NT40", object);
7332 0 : ret = PyUnicode_FromString(retstr);
7333 0 : talloc_free(retstr);
7334 :
7335 0 : return ret;
7336 : }
7337 :
7338 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods[] = {
7339 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7340 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7341 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7342 : { NULL, NULL, 0, NULL }
7343 : };
7344 :
7345 :
7346 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_NT40_Type = {
7347 : PyVarObject_HEAD_INIT(NULL, 0)
7348 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40",
7349 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters,
7350 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods,
7351 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7352 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new,
7353 : };
7354 :
7355 :
7356 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_command(PyObject *obj, void *closure)
7357 : {
7358 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7359 0 : PyObject *py_command;
7360 0 : py_command = PyLong_FromLong((uint16_t)object->command);
7361 0 : return py_command;
7362 : }
7363 :
7364 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_command(PyObject *py_obj, PyObject *value, void *closure)
7365 : {
7366 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7367 0 : if (value == NULL) {
7368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
7369 0 : return -1;
7370 : }
7371 : {
7372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
7373 0 : if (PyLong_Check(value)) {
7374 0 : unsigned long long test_var;
7375 0 : test_var = PyLong_AsUnsignedLongLong(value);
7376 0 : if (PyErr_Occurred() != NULL) {
7377 0 : return -1;
7378 : }
7379 0 : if (test_var > uint_max) {
7380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7381 : PyLong_Type.tp_name, uint_max, test_var);
7382 0 : return -1;
7383 : }
7384 0 : object->command = test_var;
7385 : } else {
7386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7387 : PyLong_Type.tp_name);
7388 0 : return -1;
7389 : }
7390 : }
7391 0 : return 0;
7392 : }
7393 :
7394 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name(PyObject *obj, void *closure)
7395 : {
7396 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7397 0 : PyObject *py_pdc_name;
7398 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
7399 0 : return py_pdc_name;
7400 : }
7401 :
7402 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
7403 : {
7404 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7405 0 : if (value == NULL) {
7406 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
7407 0 : return -1;
7408 : }
7409 : {
7410 0 : const char *test_str;
7411 0 : const char *talloc_str;
7412 0 : PyObject *unicode = NULL;
7413 0 : if (PyUnicode_Check(value)) {
7414 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7415 0 : if (unicode == NULL) {
7416 0 : return -1;
7417 : }
7418 0 : test_str = PyBytes_AS_STRING(unicode);
7419 0 : } else if (PyBytes_Check(value)) {
7420 0 : test_str = PyBytes_AS_STRING(value);
7421 : } else {
7422 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7423 0 : return -1;
7424 : }
7425 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7426 0 : if (unicode != NULL) {
7427 0 : Py_DECREF(unicode);
7428 : }
7429 0 : if (talloc_str == NULL) {
7430 0 : PyErr_NoMemory();
7431 0 : return -1;
7432 : }
7433 0 : object->pdc_name = talloc_str;
7434 : }
7435 0 : return 0;
7436 : }
7437 :
7438 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name(PyObject *obj, void *closure)
7439 : {
7440 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7441 0 : PyObject *py_user_name;
7442 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
7443 0 : return py_user_name;
7444 : }
7445 :
7446 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
7447 : {
7448 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7449 0 : if (value == NULL) {
7450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
7451 0 : return -1;
7452 : }
7453 : {
7454 0 : const char *test_str;
7455 0 : const char *talloc_str;
7456 0 : PyObject *unicode = NULL;
7457 0 : if (PyUnicode_Check(value)) {
7458 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7459 0 : if (unicode == NULL) {
7460 0 : return -1;
7461 : }
7462 0 : test_str = PyBytes_AS_STRING(unicode);
7463 0 : } else if (PyBytes_Check(value)) {
7464 0 : test_str = PyBytes_AS_STRING(value);
7465 : } else {
7466 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7467 0 : return -1;
7468 : }
7469 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7470 0 : if (unicode != NULL) {
7471 0 : Py_DECREF(unicode);
7472 : }
7473 0 : if (talloc_str == NULL) {
7474 0 : PyErr_NoMemory();
7475 0 : return -1;
7476 : }
7477 0 : object->user_name = talloc_str;
7478 : }
7479 0 : return 0;
7480 : }
7481 :
7482 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name(PyObject *obj, void *closure)
7483 : {
7484 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7485 0 : PyObject *py_domain_name;
7486 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
7487 0 : return py_domain_name;
7488 : }
7489 :
7490 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
7491 : {
7492 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7493 0 : if (value == NULL) {
7494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
7495 0 : return -1;
7496 : }
7497 : {
7498 0 : const char *test_str;
7499 0 : const char *talloc_str;
7500 0 : PyObject *unicode = NULL;
7501 0 : if (PyUnicode_Check(value)) {
7502 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7503 0 : if (unicode == NULL) {
7504 0 : return -1;
7505 : }
7506 0 : test_str = PyBytes_AS_STRING(unicode);
7507 0 : } else if (PyBytes_Check(value)) {
7508 0 : test_str = PyBytes_AS_STRING(value);
7509 : } else {
7510 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7511 0 : return -1;
7512 : }
7513 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7514 0 : if (unicode != NULL) {
7515 0 : Py_DECREF(unicode);
7516 : }
7517 0 : if (talloc_str == NULL) {
7518 0 : PyErr_NoMemory();
7519 0 : return -1;
7520 : }
7521 0 : object->domain_name = talloc_str;
7522 : }
7523 0 : return 0;
7524 : }
7525 :
7526 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid(PyObject *obj, void *closure)
7527 : {
7528 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7529 0 : PyObject *py_domain_uuid;
7530 0 : py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
7531 0 : return py_domain_uuid;
7532 : }
7533 :
7534 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
7535 : {
7536 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7537 0 : if (value == NULL) {
7538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_uuid");
7539 0 : return -1;
7540 : }
7541 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
7542 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7543 0 : PyErr_NoMemory();
7544 0 : return -1;
7545 : }
7546 0 : object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
7547 0 : return 0;
7548 : }
7549 :
7550 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid(PyObject *obj, void *closure)
7551 : {
7552 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7553 0 : PyObject *py_zero_uuid;
7554 0 : py_zero_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->zero_uuid);
7555 0 : return py_zero_uuid;
7556 : }
7557 :
7558 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid(PyObject *py_obj, PyObject *value, void *closure)
7559 : {
7560 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7561 0 : if (value == NULL) {
7562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->zero_uuid");
7563 0 : return -1;
7564 : }
7565 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
7566 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7567 0 : PyErr_NoMemory();
7568 0 : return -1;
7569 : }
7570 0 : object->zero_uuid = *(struct GUID *)pytalloc_get_ptr(value);
7571 0 : return 0;
7572 : }
7573 :
7574 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_forest(PyObject *obj, void *closure)
7575 : {
7576 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7577 0 : PyObject *py_forest;
7578 0 : py_forest = PyString_FromStringOrNULL(object->forest);
7579 0 : return py_forest;
7580 : }
7581 :
7582 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_forest(PyObject *py_obj, PyObject *value, void *closure)
7583 : {
7584 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7585 0 : if (value == NULL) {
7586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest");
7587 0 : return -1;
7588 : }
7589 : {
7590 0 : const char *test_str;
7591 0 : const char *talloc_str;
7592 0 : PyObject *unicode = NULL;
7593 0 : if (PyUnicode_Check(value)) {
7594 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7595 0 : if (unicode == NULL) {
7596 0 : return -1;
7597 : }
7598 0 : test_str = PyBytes_AS_STRING(unicode);
7599 0 : } else if (PyBytes_Check(value)) {
7600 0 : test_str = PyBytes_AS_STRING(value);
7601 : } else {
7602 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7603 0 : return -1;
7604 : }
7605 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7606 0 : if (unicode != NULL) {
7607 0 : Py_DECREF(unicode);
7608 : }
7609 0 : if (talloc_str == NULL) {
7610 0 : PyErr_NoMemory();
7611 0 : return -1;
7612 : }
7613 0 : object->forest = talloc_str;
7614 : }
7615 0 : return 0;
7616 : }
7617 :
7618 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain(PyObject *obj, void *closure)
7619 : {
7620 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7621 0 : PyObject *py_dns_domain;
7622 0 : py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
7623 0 : return py_dns_domain;
7624 : }
7625 :
7626 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
7627 : {
7628 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7629 0 : if (value == NULL) {
7630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
7631 0 : return -1;
7632 : }
7633 : {
7634 0 : const char *test_str;
7635 0 : const char *talloc_str;
7636 0 : PyObject *unicode = NULL;
7637 0 : if (PyUnicode_Check(value)) {
7638 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7639 0 : if (unicode == NULL) {
7640 0 : return -1;
7641 : }
7642 0 : test_str = PyBytes_AS_STRING(unicode);
7643 0 : } else if (PyBytes_Check(value)) {
7644 0 : test_str = PyBytes_AS_STRING(value);
7645 : } else {
7646 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7647 0 : return -1;
7648 : }
7649 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7650 0 : if (unicode != NULL) {
7651 0 : Py_DECREF(unicode);
7652 : }
7653 0 : if (talloc_str == NULL) {
7654 0 : PyErr_NoMemory();
7655 0 : return -1;
7656 : }
7657 0 : object->dns_domain = talloc_str;
7658 : }
7659 0 : return 0;
7660 : }
7661 :
7662 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name(PyObject *obj, void *closure)
7663 : {
7664 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7665 0 : PyObject *py_pdc_dns_name;
7666 0 : py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
7667 0 : return py_pdc_dns_name;
7668 : }
7669 :
7670 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
7671 : {
7672 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7673 0 : if (value == NULL) {
7674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_dns_name");
7675 0 : return -1;
7676 : }
7677 : {
7678 0 : const char *test_str;
7679 0 : const char *talloc_str;
7680 0 : PyObject *unicode = NULL;
7681 0 : if (PyUnicode_Check(value)) {
7682 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7683 0 : if (unicode == NULL) {
7684 0 : return -1;
7685 : }
7686 0 : test_str = PyBytes_AS_STRING(unicode);
7687 0 : } else if (PyBytes_Check(value)) {
7688 0 : test_str = PyBytes_AS_STRING(value);
7689 : } else {
7690 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7691 0 : return -1;
7692 : }
7693 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7694 0 : if (unicode != NULL) {
7695 0 : Py_DECREF(unicode);
7696 : }
7697 0 : if (talloc_str == NULL) {
7698 0 : PyErr_NoMemory();
7699 0 : return -1;
7700 : }
7701 0 : object->pdc_dns_name = talloc_str;
7702 : }
7703 0 : return 0;
7704 : }
7705 :
7706 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip(PyObject *obj, void *closure)
7707 : {
7708 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7709 0 : PyObject *py_pdc_ip;
7710 0 : py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
7711 0 : return py_pdc_ip;
7712 : }
7713 :
7714 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
7715 : {
7716 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7717 0 : if (value == NULL) {
7718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_ip");
7719 0 : return -1;
7720 : }
7721 : {
7722 0 : const char *test_str;
7723 0 : const char *talloc_str;
7724 0 : PyObject *unicode = NULL;
7725 0 : if (PyUnicode_Check(value)) {
7726 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7727 0 : if (unicode == NULL) {
7728 0 : return -1;
7729 : }
7730 0 : test_str = PyBytes_AS_STRING(unicode);
7731 0 : } else if (PyBytes_Check(value)) {
7732 0 : test_str = PyBytes_AS_STRING(value);
7733 : } else {
7734 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7735 0 : return -1;
7736 : }
7737 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7738 0 : if (unicode != NULL) {
7739 0 : Py_DECREF(unicode);
7740 : }
7741 0 : if (talloc_str == NULL) {
7742 0 : PyErr_NoMemory();
7743 0 : return -1;
7744 : }
7745 0 : object->pdc_ip = talloc_str;
7746 : }
7747 0 : return 0;
7748 : }
7749 :
7750 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type(PyObject *obj, void *closure)
7751 : {
7752 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7753 0 : PyObject *py_server_type;
7754 0 : py_server_type = PyLong_FromUnsignedLongLong((uint32_t)object->server_type);
7755 0 : return py_server_type;
7756 : }
7757 :
7758 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
7759 : {
7760 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7761 0 : if (value == NULL) {
7762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_type");
7763 0 : return -1;
7764 : }
7765 : {
7766 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
7767 0 : if (PyLong_Check(value)) {
7768 0 : unsigned long long test_var;
7769 0 : test_var = PyLong_AsUnsignedLongLong(value);
7770 0 : if (PyErr_Occurred() != NULL) {
7771 0 : return -1;
7772 : }
7773 0 : if (test_var > uint_max) {
7774 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7775 : PyLong_Type.tp_name, uint_max, test_var);
7776 0 : return -1;
7777 : }
7778 0 : object->server_type = test_var;
7779 : } else {
7780 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7781 : PyLong_Type.tp_name);
7782 0 : return -1;
7783 : }
7784 : }
7785 0 : return 0;
7786 : }
7787 :
7788 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version(PyObject *obj, void *closure)
7789 : {
7790 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7791 0 : PyObject *py_nt_version;
7792 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
7793 0 : return py_nt_version;
7794 : }
7795 :
7796 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
7797 : {
7798 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7799 0 : if (value == NULL) {
7800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
7801 0 : return -1;
7802 : }
7803 : {
7804 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
7805 0 : if (PyLong_Check(value)) {
7806 0 : unsigned long long test_var;
7807 0 : test_var = PyLong_AsUnsignedLongLong(value);
7808 0 : if (PyErr_Occurred() != NULL) {
7809 0 : return -1;
7810 : }
7811 0 : if (test_var > uint_max) {
7812 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7813 : PyLong_Type.tp_name, uint_max, test_var);
7814 0 : return -1;
7815 : }
7816 0 : object->nt_version = test_var;
7817 : } else {
7818 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7819 : PyLong_Type.tp_name);
7820 0 : return -1;
7821 : }
7822 : }
7823 0 : return 0;
7824 : }
7825 :
7826 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token(PyObject *obj, void *closure)
7827 : {
7828 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7829 0 : PyObject *py_lmnt_token;
7830 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
7831 0 : return py_lmnt_token;
7832 : }
7833 :
7834 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
7835 : {
7836 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7837 0 : if (value == NULL) {
7838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
7839 0 : return -1;
7840 : }
7841 : {
7842 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
7843 0 : if (PyLong_Check(value)) {
7844 0 : unsigned long long test_var;
7845 0 : test_var = PyLong_AsUnsignedLongLong(value);
7846 0 : if (PyErr_Occurred() != NULL) {
7847 0 : return -1;
7848 : }
7849 0 : if (test_var > uint_max) {
7850 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7851 : PyLong_Type.tp_name, uint_max, test_var);
7852 0 : return -1;
7853 : }
7854 0 : object->lmnt_token = test_var;
7855 : } else {
7856 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7857 : PyLong_Type.tp_name);
7858 0 : return -1;
7859 : }
7860 : }
7861 0 : return 0;
7862 : }
7863 :
7864 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token(PyObject *obj, void *closure)
7865 : {
7866 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7867 0 : PyObject *py_lm20_token;
7868 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
7869 0 : return py_lm20_token;
7870 : }
7871 :
7872 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
7873 : {
7874 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7875 0 : if (value == NULL) {
7876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
7877 0 : return -1;
7878 : }
7879 : {
7880 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
7881 0 : if (PyLong_Check(value)) {
7882 0 : unsigned long long test_var;
7883 0 : test_var = PyLong_AsUnsignedLongLong(value);
7884 0 : if (PyErr_Occurred() != NULL) {
7885 0 : return -1;
7886 : }
7887 0 : if (test_var > uint_max) {
7888 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7889 : PyLong_Type.tp_name, uint_max, test_var);
7890 0 : return -1;
7891 : }
7892 0 : object->lm20_token = test_var;
7893 : } else {
7894 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7895 : PyLong_Type.tp_name);
7896 0 : return -1;
7897 : }
7898 : }
7899 0 : return 0;
7900 : }
7901 :
7902 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_getsetters[] = {
7903 : {
7904 : .name = discard_const_p(char, "command"),
7905 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_command,
7906 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_command,
7907 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
7908 : },
7909 : {
7910 : .name = discard_const_p(char, "pdc_name"),
7911 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name,
7912 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name,
7913 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7914 : },
7915 : {
7916 : .name = discard_const_p(char, "user_name"),
7917 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name,
7918 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name,
7919 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7920 : },
7921 : {
7922 : .name = discard_const_p(char, "domain_name"),
7923 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name,
7924 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name,
7925 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7926 : },
7927 : {
7928 : .name = discard_const_p(char, "domain_uuid"),
7929 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid,
7930 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid,
7931 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
7932 : },
7933 : {
7934 : .name = discard_const_p(char, "zero_uuid"),
7935 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid,
7936 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid,
7937 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
7938 : },
7939 : {
7940 : .name = discard_const_p(char, "forest"),
7941 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_forest,
7942 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_forest,
7943 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7944 : },
7945 : {
7946 : .name = discard_const_p(char, "dns_domain"),
7947 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain,
7948 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain,
7949 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7950 : },
7951 : {
7952 : .name = discard_const_p(char, "pdc_dns_name"),
7953 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name,
7954 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name,
7955 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7956 : },
7957 : {
7958 : .name = discard_const_p(char, "pdc_ip"),
7959 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip,
7960 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip,
7961 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
7962 : },
7963 : {
7964 : .name = discard_const_p(char, "server_type"),
7965 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type,
7966 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type,
7967 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
7968 : },
7969 : {
7970 : .name = discard_const_p(char, "nt_version"),
7971 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version,
7972 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version,
7973 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
7974 : },
7975 : {
7976 : .name = discard_const_p(char, "lmnt_token"),
7977 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token,
7978 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token,
7979 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7980 : },
7981 : {
7982 : .name = discard_const_p(char, "lm20_token"),
7983 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token,
7984 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token,
7985 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7986 : },
7987 : { .name = NULL }
7988 : };
7989 :
7990 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7991 : {
7992 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE, type);
7993 : }
7994 :
7995 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7996 : {
7997 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7998 0 : PyObject *ret = NULL;
7999 0 : DATA_BLOB blob;
8000 0 : enum ndr_err_code err;
8001 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8002 0 : if (tmp_ctx == NULL) {
8003 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8004 0 : return NULL;
8005 : }
8006 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE);
8007 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8008 0 : TALLOC_FREE(tmp_ctx);
8009 0 : PyErr_SetNdrError(err);
8010 0 : return NULL;
8011 : }
8012 :
8013 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8014 0 : TALLOC_FREE(tmp_ctx);
8015 0 : return ret;
8016 : }
8017 :
8018 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8019 : {
8020 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
8021 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8022 0 : Py_ssize_t blob_length = 0;
8023 0 : enum ndr_err_code err;
8024 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8025 0 : PyObject *allow_remaining_obj = NULL;
8026 0 : bool allow_remaining = false;
8027 :
8028 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8029 : discard_const_p(char *, kwnames),
8030 : &blob.data, &blob_length,
8031 : &allow_remaining_obj)) {
8032 0 : return NULL;
8033 : }
8034 0 : blob.length = blob_length;
8035 :
8036 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8037 0 : allow_remaining = true;
8038 : }
8039 :
8040 0 : if (allow_remaining) {
8041 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
8042 : } else {
8043 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
8044 : }
8045 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8046 0 : PyErr_SetNdrError(err);
8047 0 : return NULL;
8048 : }
8049 :
8050 0 : Py_RETURN_NONE;
8051 : }
8052 :
8053 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8054 : {
8055 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
8056 0 : PyObject *ret;
8057 0 : char *retstr;
8058 :
8059 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE, "NETLOGON_SAM_LOGON_RESPONSE", object);
8060 0 : ret = PyUnicode_FromString(retstr);
8061 0 : talloc_free(retstr);
8062 :
8063 0 : return ret;
8064 : }
8065 :
8066 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_methods[] = {
8067 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8068 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8069 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8070 : { NULL, NULL, 0, NULL }
8071 : };
8072 :
8073 :
8074 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_Type = {
8075 : PyVarObject_HEAD_INIT(NULL, 0)
8076 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE",
8077 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_getsetters,
8078 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_methods,
8079 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8080 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_new,
8081 : };
8082 :
8083 :
8084 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command(PyObject *obj, void *closure)
8085 : {
8086 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8087 0 : PyObject *py_command;
8088 0 : py_command = PyLong_FromLong((uint16_t)object->command);
8089 0 : return py_command;
8090 : }
8091 :
8092 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command(PyObject *py_obj, PyObject *value, void *closure)
8093 : {
8094 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8095 0 : if (value == NULL) {
8096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
8097 0 : return -1;
8098 : }
8099 : {
8100 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
8101 0 : if (PyLong_Check(value)) {
8102 0 : unsigned long long test_var;
8103 0 : test_var = PyLong_AsUnsignedLongLong(value);
8104 0 : if (PyErr_Occurred() != NULL) {
8105 0 : return -1;
8106 : }
8107 0 : if (test_var > uint_max) {
8108 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8109 : PyLong_Type.tp_name, uint_max, test_var);
8110 0 : return -1;
8111 : }
8112 0 : object->command = test_var;
8113 : } else {
8114 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8115 : PyLong_Type.tp_name);
8116 0 : return -1;
8117 : }
8118 : }
8119 0 : return 0;
8120 : }
8121 :
8122 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz(PyObject *obj, void *closure)
8123 : {
8124 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8125 0 : PyObject *py_sbz;
8126 0 : py_sbz = PyLong_FromLong((uint16_t)object->sbz);
8127 0 : return py_sbz;
8128 : }
8129 :
8130 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz(PyObject *py_obj, PyObject *value, void *closure)
8131 : {
8132 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8133 0 : if (value == NULL) {
8134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sbz");
8135 0 : return -1;
8136 : }
8137 : {
8138 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sbz));
8139 0 : if (PyLong_Check(value)) {
8140 0 : unsigned long long test_var;
8141 0 : test_var = PyLong_AsUnsignedLongLong(value);
8142 0 : if (PyErr_Occurred() != NULL) {
8143 0 : return -1;
8144 : }
8145 0 : if (test_var > uint_max) {
8146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8147 : PyLong_Type.tp_name, uint_max, test_var);
8148 0 : return -1;
8149 : }
8150 0 : object->sbz = test_var;
8151 : } else {
8152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8153 : PyLong_Type.tp_name);
8154 0 : return -1;
8155 : }
8156 : }
8157 0 : return 0;
8158 : }
8159 :
8160 35 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type(PyObject *obj, void *closure)
8161 : {
8162 35 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8163 0 : PyObject *py_server_type;
8164 35 : py_server_type = PyLong_FromUnsignedLongLong((uint32_t)object->server_type);
8165 35 : return py_server_type;
8166 : }
8167 :
8168 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
8169 : {
8170 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8171 0 : if (value == NULL) {
8172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_type");
8173 0 : return -1;
8174 : }
8175 : {
8176 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
8177 0 : if (PyLong_Check(value)) {
8178 0 : unsigned long long test_var;
8179 0 : test_var = PyLong_AsUnsignedLongLong(value);
8180 0 : if (PyErr_Occurred() != NULL) {
8181 0 : return -1;
8182 : }
8183 0 : if (test_var > uint_max) {
8184 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8185 : PyLong_Type.tp_name, uint_max, test_var);
8186 0 : return -1;
8187 : }
8188 0 : object->server_type = test_var;
8189 : } else {
8190 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8191 : PyLong_Type.tp_name);
8192 0 : return -1;
8193 : }
8194 : }
8195 0 : return 0;
8196 : }
8197 :
8198 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid(PyObject *obj, void *closure)
8199 : {
8200 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8201 0 : PyObject *py_domain_uuid;
8202 0 : py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
8203 0 : return py_domain_uuid;
8204 : }
8205 :
8206 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
8207 : {
8208 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8209 0 : if (value == NULL) {
8210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_uuid");
8211 0 : return -1;
8212 : }
8213 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
8214 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8215 0 : PyErr_NoMemory();
8216 0 : return -1;
8217 : }
8218 0 : object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
8219 0 : return 0;
8220 : }
8221 :
8222 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest(PyObject *obj, void *closure)
8223 : {
8224 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8225 0 : PyObject *py_forest;
8226 1 : py_forest = PyString_FromStringOrNULL(object->forest);
8227 1 : return py_forest;
8228 : }
8229 :
8230 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest(PyObject *py_obj, PyObject *value, void *closure)
8231 : {
8232 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8233 0 : if (value == NULL) {
8234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest");
8235 0 : return -1;
8236 : }
8237 : {
8238 0 : const char *test_str;
8239 0 : const char *talloc_str;
8240 0 : PyObject *unicode = NULL;
8241 0 : if (PyUnicode_Check(value)) {
8242 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8243 0 : if (unicode == NULL) {
8244 0 : return -1;
8245 : }
8246 0 : test_str = PyBytes_AS_STRING(unicode);
8247 0 : } else if (PyBytes_Check(value)) {
8248 0 : test_str = PyBytes_AS_STRING(value);
8249 : } else {
8250 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8251 0 : return -1;
8252 : }
8253 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8254 0 : if (unicode != NULL) {
8255 0 : Py_DECREF(unicode);
8256 : }
8257 0 : if (talloc_str == NULL) {
8258 0 : PyErr_NoMemory();
8259 0 : return -1;
8260 : }
8261 0 : object->forest = talloc_str;
8262 : }
8263 0 : return 0;
8264 : }
8265 :
8266 253 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain(PyObject *obj, void *closure)
8267 : {
8268 253 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8269 0 : PyObject *py_dns_domain;
8270 253 : py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
8271 253 : return py_dns_domain;
8272 : }
8273 :
8274 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
8275 : {
8276 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8277 0 : if (value == NULL) {
8278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
8279 0 : return -1;
8280 : }
8281 : {
8282 0 : const char *test_str;
8283 0 : const char *talloc_str;
8284 0 : PyObject *unicode = NULL;
8285 0 : if (PyUnicode_Check(value)) {
8286 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8287 0 : if (unicode == NULL) {
8288 0 : return -1;
8289 : }
8290 0 : test_str = PyBytes_AS_STRING(unicode);
8291 0 : } else if (PyBytes_Check(value)) {
8292 0 : test_str = PyBytes_AS_STRING(value);
8293 : } else {
8294 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8295 0 : return -1;
8296 : }
8297 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8298 0 : if (unicode != NULL) {
8299 0 : Py_DECREF(unicode);
8300 : }
8301 0 : if (talloc_str == NULL) {
8302 0 : PyErr_NoMemory();
8303 0 : return -1;
8304 : }
8305 0 : object->dns_domain = talloc_str;
8306 : }
8307 0 : return 0;
8308 : }
8309 :
8310 179 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name(PyObject *obj, void *closure)
8311 : {
8312 179 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8313 0 : PyObject *py_pdc_dns_name;
8314 179 : py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
8315 179 : return py_pdc_dns_name;
8316 : }
8317 :
8318 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
8319 : {
8320 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8321 0 : if (value == NULL) {
8322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_dns_name");
8323 0 : return -1;
8324 : }
8325 : {
8326 0 : const char *test_str;
8327 0 : const char *talloc_str;
8328 0 : PyObject *unicode = NULL;
8329 0 : if (PyUnicode_Check(value)) {
8330 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8331 0 : if (unicode == NULL) {
8332 0 : return -1;
8333 : }
8334 0 : test_str = PyBytes_AS_STRING(unicode);
8335 0 : } else if (PyBytes_Check(value)) {
8336 0 : test_str = PyBytes_AS_STRING(value);
8337 : } else {
8338 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8339 0 : return -1;
8340 : }
8341 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8342 0 : if (unicode != NULL) {
8343 0 : Py_DECREF(unicode);
8344 : }
8345 0 : if (talloc_str == NULL) {
8346 0 : PyErr_NoMemory();
8347 0 : return -1;
8348 : }
8349 0 : object->pdc_dns_name = talloc_str;
8350 : }
8351 0 : return 0;
8352 : }
8353 :
8354 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name(PyObject *obj, void *closure)
8355 : {
8356 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8357 0 : PyObject *py_domain_name;
8358 1 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
8359 1 : return py_domain_name;
8360 : }
8361 :
8362 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
8363 : {
8364 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8365 0 : if (value == NULL) {
8366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
8367 0 : return -1;
8368 : }
8369 : {
8370 0 : const char *test_str;
8371 0 : const char *talloc_str;
8372 0 : PyObject *unicode = NULL;
8373 0 : if (PyUnicode_Check(value)) {
8374 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8375 0 : if (unicode == NULL) {
8376 0 : return -1;
8377 : }
8378 0 : test_str = PyBytes_AS_STRING(unicode);
8379 0 : } else if (PyBytes_Check(value)) {
8380 0 : test_str = PyBytes_AS_STRING(value);
8381 : } else {
8382 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8383 0 : return -1;
8384 : }
8385 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8386 0 : if (unicode != NULL) {
8387 0 : Py_DECREF(unicode);
8388 : }
8389 0 : if (talloc_str == NULL) {
8390 0 : PyErr_NoMemory();
8391 0 : return -1;
8392 : }
8393 0 : object->domain_name = talloc_str;
8394 : }
8395 0 : return 0;
8396 : }
8397 :
8398 22 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name(PyObject *obj, void *closure)
8399 : {
8400 22 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8401 0 : PyObject *py_pdc_name;
8402 22 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
8403 22 : return py_pdc_name;
8404 : }
8405 :
8406 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
8407 : {
8408 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8409 0 : if (value == NULL) {
8410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
8411 0 : return -1;
8412 : }
8413 : {
8414 0 : const char *test_str;
8415 0 : const char *talloc_str;
8416 0 : PyObject *unicode = NULL;
8417 0 : if (PyUnicode_Check(value)) {
8418 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8419 0 : if (unicode == NULL) {
8420 0 : return -1;
8421 : }
8422 0 : test_str = PyBytes_AS_STRING(unicode);
8423 0 : } else if (PyBytes_Check(value)) {
8424 0 : test_str = PyBytes_AS_STRING(value);
8425 : } else {
8426 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8427 0 : return -1;
8428 : }
8429 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8430 0 : if (unicode != NULL) {
8431 0 : Py_DECREF(unicode);
8432 : }
8433 0 : if (talloc_str == NULL) {
8434 0 : PyErr_NoMemory();
8435 0 : return -1;
8436 : }
8437 0 : object->pdc_name = talloc_str;
8438 : }
8439 0 : return 0;
8440 : }
8441 :
8442 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name(PyObject *obj, void *closure)
8443 : {
8444 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8445 0 : PyObject *py_user_name;
8446 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
8447 0 : return py_user_name;
8448 : }
8449 :
8450 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
8451 : {
8452 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8453 0 : if (value == NULL) {
8454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
8455 0 : return -1;
8456 : }
8457 : {
8458 0 : const char *test_str;
8459 0 : const char *talloc_str;
8460 0 : PyObject *unicode = NULL;
8461 0 : if (PyUnicode_Check(value)) {
8462 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8463 0 : if (unicode == NULL) {
8464 0 : return -1;
8465 : }
8466 0 : test_str = PyBytes_AS_STRING(unicode);
8467 0 : } else if (PyBytes_Check(value)) {
8468 0 : test_str = PyBytes_AS_STRING(value);
8469 : } else {
8470 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8471 0 : return -1;
8472 : }
8473 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8474 0 : if (unicode != NULL) {
8475 0 : Py_DECREF(unicode);
8476 : }
8477 0 : if (talloc_str == NULL) {
8478 0 : PyErr_NoMemory();
8479 0 : return -1;
8480 : }
8481 0 : object->user_name = talloc_str;
8482 : }
8483 0 : return 0;
8484 : }
8485 :
8486 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site(PyObject *obj, void *closure)
8487 : {
8488 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8489 0 : PyObject *py_server_site;
8490 1 : py_server_site = PyString_FromStringOrNULL(object->server_site);
8491 1 : return py_server_site;
8492 : }
8493 :
8494 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site(PyObject *py_obj, PyObject *value, void *closure)
8495 : {
8496 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8497 0 : if (value == NULL) {
8498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_site");
8499 0 : return -1;
8500 : }
8501 : {
8502 0 : const char *test_str;
8503 0 : const char *talloc_str;
8504 0 : PyObject *unicode = NULL;
8505 0 : if (PyUnicode_Check(value)) {
8506 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8507 0 : if (unicode == NULL) {
8508 0 : return -1;
8509 : }
8510 0 : test_str = PyBytes_AS_STRING(unicode);
8511 0 : } else if (PyBytes_Check(value)) {
8512 0 : test_str = PyBytes_AS_STRING(value);
8513 : } else {
8514 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8515 0 : return -1;
8516 : }
8517 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8518 0 : if (unicode != NULL) {
8519 0 : Py_DECREF(unicode);
8520 : }
8521 0 : if (talloc_str == NULL) {
8522 0 : PyErr_NoMemory();
8523 0 : return -1;
8524 : }
8525 0 : object->server_site = talloc_str;
8526 : }
8527 0 : return 0;
8528 : }
8529 :
8530 203 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site(PyObject *obj, void *closure)
8531 : {
8532 203 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8533 0 : PyObject *py_client_site;
8534 203 : py_client_site = PyString_FromStringOrNULL(object->client_site);
8535 203 : return py_client_site;
8536 : }
8537 :
8538 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site(PyObject *py_obj, PyObject *value, void *closure)
8539 : {
8540 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8541 0 : if (value == NULL) {
8542 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_site");
8543 0 : return -1;
8544 : }
8545 : {
8546 0 : const char *test_str;
8547 0 : const char *talloc_str;
8548 0 : PyObject *unicode = NULL;
8549 0 : if (PyUnicode_Check(value)) {
8550 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8551 0 : if (unicode == NULL) {
8552 0 : return -1;
8553 : }
8554 0 : test_str = PyBytes_AS_STRING(unicode);
8555 0 : } else if (PyBytes_Check(value)) {
8556 0 : test_str = PyBytes_AS_STRING(value);
8557 : } else {
8558 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8559 0 : return -1;
8560 : }
8561 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8562 0 : if (unicode != NULL) {
8563 0 : Py_DECREF(unicode);
8564 : }
8565 0 : if (talloc_str == NULL) {
8566 0 : PyErr_NoMemory();
8567 0 : return -1;
8568 : }
8569 0 : object->client_site = talloc_str;
8570 : }
8571 0 : return 0;
8572 : }
8573 :
8574 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size(PyObject *obj, void *closure)
8575 : {
8576 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8577 0 : PyObject *py_sockaddr_size;
8578 0 : py_sockaddr_size = PyLong_FromLong((uint16_t)object->sockaddr_size);
8579 0 : return py_sockaddr_size;
8580 : }
8581 :
8582 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size(PyObject *py_obj, PyObject *value, void *closure)
8583 : {
8584 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8585 0 : if (value == NULL) {
8586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr_size");
8587 0 : return -1;
8588 : }
8589 : {
8590 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_size));
8591 0 : if (PyLong_Check(value)) {
8592 0 : unsigned long long test_var;
8593 0 : test_var = PyLong_AsUnsignedLongLong(value);
8594 0 : if (PyErr_Occurred() != NULL) {
8595 0 : return -1;
8596 : }
8597 0 : if (test_var > uint_max) {
8598 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8599 : PyLong_Type.tp_name, uint_max, test_var);
8600 0 : return -1;
8601 : }
8602 0 : object->sockaddr_size = test_var;
8603 : } else {
8604 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8605 : PyLong_Type.tp_name);
8606 0 : return -1;
8607 : }
8608 : }
8609 0 : return 0;
8610 : }
8611 :
8612 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr(PyObject *obj, void *closure)
8613 : {
8614 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8615 0 : PyObject *py_sockaddr;
8616 0 : py_sockaddr = pytalloc_reference_ex(&nbt_sockaddr_Type, pytalloc_get_mem_ctx(obj), &object->sockaddr);
8617 0 : return py_sockaddr;
8618 : }
8619 :
8620 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr(PyObject *py_obj, PyObject *value, void *closure)
8621 : {
8622 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8623 0 : if (value == NULL) {
8624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr");
8625 0 : return -1;
8626 : }
8627 0 : PY_CHECK_TYPE(&nbt_sockaddr_Type, value, return -1;);
8628 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8629 0 : PyErr_NoMemory();
8630 0 : return -1;
8631 : }
8632 0 : object->sockaddr = *(struct nbt_sockaddr *)pytalloc_get_ptr(value);
8633 0 : return 0;
8634 : }
8635 :
8636 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site(PyObject *obj, void *closure)
8637 : {
8638 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8639 0 : PyObject *py_next_closest_site;
8640 0 : py_next_closest_site = PyString_FromStringOrNULL(object->next_closest_site);
8641 0 : return py_next_closest_site;
8642 : }
8643 :
8644 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site(PyObject *py_obj, PyObject *value, void *closure)
8645 : {
8646 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8647 0 : if (value == NULL) {
8648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->next_closest_site");
8649 0 : return -1;
8650 : }
8651 : {
8652 0 : const char *test_str;
8653 0 : const char *talloc_str;
8654 0 : PyObject *unicode = NULL;
8655 0 : if (PyUnicode_Check(value)) {
8656 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8657 0 : if (unicode == NULL) {
8658 0 : return -1;
8659 : }
8660 0 : test_str = PyBytes_AS_STRING(unicode);
8661 0 : } else if (PyBytes_Check(value)) {
8662 0 : test_str = PyBytes_AS_STRING(value);
8663 : } else {
8664 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8665 0 : return -1;
8666 : }
8667 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8668 0 : if (unicode != NULL) {
8669 0 : Py_DECREF(unicode);
8670 : }
8671 0 : if (talloc_str == NULL) {
8672 0 : PyErr_NoMemory();
8673 0 : return -1;
8674 : }
8675 0 : object->next_closest_site = talloc_str;
8676 : }
8677 0 : return 0;
8678 : }
8679 :
8680 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version(PyObject *obj, void *closure)
8681 : {
8682 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8683 0 : PyObject *py_nt_version;
8684 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
8685 0 : return py_nt_version;
8686 : }
8687 :
8688 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
8689 : {
8690 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8691 0 : if (value == NULL) {
8692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
8693 0 : return -1;
8694 : }
8695 : {
8696 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
8697 0 : if (PyLong_Check(value)) {
8698 0 : unsigned long long test_var;
8699 0 : test_var = PyLong_AsUnsignedLongLong(value);
8700 0 : if (PyErr_Occurred() != NULL) {
8701 0 : return -1;
8702 : }
8703 0 : if (test_var > uint_max) {
8704 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8705 : PyLong_Type.tp_name, uint_max, test_var);
8706 0 : return -1;
8707 : }
8708 0 : object->nt_version = test_var;
8709 : } else {
8710 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8711 : PyLong_Type.tp_name);
8712 0 : return -1;
8713 : }
8714 : }
8715 0 : return 0;
8716 : }
8717 :
8718 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token(PyObject *obj, void *closure)
8719 : {
8720 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8721 0 : PyObject *py_lmnt_token;
8722 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
8723 0 : return py_lmnt_token;
8724 : }
8725 :
8726 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
8727 : {
8728 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8729 0 : if (value == NULL) {
8730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
8731 0 : return -1;
8732 : }
8733 : {
8734 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
8735 0 : if (PyLong_Check(value)) {
8736 0 : unsigned long long test_var;
8737 0 : test_var = PyLong_AsUnsignedLongLong(value);
8738 0 : if (PyErr_Occurred() != NULL) {
8739 0 : return -1;
8740 : }
8741 0 : if (test_var > uint_max) {
8742 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8743 : PyLong_Type.tp_name, uint_max, test_var);
8744 0 : return -1;
8745 : }
8746 0 : object->lmnt_token = test_var;
8747 : } else {
8748 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8749 : PyLong_Type.tp_name);
8750 0 : return -1;
8751 : }
8752 : }
8753 0 : return 0;
8754 : }
8755 :
8756 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token(PyObject *obj, void *closure)
8757 : {
8758 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8759 0 : PyObject *py_lm20_token;
8760 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
8761 0 : return py_lm20_token;
8762 : }
8763 :
8764 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
8765 : {
8766 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8767 0 : if (value == NULL) {
8768 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
8769 0 : return -1;
8770 : }
8771 : {
8772 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
8773 0 : if (PyLong_Check(value)) {
8774 0 : unsigned long long test_var;
8775 0 : test_var = PyLong_AsUnsignedLongLong(value);
8776 0 : if (PyErr_Occurred() != NULL) {
8777 0 : return -1;
8778 : }
8779 0 : if (test_var > uint_max) {
8780 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8781 : PyLong_Type.tp_name, uint_max, test_var);
8782 0 : return -1;
8783 : }
8784 0 : object->lm20_token = test_var;
8785 : } else {
8786 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8787 : PyLong_Type.tp_name);
8788 0 : return -1;
8789 : }
8790 : }
8791 0 : return 0;
8792 : }
8793 :
8794 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters[] = {
8795 : {
8796 : .name = discard_const_p(char, "command"),
8797 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command,
8798 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command,
8799 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
8800 : },
8801 : {
8802 : .name = discard_const_p(char, "sbz"),
8803 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz,
8804 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz,
8805 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8806 : },
8807 : {
8808 : .name = discard_const_p(char, "server_type"),
8809 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type,
8810 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type,
8811 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
8812 : },
8813 : {
8814 : .name = discard_const_p(char, "domain_uuid"),
8815 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid,
8816 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid,
8817 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
8818 : },
8819 : {
8820 : .name = discard_const_p(char, "forest"),
8821 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest,
8822 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest,
8823 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8824 : },
8825 : {
8826 : .name = discard_const_p(char, "dns_domain"),
8827 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain,
8828 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain,
8829 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8830 : },
8831 : {
8832 : .name = discard_const_p(char, "pdc_dns_name"),
8833 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name,
8834 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name,
8835 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8836 : },
8837 : {
8838 : .name = discard_const_p(char, "domain_name"),
8839 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name,
8840 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name,
8841 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8842 : },
8843 : {
8844 : .name = discard_const_p(char, "pdc_name"),
8845 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name,
8846 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name,
8847 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8848 : },
8849 : {
8850 : .name = discard_const_p(char, "user_name"),
8851 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name,
8852 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name,
8853 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8854 : },
8855 : {
8856 : .name = discard_const_p(char, "server_site"),
8857 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site,
8858 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site,
8859 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8860 : },
8861 : {
8862 : .name = discard_const_p(char, "client_site"),
8863 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site,
8864 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site,
8865 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8866 : },
8867 : {
8868 : .name = discard_const_p(char, "sockaddr_size"),
8869 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size,
8870 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size,
8871 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8872 : },
8873 : {
8874 : .name = discard_const_p(char, "sockaddr"),
8875 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr,
8876 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr,
8877 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_sockaddr")
8878 : },
8879 : {
8880 : .name = discard_const_p(char, "next_closest_site"),
8881 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site,
8882 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site,
8883 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8884 : },
8885 : {
8886 : .name = discard_const_p(char, "nt_version"),
8887 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version,
8888 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version,
8889 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
8890 : },
8891 : {
8892 : .name = discard_const_p(char, "lmnt_token"),
8893 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token,
8894 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token,
8895 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8896 : },
8897 : {
8898 : .name = discard_const_p(char, "lm20_token"),
8899 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token,
8900 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token,
8901 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8902 : },
8903 : { .name = NULL }
8904 : };
8905 :
8906 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8907 : {
8908 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_EX, type);
8909 : }
8910 :
8911 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8912 : {
8913 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8914 0 : PyObject *ret = NULL;
8915 0 : DATA_BLOB blob;
8916 0 : enum ndr_err_code err;
8917 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8918 0 : if (tmp_ctx == NULL) {
8919 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8920 0 : return NULL;
8921 : }
8922 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX);
8923 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8924 0 : TALLOC_FREE(tmp_ctx);
8925 0 : PyErr_SetNdrError(err);
8926 0 : return NULL;
8927 : }
8928 :
8929 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8930 0 : TALLOC_FREE(tmp_ctx);
8931 0 : return ret;
8932 : }
8933 :
8934 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8935 : {
8936 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8937 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8938 0 : Py_ssize_t blob_length = 0;
8939 0 : enum ndr_err_code err;
8940 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8941 0 : PyObject *allow_remaining_obj = NULL;
8942 0 : bool allow_remaining = false;
8943 :
8944 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8945 : discard_const_p(char *, kwnames),
8946 : &blob.data, &blob_length,
8947 : &allow_remaining_obj)) {
8948 0 : return NULL;
8949 : }
8950 0 : blob.length = blob_length;
8951 :
8952 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8953 0 : allow_remaining = true;
8954 : }
8955 :
8956 0 : if (allow_remaining) {
8957 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
8958 : } else {
8959 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
8960 : }
8961 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8962 0 : PyErr_SetNdrError(err);
8963 0 : return NULL;
8964 : }
8965 :
8966 0 : Py_RETURN_NONE;
8967 : }
8968 :
8969 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8970 : {
8971 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8972 0 : PyObject *ret;
8973 0 : char *retstr;
8974 :
8975 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX, "NETLOGON_SAM_LOGON_RESPONSE_EX", object);
8976 0 : ret = PyUnicode_FromString(retstr);
8977 0 : talloc_free(retstr);
8978 :
8979 0 : return ret;
8980 : }
8981 :
8982 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods[] = {
8983 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8984 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8985 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8986 : { NULL, NULL, 0, NULL }
8987 : };
8988 :
8989 :
8990 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_EX_Type = {
8991 : PyVarObject_HEAD_INIT(NULL, 0)
8992 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX",
8993 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters,
8994 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods,
8995 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8996 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_EX_new,
8997 : };
8998 :
8999 0 : static PyObject *py_import_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, union netlogon_samlogon_response_union *in)
9000 : {
9001 0 : PyObject *ret;
9002 :
9003 0 : switch (level) {
9004 0 : case NETLOGON_NT_VERSION_1:
9005 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, mem_ctx, &in->nt4);
9006 0 : return ret;
9007 :
9008 0 : case NETLOGON_NT_VERSION_5:
9009 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_Type, mem_ctx, &in->nt5);
9010 0 : return ret;
9011 :
9012 0 : case NETLOGON_NT_VERSION_5EX:
9013 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, mem_ctx, &in->nt5_ex);
9014 0 : return ret;
9015 :
9016 : }
9017 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9018 0 : return NULL;
9019 : }
9020 :
9021 0 : static union netlogon_samlogon_response_union *py_export_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9022 : {
9023 0 : union netlogon_samlogon_response_union *ret = talloc_zero(mem_ctx, union netlogon_samlogon_response_union);
9024 0 : switch (level) {
9025 0 : case NETLOGON_NT_VERSION_1:
9026 0 : if (in == NULL) {
9027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt4");
9028 0 : talloc_free(ret); return NULL;
9029 : }
9030 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, in, talloc_free(ret); return NULL;);
9031 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9032 0 : PyErr_NoMemory();
9033 0 : talloc_free(ret); return NULL;
9034 : }
9035 0 : ret->nt4 = *(struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(in);
9036 0 : break;
9037 :
9038 0 : case NETLOGON_NT_VERSION_5:
9039 0 : if (in == NULL) {
9040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt5");
9041 0 : talloc_free(ret); return NULL;
9042 : }
9043 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_Type, in, talloc_free(ret); return NULL;);
9044 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9045 0 : PyErr_NoMemory();
9046 0 : talloc_free(ret); return NULL;
9047 : }
9048 0 : ret->nt5 = *(struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(in);
9049 0 : break;
9050 :
9051 0 : case NETLOGON_NT_VERSION_5EX:
9052 0 : if (in == NULL) {
9053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt5_ex");
9054 0 : talloc_free(ret); return NULL;
9055 : }
9056 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, in, talloc_free(ret); return NULL;);
9057 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9058 0 : PyErr_NoMemory();
9059 0 : talloc_free(ret); return NULL;
9060 : }
9061 0 : ret->nt5_ex = *(struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(in);
9062 0 : break;
9063 :
9064 0 : default:
9065 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9066 0 : talloc_free(ret);
9067 0 : ret = NULL;
9068 : }
9069 :
9070 0 : return ret;
9071 : }
9072 :
9073 0 : static PyObject *py_netlogon_samlogon_response_union_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9074 : {
9075 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9076 0 : PyObject *mem_ctx_obj = NULL;
9077 0 : TALLOC_CTX *mem_ctx = NULL;
9078 0 : int level = 0;
9079 0 : PyObject *in_obj = NULL;
9080 0 : union netlogon_samlogon_response_union *in = NULL;
9081 :
9082 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9083 : discard_const_p(char *, kwnames),
9084 : &mem_ctx_obj,
9085 : &level,
9086 : &in_obj)) {
9087 0 : return NULL;
9088 : }
9089 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9090 0 : if (mem_ctx == NULL) {
9091 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9092 0 : return NULL;
9093 : }
9094 0 : in = (union netlogon_samlogon_response_union *)pytalloc_get_ptr(in_obj);
9095 0 : if (in == NULL) {
9096 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netlogon_samlogon_response_union!");
9097 0 : return NULL;
9098 : }
9099 :
9100 0 : return py_import_netlogon_samlogon_response_union(mem_ctx, level, in);
9101 : }
9102 :
9103 0 : static PyObject *py_netlogon_samlogon_response_union_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9104 : {
9105 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9106 0 : PyObject *mem_ctx_obj = NULL;
9107 0 : TALLOC_CTX *mem_ctx = NULL;
9108 0 : int level = 0;
9109 0 : PyObject *in = NULL;
9110 0 : union netlogon_samlogon_response_union *out = NULL;
9111 :
9112 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9113 : discard_const_p(char *, kwnames),
9114 : &mem_ctx_obj,
9115 : &level,
9116 : &in)) {
9117 0 : return NULL;
9118 : }
9119 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9120 0 : if (mem_ctx == NULL) {
9121 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9122 0 : return NULL;
9123 : }
9124 :
9125 0 : out = py_export_netlogon_samlogon_response_union(mem_ctx, level, in);
9126 0 : if (out == NULL) {
9127 0 : return NULL;
9128 : }
9129 :
9130 0 : return pytalloc_GenericObject_reference(out);
9131 : }
9132 :
9133 : static PyMethodDef py_netlogon_samlogon_response_union_methods[] = {
9134 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_import),
9135 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9136 : "T.__import__(mem_ctx, level, in) => ret." },
9137 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_export),
9138 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9139 : "T.__export__(mem_ctx, level, in) => ret." },
9140 : { NULL, NULL, 0, NULL }
9141 : };
9142 :
9143 0 : static PyObject *py_netlogon_samlogon_response_union_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9144 : {
9145 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9146 0 : return NULL;
9147 : }
9148 :
9149 :
9150 : static PyTypeObject netlogon_samlogon_response_union_Type = {
9151 : PyVarObject_HEAD_INIT(NULL, 0)
9152 : .tp_name = "nbt.netlogon_samlogon_response_union",
9153 : .tp_getset = NULL,
9154 : .tp_methods = py_netlogon_samlogon_response_union_methods,
9155 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9156 : .tp_new = py_netlogon_samlogon_response_union_new,
9157 : };
9158 :
9159 :
9160 0 : static PyObject *py_netlogon_samlogon_response_get_ntver(PyObject *obj, void *closure)
9161 : {
9162 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(obj);
9163 0 : PyObject *py_ntver;
9164 0 : py_ntver = PyLong_FromUnsignedLongLong((uint32_t)object->ntver);
9165 0 : return py_ntver;
9166 : }
9167 :
9168 0 : static int py_netlogon_samlogon_response_set_ntver(PyObject *py_obj, PyObject *value, void *closure)
9169 : {
9170 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(py_obj);
9171 0 : if (value == NULL) {
9172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntver");
9173 0 : return -1;
9174 : }
9175 : {
9176 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ntver));
9177 0 : if (PyLong_Check(value)) {
9178 0 : unsigned long long test_var;
9179 0 : test_var = PyLong_AsUnsignedLongLong(value);
9180 0 : if (PyErr_Occurred() != NULL) {
9181 0 : return -1;
9182 : }
9183 0 : if (test_var > uint_max) {
9184 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9185 : PyLong_Type.tp_name, uint_max, test_var);
9186 0 : return -1;
9187 : }
9188 0 : object->ntver = test_var;
9189 : } else {
9190 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9191 : PyLong_Type.tp_name);
9192 0 : return -1;
9193 : }
9194 : }
9195 0 : return 0;
9196 : }
9197 :
9198 0 : static PyObject *py_netlogon_samlogon_response_get_data(PyObject *obj, void *closure)
9199 : {
9200 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(obj);
9201 0 : PyObject *py_data;
9202 0 : py_data = pyrpc_import_union(&netlogon_samlogon_response_union_Type, pytalloc_get_mem_ctx(obj), object->ntver, &object->data, "union netlogon_samlogon_response_union");
9203 0 : if (py_data == NULL) {
9204 0 : return NULL;
9205 : }
9206 0 : return py_data;
9207 : }
9208 :
9209 0 : static int py_netlogon_samlogon_response_set_data(PyObject *py_obj, PyObject *value, void *closure)
9210 : {
9211 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(py_obj);
9212 0 : if (value == NULL) {
9213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
9214 0 : return -1;
9215 : }
9216 : {
9217 0 : union netlogon_samlogon_response_union *data_switch_0;
9218 0 : data_switch_0 = (union netlogon_samlogon_response_union *)pyrpc_export_union(&netlogon_samlogon_response_union_Type, pytalloc_get_mem_ctx(py_obj), object->ntver, value, "union netlogon_samlogon_response_union");
9219 0 : if (data_switch_0 == NULL) {
9220 0 : return -1;
9221 : }
9222 0 : object->data = *data_switch_0;
9223 : }
9224 0 : return 0;
9225 : }
9226 :
9227 : static PyGetSetDef py_netlogon_samlogon_response_getsetters[] = {
9228 : {
9229 : .name = discard_const_p(char, "ntver"),
9230 : .get = py_netlogon_samlogon_response_get_ntver,
9231 : .set = py_netlogon_samlogon_response_set_ntver,
9232 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9233 : },
9234 : {
9235 : .name = discard_const_p(char, "data"),
9236 : .get = py_netlogon_samlogon_response_get_data,
9237 : .set = py_netlogon_samlogon_response_set_data,
9238 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_samlogon_response_union")
9239 : },
9240 : { .name = NULL }
9241 : };
9242 :
9243 0 : static PyObject *py_netlogon_samlogon_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9244 : {
9245 0 : return pytalloc_new(struct netlogon_samlogon_response, type);
9246 : }
9247 :
9248 :
9249 : static PyTypeObject netlogon_samlogon_response_Type = {
9250 : PyVarObject_HEAD_INIT(NULL, 0)
9251 : .tp_name = "nbt.netlogon_samlogon_response",
9252 : .tp_getset = py_netlogon_samlogon_response_getsetters,
9253 : .tp_methods = NULL,
9254 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9255 : .tp_new = py_netlogon_samlogon_response_new,
9256 : };
9257 :
9258 :
9259 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_computer_name(PyObject *obj, void *closure)
9260 : {
9261 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9262 0 : PyObject *py_computer_name;
9263 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
9264 0 : return py_computer_name;
9265 : }
9266 :
9267 0 : static int py_nbt_netlogon_query_for_pdc_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
9268 : {
9269 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9270 0 : if (value == NULL) {
9271 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
9272 0 : return -1;
9273 : }
9274 : {
9275 0 : const char *test_str;
9276 0 : const char *talloc_str;
9277 0 : PyObject *unicode = NULL;
9278 0 : if (PyUnicode_Check(value)) {
9279 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9280 0 : if (unicode == NULL) {
9281 0 : return -1;
9282 : }
9283 0 : test_str = PyBytes_AS_STRING(unicode);
9284 0 : } else if (PyBytes_Check(value)) {
9285 0 : test_str = PyBytes_AS_STRING(value);
9286 : } else {
9287 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9288 0 : return -1;
9289 : }
9290 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9291 0 : if (unicode != NULL) {
9292 0 : Py_DECREF(unicode);
9293 : }
9294 0 : if (talloc_str == NULL) {
9295 0 : PyErr_NoMemory();
9296 0 : return -1;
9297 : }
9298 0 : object->computer_name = talloc_str;
9299 : }
9300 0 : return 0;
9301 : }
9302 :
9303 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_mailslot_name(PyObject *obj, void *closure)
9304 : {
9305 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9306 0 : PyObject *py_mailslot_name;
9307 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
9308 0 : return py_mailslot_name;
9309 : }
9310 :
9311 0 : static int py_nbt_netlogon_query_for_pdc_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
9312 : {
9313 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9314 0 : if (value == NULL) {
9315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
9316 0 : return -1;
9317 : }
9318 : {
9319 0 : const char *test_str;
9320 0 : const char *talloc_str;
9321 0 : PyObject *unicode = NULL;
9322 0 : if (PyUnicode_Check(value)) {
9323 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9324 0 : if (unicode == NULL) {
9325 0 : return -1;
9326 : }
9327 0 : test_str = PyBytes_AS_STRING(unicode);
9328 0 : } else if (PyBytes_Check(value)) {
9329 0 : test_str = PyBytes_AS_STRING(value);
9330 : } else {
9331 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9332 0 : return -1;
9333 : }
9334 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9335 0 : if (unicode != NULL) {
9336 0 : Py_DECREF(unicode);
9337 : }
9338 0 : if (talloc_str == NULL) {
9339 0 : PyErr_NoMemory();
9340 0 : return -1;
9341 : }
9342 0 : object->mailslot_name = talloc_str;
9343 : }
9344 0 : return 0;
9345 : }
9346 :
9347 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get__pad(PyObject *obj, void *closure)
9348 : {
9349 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9350 0 : PyObject *py__pad;
9351 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9352 0 : return py__pad;
9353 : }
9354 :
9355 0 : static int py_nbt_netlogon_query_for_pdc_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9356 : {
9357 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9358 0 : if (value == NULL) {
9359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
9360 0 : return -1;
9361 : }
9362 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9363 0 : return 0;
9364 : }
9365 :
9366 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_unicode_name(PyObject *obj, void *closure)
9367 : {
9368 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9369 0 : PyObject *py_unicode_name;
9370 0 : py_unicode_name = PyString_FromStringOrNULL(object->unicode_name);
9371 0 : return py_unicode_name;
9372 : }
9373 :
9374 0 : static int py_nbt_netlogon_query_for_pdc_set_unicode_name(PyObject *py_obj, PyObject *value, void *closure)
9375 : {
9376 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9377 0 : if (value == NULL) {
9378 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_name");
9379 0 : return -1;
9380 : }
9381 : {
9382 0 : const char *test_str;
9383 0 : const char *talloc_str;
9384 0 : PyObject *unicode = NULL;
9385 0 : if (PyUnicode_Check(value)) {
9386 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9387 0 : if (unicode == NULL) {
9388 0 : return -1;
9389 : }
9390 0 : test_str = PyBytes_AS_STRING(unicode);
9391 0 : } else if (PyBytes_Check(value)) {
9392 0 : test_str = PyBytes_AS_STRING(value);
9393 : } else {
9394 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9395 0 : return -1;
9396 : }
9397 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9398 0 : if (unicode != NULL) {
9399 0 : Py_DECREF(unicode);
9400 : }
9401 0 : if (talloc_str == NULL) {
9402 0 : PyErr_NoMemory();
9403 0 : return -1;
9404 : }
9405 0 : object->unicode_name = talloc_str;
9406 : }
9407 0 : return 0;
9408 : }
9409 :
9410 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_nt_version(PyObject *obj, void *closure)
9411 : {
9412 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9413 0 : PyObject *py_nt_version;
9414 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
9415 0 : return py_nt_version;
9416 : }
9417 :
9418 0 : static int py_nbt_netlogon_query_for_pdc_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
9419 : {
9420 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9421 0 : if (value == NULL) {
9422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
9423 0 : return -1;
9424 : }
9425 : {
9426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
9427 0 : if (PyLong_Check(value)) {
9428 0 : unsigned long long test_var;
9429 0 : test_var = PyLong_AsUnsignedLongLong(value);
9430 0 : if (PyErr_Occurred() != NULL) {
9431 0 : return -1;
9432 : }
9433 0 : if (test_var > uint_max) {
9434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9435 : PyLong_Type.tp_name, uint_max, test_var);
9436 0 : return -1;
9437 : }
9438 0 : object->nt_version = test_var;
9439 : } else {
9440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9441 : PyLong_Type.tp_name);
9442 0 : return -1;
9443 : }
9444 : }
9445 0 : return 0;
9446 : }
9447 :
9448 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_lmnt_token(PyObject *obj, void *closure)
9449 : {
9450 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9451 0 : PyObject *py_lmnt_token;
9452 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
9453 0 : return py_lmnt_token;
9454 : }
9455 :
9456 0 : static int py_nbt_netlogon_query_for_pdc_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
9457 : {
9458 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9459 0 : if (value == NULL) {
9460 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
9461 0 : return -1;
9462 : }
9463 : {
9464 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
9465 0 : if (PyLong_Check(value)) {
9466 0 : unsigned long long test_var;
9467 0 : test_var = PyLong_AsUnsignedLongLong(value);
9468 0 : if (PyErr_Occurred() != NULL) {
9469 0 : return -1;
9470 : }
9471 0 : if (test_var > uint_max) {
9472 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9473 : PyLong_Type.tp_name, uint_max, test_var);
9474 0 : return -1;
9475 : }
9476 0 : object->lmnt_token = test_var;
9477 : } else {
9478 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9479 : PyLong_Type.tp_name);
9480 0 : return -1;
9481 : }
9482 : }
9483 0 : return 0;
9484 : }
9485 :
9486 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_lm20_token(PyObject *obj, void *closure)
9487 : {
9488 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9489 0 : PyObject *py_lm20_token;
9490 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
9491 0 : return py_lm20_token;
9492 : }
9493 :
9494 0 : static int py_nbt_netlogon_query_for_pdc_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
9495 : {
9496 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9497 0 : if (value == NULL) {
9498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
9499 0 : return -1;
9500 : }
9501 : {
9502 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
9503 0 : if (PyLong_Check(value)) {
9504 0 : unsigned long long test_var;
9505 0 : test_var = PyLong_AsUnsignedLongLong(value);
9506 0 : if (PyErr_Occurred() != NULL) {
9507 0 : return -1;
9508 : }
9509 0 : if (test_var > uint_max) {
9510 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9511 : PyLong_Type.tp_name, uint_max, test_var);
9512 0 : return -1;
9513 : }
9514 0 : object->lm20_token = test_var;
9515 : } else {
9516 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9517 : PyLong_Type.tp_name);
9518 0 : return -1;
9519 : }
9520 : }
9521 0 : return 0;
9522 : }
9523 :
9524 : static PyGetSetDef py_nbt_netlogon_query_for_pdc_getsetters[] = {
9525 : {
9526 : .name = discard_const_p(char, "computer_name"),
9527 : .get = py_nbt_netlogon_query_for_pdc_get_computer_name,
9528 : .set = py_nbt_netlogon_query_for_pdc_set_computer_name,
9529 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9530 : },
9531 : {
9532 : .name = discard_const_p(char, "mailslot_name"),
9533 : .get = py_nbt_netlogon_query_for_pdc_get_mailslot_name,
9534 : .set = py_nbt_netlogon_query_for_pdc_set_mailslot_name,
9535 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9536 : },
9537 : {
9538 : .name = discard_const_p(char, "_pad"),
9539 : .get = py_nbt_netlogon_query_for_pdc_get__pad,
9540 : .set = py_nbt_netlogon_query_for_pdc_set__pad,
9541 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9542 : },
9543 : {
9544 : .name = discard_const_p(char, "unicode_name"),
9545 : .get = py_nbt_netlogon_query_for_pdc_get_unicode_name,
9546 : .set = py_nbt_netlogon_query_for_pdc_set_unicode_name,
9547 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9548 : },
9549 : {
9550 : .name = discard_const_p(char, "nt_version"),
9551 : .get = py_nbt_netlogon_query_for_pdc_get_nt_version,
9552 : .set = py_nbt_netlogon_query_for_pdc_set_nt_version,
9553 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
9554 : },
9555 : {
9556 : .name = discard_const_p(char, "lmnt_token"),
9557 : .get = py_nbt_netlogon_query_for_pdc_get_lmnt_token,
9558 : .set = py_nbt_netlogon_query_for_pdc_set_lmnt_token,
9559 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9560 : },
9561 : {
9562 : .name = discard_const_p(char, "lm20_token"),
9563 : .get = py_nbt_netlogon_query_for_pdc_get_lm20_token,
9564 : .set = py_nbt_netlogon_query_for_pdc_set_lm20_token,
9565 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9566 : },
9567 : { .name = NULL }
9568 : };
9569 :
9570 0 : static PyObject *py_nbt_netlogon_query_for_pdc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9571 : {
9572 0 : return pytalloc_new(struct nbt_netlogon_query_for_pdc, type);
9573 : }
9574 :
9575 :
9576 : static PyTypeObject nbt_netlogon_query_for_pdc_Type = {
9577 : PyVarObject_HEAD_INIT(NULL, 0)
9578 : .tp_name = "nbt.netlogon_query_for_pdc",
9579 : .tp_getset = py_nbt_netlogon_query_for_pdc_getsetters,
9580 : .tp_methods = NULL,
9581 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9582 : .tp_new = py_nbt_netlogon_query_for_pdc_new,
9583 : };
9584 :
9585 :
9586 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_command(PyObject *obj, void *closure)
9587 : {
9588 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9589 0 : PyObject *py_command;
9590 0 : py_command = PyLong_FromLong((uint16_t)object->command);
9591 0 : return py_command;
9592 : }
9593 :
9594 0 : static int py_nbt_netlogon_response_from_pdc_set_command(PyObject *py_obj, PyObject *value, void *closure)
9595 : {
9596 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9597 0 : if (value == NULL) {
9598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
9599 0 : return -1;
9600 : }
9601 : {
9602 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
9603 0 : if (PyLong_Check(value)) {
9604 0 : unsigned long long test_var;
9605 0 : test_var = PyLong_AsUnsignedLongLong(value);
9606 0 : if (PyErr_Occurred() != NULL) {
9607 0 : return -1;
9608 : }
9609 0 : if (test_var > uint_max) {
9610 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9611 : PyLong_Type.tp_name, uint_max, test_var);
9612 0 : return -1;
9613 : }
9614 0 : object->command = test_var;
9615 : } else {
9616 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9617 : PyLong_Type.tp_name);
9618 0 : return -1;
9619 : }
9620 : }
9621 0 : return 0;
9622 : }
9623 :
9624 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_pdc_name(PyObject *obj, void *closure)
9625 : {
9626 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9627 0 : PyObject *py_pdc_name;
9628 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
9629 0 : return py_pdc_name;
9630 : }
9631 :
9632 0 : static int py_nbt_netlogon_response_from_pdc_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
9633 : {
9634 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9635 0 : if (value == NULL) {
9636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
9637 0 : return -1;
9638 : }
9639 : {
9640 0 : const char *test_str;
9641 0 : const char *talloc_str;
9642 0 : PyObject *unicode = NULL;
9643 0 : if (PyUnicode_Check(value)) {
9644 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9645 0 : if (unicode == NULL) {
9646 0 : return -1;
9647 : }
9648 0 : test_str = PyBytes_AS_STRING(unicode);
9649 0 : } else if (PyBytes_Check(value)) {
9650 0 : test_str = PyBytes_AS_STRING(value);
9651 : } else {
9652 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9653 0 : return -1;
9654 : }
9655 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9656 0 : if (unicode != NULL) {
9657 0 : Py_DECREF(unicode);
9658 : }
9659 0 : if (talloc_str == NULL) {
9660 0 : PyErr_NoMemory();
9661 0 : return -1;
9662 : }
9663 0 : object->pdc_name = talloc_str;
9664 : }
9665 0 : return 0;
9666 : }
9667 :
9668 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get__pad(PyObject *obj, void *closure)
9669 : {
9670 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9671 0 : PyObject *py__pad;
9672 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9673 0 : return py__pad;
9674 : }
9675 :
9676 0 : static int py_nbt_netlogon_response_from_pdc_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9677 : {
9678 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9679 0 : if (value == NULL) {
9680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
9681 0 : return -1;
9682 : }
9683 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9684 0 : return 0;
9685 : }
9686 :
9687 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_unicode_pdc_name(PyObject *obj, void *closure)
9688 : {
9689 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9690 0 : PyObject *py_unicode_pdc_name;
9691 0 : py_unicode_pdc_name = PyString_FromStringOrNULL(object->unicode_pdc_name);
9692 0 : return py_unicode_pdc_name;
9693 : }
9694 :
9695 0 : static int py_nbt_netlogon_response_from_pdc_set_unicode_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
9696 : {
9697 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9698 0 : if (value == NULL) {
9699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_pdc_name");
9700 0 : return -1;
9701 : }
9702 : {
9703 0 : const char *test_str;
9704 0 : const char *talloc_str;
9705 0 : PyObject *unicode = NULL;
9706 0 : if (PyUnicode_Check(value)) {
9707 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9708 0 : if (unicode == NULL) {
9709 0 : return -1;
9710 : }
9711 0 : test_str = PyBytes_AS_STRING(unicode);
9712 0 : } else if (PyBytes_Check(value)) {
9713 0 : test_str = PyBytes_AS_STRING(value);
9714 : } else {
9715 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9716 0 : return -1;
9717 : }
9718 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9719 0 : if (unicode != NULL) {
9720 0 : Py_DECREF(unicode);
9721 : }
9722 0 : if (talloc_str == NULL) {
9723 0 : PyErr_NoMemory();
9724 0 : return -1;
9725 : }
9726 0 : object->unicode_pdc_name = talloc_str;
9727 : }
9728 0 : return 0;
9729 : }
9730 :
9731 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_domain_name(PyObject *obj, void *closure)
9732 : {
9733 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9734 0 : PyObject *py_domain_name;
9735 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
9736 0 : return py_domain_name;
9737 : }
9738 :
9739 0 : static int py_nbt_netlogon_response_from_pdc_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
9740 : {
9741 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9742 0 : if (value == NULL) {
9743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
9744 0 : return -1;
9745 : }
9746 : {
9747 0 : const char *test_str;
9748 0 : const char *talloc_str;
9749 0 : PyObject *unicode = NULL;
9750 0 : if (PyUnicode_Check(value)) {
9751 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9752 0 : if (unicode == NULL) {
9753 0 : return -1;
9754 : }
9755 0 : test_str = PyBytes_AS_STRING(unicode);
9756 0 : } else if (PyBytes_Check(value)) {
9757 0 : test_str = PyBytes_AS_STRING(value);
9758 : } else {
9759 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9760 0 : return -1;
9761 : }
9762 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9763 0 : if (unicode != NULL) {
9764 0 : Py_DECREF(unicode);
9765 : }
9766 0 : if (talloc_str == NULL) {
9767 0 : PyErr_NoMemory();
9768 0 : return -1;
9769 : }
9770 0 : object->domain_name = talloc_str;
9771 : }
9772 0 : return 0;
9773 : }
9774 :
9775 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_nt_version(PyObject *obj, void *closure)
9776 : {
9777 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9778 0 : PyObject *py_nt_version;
9779 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
9780 0 : return py_nt_version;
9781 : }
9782 :
9783 0 : static int py_nbt_netlogon_response_from_pdc_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
9784 : {
9785 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9786 0 : if (value == NULL) {
9787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
9788 0 : return -1;
9789 : }
9790 : {
9791 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
9792 0 : if (PyLong_Check(value)) {
9793 0 : unsigned long long test_var;
9794 0 : test_var = PyLong_AsUnsignedLongLong(value);
9795 0 : if (PyErr_Occurred() != NULL) {
9796 0 : return -1;
9797 : }
9798 0 : if (test_var > uint_max) {
9799 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9800 : PyLong_Type.tp_name, uint_max, test_var);
9801 0 : return -1;
9802 : }
9803 0 : object->nt_version = test_var;
9804 : } else {
9805 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9806 : PyLong_Type.tp_name);
9807 0 : return -1;
9808 : }
9809 : }
9810 0 : return 0;
9811 : }
9812 :
9813 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_lmnt_token(PyObject *obj, void *closure)
9814 : {
9815 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9816 0 : PyObject *py_lmnt_token;
9817 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
9818 0 : return py_lmnt_token;
9819 : }
9820 :
9821 0 : static int py_nbt_netlogon_response_from_pdc_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
9822 : {
9823 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9824 0 : if (value == NULL) {
9825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
9826 0 : return -1;
9827 : }
9828 : {
9829 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
9830 0 : if (PyLong_Check(value)) {
9831 0 : unsigned long long test_var;
9832 0 : test_var = PyLong_AsUnsignedLongLong(value);
9833 0 : if (PyErr_Occurred() != NULL) {
9834 0 : return -1;
9835 : }
9836 0 : if (test_var > uint_max) {
9837 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9838 : PyLong_Type.tp_name, uint_max, test_var);
9839 0 : return -1;
9840 : }
9841 0 : object->lmnt_token = test_var;
9842 : } else {
9843 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9844 : PyLong_Type.tp_name);
9845 0 : return -1;
9846 : }
9847 : }
9848 0 : return 0;
9849 : }
9850 :
9851 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_lm20_token(PyObject *obj, void *closure)
9852 : {
9853 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9854 0 : PyObject *py_lm20_token;
9855 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
9856 0 : return py_lm20_token;
9857 : }
9858 :
9859 0 : static int py_nbt_netlogon_response_from_pdc_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
9860 : {
9861 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9862 0 : if (value == NULL) {
9863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
9864 0 : return -1;
9865 : }
9866 : {
9867 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
9868 0 : if (PyLong_Check(value)) {
9869 0 : unsigned long long test_var;
9870 0 : test_var = PyLong_AsUnsignedLongLong(value);
9871 0 : if (PyErr_Occurred() != NULL) {
9872 0 : return -1;
9873 : }
9874 0 : if (test_var > uint_max) {
9875 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9876 : PyLong_Type.tp_name, uint_max, test_var);
9877 0 : return -1;
9878 : }
9879 0 : object->lm20_token = test_var;
9880 : } else {
9881 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9882 : PyLong_Type.tp_name);
9883 0 : return -1;
9884 : }
9885 : }
9886 0 : return 0;
9887 : }
9888 :
9889 : static PyGetSetDef py_nbt_netlogon_response_from_pdc_getsetters[] = {
9890 : {
9891 : .name = discard_const_p(char, "command"),
9892 : .get = py_nbt_netlogon_response_from_pdc_get_command,
9893 : .set = py_nbt_netlogon_response_from_pdc_set_command,
9894 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
9895 : },
9896 : {
9897 : .name = discard_const_p(char, "pdc_name"),
9898 : .get = py_nbt_netlogon_response_from_pdc_get_pdc_name,
9899 : .set = py_nbt_netlogon_response_from_pdc_set_pdc_name,
9900 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9901 : },
9902 : {
9903 : .name = discard_const_p(char, "_pad"),
9904 : .get = py_nbt_netlogon_response_from_pdc_get__pad,
9905 : .set = py_nbt_netlogon_response_from_pdc_set__pad,
9906 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9907 : },
9908 : {
9909 : .name = discard_const_p(char, "unicode_pdc_name"),
9910 : .get = py_nbt_netlogon_response_from_pdc_get_unicode_pdc_name,
9911 : .set = py_nbt_netlogon_response_from_pdc_set_unicode_pdc_name,
9912 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9913 : },
9914 : {
9915 : .name = discard_const_p(char, "domain_name"),
9916 : .get = py_nbt_netlogon_response_from_pdc_get_domain_name,
9917 : .set = py_nbt_netlogon_response_from_pdc_set_domain_name,
9918 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9919 : },
9920 : {
9921 : .name = discard_const_p(char, "nt_version"),
9922 : .get = py_nbt_netlogon_response_from_pdc_get_nt_version,
9923 : .set = py_nbt_netlogon_response_from_pdc_set_nt_version,
9924 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
9925 : },
9926 : {
9927 : .name = discard_const_p(char, "lmnt_token"),
9928 : .get = py_nbt_netlogon_response_from_pdc_get_lmnt_token,
9929 : .set = py_nbt_netlogon_response_from_pdc_set_lmnt_token,
9930 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9931 : },
9932 : {
9933 : .name = discard_const_p(char, "lm20_token"),
9934 : .get = py_nbt_netlogon_response_from_pdc_get_lm20_token,
9935 : .set = py_nbt_netlogon_response_from_pdc_set_lm20_token,
9936 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9937 : },
9938 : { .name = NULL }
9939 : };
9940 :
9941 0 : static PyObject *py_nbt_netlogon_response_from_pdc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9942 : {
9943 0 : return pytalloc_new(struct nbt_netlogon_response_from_pdc, type);
9944 : }
9945 :
9946 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9947 : {
9948 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9949 0 : PyObject *ret = NULL;
9950 0 : DATA_BLOB blob;
9951 0 : enum ndr_err_code err;
9952 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9953 0 : if (tmp_ctx == NULL) {
9954 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9955 0 : return NULL;
9956 : }
9957 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response_from_pdc);
9958 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9959 0 : TALLOC_FREE(tmp_ctx);
9960 0 : PyErr_SetNdrError(err);
9961 0 : return NULL;
9962 : }
9963 :
9964 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9965 0 : TALLOC_FREE(tmp_ctx);
9966 0 : return ret;
9967 : }
9968 :
9969 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9970 : {
9971 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9972 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
9973 0 : Py_ssize_t blob_length = 0;
9974 0 : enum ndr_err_code err;
9975 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9976 0 : PyObject *allow_remaining_obj = NULL;
9977 0 : bool allow_remaining = false;
9978 :
9979 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
9980 : discard_const_p(char *, kwnames),
9981 : &blob.data, &blob_length,
9982 : &allow_remaining_obj)) {
9983 0 : return NULL;
9984 : }
9985 0 : blob.length = blob_length;
9986 :
9987 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9988 0 : allow_remaining = true;
9989 : }
9990 :
9991 0 : if (allow_remaining) {
9992 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response_from_pdc);
9993 : } else {
9994 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response_from_pdc);
9995 : }
9996 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9997 0 : PyErr_SetNdrError(err);
9998 0 : return NULL;
9999 : }
10000 :
10001 0 : Py_RETURN_NONE;
10002 : }
10003 :
10004 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10005 : {
10006 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
10007 0 : PyObject *ret;
10008 0 : char *retstr;
10009 :
10010 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_netlogon_response_from_pdc, "nbt_netlogon_response_from_pdc", object);
10011 0 : ret = PyUnicode_FromString(retstr);
10012 0 : talloc_free(retstr);
10013 :
10014 0 : return ret;
10015 : }
10016 :
10017 : static PyMethodDef py_nbt_netlogon_response_from_pdc_methods[] = {
10018 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_response_from_pdc_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10019 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_response_from_pdc_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10020 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_response_from_pdc_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10021 : { NULL, NULL, 0, NULL }
10022 : };
10023 :
10024 :
10025 : static PyTypeObject nbt_netlogon_response_from_pdc_Type = {
10026 : PyVarObject_HEAD_INIT(NULL, 0)
10027 : .tp_name = "nbt.netlogon_response_from_pdc",
10028 : .tp_getset = py_nbt_netlogon_response_from_pdc_getsetters,
10029 : .tp_methods = py_nbt_netlogon_response_from_pdc_methods,
10030 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10031 : .tp_new = py_nbt_netlogon_response_from_pdc_new,
10032 : };
10033 :
10034 :
10035 0 : static PyObject *py_nbt_netlogon_response2_get_command(PyObject *obj, void *closure)
10036 : {
10037 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(obj);
10038 0 : PyObject *py_command;
10039 0 : py_command = PyLong_FromLong((uint16_t)object->command);
10040 0 : return py_command;
10041 : }
10042 :
10043 0 : static int py_nbt_netlogon_response2_set_command(PyObject *py_obj, PyObject *value, void *closure)
10044 : {
10045 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10046 0 : if (value == NULL) {
10047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
10048 0 : return -1;
10049 : }
10050 : {
10051 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
10052 0 : if (PyLong_Check(value)) {
10053 0 : unsigned long long test_var;
10054 0 : test_var = PyLong_AsUnsignedLongLong(value);
10055 0 : if (PyErr_Occurred() != NULL) {
10056 0 : return -1;
10057 : }
10058 0 : if (test_var > uint_max) {
10059 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10060 : PyLong_Type.tp_name, uint_max, test_var);
10061 0 : return -1;
10062 : }
10063 0 : object->command = test_var;
10064 : } else {
10065 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10066 : PyLong_Type.tp_name);
10067 0 : return -1;
10068 : }
10069 : }
10070 0 : return 0;
10071 : }
10072 :
10073 0 : static PyObject *py_nbt_netlogon_response2_get_pdc_name(PyObject *obj, void *closure)
10074 : {
10075 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(obj);
10076 0 : PyObject *py_pdc_name;
10077 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
10078 0 : return py_pdc_name;
10079 : }
10080 :
10081 0 : static int py_nbt_netlogon_response2_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10082 : {
10083 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10084 0 : if (value == NULL) {
10085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
10086 0 : return -1;
10087 : }
10088 : {
10089 0 : const char *test_str;
10090 0 : const char *talloc_str;
10091 0 : PyObject *unicode = NULL;
10092 0 : if (PyUnicode_Check(value)) {
10093 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10094 0 : if (unicode == NULL) {
10095 0 : return -1;
10096 : }
10097 0 : test_str = PyBytes_AS_STRING(unicode);
10098 0 : } else if (PyBytes_Check(value)) {
10099 0 : test_str = PyBytes_AS_STRING(value);
10100 : } else {
10101 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10102 0 : return -1;
10103 : }
10104 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10105 0 : if (unicode != NULL) {
10106 0 : Py_DECREF(unicode);
10107 : }
10108 0 : if (talloc_str == NULL) {
10109 0 : PyErr_NoMemory();
10110 0 : return -1;
10111 : }
10112 0 : object->pdc_name = talloc_str;
10113 : }
10114 0 : return 0;
10115 : }
10116 :
10117 0 : static PyObject *py_nbt_netlogon_response2_get_lm20_token(PyObject *obj, void *closure)
10118 : {
10119 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(obj);
10120 0 : PyObject *py_lm20_token;
10121 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
10122 0 : return py_lm20_token;
10123 : }
10124 :
10125 0 : static int py_nbt_netlogon_response2_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
10126 : {
10127 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10128 0 : if (value == NULL) {
10129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
10130 0 : return -1;
10131 : }
10132 : {
10133 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
10134 0 : if (PyLong_Check(value)) {
10135 0 : unsigned long long test_var;
10136 0 : test_var = PyLong_AsUnsignedLongLong(value);
10137 0 : if (PyErr_Occurred() != NULL) {
10138 0 : return -1;
10139 : }
10140 0 : if (test_var > uint_max) {
10141 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10142 : PyLong_Type.tp_name, uint_max, test_var);
10143 0 : return -1;
10144 : }
10145 0 : object->lm20_token = test_var;
10146 : } else {
10147 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10148 : PyLong_Type.tp_name);
10149 0 : return -1;
10150 : }
10151 : }
10152 0 : return 0;
10153 : }
10154 :
10155 : static PyGetSetDef py_nbt_netlogon_response2_getsetters[] = {
10156 : {
10157 : .name = discard_const_p(char, "command"),
10158 : .get = py_nbt_netlogon_response2_get_command,
10159 : .set = py_nbt_netlogon_response2_set_command,
10160 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
10161 : },
10162 : {
10163 : .name = discard_const_p(char, "pdc_name"),
10164 : .get = py_nbt_netlogon_response2_get_pdc_name,
10165 : .set = py_nbt_netlogon_response2_set_pdc_name,
10166 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
10167 : },
10168 : {
10169 : .name = discard_const_p(char, "lm20_token"),
10170 : .get = py_nbt_netlogon_response2_get_lm20_token,
10171 : .set = py_nbt_netlogon_response2_set_lm20_token,
10172 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10173 : },
10174 : { .name = NULL }
10175 : };
10176 :
10177 0 : static PyObject *py_nbt_netlogon_response2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10178 : {
10179 0 : return pytalloc_new(struct nbt_netlogon_response2, type);
10180 : }
10181 :
10182 0 : static PyObject *py_nbt_netlogon_response2_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10183 : {
10184 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10185 0 : PyObject *ret = NULL;
10186 0 : DATA_BLOB blob;
10187 0 : enum ndr_err_code err;
10188 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10189 0 : if (tmp_ctx == NULL) {
10190 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10191 0 : return NULL;
10192 : }
10193 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response2);
10194 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10195 0 : TALLOC_FREE(tmp_ctx);
10196 0 : PyErr_SetNdrError(err);
10197 0 : return NULL;
10198 : }
10199 :
10200 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10201 0 : TALLOC_FREE(tmp_ctx);
10202 0 : return ret;
10203 : }
10204 :
10205 0 : static PyObject *py_nbt_netlogon_response2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10206 : {
10207 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10208 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10209 0 : Py_ssize_t blob_length = 0;
10210 0 : enum ndr_err_code err;
10211 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10212 0 : PyObject *allow_remaining_obj = NULL;
10213 0 : bool allow_remaining = false;
10214 :
10215 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10216 : discard_const_p(char *, kwnames),
10217 : &blob.data, &blob_length,
10218 : &allow_remaining_obj)) {
10219 0 : return NULL;
10220 : }
10221 0 : blob.length = blob_length;
10222 :
10223 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10224 0 : allow_remaining = true;
10225 : }
10226 :
10227 0 : if (allow_remaining) {
10228 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response2);
10229 : } else {
10230 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response2);
10231 : }
10232 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10233 0 : PyErr_SetNdrError(err);
10234 0 : return NULL;
10235 : }
10236 :
10237 0 : Py_RETURN_NONE;
10238 : }
10239 :
10240 0 : static PyObject *py_nbt_netlogon_response2_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10241 : {
10242 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10243 0 : PyObject *ret;
10244 0 : char *retstr;
10245 :
10246 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_netlogon_response2, "nbt_netlogon_response2", object);
10247 0 : ret = PyUnicode_FromString(retstr);
10248 0 : talloc_free(retstr);
10249 :
10250 0 : return ret;
10251 : }
10252 :
10253 : static PyMethodDef py_nbt_netlogon_response2_methods[] = {
10254 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_response2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10255 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_response2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10256 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_response2_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10257 : { NULL, NULL, 0, NULL }
10258 : };
10259 :
10260 :
10261 : static PyTypeObject nbt_netlogon_response2_Type = {
10262 : PyVarObject_HEAD_INIT(NULL, 0)
10263 : .tp_name = "nbt.netlogon_response2",
10264 : .tp_getset = py_nbt_netlogon_response2_getsetters,
10265 : .tp_methods = py_nbt_netlogon_response2_methods,
10266 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10267 : .tp_new = py_nbt_netlogon_response2_new,
10268 : };
10269 :
10270 :
10271 0 : static PyObject *py_nbt_db_change_info_get_db_index(PyObject *obj, void *closure)
10272 : {
10273 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(obj);
10274 0 : PyObject *py_db_index;
10275 0 : py_db_index = PyLong_FromUnsignedLongLong((uint32_t)object->db_index);
10276 0 : return py_db_index;
10277 : }
10278 :
10279 0 : static int py_nbt_db_change_info_set_db_index(PyObject *py_obj, PyObject *value, void *closure)
10280 : {
10281 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(py_obj);
10282 0 : if (value == NULL) {
10283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_index");
10284 0 : return -1;
10285 : }
10286 : {
10287 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_index));
10288 0 : if (PyLong_Check(value)) {
10289 0 : unsigned long long test_var;
10290 0 : test_var = PyLong_AsUnsignedLongLong(value);
10291 0 : if (PyErr_Occurred() != NULL) {
10292 0 : return -1;
10293 : }
10294 0 : if (test_var > uint_max) {
10295 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10296 : PyLong_Type.tp_name, uint_max, test_var);
10297 0 : return -1;
10298 : }
10299 0 : object->db_index = test_var;
10300 : } else {
10301 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10302 : PyLong_Type.tp_name);
10303 0 : return -1;
10304 : }
10305 : }
10306 0 : return 0;
10307 : }
10308 :
10309 0 : static PyObject *py_nbt_db_change_info_get_serial(PyObject *obj, void *closure)
10310 : {
10311 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(obj);
10312 0 : PyObject *py_serial;
10313 0 : py_serial = PyLong_FromUnsignedLongLong(object->serial);
10314 0 : return py_serial;
10315 : }
10316 :
10317 0 : static int py_nbt_db_change_info_set_serial(PyObject *py_obj, PyObject *value, void *closure)
10318 : {
10319 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(py_obj);
10320 0 : if (value == NULL) {
10321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial");
10322 0 : return -1;
10323 : }
10324 : {
10325 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial));
10326 0 : if (PyLong_Check(value)) {
10327 0 : unsigned long long test_var;
10328 0 : test_var = PyLong_AsUnsignedLongLong(value);
10329 0 : if (PyErr_Occurred() != NULL) {
10330 0 : return -1;
10331 : }
10332 0 : if (test_var > uint_max) {
10333 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10334 : PyLong_Type.tp_name, uint_max, test_var);
10335 0 : return -1;
10336 : }
10337 0 : object->serial = test_var;
10338 : } else {
10339 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10340 : PyLong_Type.tp_name);
10341 0 : return -1;
10342 : }
10343 : }
10344 0 : return 0;
10345 : }
10346 :
10347 0 : static PyObject *py_nbt_db_change_info_get_timestamp(PyObject *obj, void *closure)
10348 : {
10349 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(obj);
10350 0 : PyObject *py_timestamp;
10351 0 : py_timestamp = PyLong_FromUnsignedLongLong(object->timestamp);
10352 0 : return py_timestamp;
10353 : }
10354 :
10355 0 : static int py_nbt_db_change_info_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
10356 : {
10357 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(py_obj);
10358 0 : if (value == NULL) {
10359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
10360 0 : return -1;
10361 : }
10362 : {
10363 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timestamp));
10364 0 : if (PyLong_Check(value)) {
10365 0 : unsigned long long test_var;
10366 0 : test_var = PyLong_AsUnsignedLongLong(value);
10367 0 : if (PyErr_Occurred() != NULL) {
10368 0 : return -1;
10369 : }
10370 0 : if (test_var > uint_max) {
10371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10372 : PyLong_Type.tp_name, uint_max, test_var);
10373 0 : return -1;
10374 : }
10375 0 : object->timestamp = test_var;
10376 : } else {
10377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10378 : PyLong_Type.tp_name);
10379 0 : return -1;
10380 : }
10381 : }
10382 0 : return 0;
10383 : }
10384 :
10385 : static PyGetSetDef py_nbt_db_change_info_getsetters[] = {
10386 : {
10387 : .name = discard_const_p(char, "db_index"),
10388 : .get = py_nbt_db_change_info_get_db_index,
10389 : .set = py_nbt_db_change_info_set_db_index,
10390 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID")
10391 : },
10392 : {
10393 : .name = discard_const_p(char, "serial"),
10394 : .get = py_nbt_db_change_info_get_serial,
10395 : .set = py_nbt_db_change_info_set_serial,
10396 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
10397 : },
10398 : {
10399 : .name = discard_const_p(char, "timestamp"),
10400 : .get = py_nbt_db_change_info_get_timestamp,
10401 : .set = py_nbt_db_change_info_set_timestamp,
10402 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
10403 : },
10404 : { .name = NULL }
10405 : };
10406 :
10407 0 : static PyObject *py_nbt_db_change_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10408 : {
10409 0 : return pytalloc_new(struct nbt_db_change_info, type);
10410 : }
10411 :
10412 :
10413 : static PyTypeObject nbt_db_change_info_Type = {
10414 : PyVarObject_HEAD_INIT(NULL, 0)
10415 : .tp_name = "nbt.db_change_info",
10416 : .tp_getset = py_nbt_db_change_info_getsetters,
10417 : .tp_methods = NULL,
10418 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10419 : .tp_new = py_nbt_db_change_info_new,
10420 : };
10421 :
10422 :
10423 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_serial_lo(PyObject *obj, void *closure)
10424 : {
10425 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10426 0 : PyObject *py_serial_lo;
10427 0 : py_serial_lo = PyLong_FromUnsignedLongLong((uint32_t)object->serial_lo);
10428 0 : return py_serial_lo;
10429 : }
10430 :
10431 0 : static int py_NETLOGON_DB_CHANGE_set_serial_lo(PyObject *py_obj, PyObject *value, void *closure)
10432 : {
10433 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10434 0 : if (value == NULL) {
10435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_lo");
10436 0 : return -1;
10437 : }
10438 : {
10439 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_lo));
10440 0 : if (PyLong_Check(value)) {
10441 0 : unsigned long long test_var;
10442 0 : test_var = PyLong_AsUnsignedLongLong(value);
10443 0 : if (PyErr_Occurred() != NULL) {
10444 0 : return -1;
10445 : }
10446 0 : if (test_var > uint_max) {
10447 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10448 : PyLong_Type.tp_name, uint_max, test_var);
10449 0 : return -1;
10450 : }
10451 0 : object->serial_lo = test_var;
10452 : } else {
10453 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10454 : PyLong_Type.tp_name);
10455 0 : return -1;
10456 : }
10457 : }
10458 0 : return 0;
10459 : }
10460 :
10461 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_timestamp(PyObject *obj, void *closure)
10462 : {
10463 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10464 0 : PyObject *py_timestamp;
10465 0 : py_timestamp = PyLong_FromLong(object->timestamp);
10466 0 : return py_timestamp;
10467 : }
10468 :
10469 0 : static int py_NETLOGON_DB_CHANGE_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
10470 : {
10471 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10472 0 : if (value == NULL) {
10473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
10474 0 : return -1;
10475 : }
10476 : {
10477 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp));
10478 0 : const long long int_min = -int_max - 1;
10479 0 : if (PyLong_Check(value)) {
10480 0 : long long test_var;
10481 0 : test_var = PyLong_AsLongLong(value);
10482 0 : if (PyErr_Occurred() != NULL) {
10483 0 : return -1;
10484 : }
10485 0 : if (test_var < int_min || test_var > int_max) {
10486 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
10487 : PyLong_Type.tp_name, int_min, int_max, test_var);
10488 0 : return -1;
10489 : }
10490 0 : object->timestamp = test_var;
10491 : } else {
10492 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10493 : PyLong_Type.tp_name);
10494 0 : return -1;
10495 : }
10496 : }
10497 0 : return 0;
10498 : }
10499 :
10500 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_pulse(PyObject *obj, void *closure)
10501 : {
10502 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10503 0 : PyObject *py_pulse;
10504 0 : py_pulse = PyLong_FromUnsignedLongLong((uint32_t)object->pulse);
10505 0 : return py_pulse;
10506 : }
10507 :
10508 0 : static int py_NETLOGON_DB_CHANGE_set_pulse(PyObject *py_obj, PyObject *value, void *closure)
10509 : {
10510 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10511 0 : if (value == NULL) {
10512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pulse");
10513 0 : return -1;
10514 : }
10515 : {
10516 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pulse));
10517 0 : if (PyLong_Check(value)) {
10518 0 : unsigned long long test_var;
10519 0 : test_var = PyLong_AsUnsignedLongLong(value);
10520 0 : if (PyErr_Occurred() != NULL) {
10521 0 : return -1;
10522 : }
10523 0 : if (test_var > uint_max) {
10524 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10525 : PyLong_Type.tp_name, uint_max, test_var);
10526 0 : return -1;
10527 : }
10528 0 : object->pulse = test_var;
10529 : } else {
10530 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10531 : PyLong_Type.tp_name);
10532 0 : return -1;
10533 : }
10534 : }
10535 0 : return 0;
10536 : }
10537 :
10538 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_random(PyObject *obj, void *closure)
10539 : {
10540 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10541 0 : PyObject *py_random;
10542 0 : py_random = PyLong_FromUnsignedLongLong((uint32_t)object->random);
10543 0 : return py_random;
10544 : }
10545 :
10546 0 : static int py_NETLOGON_DB_CHANGE_set_random(PyObject *py_obj, PyObject *value, void *closure)
10547 : {
10548 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10549 0 : if (value == NULL) {
10550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->random");
10551 0 : return -1;
10552 : }
10553 : {
10554 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->random));
10555 0 : if (PyLong_Check(value)) {
10556 0 : unsigned long long test_var;
10557 0 : test_var = PyLong_AsUnsignedLongLong(value);
10558 0 : if (PyErr_Occurred() != NULL) {
10559 0 : return -1;
10560 : }
10561 0 : if (test_var > uint_max) {
10562 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10563 : PyLong_Type.tp_name, uint_max, test_var);
10564 0 : return -1;
10565 : }
10566 0 : object->random = test_var;
10567 : } else {
10568 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10569 : PyLong_Type.tp_name);
10570 0 : return -1;
10571 : }
10572 : }
10573 0 : return 0;
10574 : }
10575 :
10576 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_pdc_name(PyObject *obj, void *closure)
10577 : {
10578 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10579 0 : PyObject *py_pdc_name;
10580 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
10581 0 : return py_pdc_name;
10582 : }
10583 :
10584 0 : static int py_NETLOGON_DB_CHANGE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10585 : {
10586 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10587 0 : if (value == NULL) {
10588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
10589 0 : return -1;
10590 : }
10591 : {
10592 0 : const char *test_str;
10593 0 : const char *talloc_str;
10594 0 : PyObject *unicode = NULL;
10595 0 : if (PyUnicode_Check(value)) {
10596 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10597 0 : if (unicode == NULL) {
10598 0 : return -1;
10599 : }
10600 0 : test_str = PyBytes_AS_STRING(unicode);
10601 0 : } else if (PyBytes_Check(value)) {
10602 0 : test_str = PyBytes_AS_STRING(value);
10603 : } else {
10604 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10605 0 : return -1;
10606 : }
10607 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10608 0 : if (unicode != NULL) {
10609 0 : Py_DECREF(unicode);
10610 : }
10611 0 : if (talloc_str == NULL) {
10612 0 : PyErr_NoMemory();
10613 0 : return -1;
10614 : }
10615 0 : object->pdc_name = talloc_str;
10616 : }
10617 0 : return 0;
10618 : }
10619 :
10620 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_domain(PyObject *obj, void *closure)
10621 : {
10622 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10623 0 : PyObject *py_domain;
10624 0 : py_domain = PyString_FromStringOrNULL(object->domain);
10625 0 : return py_domain;
10626 : }
10627 :
10628 0 : static int py_NETLOGON_DB_CHANGE_set_domain(PyObject *py_obj, PyObject *value, void *closure)
10629 : {
10630 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10631 0 : if (value == NULL) {
10632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain");
10633 0 : return -1;
10634 : }
10635 : {
10636 0 : const char *test_str;
10637 0 : const char *talloc_str;
10638 0 : PyObject *unicode = NULL;
10639 0 : if (PyUnicode_Check(value)) {
10640 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10641 0 : if (unicode == NULL) {
10642 0 : return -1;
10643 : }
10644 0 : test_str = PyBytes_AS_STRING(unicode);
10645 0 : } else if (PyBytes_Check(value)) {
10646 0 : test_str = PyBytes_AS_STRING(value);
10647 : } else {
10648 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10649 0 : return -1;
10650 : }
10651 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10652 0 : if (unicode != NULL) {
10653 0 : Py_DECREF(unicode);
10654 : }
10655 0 : if (talloc_str == NULL) {
10656 0 : PyErr_NoMemory();
10657 0 : return -1;
10658 : }
10659 0 : object->domain = talloc_str;
10660 : }
10661 0 : return 0;
10662 : }
10663 :
10664 0 : static PyObject *py_NETLOGON_DB_CHANGE_get__pad(PyObject *obj, void *closure)
10665 : {
10666 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10667 0 : PyObject *py__pad;
10668 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
10669 0 : return py__pad;
10670 : }
10671 :
10672 0 : static int py_NETLOGON_DB_CHANGE_set__pad(PyObject *py_obj, PyObject *value, void *closure)
10673 : {
10674 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10675 0 : if (value == NULL) {
10676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
10677 0 : return -1;
10678 : }
10679 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
10680 0 : return 0;
10681 : }
10682 :
10683 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_unicode_pdc_name(PyObject *obj, void *closure)
10684 : {
10685 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10686 0 : PyObject *py_unicode_pdc_name;
10687 0 : py_unicode_pdc_name = PyString_FromStringOrNULL(object->unicode_pdc_name);
10688 0 : return py_unicode_pdc_name;
10689 : }
10690 :
10691 0 : static int py_NETLOGON_DB_CHANGE_set_unicode_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10692 : {
10693 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10694 0 : if (value == NULL) {
10695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_pdc_name");
10696 0 : return -1;
10697 : }
10698 : {
10699 0 : const char *test_str;
10700 0 : const char *talloc_str;
10701 0 : PyObject *unicode = NULL;
10702 0 : if (PyUnicode_Check(value)) {
10703 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10704 0 : if (unicode == NULL) {
10705 0 : return -1;
10706 : }
10707 0 : test_str = PyBytes_AS_STRING(unicode);
10708 0 : } else if (PyBytes_Check(value)) {
10709 0 : test_str = PyBytes_AS_STRING(value);
10710 : } else {
10711 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10712 0 : return -1;
10713 : }
10714 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10715 0 : if (unicode != NULL) {
10716 0 : Py_DECREF(unicode);
10717 : }
10718 0 : if (talloc_str == NULL) {
10719 0 : PyErr_NoMemory();
10720 0 : return -1;
10721 : }
10722 0 : object->unicode_pdc_name = talloc_str;
10723 : }
10724 0 : return 0;
10725 : }
10726 :
10727 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_unicode_domain(PyObject *obj, void *closure)
10728 : {
10729 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10730 0 : PyObject *py_unicode_domain;
10731 0 : py_unicode_domain = PyString_FromStringOrNULL(object->unicode_domain);
10732 0 : return py_unicode_domain;
10733 : }
10734 :
10735 0 : static int py_NETLOGON_DB_CHANGE_set_unicode_domain(PyObject *py_obj, PyObject *value, void *closure)
10736 : {
10737 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10738 0 : if (value == NULL) {
10739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_domain");
10740 0 : return -1;
10741 : }
10742 : {
10743 0 : const char *test_str;
10744 0 : const char *talloc_str;
10745 0 : PyObject *unicode = NULL;
10746 0 : if (PyUnicode_Check(value)) {
10747 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10748 0 : if (unicode == NULL) {
10749 0 : return -1;
10750 : }
10751 0 : test_str = PyBytes_AS_STRING(unicode);
10752 0 : } else if (PyBytes_Check(value)) {
10753 0 : test_str = PyBytes_AS_STRING(value);
10754 : } else {
10755 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10756 0 : return -1;
10757 : }
10758 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10759 0 : if (unicode != NULL) {
10760 0 : Py_DECREF(unicode);
10761 : }
10762 0 : if (talloc_str == NULL) {
10763 0 : PyErr_NoMemory();
10764 0 : return -1;
10765 : }
10766 0 : object->unicode_domain = talloc_str;
10767 : }
10768 0 : return 0;
10769 : }
10770 :
10771 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_db_count(PyObject *obj, void *closure)
10772 : {
10773 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10774 0 : PyObject *py_db_count;
10775 0 : py_db_count = PyLong_FromUnsignedLongLong((uint32_t)object->db_count);
10776 0 : return py_db_count;
10777 : }
10778 :
10779 0 : static int py_NETLOGON_DB_CHANGE_set_db_count(PyObject *py_obj, PyObject *value, void *closure)
10780 : {
10781 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10782 0 : if (value == NULL) {
10783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_count");
10784 0 : return -1;
10785 : }
10786 : {
10787 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_count));
10788 0 : if (PyLong_Check(value)) {
10789 0 : unsigned long long test_var;
10790 0 : test_var = PyLong_AsUnsignedLongLong(value);
10791 0 : if (PyErr_Occurred() != NULL) {
10792 0 : return -1;
10793 : }
10794 0 : if (test_var > uint_max) {
10795 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10796 : PyLong_Type.tp_name, uint_max, test_var);
10797 0 : return -1;
10798 : }
10799 0 : object->db_count = test_var;
10800 : } else {
10801 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10802 : PyLong_Type.tp_name);
10803 0 : return -1;
10804 : }
10805 : }
10806 0 : return 0;
10807 : }
10808 :
10809 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_dbchange(PyObject *obj, void *closure)
10810 : {
10811 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10812 0 : PyObject *py_dbchange;
10813 0 : py_dbchange = PyList_New(object->db_count);
10814 0 : if (py_dbchange == NULL) {
10815 0 : return NULL;
10816 : }
10817 : {
10818 : int dbchange_cntr_0;
10819 0 : for (dbchange_cntr_0 = 0; dbchange_cntr_0 < (object->db_count); dbchange_cntr_0++) {
10820 0 : PyObject *py_dbchange_0;
10821 0 : py_dbchange_0 = pytalloc_reference_ex(&nbt_db_change_info_Type, object->dbchange, &object->dbchange[dbchange_cntr_0]);
10822 0 : PyList_SetItem(py_dbchange, dbchange_cntr_0, py_dbchange_0);
10823 : }
10824 : }
10825 0 : return py_dbchange;
10826 : }
10827 :
10828 0 : static int py_NETLOGON_DB_CHANGE_set_dbchange(PyObject *py_obj, PyObject *value, void *closure)
10829 : {
10830 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10831 0 : if (value == NULL) {
10832 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dbchange");
10833 0 : return -1;
10834 : }
10835 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10836 : {
10837 0 : int dbchange_cntr_0;
10838 0 : object->dbchange = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->dbchange, PyList_GET_SIZE(value));
10839 0 : if (!object->dbchange) { return -1; }
10840 0 : talloc_set_name_const(object->dbchange, "ARRAY: object->dbchange");
10841 0 : for (dbchange_cntr_0 = 0; dbchange_cntr_0 < PyList_GET_SIZE(value); dbchange_cntr_0++) {
10842 0 : if (PyList_GET_ITEM(value, dbchange_cntr_0) == NULL) {
10843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dbchange[dbchange_cntr_0]");
10844 0 : return -1;
10845 : }
10846 0 : PY_CHECK_TYPE(&nbt_db_change_info_Type, PyList_GET_ITEM(value, dbchange_cntr_0), return -1;);
10847 0 : if (talloc_reference(object->dbchange, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, dbchange_cntr_0))) == NULL) {
10848 0 : PyErr_NoMemory();
10849 0 : return -1;
10850 : }
10851 0 : object->dbchange[dbchange_cntr_0] = *(struct nbt_db_change_info *)pytalloc_get_ptr(PyList_GET_ITEM(value, dbchange_cntr_0));
10852 : }
10853 : }
10854 0 : return 0;
10855 : }
10856 :
10857 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_sid_size(PyObject *obj, void *closure)
10858 : {
10859 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10860 0 : PyObject *py_sid_size;
10861 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)object->sid_size);
10862 0 : return py_sid_size;
10863 : }
10864 :
10865 0 : static int py_NETLOGON_DB_CHANGE_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
10866 : {
10867 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10868 0 : if (value == NULL) {
10869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_size");
10870 0 : return -1;
10871 : }
10872 : {
10873 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
10874 0 : if (PyLong_Check(value)) {
10875 0 : unsigned long long test_var;
10876 0 : test_var = PyLong_AsUnsignedLongLong(value);
10877 0 : if (PyErr_Occurred() != NULL) {
10878 0 : return -1;
10879 : }
10880 0 : if (test_var > uint_max) {
10881 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10882 : PyLong_Type.tp_name, uint_max, test_var);
10883 0 : return -1;
10884 : }
10885 0 : object->sid_size = test_var;
10886 : } else {
10887 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10888 : PyLong_Type.tp_name);
10889 0 : return -1;
10890 : }
10891 : }
10892 0 : return 0;
10893 : }
10894 :
10895 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_sid(PyObject *obj, void *closure)
10896 : {
10897 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10898 0 : PyObject *py_sid;
10899 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
10900 0 : return py_sid;
10901 : }
10902 :
10903 0 : static int py_NETLOGON_DB_CHANGE_set_sid(PyObject *py_obj, PyObject *value, void *closure)
10904 : {
10905 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10906 0 : if (value == NULL) {
10907 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
10908 0 : return -1;
10909 : }
10910 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10911 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10912 0 : PyErr_NoMemory();
10913 0 : return -1;
10914 : }
10915 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
10916 0 : return 0;
10917 : }
10918 :
10919 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_message_format_version(PyObject *obj, void *closure)
10920 : {
10921 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10922 0 : PyObject *py_message_format_version;
10923 0 : py_message_format_version = PyLong_FromUnsignedLongLong((uint32_t)object->message_format_version);
10924 0 : return py_message_format_version;
10925 : }
10926 :
10927 0 : static int py_NETLOGON_DB_CHANGE_set_message_format_version(PyObject *py_obj, PyObject *value, void *closure)
10928 : {
10929 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10930 0 : if (value == NULL) {
10931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_format_version");
10932 0 : return -1;
10933 : }
10934 : {
10935 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_format_version));
10936 0 : if (PyLong_Check(value)) {
10937 0 : unsigned long long test_var;
10938 0 : test_var = PyLong_AsUnsignedLongLong(value);
10939 0 : if (PyErr_Occurred() != NULL) {
10940 0 : return -1;
10941 : }
10942 0 : if (test_var > uint_max) {
10943 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10944 : PyLong_Type.tp_name, uint_max, test_var);
10945 0 : return -1;
10946 : }
10947 0 : object->message_format_version = test_var;
10948 : } else {
10949 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10950 : PyLong_Type.tp_name);
10951 0 : return -1;
10952 : }
10953 : }
10954 0 : return 0;
10955 : }
10956 :
10957 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_message_token(PyObject *obj, void *closure)
10958 : {
10959 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10960 0 : PyObject *py_message_token;
10961 0 : py_message_token = PyLong_FromUnsignedLongLong((uint32_t)object->message_token);
10962 0 : return py_message_token;
10963 : }
10964 :
10965 0 : static int py_NETLOGON_DB_CHANGE_set_message_token(PyObject *py_obj, PyObject *value, void *closure)
10966 : {
10967 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10968 0 : if (value == NULL) {
10969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_token");
10970 0 : return -1;
10971 : }
10972 : {
10973 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_token));
10974 0 : if (PyLong_Check(value)) {
10975 0 : unsigned long long test_var;
10976 0 : test_var = PyLong_AsUnsignedLongLong(value);
10977 0 : if (PyErr_Occurred() != NULL) {
10978 0 : return -1;
10979 : }
10980 0 : if (test_var > uint_max) {
10981 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10982 : PyLong_Type.tp_name, uint_max, test_var);
10983 0 : return -1;
10984 : }
10985 0 : object->message_token = test_var;
10986 : } else {
10987 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10988 : PyLong_Type.tp_name);
10989 0 : return -1;
10990 : }
10991 : }
10992 0 : return 0;
10993 : }
10994 :
10995 : static PyGetSetDef py_NETLOGON_DB_CHANGE_getsetters[] = {
10996 : {
10997 : .name = discard_const_p(char, "serial_lo"),
10998 : .get = py_NETLOGON_DB_CHANGE_get_serial_lo,
10999 : .set = py_NETLOGON_DB_CHANGE_set_serial_lo,
11000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11001 : },
11002 : {
11003 : .name = discard_const_p(char, "timestamp"),
11004 : .get = py_NETLOGON_DB_CHANGE_get_timestamp,
11005 : .set = py_NETLOGON_DB_CHANGE_set_timestamp,
11006 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
11007 : },
11008 : {
11009 : .name = discard_const_p(char, "pulse"),
11010 : .get = py_NETLOGON_DB_CHANGE_get_pulse,
11011 : .set = py_NETLOGON_DB_CHANGE_set_pulse,
11012 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11013 : },
11014 : {
11015 : .name = discard_const_p(char, "random"),
11016 : .get = py_NETLOGON_DB_CHANGE_get_random,
11017 : .set = py_NETLOGON_DB_CHANGE_set_random,
11018 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11019 : },
11020 : {
11021 : .name = discard_const_p(char, "pdc_name"),
11022 : .get = py_NETLOGON_DB_CHANGE_get_pdc_name,
11023 : .set = py_NETLOGON_DB_CHANGE_set_pdc_name,
11024 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11025 : },
11026 : {
11027 : .name = discard_const_p(char, "domain"),
11028 : .get = py_NETLOGON_DB_CHANGE_get_domain,
11029 : .set = py_NETLOGON_DB_CHANGE_set_domain,
11030 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11031 : },
11032 : {
11033 : .name = discard_const_p(char, "_pad"),
11034 : .get = py_NETLOGON_DB_CHANGE_get__pad,
11035 : .set = py_NETLOGON_DB_CHANGE_set__pad,
11036 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
11037 : },
11038 : {
11039 : .name = discard_const_p(char, "unicode_pdc_name"),
11040 : .get = py_NETLOGON_DB_CHANGE_get_unicode_pdc_name,
11041 : .set = py_NETLOGON_DB_CHANGE_set_unicode_pdc_name,
11042 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11043 : },
11044 : {
11045 : .name = discard_const_p(char, "unicode_domain"),
11046 : .get = py_NETLOGON_DB_CHANGE_get_unicode_domain,
11047 : .set = py_NETLOGON_DB_CHANGE_set_unicode_domain,
11048 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11049 : },
11050 : {
11051 : .name = discard_const_p(char, "db_count"),
11052 : .get = py_NETLOGON_DB_CHANGE_get_db_count,
11053 : .set = py_NETLOGON_DB_CHANGE_set_db_count,
11054 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11055 : },
11056 : {
11057 : .name = discard_const_p(char, "dbchange"),
11058 : .get = py_NETLOGON_DB_CHANGE_get_dbchange,
11059 : .set = py_NETLOGON_DB_CHANGE_set_dbchange,
11060 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_db_change_info")
11061 : },
11062 : {
11063 : .name = discard_const_p(char, "sid_size"),
11064 : .get = py_NETLOGON_DB_CHANGE_get_sid_size,
11065 : .set = py_NETLOGON_DB_CHANGE_set_sid_size,
11066 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11067 : },
11068 : {
11069 : .name = discard_const_p(char, "sid"),
11070 : .get = py_NETLOGON_DB_CHANGE_get_sid,
11071 : .set = py_NETLOGON_DB_CHANGE_set_sid,
11072 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
11073 : },
11074 : {
11075 : .name = discard_const_p(char, "message_format_version"),
11076 : .get = py_NETLOGON_DB_CHANGE_get_message_format_version,
11077 : .set = py_NETLOGON_DB_CHANGE_set_message_format_version,
11078 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11079 : },
11080 : {
11081 : .name = discard_const_p(char, "message_token"),
11082 : .get = py_NETLOGON_DB_CHANGE_get_message_token,
11083 : .set = py_NETLOGON_DB_CHANGE_set_message_token,
11084 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11085 : },
11086 : { .name = NULL }
11087 : };
11088 :
11089 0 : static PyObject *py_NETLOGON_DB_CHANGE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11090 : {
11091 0 : return pytalloc_new(struct NETLOGON_DB_CHANGE, type);
11092 : }
11093 :
11094 :
11095 : static PyTypeObject NETLOGON_DB_CHANGE_Type = {
11096 : PyVarObject_HEAD_INIT(NULL, 0)
11097 : .tp_name = "nbt.NETLOGON_DB_CHANGE",
11098 : .tp_getset = py_NETLOGON_DB_CHANGE_getsetters,
11099 : .tp_methods = NULL,
11100 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11101 : .tp_new = py_NETLOGON_DB_CHANGE_new,
11102 : };
11103 :
11104 0 : static PyObject *py_import_nbt_netlogon_request(TALLOC_CTX *mem_ctx, int level, union nbt_netlogon_request *in)
11105 : {
11106 0 : PyObject *ret;
11107 :
11108 0 : switch (level) {
11109 0 : case LOGON_REQUEST:
11110 0 : ret = pytalloc_reference_ex(&NETLOGON_LOGON_REQUEST_Type, mem_ctx, &in->logon0);
11111 0 : return ret;
11112 :
11113 0 : case LOGON_SAM_LOGON_REQUEST:
11114 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_REQUEST_Type, mem_ctx, &in->logon);
11115 0 : return ret;
11116 :
11117 0 : case LOGON_PRIMARY_QUERY:
11118 0 : ret = pytalloc_reference_ex(&nbt_netlogon_query_for_pdc_Type, mem_ctx, &in->pdc);
11119 0 : return ret;
11120 :
11121 0 : case NETLOGON_ANNOUNCE_UAS:
11122 0 : ret = pytalloc_reference_ex(&NETLOGON_DB_CHANGE_Type, mem_ctx, &in->uas);
11123 0 : return ret;
11124 :
11125 : }
11126 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11127 0 : return NULL;
11128 : }
11129 :
11130 0 : static union nbt_netlogon_request *py_export_nbt_netlogon_request(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11131 : {
11132 0 : union nbt_netlogon_request *ret = talloc_zero(mem_ctx, union nbt_netlogon_request);
11133 0 : switch (level) {
11134 0 : case LOGON_REQUEST:
11135 0 : if (in == NULL) {
11136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon0");
11137 0 : talloc_free(ret); return NULL;
11138 : }
11139 0 : PY_CHECK_TYPE(&NETLOGON_LOGON_REQUEST_Type, in, talloc_free(ret); return NULL;);
11140 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11141 0 : PyErr_NoMemory();
11142 0 : talloc_free(ret); return NULL;
11143 : }
11144 0 : ret->logon0 = *(struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(in);
11145 0 : break;
11146 :
11147 0 : case LOGON_SAM_LOGON_REQUEST:
11148 0 : if (in == NULL) {
11149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon");
11150 0 : talloc_free(ret); return NULL;
11151 : }
11152 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_REQUEST_Type, in, talloc_free(ret); return NULL;);
11153 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11154 0 : PyErr_NoMemory();
11155 0 : talloc_free(ret); return NULL;
11156 : }
11157 0 : ret->logon = *(struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(in);
11158 0 : break;
11159 :
11160 0 : case LOGON_PRIMARY_QUERY:
11161 0 : if (in == NULL) {
11162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pdc");
11163 0 : talloc_free(ret); return NULL;
11164 : }
11165 0 : PY_CHECK_TYPE(&nbt_netlogon_query_for_pdc_Type, in, talloc_free(ret); return NULL;);
11166 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11167 0 : PyErr_NoMemory();
11168 0 : talloc_free(ret); return NULL;
11169 : }
11170 0 : ret->pdc = *(struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(in);
11171 0 : break;
11172 :
11173 0 : case NETLOGON_ANNOUNCE_UAS:
11174 0 : if (in == NULL) {
11175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uas");
11176 0 : talloc_free(ret); return NULL;
11177 : }
11178 0 : PY_CHECK_TYPE(&NETLOGON_DB_CHANGE_Type, in, talloc_free(ret); return NULL;);
11179 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11180 0 : PyErr_NoMemory();
11181 0 : talloc_free(ret); return NULL;
11182 : }
11183 0 : ret->uas = *(struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(in);
11184 0 : break;
11185 :
11186 0 : default:
11187 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
11188 0 : talloc_free(ret);
11189 0 : ret = NULL;
11190 : }
11191 :
11192 0 : return ret;
11193 : }
11194 :
11195 0 : static PyObject *py_nbt_netlogon_request_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11196 : {
11197 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11198 0 : PyObject *mem_ctx_obj = NULL;
11199 0 : TALLOC_CTX *mem_ctx = NULL;
11200 0 : int level = 0;
11201 0 : PyObject *in_obj = NULL;
11202 0 : union nbt_netlogon_request *in = NULL;
11203 :
11204 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11205 : discard_const_p(char *, kwnames),
11206 : &mem_ctx_obj,
11207 : &level,
11208 : &in_obj)) {
11209 0 : return NULL;
11210 : }
11211 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11212 0 : if (mem_ctx == NULL) {
11213 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11214 0 : return NULL;
11215 : }
11216 0 : in = (union nbt_netlogon_request *)pytalloc_get_ptr(in_obj);
11217 0 : if (in == NULL) {
11218 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_netlogon_request!");
11219 0 : return NULL;
11220 : }
11221 :
11222 0 : return py_import_nbt_netlogon_request(mem_ctx, level, in);
11223 : }
11224 :
11225 0 : static PyObject *py_nbt_netlogon_request_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11226 : {
11227 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11228 0 : PyObject *mem_ctx_obj = NULL;
11229 0 : TALLOC_CTX *mem_ctx = NULL;
11230 0 : int level = 0;
11231 0 : PyObject *in = NULL;
11232 0 : union nbt_netlogon_request *out = NULL;
11233 :
11234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11235 : discard_const_p(char *, kwnames),
11236 : &mem_ctx_obj,
11237 : &level,
11238 : &in)) {
11239 0 : return NULL;
11240 : }
11241 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11242 0 : if (mem_ctx == NULL) {
11243 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11244 0 : return NULL;
11245 : }
11246 :
11247 0 : out = py_export_nbt_netlogon_request(mem_ctx, level, in);
11248 0 : if (out == NULL) {
11249 0 : return NULL;
11250 : }
11251 :
11252 0 : return pytalloc_GenericObject_reference(out);
11253 : }
11254 :
11255 : static PyMethodDef py_nbt_netlogon_request_methods[] = {
11256 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_request_import),
11257 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11258 : "T.__import__(mem_ctx, level, in) => ret." },
11259 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_request_export),
11260 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11261 : "T.__export__(mem_ctx, level, in) => ret." },
11262 : { NULL, NULL, 0, NULL }
11263 : };
11264 :
11265 0 : static PyObject *py_nbt_netlogon_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11266 : {
11267 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
11268 0 : return NULL;
11269 : }
11270 :
11271 :
11272 : static PyTypeObject nbt_netlogon_request_Type = {
11273 : PyVarObject_HEAD_INIT(NULL, 0)
11274 : .tp_name = "nbt.netlogon_request",
11275 : .tp_getset = NULL,
11276 : .tp_methods = py_nbt_netlogon_request_methods,
11277 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11278 : .tp_new = py_nbt_netlogon_request_new,
11279 : };
11280 :
11281 :
11282 0 : static PyObject *py_nbt_netlogon_packet_get_command(PyObject *obj, void *closure)
11283 : {
11284 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(obj);
11285 0 : PyObject *py_command;
11286 0 : py_command = PyLong_FromLong((uint16_t)object->command);
11287 0 : return py_command;
11288 : }
11289 :
11290 0 : static int py_nbt_netlogon_packet_set_command(PyObject *py_obj, PyObject *value, void *closure)
11291 : {
11292 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11293 0 : if (value == NULL) {
11294 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
11295 0 : return -1;
11296 : }
11297 : {
11298 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
11299 0 : if (PyLong_Check(value)) {
11300 0 : unsigned long long test_var;
11301 0 : test_var = PyLong_AsUnsignedLongLong(value);
11302 0 : if (PyErr_Occurred() != NULL) {
11303 0 : return -1;
11304 : }
11305 0 : if (test_var > uint_max) {
11306 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11307 : PyLong_Type.tp_name, uint_max, test_var);
11308 0 : return -1;
11309 : }
11310 0 : object->command = test_var;
11311 : } else {
11312 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11313 : PyLong_Type.tp_name);
11314 0 : return -1;
11315 : }
11316 : }
11317 0 : return 0;
11318 : }
11319 :
11320 0 : static PyObject *py_nbt_netlogon_packet_get_req(PyObject *obj, void *closure)
11321 : {
11322 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(obj);
11323 0 : PyObject *py_req;
11324 0 : py_req = pyrpc_import_union(&nbt_netlogon_request_Type, pytalloc_get_mem_ctx(obj), object->command, &object->req, "union nbt_netlogon_request");
11325 0 : if (py_req == NULL) {
11326 0 : return NULL;
11327 : }
11328 0 : return py_req;
11329 : }
11330 :
11331 0 : static int py_nbt_netlogon_packet_set_req(PyObject *py_obj, PyObject *value, void *closure)
11332 : {
11333 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11334 0 : if (value == NULL) {
11335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->req");
11336 0 : return -1;
11337 : }
11338 : {
11339 0 : union nbt_netlogon_request *req_switch_0;
11340 0 : req_switch_0 = (union nbt_netlogon_request *)pyrpc_export_union(&nbt_netlogon_request_Type, pytalloc_get_mem_ctx(py_obj), object->command, value, "union nbt_netlogon_request");
11341 0 : if (req_switch_0 == NULL) {
11342 0 : return -1;
11343 : }
11344 0 : object->req = *req_switch_0;
11345 : }
11346 0 : return 0;
11347 : }
11348 :
11349 : static PyGetSetDef py_nbt_netlogon_packet_getsetters[] = {
11350 : {
11351 : .name = discard_const_p(char, "command"),
11352 : .get = py_nbt_netlogon_packet_get_command,
11353 : .set = py_nbt_netlogon_packet_set_command,
11354 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
11355 : },
11356 : {
11357 : .name = discard_const_p(char, "req"),
11358 : .get = py_nbt_netlogon_packet_get_req,
11359 : .set = py_nbt_netlogon_packet_set_req,
11360 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_netlogon_request")
11361 : },
11362 : { .name = NULL }
11363 : };
11364 :
11365 0 : static PyObject *py_nbt_netlogon_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11366 : {
11367 0 : return pytalloc_new(struct nbt_netlogon_packet, type);
11368 : }
11369 :
11370 0 : static PyObject *py_nbt_netlogon_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11371 : {
11372 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11373 0 : PyObject *ret = NULL;
11374 0 : DATA_BLOB blob;
11375 0 : enum ndr_err_code err;
11376 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11377 0 : if (tmp_ctx == NULL) {
11378 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11379 0 : return NULL;
11380 : }
11381 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet);
11382 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11383 0 : TALLOC_FREE(tmp_ctx);
11384 0 : PyErr_SetNdrError(err);
11385 0 : return NULL;
11386 : }
11387 :
11388 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11389 0 : TALLOC_FREE(tmp_ctx);
11390 0 : return ret;
11391 : }
11392 :
11393 0 : static PyObject *py_nbt_netlogon_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11394 : {
11395 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11396 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11397 0 : Py_ssize_t blob_length = 0;
11398 0 : enum ndr_err_code err;
11399 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11400 0 : PyObject *allow_remaining_obj = NULL;
11401 0 : bool allow_remaining = false;
11402 :
11403 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11404 : discard_const_p(char *, kwnames),
11405 : &blob.data, &blob_length,
11406 : &allow_remaining_obj)) {
11407 0 : return NULL;
11408 : }
11409 0 : blob.length = blob_length;
11410 :
11411 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11412 0 : allow_remaining = true;
11413 : }
11414 :
11415 0 : if (allow_remaining) {
11416 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
11417 : } else {
11418 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
11419 : }
11420 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11421 0 : PyErr_SetNdrError(err);
11422 0 : return NULL;
11423 : }
11424 :
11425 0 : Py_RETURN_NONE;
11426 : }
11427 :
11428 0 : static PyObject *py_nbt_netlogon_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11429 : {
11430 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11431 0 : PyObject *ret;
11432 0 : char *retstr;
11433 :
11434 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_netlogon_packet, "nbt_netlogon_packet", object);
11435 0 : ret = PyUnicode_FromString(retstr);
11436 0 : talloc_free(retstr);
11437 :
11438 0 : return ret;
11439 : }
11440 :
11441 : static PyMethodDef py_nbt_netlogon_packet_methods[] = {
11442 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11443 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11444 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11445 : { NULL, NULL, 0, NULL }
11446 : };
11447 :
11448 :
11449 : static PyTypeObject nbt_netlogon_packet_Type = {
11450 : PyVarObject_HEAD_INIT(NULL, 0)
11451 : .tp_name = "nbt.netlogon_packet",
11452 : .tp_getset = py_nbt_netlogon_packet_getsetters,
11453 : .tp_methods = py_nbt_netlogon_packet_methods,
11454 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11455 : .tp_new = py_nbt_netlogon_packet_new,
11456 : };
11457 :
11458 :
11459 0 : static PyObject *py_nbt_browse_host_announcement_get_UpdateCount(PyObject *obj, void *closure)
11460 : {
11461 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11462 0 : PyObject *py_UpdateCount;
11463 0 : py_UpdateCount = PyLong_FromLong((uint16_t)object->UpdateCount);
11464 0 : return py_UpdateCount;
11465 : }
11466 :
11467 0 : static int py_nbt_browse_host_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
11468 : {
11469 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11470 0 : if (value == NULL) {
11471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpdateCount");
11472 0 : return -1;
11473 : }
11474 : {
11475 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
11476 0 : if (PyLong_Check(value)) {
11477 0 : unsigned long long test_var;
11478 0 : test_var = PyLong_AsUnsignedLongLong(value);
11479 0 : if (PyErr_Occurred() != NULL) {
11480 0 : return -1;
11481 : }
11482 0 : if (test_var > uint_max) {
11483 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11484 : PyLong_Type.tp_name, uint_max, test_var);
11485 0 : return -1;
11486 : }
11487 0 : object->UpdateCount = test_var;
11488 : } else {
11489 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11490 : PyLong_Type.tp_name);
11491 0 : return -1;
11492 : }
11493 : }
11494 0 : return 0;
11495 : }
11496 :
11497 0 : static PyObject *py_nbt_browse_host_announcement_get_Periodicity(PyObject *obj, void *closure)
11498 : {
11499 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11500 0 : PyObject *py_Periodicity;
11501 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)object->Periodicity);
11502 0 : return py_Periodicity;
11503 : }
11504 :
11505 0 : static int py_nbt_browse_host_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
11506 : {
11507 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11508 0 : if (value == NULL) {
11509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Periodicity");
11510 0 : return -1;
11511 : }
11512 : {
11513 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
11514 0 : if (PyLong_Check(value)) {
11515 0 : unsigned long long test_var;
11516 0 : test_var = PyLong_AsUnsignedLongLong(value);
11517 0 : if (PyErr_Occurred() != NULL) {
11518 0 : return -1;
11519 : }
11520 0 : if (test_var > uint_max) {
11521 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11522 : PyLong_Type.tp_name, uint_max, test_var);
11523 0 : return -1;
11524 : }
11525 0 : object->Periodicity = test_var;
11526 : } else {
11527 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11528 : PyLong_Type.tp_name);
11529 0 : return -1;
11530 : }
11531 : }
11532 0 : return 0;
11533 : }
11534 :
11535 0 : static PyObject *py_nbt_browse_host_announcement_get_ServerName(PyObject *obj, void *closure)
11536 : {
11537 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11538 0 : PyObject *py_ServerName;
11539 0 : if (object->ServerName == NULL) {
11540 0 : py_ServerName = Py_None;
11541 0 : Py_INCREF(py_ServerName);
11542 : } else {
11543 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
11544 : }
11545 0 : return py_ServerName;
11546 : }
11547 :
11548 0 : static int py_nbt_browse_host_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
11549 : {
11550 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11551 0 : if (value == NULL) {
11552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
11553 0 : return -1;
11554 : }
11555 : {
11556 0 : const char *test_str;
11557 0 : const char *talloc_str;
11558 0 : PyObject *unicode = NULL;
11559 0 : if (PyUnicode_Check(value)) {
11560 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11561 0 : if (unicode == NULL) {
11562 0 : return -1;
11563 : }
11564 0 : test_str = PyBytes_AS_STRING(unicode);
11565 0 : } else if (PyBytes_Check(value)) {
11566 0 : test_str = PyBytes_AS_STRING(value);
11567 : } else {
11568 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11569 0 : return -1;
11570 : }
11571 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11572 0 : if (unicode != NULL) {
11573 0 : Py_DECREF(unicode);
11574 : }
11575 0 : if (talloc_str == NULL) {
11576 0 : PyErr_NoMemory();
11577 0 : return -1;
11578 : }
11579 0 : object->ServerName = talloc_str;
11580 : }
11581 0 : return 0;
11582 : }
11583 :
11584 0 : static PyObject *py_nbt_browse_host_announcement_get_OSMajor(PyObject *obj, void *closure)
11585 : {
11586 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11587 0 : PyObject *py_OSMajor;
11588 0 : py_OSMajor = PyLong_FromLong((uint16_t)object->OSMajor);
11589 0 : return py_OSMajor;
11590 : }
11591 :
11592 0 : static int py_nbt_browse_host_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
11593 : {
11594 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11595 0 : if (value == NULL) {
11596 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMajor");
11597 0 : return -1;
11598 : }
11599 : {
11600 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
11601 0 : if (PyLong_Check(value)) {
11602 0 : unsigned long long test_var;
11603 0 : test_var = PyLong_AsUnsignedLongLong(value);
11604 0 : if (PyErr_Occurred() != NULL) {
11605 0 : return -1;
11606 : }
11607 0 : if (test_var > uint_max) {
11608 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11609 : PyLong_Type.tp_name, uint_max, test_var);
11610 0 : return -1;
11611 : }
11612 0 : object->OSMajor = test_var;
11613 : } else {
11614 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11615 : PyLong_Type.tp_name);
11616 0 : return -1;
11617 : }
11618 : }
11619 0 : return 0;
11620 : }
11621 :
11622 0 : static PyObject *py_nbt_browse_host_announcement_get_OSMinor(PyObject *obj, void *closure)
11623 : {
11624 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11625 0 : PyObject *py_OSMinor;
11626 0 : py_OSMinor = PyLong_FromLong((uint16_t)object->OSMinor);
11627 0 : return py_OSMinor;
11628 : }
11629 :
11630 0 : static int py_nbt_browse_host_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
11631 : {
11632 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11633 0 : if (value == NULL) {
11634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMinor");
11635 0 : return -1;
11636 : }
11637 : {
11638 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
11639 0 : if (PyLong_Check(value)) {
11640 0 : unsigned long long test_var;
11641 0 : test_var = PyLong_AsUnsignedLongLong(value);
11642 0 : if (PyErr_Occurred() != NULL) {
11643 0 : return -1;
11644 : }
11645 0 : if (test_var > uint_max) {
11646 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11647 : PyLong_Type.tp_name, uint_max, test_var);
11648 0 : return -1;
11649 : }
11650 0 : object->OSMinor = test_var;
11651 : } else {
11652 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11653 : PyLong_Type.tp_name);
11654 0 : return -1;
11655 : }
11656 : }
11657 0 : return 0;
11658 : }
11659 :
11660 0 : static PyObject *py_nbt_browse_host_announcement_get_ServerType(PyObject *obj, void *closure)
11661 : {
11662 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11663 0 : PyObject *py_ServerType;
11664 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)object->ServerType);
11665 0 : return py_ServerType;
11666 : }
11667 :
11668 0 : static int py_nbt_browse_host_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
11669 : {
11670 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11671 0 : if (value == NULL) {
11672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerType");
11673 0 : return -1;
11674 : }
11675 : {
11676 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
11677 0 : if (PyLong_Check(value)) {
11678 0 : unsigned long long test_var;
11679 0 : test_var = PyLong_AsUnsignedLongLong(value);
11680 0 : if (PyErr_Occurred() != NULL) {
11681 0 : return -1;
11682 : }
11683 0 : if (test_var > uint_max) {
11684 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11685 : PyLong_Type.tp_name, uint_max, test_var);
11686 0 : return -1;
11687 : }
11688 0 : object->ServerType = test_var;
11689 : } else {
11690 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11691 : PyLong_Type.tp_name);
11692 0 : return -1;
11693 : }
11694 : }
11695 0 : return 0;
11696 : }
11697 :
11698 0 : static PyObject *py_nbt_browse_host_announcement_get_BroMajorVer(PyObject *obj, void *closure)
11699 : {
11700 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11701 0 : PyObject *py_BroMajorVer;
11702 0 : py_BroMajorVer = PyLong_FromLong((uint16_t)object->BroMajorVer);
11703 0 : return py_BroMajorVer;
11704 : }
11705 :
11706 0 : static int py_nbt_browse_host_announcement_set_BroMajorVer(PyObject *py_obj, PyObject *value, void *closure)
11707 : {
11708 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11709 0 : if (value == NULL) {
11710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMajorVer");
11711 0 : return -1;
11712 : }
11713 : {
11714 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMajorVer));
11715 0 : if (PyLong_Check(value)) {
11716 0 : unsigned long long test_var;
11717 0 : test_var = PyLong_AsUnsignedLongLong(value);
11718 0 : if (PyErr_Occurred() != NULL) {
11719 0 : return -1;
11720 : }
11721 0 : if (test_var > uint_max) {
11722 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11723 : PyLong_Type.tp_name, uint_max, test_var);
11724 0 : return -1;
11725 : }
11726 0 : object->BroMajorVer = test_var;
11727 : } else {
11728 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11729 : PyLong_Type.tp_name);
11730 0 : return -1;
11731 : }
11732 : }
11733 0 : return 0;
11734 : }
11735 :
11736 0 : static PyObject *py_nbt_browse_host_announcement_get_BroMinorVer(PyObject *obj, void *closure)
11737 : {
11738 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11739 0 : PyObject *py_BroMinorVer;
11740 0 : py_BroMinorVer = PyLong_FromLong((uint16_t)object->BroMinorVer);
11741 0 : return py_BroMinorVer;
11742 : }
11743 :
11744 0 : static int py_nbt_browse_host_announcement_set_BroMinorVer(PyObject *py_obj, PyObject *value, void *closure)
11745 : {
11746 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11747 0 : if (value == NULL) {
11748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMinorVer");
11749 0 : return -1;
11750 : }
11751 : {
11752 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMinorVer));
11753 0 : if (PyLong_Check(value)) {
11754 0 : unsigned long long test_var;
11755 0 : test_var = PyLong_AsUnsignedLongLong(value);
11756 0 : if (PyErr_Occurred() != NULL) {
11757 0 : return -1;
11758 : }
11759 0 : if (test_var > uint_max) {
11760 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11761 : PyLong_Type.tp_name, uint_max, test_var);
11762 0 : return -1;
11763 : }
11764 0 : object->BroMinorVer = test_var;
11765 : } else {
11766 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11767 : PyLong_Type.tp_name);
11768 0 : return -1;
11769 : }
11770 : }
11771 0 : return 0;
11772 : }
11773 :
11774 0 : static PyObject *py_nbt_browse_host_announcement_get_Signature(PyObject *obj, void *closure)
11775 : {
11776 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11777 0 : PyObject *py_Signature;
11778 0 : py_Signature = PyLong_FromLong((uint16_t)object->Signature);
11779 0 : return py_Signature;
11780 : }
11781 :
11782 0 : static int py_nbt_browse_host_announcement_set_Signature(PyObject *py_obj, PyObject *value, void *closure)
11783 : {
11784 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11785 0 : if (value == NULL) {
11786 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Signature");
11787 0 : return -1;
11788 : }
11789 : {
11790 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Signature));
11791 0 : if (PyLong_Check(value)) {
11792 0 : unsigned long long test_var;
11793 0 : test_var = PyLong_AsUnsignedLongLong(value);
11794 0 : if (PyErr_Occurred() != NULL) {
11795 0 : return -1;
11796 : }
11797 0 : if (test_var > uint_max) {
11798 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11799 : PyLong_Type.tp_name, uint_max, test_var);
11800 0 : return -1;
11801 : }
11802 0 : object->Signature = test_var;
11803 : } else {
11804 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11805 : PyLong_Type.tp_name);
11806 0 : return -1;
11807 : }
11808 : }
11809 0 : return 0;
11810 : }
11811 :
11812 0 : static PyObject *py_nbt_browse_host_announcement_get_Comment(PyObject *obj, void *closure)
11813 : {
11814 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11815 0 : PyObject *py_Comment;
11816 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
11817 0 : return py_Comment;
11818 : }
11819 :
11820 0 : static int py_nbt_browse_host_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
11821 : {
11822 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11823 0 : if (value == NULL) {
11824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Comment");
11825 0 : return -1;
11826 : }
11827 : {
11828 0 : const char *test_str;
11829 0 : const char *talloc_str;
11830 0 : PyObject *unicode = NULL;
11831 0 : if (PyUnicode_Check(value)) {
11832 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11833 0 : if (unicode == NULL) {
11834 0 : return -1;
11835 : }
11836 0 : test_str = PyBytes_AS_STRING(unicode);
11837 0 : } else if (PyBytes_Check(value)) {
11838 0 : test_str = PyBytes_AS_STRING(value);
11839 : } else {
11840 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11841 0 : return -1;
11842 : }
11843 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11844 0 : if (unicode != NULL) {
11845 0 : Py_DECREF(unicode);
11846 : }
11847 0 : if (talloc_str == NULL) {
11848 0 : PyErr_NoMemory();
11849 0 : return -1;
11850 : }
11851 0 : object->Comment = talloc_str;
11852 : }
11853 0 : return 0;
11854 : }
11855 :
11856 : static PyGetSetDef py_nbt_browse_host_announcement_getsetters[] = {
11857 : {
11858 : .name = discard_const_p(char, "UpdateCount"),
11859 : .get = py_nbt_browse_host_announcement_get_UpdateCount,
11860 : .set = py_nbt_browse_host_announcement_set_UpdateCount,
11861 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11862 : },
11863 : {
11864 : .name = discard_const_p(char, "Periodicity"),
11865 : .get = py_nbt_browse_host_announcement_get_Periodicity,
11866 : .set = py_nbt_browse_host_announcement_set_Periodicity,
11867 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11868 : },
11869 : {
11870 : .name = discard_const_p(char, "ServerName"),
11871 : .get = py_nbt_browse_host_announcement_get_ServerName,
11872 : .set = py_nbt_browse_host_announcement_set_ServerName,
11873 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11874 : },
11875 : {
11876 : .name = discard_const_p(char, "OSMajor"),
11877 : .get = py_nbt_browse_host_announcement_get_OSMajor,
11878 : .set = py_nbt_browse_host_announcement_set_OSMajor,
11879 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11880 : },
11881 : {
11882 : .name = discard_const_p(char, "OSMinor"),
11883 : .get = py_nbt_browse_host_announcement_get_OSMinor,
11884 : .set = py_nbt_browse_host_announcement_set_OSMinor,
11885 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11886 : },
11887 : {
11888 : .name = discard_const_p(char, "ServerType"),
11889 : .get = py_nbt_browse_host_announcement_get_ServerType,
11890 : .set = py_nbt_browse_host_announcement_set_ServerType,
11891 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
11892 : },
11893 : {
11894 : .name = discard_const_p(char, "BroMajorVer"),
11895 : .get = py_nbt_browse_host_announcement_get_BroMajorVer,
11896 : .set = py_nbt_browse_host_announcement_set_BroMajorVer,
11897 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11898 : },
11899 : {
11900 : .name = discard_const_p(char, "BroMinorVer"),
11901 : .get = py_nbt_browse_host_announcement_get_BroMinorVer,
11902 : .set = py_nbt_browse_host_announcement_set_BroMinorVer,
11903 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11904 : },
11905 : {
11906 : .name = discard_const_p(char, "Signature"),
11907 : .get = py_nbt_browse_host_announcement_get_Signature,
11908 : .set = py_nbt_browse_host_announcement_set_Signature,
11909 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11910 : },
11911 : {
11912 : .name = discard_const_p(char, "Comment"),
11913 : .get = py_nbt_browse_host_announcement_get_Comment,
11914 : .set = py_nbt_browse_host_announcement_set_Comment,
11915 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11916 : },
11917 : { .name = NULL }
11918 : };
11919 :
11920 0 : static PyObject *py_nbt_browse_host_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11921 : {
11922 0 : return pytalloc_new(struct nbt_browse_host_announcement, type);
11923 : }
11924 :
11925 :
11926 : static PyTypeObject nbt_browse_host_announcement_Type = {
11927 : PyVarObject_HEAD_INIT(NULL, 0)
11928 : .tp_name = "nbt.browse_host_announcement",
11929 : .tp_getset = py_nbt_browse_host_announcement_getsetters,
11930 : .tp_methods = NULL,
11931 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11932 : .tp_new = py_nbt_browse_host_announcement_new,
11933 : };
11934 :
11935 :
11936 0 : static PyObject *py_nbt_browse_announcement_request_get_Unused(PyObject *obj, void *closure)
11937 : {
11938 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(obj);
11939 0 : PyObject *py_Unused;
11940 0 : py_Unused = PyLong_FromLong((uint16_t)object->Unused);
11941 0 : return py_Unused;
11942 : }
11943 :
11944 0 : static int py_nbt_browse_announcement_request_set_Unused(PyObject *py_obj, PyObject *value, void *closure)
11945 : {
11946 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(py_obj);
11947 0 : if (value == NULL) {
11948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Unused");
11949 0 : return -1;
11950 : }
11951 : {
11952 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Unused));
11953 0 : if (PyLong_Check(value)) {
11954 0 : unsigned long long test_var;
11955 0 : test_var = PyLong_AsUnsignedLongLong(value);
11956 0 : if (PyErr_Occurred() != NULL) {
11957 0 : return -1;
11958 : }
11959 0 : if (test_var > uint_max) {
11960 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11961 : PyLong_Type.tp_name, uint_max, test_var);
11962 0 : return -1;
11963 : }
11964 0 : object->Unused = test_var;
11965 : } else {
11966 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11967 : PyLong_Type.tp_name);
11968 0 : return -1;
11969 : }
11970 : }
11971 0 : return 0;
11972 : }
11973 :
11974 0 : static PyObject *py_nbt_browse_announcement_request_get_ResponseName(PyObject *obj, void *closure)
11975 : {
11976 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(obj);
11977 0 : PyObject *py_ResponseName;
11978 0 : py_ResponseName = PyString_FromStringOrNULL(object->ResponseName);
11979 0 : return py_ResponseName;
11980 : }
11981 :
11982 0 : static int py_nbt_browse_announcement_request_set_ResponseName(PyObject *py_obj, PyObject *value, void *closure)
11983 : {
11984 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(py_obj);
11985 0 : if (value == NULL) {
11986 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ResponseName");
11987 0 : return -1;
11988 : }
11989 : {
11990 0 : const char *test_str;
11991 0 : const char *talloc_str;
11992 0 : PyObject *unicode = NULL;
11993 0 : if (PyUnicode_Check(value)) {
11994 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11995 0 : if (unicode == NULL) {
11996 0 : return -1;
11997 : }
11998 0 : test_str = PyBytes_AS_STRING(unicode);
11999 0 : } else if (PyBytes_Check(value)) {
12000 0 : test_str = PyBytes_AS_STRING(value);
12001 : } else {
12002 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12003 0 : return -1;
12004 : }
12005 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12006 0 : if (unicode != NULL) {
12007 0 : Py_DECREF(unicode);
12008 : }
12009 0 : if (talloc_str == NULL) {
12010 0 : PyErr_NoMemory();
12011 0 : return -1;
12012 : }
12013 0 : object->ResponseName = talloc_str;
12014 : }
12015 0 : return 0;
12016 : }
12017 :
12018 : static PyGetSetDef py_nbt_browse_announcement_request_getsetters[] = {
12019 : {
12020 : .name = discard_const_p(char, "Unused"),
12021 : .get = py_nbt_browse_announcement_request_get_Unused,
12022 : .set = py_nbt_browse_announcement_request_set_Unused,
12023 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12024 : },
12025 : {
12026 : .name = discard_const_p(char, "ResponseName"),
12027 : .get = py_nbt_browse_announcement_request_get_ResponseName,
12028 : .set = py_nbt_browse_announcement_request_set_ResponseName,
12029 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12030 : },
12031 : { .name = NULL }
12032 : };
12033 :
12034 0 : static PyObject *py_nbt_browse_announcement_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12035 : {
12036 0 : return pytalloc_new(struct nbt_browse_announcement_request, type);
12037 : }
12038 :
12039 :
12040 : static PyTypeObject nbt_browse_announcement_request_Type = {
12041 : PyVarObject_HEAD_INIT(NULL, 0)
12042 : .tp_name = "nbt.browse_announcement_request",
12043 : .tp_getset = py_nbt_browse_announcement_request_getsetters,
12044 : .tp_methods = NULL,
12045 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12046 : .tp_new = py_nbt_browse_announcement_request_new,
12047 : };
12048 :
12049 :
12050 0 : static PyObject *py_nbt_browse_election_request_get_Version(PyObject *obj, void *closure)
12051 : {
12052 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12053 0 : PyObject *py_Version;
12054 0 : py_Version = PyLong_FromLong((uint16_t)object->Version);
12055 0 : return py_Version;
12056 : }
12057 :
12058 0 : static int py_nbt_browse_election_request_set_Version(PyObject *py_obj, PyObject *value, void *closure)
12059 : {
12060 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12061 0 : if (value == NULL) {
12062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Version");
12063 0 : return -1;
12064 : }
12065 : {
12066 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
12067 0 : if (PyLong_Check(value)) {
12068 0 : unsigned long long test_var;
12069 0 : test_var = PyLong_AsUnsignedLongLong(value);
12070 0 : if (PyErr_Occurred() != NULL) {
12071 0 : return -1;
12072 : }
12073 0 : if (test_var > uint_max) {
12074 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12075 : PyLong_Type.tp_name, uint_max, test_var);
12076 0 : return -1;
12077 : }
12078 0 : object->Version = test_var;
12079 : } else {
12080 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12081 : PyLong_Type.tp_name);
12082 0 : return -1;
12083 : }
12084 : }
12085 0 : return 0;
12086 : }
12087 :
12088 0 : static PyObject *py_nbt_browse_election_request_get_Criteria(PyObject *obj, void *closure)
12089 : {
12090 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12091 0 : PyObject *py_Criteria;
12092 0 : py_Criteria = PyLong_FromUnsignedLongLong((uint32_t)object->Criteria);
12093 0 : return py_Criteria;
12094 : }
12095 :
12096 0 : static int py_nbt_browse_election_request_set_Criteria(PyObject *py_obj, PyObject *value, void *closure)
12097 : {
12098 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12099 0 : if (value == NULL) {
12100 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Criteria");
12101 0 : return -1;
12102 : }
12103 : {
12104 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Criteria));
12105 0 : if (PyLong_Check(value)) {
12106 0 : unsigned long long test_var;
12107 0 : test_var = PyLong_AsUnsignedLongLong(value);
12108 0 : if (PyErr_Occurred() != NULL) {
12109 0 : return -1;
12110 : }
12111 0 : if (test_var > uint_max) {
12112 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12113 : PyLong_Type.tp_name, uint_max, test_var);
12114 0 : return -1;
12115 : }
12116 0 : object->Criteria = test_var;
12117 : } else {
12118 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12119 : PyLong_Type.tp_name);
12120 0 : return -1;
12121 : }
12122 : }
12123 0 : return 0;
12124 : }
12125 :
12126 0 : static PyObject *py_nbt_browse_election_request_get_UpTime(PyObject *obj, void *closure)
12127 : {
12128 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12129 0 : PyObject *py_UpTime;
12130 0 : py_UpTime = PyLong_FromUnsignedLongLong((uint32_t)object->UpTime);
12131 0 : return py_UpTime;
12132 : }
12133 :
12134 0 : static int py_nbt_browse_election_request_set_UpTime(PyObject *py_obj, PyObject *value, void *closure)
12135 : {
12136 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12137 0 : if (value == NULL) {
12138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpTime");
12139 0 : return -1;
12140 : }
12141 : {
12142 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpTime));
12143 0 : if (PyLong_Check(value)) {
12144 0 : unsigned long long test_var;
12145 0 : test_var = PyLong_AsUnsignedLongLong(value);
12146 0 : if (PyErr_Occurred() != NULL) {
12147 0 : return -1;
12148 : }
12149 0 : if (test_var > uint_max) {
12150 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12151 : PyLong_Type.tp_name, uint_max, test_var);
12152 0 : return -1;
12153 : }
12154 0 : object->UpTime = test_var;
12155 : } else {
12156 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12157 : PyLong_Type.tp_name);
12158 0 : return -1;
12159 : }
12160 : }
12161 0 : return 0;
12162 : }
12163 :
12164 0 : static PyObject *py_nbt_browse_election_request_get_Reserved(PyObject *obj, void *closure)
12165 : {
12166 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12167 0 : PyObject *py_Reserved;
12168 0 : py_Reserved = PyLong_FromUnsignedLongLong((uint32_t)object->Reserved);
12169 0 : return py_Reserved;
12170 : }
12171 :
12172 0 : static int py_nbt_browse_election_request_set_Reserved(PyObject *py_obj, PyObject *value, void *closure)
12173 : {
12174 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12175 0 : if (value == NULL) {
12176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Reserved");
12177 0 : return -1;
12178 : }
12179 : {
12180 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved));
12181 0 : if (PyLong_Check(value)) {
12182 0 : unsigned long long test_var;
12183 0 : test_var = PyLong_AsUnsignedLongLong(value);
12184 0 : if (PyErr_Occurred() != NULL) {
12185 0 : return -1;
12186 : }
12187 0 : if (test_var > uint_max) {
12188 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12189 : PyLong_Type.tp_name, uint_max, test_var);
12190 0 : return -1;
12191 : }
12192 0 : object->Reserved = test_var;
12193 : } else {
12194 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12195 : PyLong_Type.tp_name);
12196 0 : return -1;
12197 : }
12198 : }
12199 0 : return 0;
12200 : }
12201 :
12202 0 : static PyObject *py_nbt_browse_election_request_get_ServerName(PyObject *obj, void *closure)
12203 : {
12204 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12205 0 : PyObject *py_ServerName;
12206 0 : py_ServerName = PyString_FromStringOrNULL(object->ServerName);
12207 0 : return py_ServerName;
12208 : }
12209 :
12210 0 : static int py_nbt_browse_election_request_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
12211 : {
12212 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12213 0 : if (value == NULL) {
12214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
12215 0 : return -1;
12216 : }
12217 : {
12218 0 : const char *test_str;
12219 0 : const char *talloc_str;
12220 0 : PyObject *unicode = NULL;
12221 0 : if (PyUnicode_Check(value)) {
12222 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12223 0 : if (unicode == NULL) {
12224 0 : return -1;
12225 : }
12226 0 : test_str = PyBytes_AS_STRING(unicode);
12227 0 : } else if (PyBytes_Check(value)) {
12228 0 : test_str = PyBytes_AS_STRING(value);
12229 : } else {
12230 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12231 0 : return -1;
12232 : }
12233 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12234 0 : if (unicode != NULL) {
12235 0 : Py_DECREF(unicode);
12236 : }
12237 0 : if (talloc_str == NULL) {
12238 0 : PyErr_NoMemory();
12239 0 : return -1;
12240 : }
12241 0 : object->ServerName = talloc_str;
12242 : }
12243 0 : return 0;
12244 : }
12245 :
12246 : static PyGetSetDef py_nbt_browse_election_request_getsetters[] = {
12247 : {
12248 : .name = discard_const_p(char, "Version"),
12249 : .get = py_nbt_browse_election_request_get_Version,
12250 : .set = py_nbt_browse_election_request_set_Version,
12251 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12252 : },
12253 : {
12254 : .name = discard_const_p(char, "Criteria"),
12255 : .get = py_nbt_browse_election_request_get_Criteria,
12256 : .set = py_nbt_browse_election_request_set_Criteria,
12257 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12258 : },
12259 : {
12260 : .name = discard_const_p(char, "UpTime"),
12261 : .get = py_nbt_browse_election_request_get_UpTime,
12262 : .set = py_nbt_browse_election_request_set_UpTime,
12263 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12264 : },
12265 : {
12266 : .name = discard_const_p(char, "Reserved"),
12267 : .get = py_nbt_browse_election_request_get_Reserved,
12268 : .set = py_nbt_browse_election_request_set_Reserved,
12269 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12270 : },
12271 : {
12272 : .name = discard_const_p(char, "ServerName"),
12273 : .get = py_nbt_browse_election_request_get_ServerName,
12274 : .set = py_nbt_browse_election_request_set_ServerName,
12275 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12276 : },
12277 : { .name = NULL }
12278 : };
12279 :
12280 0 : static PyObject *py_nbt_browse_election_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12281 : {
12282 0 : return pytalloc_new(struct nbt_browse_election_request, type);
12283 : }
12284 :
12285 :
12286 : static PyTypeObject nbt_browse_election_request_Type = {
12287 : PyVarObject_HEAD_INIT(NULL, 0)
12288 : .tp_name = "nbt.browse_election_request",
12289 : .tp_getset = py_nbt_browse_election_request_getsetters,
12290 : .tp_methods = NULL,
12291 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12292 : .tp_new = py_nbt_browse_election_request_new,
12293 : };
12294 :
12295 :
12296 0 : static PyObject *py_nbt_browse_backup_list_request_get_ReqCount(PyObject *obj, void *closure)
12297 : {
12298 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(obj);
12299 0 : PyObject *py_ReqCount;
12300 0 : py_ReqCount = PyLong_FromLong((uint16_t)object->ReqCount);
12301 0 : return py_ReqCount;
12302 : }
12303 :
12304 0 : static int py_nbt_browse_backup_list_request_set_ReqCount(PyObject *py_obj, PyObject *value, void *closure)
12305 : {
12306 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(py_obj);
12307 0 : if (value == NULL) {
12308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ReqCount");
12309 0 : return -1;
12310 : }
12311 : {
12312 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReqCount));
12313 0 : if (PyLong_Check(value)) {
12314 0 : unsigned long long test_var;
12315 0 : test_var = PyLong_AsUnsignedLongLong(value);
12316 0 : if (PyErr_Occurred() != NULL) {
12317 0 : return -1;
12318 : }
12319 0 : if (test_var > uint_max) {
12320 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12321 : PyLong_Type.tp_name, uint_max, test_var);
12322 0 : return -1;
12323 : }
12324 0 : object->ReqCount = test_var;
12325 : } else {
12326 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12327 : PyLong_Type.tp_name);
12328 0 : return -1;
12329 : }
12330 : }
12331 0 : return 0;
12332 : }
12333 :
12334 0 : static PyObject *py_nbt_browse_backup_list_request_get_Token(PyObject *obj, void *closure)
12335 : {
12336 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(obj);
12337 0 : PyObject *py_Token;
12338 0 : py_Token = PyLong_FromUnsignedLongLong((uint32_t)object->Token);
12339 0 : return py_Token;
12340 : }
12341 :
12342 0 : static int py_nbt_browse_backup_list_request_set_Token(PyObject *py_obj, PyObject *value, void *closure)
12343 : {
12344 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(py_obj);
12345 0 : if (value == NULL) {
12346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Token");
12347 0 : return -1;
12348 : }
12349 : {
12350 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Token));
12351 0 : if (PyLong_Check(value)) {
12352 0 : unsigned long long test_var;
12353 0 : test_var = PyLong_AsUnsignedLongLong(value);
12354 0 : if (PyErr_Occurred() != NULL) {
12355 0 : return -1;
12356 : }
12357 0 : if (test_var > uint_max) {
12358 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12359 : PyLong_Type.tp_name, uint_max, test_var);
12360 0 : return -1;
12361 : }
12362 0 : object->Token = test_var;
12363 : } else {
12364 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12365 : PyLong_Type.tp_name);
12366 0 : return -1;
12367 : }
12368 : }
12369 0 : return 0;
12370 : }
12371 :
12372 : static PyGetSetDef py_nbt_browse_backup_list_request_getsetters[] = {
12373 : {
12374 : .name = discard_const_p(char, "ReqCount"),
12375 : .get = py_nbt_browse_backup_list_request_get_ReqCount,
12376 : .set = py_nbt_browse_backup_list_request_set_ReqCount,
12377 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12378 : },
12379 : {
12380 : .name = discard_const_p(char, "Token"),
12381 : .get = py_nbt_browse_backup_list_request_get_Token,
12382 : .set = py_nbt_browse_backup_list_request_set_Token,
12383 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12384 : },
12385 : { .name = NULL }
12386 : };
12387 :
12388 0 : static PyObject *py_nbt_browse_backup_list_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12389 : {
12390 0 : return pytalloc_new(struct nbt_browse_backup_list_request, type);
12391 : }
12392 :
12393 :
12394 : static PyTypeObject nbt_browse_backup_list_request_Type = {
12395 : PyVarObject_HEAD_INIT(NULL, 0)
12396 : .tp_name = "nbt.browse_backup_list_request",
12397 : .tp_getset = py_nbt_browse_backup_list_request_getsetters,
12398 : .tp_methods = NULL,
12399 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12400 : .tp_new = py_nbt_browse_backup_list_request_new,
12401 : };
12402 :
12403 :
12404 0 : static PyObject *py_nbt_browse_backup_list_response_get_BackupCount(PyObject *obj, void *closure)
12405 : {
12406 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(obj);
12407 0 : PyObject *py_BackupCount;
12408 0 : py_BackupCount = PyLong_FromLong((uint16_t)object->BackupCount);
12409 0 : return py_BackupCount;
12410 : }
12411 :
12412 0 : static int py_nbt_browse_backup_list_response_set_BackupCount(PyObject *py_obj, PyObject *value, void *closure)
12413 : {
12414 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(py_obj);
12415 0 : if (value == NULL) {
12416 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BackupCount");
12417 0 : return -1;
12418 : }
12419 : {
12420 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BackupCount));
12421 0 : if (PyLong_Check(value)) {
12422 0 : unsigned long long test_var;
12423 0 : test_var = PyLong_AsUnsignedLongLong(value);
12424 0 : if (PyErr_Occurred() != NULL) {
12425 0 : return -1;
12426 : }
12427 0 : if (test_var > uint_max) {
12428 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12429 : PyLong_Type.tp_name, uint_max, test_var);
12430 0 : return -1;
12431 : }
12432 0 : object->BackupCount = test_var;
12433 : } else {
12434 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12435 : PyLong_Type.tp_name);
12436 0 : return -1;
12437 : }
12438 : }
12439 0 : return 0;
12440 : }
12441 :
12442 0 : static PyObject *py_nbt_browse_backup_list_response_get_Token(PyObject *obj, void *closure)
12443 : {
12444 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(obj);
12445 0 : PyObject *py_Token;
12446 0 : py_Token = PyLong_FromUnsignedLongLong((uint32_t)object->Token);
12447 0 : return py_Token;
12448 : }
12449 :
12450 0 : static int py_nbt_browse_backup_list_response_set_Token(PyObject *py_obj, PyObject *value, void *closure)
12451 : {
12452 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(py_obj);
12453 0 : if (value == NULL) {
12454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Token");
12455 0 : return -1;
12456 : }
12457 : {
12458 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Token));
12459 0 : if (PyLong_Check(value)) {
12460 0 : unsigned long long test_var;
12461 0 : test_var = PyLong_AsUnsignedLongLong(value);
12462 0 : if (PyErr_Occurred() != NULL) {
12463 0 : return -1;
12464 : }
12465 0 : if (test_var > uint_max) {
12466 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12467 : PyLong_Type.tp_name, uint_max, test_var);
12468 0 : return -1;
12469 : }
12470 0 : object->Token = test_var;
12471 : } else {
12472 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12473 : PyLong_Type.tp_name);
12474 0 : return -1;
12475 : }
12476 : }
12477 0 : return 0;
12478 : }
12479 :
12480 0 : static PyObject *py_nbt_browse_backup_list_response_get_BackupServerList(PyObject *obj, void *closure)
12481 : {
12482 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(obj);
12483 0 : PyObject *py_BackupServerList;
12484 0 : py_BackupServerList = PyList_New(object->BackupCount);
12485 0 : if (py_BackupServerList == NULL) {
12486 0 : return NULL;
12487 : }
12488 : {
12489 : int BackupServerList_cntr_0;
12490 0 : for (BackupServerList_cntr_0 = 0; BackupServerList_cntr_0 < (object->BackupCount); BackupServerList_cntr_0++) {
12491 0 : PyObject *py_BackupServerList_0;
12492 0 : py_BackupServerList_0 = pytalloc_reference_ex(&nbt_name_Type, object->BackupServerList, &object->BackupServerList[BackupServerList_cntr_0]);
12493 0 : PyList_SetItem(py_BackupServerList, BackupServerList_cntr_0, py_BackupServerList_0);
12494 : }
12495 : }
12496 0 : return py_BackupServerList;
12497 : }
12498 :
12499 0 : static int py_nbt_browse_backup_list_response_set_BackupServerList(PyObject *py_obj, PyObject *value, void *closure)
12500 : {
12501 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(py_obj);
12502 0 : if (value == NULL) {
12503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BackupServerList");
12504 0 : return -1;
12505 : }
12506 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12507 : {
12508 0 : int BackupServerList_cntr_0;
12509 0 : object->BackupServerList = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->BackupServerList, PyList_GET_SIZE(value));
12510 0 : if (!object->BackupServerList) { return -1; }
12511 0 : talloc_set_name_const(object->BackupServerList, "ARRAY: object->BackupServerList");
12512 0 : for (BackupServerList_cntr_0 = 0; BackupServerList_cntr_0 < PyList_GET_SIZE(value); BackupServerList_cntr_0++) {
12513 0 : if (PyList_GET_ITEM(value, BackupServerList_cntr_0) == NULL) {
12514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BackupServerList[BackupServerList_cntr_0]");
12515 0 : return -1;
12516 : }
12517 0 : PY_CHECK_TYPE(&nbt_name_Type, PyList_GET_ITEM(value, BackupServerList_cntr_0), return -1;);
12518 0 : if (talloc_reference(object->BackupServerList, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, BackupServerList_cntr_0))) == NULL) {
12519 0 : PyErr_NoMemory();
12520 0 : return -1;
12521 : }
12522 0 : object->BackupServerList[BackupServerList_cntr_0] = *(struct nbt_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, BackupServerList_cntr_0));
12523 : }
12524 : }
12525 0 : return 0;
12526 : }
12527 :
12528 : static PyGetSetDef py_nbt_browse_backup_list_response_getsetters[] = {
12529 : {
12530 : .name = discard_const_p(char, "BackupCount"),
12531 : .get = py_nbt_browse_backup_list_response_get_BackupCount,
12532 : .set = py_nbt_browse_backup_list_response_set_BackupCount,
12533 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12534 : },
12535 : {
12536 : .name = discard_const_p(char, "Token"),
12537 : .get = py_nbt_browse_backup_list_response_get_Token,
12538 : .set = py_nbt_browse_backup_list_response_set_Token,
12539 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12540 : },
12541 : {
12542 : .name = discard_const_p(char, "BackupServerList"),
12543 : .get = py_nbt_browse_backup_list_response_get_BackupServerList,
12544 : .set = py_nbt_browse_backup_list_response_set_BackupServerList,
12545 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
12546 : },
12547 : { .name = NULL }
12548 : };
12549 :
12550 0 : static PyObject *py_nbt_browse_backup_list_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12551 : {
12552 0 : return pytalloc_new(struct nbt_browse_backup_list_response, type);
12553 : }
12554 :
12555 :
12556 : static PyTypeObject nbt_browse_backup_list_response_Type = {
12557 : PyVarObject_HEAD_INIT(NULL, 0)
12558 : .tp_name = "nbt.browse_backup_list_response",
12559 : .tp_getset = py_nbt_browse_backup_list_response_getsetters,
12560 : .tp_methods = NULL,
12561 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12562 : .tp_new = py_nbt_browse_backup_list_response_new,
12563 : };
12564 :
12565 :
12566 0 : static PyObject *py_nbt_browse_become_backup_get_BrowserName(PyObject *obj, void *closure)
12567 : {
12568 0 : struct nbt_browse_become_backup *object = (struct nbt_browse_become_backup *)pytalloc_get_ptr(obj);
12569 0 : PyObject *py_BrowserName;
12570 0 : py_BrowserName = PyString_FromStringOrNULL(object->BrowserName);
12571 0 : return py_BrowserName;
12572 : }
12573 :
12574 0 : static int py_nbt_browse_become_backup_set_BrowserName(PyObject *py_obj, PyObject *value, void *closure)
12575 : {
12576 0 : struct nbt_browse_become_backup *object = (struct nbt_browse_become_backup *)pytalloc_get_ptr(py_obj);
12577 0 : if (value == NULL) {
12578 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BrowserName");
12579 0 : return -1;
12580 : }
12581 : {
12582 0 : const char *test_str;
12583 0 : const char *talloc_str;
12584 0 : PyObject *unicode = NULL;
12585 0 : if (PyUnicode_Check(value)) {
12586 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12587 0 : if (unicode == NULL) {
12588 0 : return -1;
12589 : }
12590 0 : test_str = PyBytes_AS_STRING(unicode);
12591 0 : } else if (PyBytes_Check(value)) {
12592 0 : test_str = PyBytes_AS_STRING(value);
12593 : } else {
12594 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12595 0 : return -1;
12596 : }
12597 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12598 0 : if (unicode != NULL) {
12599 0 : Py_DECREF(unicode);
12600 : }
12601 0 : if (talloc_str == NULL) {
12602 0 : PyErr_NoMemory();
12603 0 : return -1;
12604 : }
12605 0 : object->BrowserName = talloc_str;
12606 : }
12607 0 : return 0;
12608 : }
12609 :
12610 : static PyGetSetDef py_nbt_browse_become_backup_getsetters[] = {
12611 : {
12612 : .name = discard_const_p(char, "BrowserName"),
12613 : .get = py_nbt_browse_become_backup_get_BrowserName,
12614 : .set = py_nbt_browse_become_backup_set_BrowserName,
12615 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12616 : },
12617 : { .name = NULL }
12618 : };
12619 :
12620 0 : static PyObject *py_nbt_browse_become_backup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12621 : {
12622 0 : return pytalloc_new(struct nbt_browse_become_backup, type);
12623 : }
12624 :
12625 :
12626 : static PyTypeObject nbt_browse_become_backup_Type = {
12627 : PyVarObject_HEAD_INIT(NULL, 0)
12628 : .tp_name = "nbt.browse_become_backup",
12629 : .tp_getset = py_nbt_browse_become_backup_getsetters,
12630 : .tp_methods = NULL,
12631 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12632 : .tp_new = py_nbt_browse_become_backup_new,
12633 : };
12634 :
12635 :
12636 0 : static PyObject *py_nbt_browse_domain_announcement_get_UpdateCount(PyObject *obj, void *closure)
12637 : {
12638 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12639 0 : PyObject *py_UpdateCount;
12640 0 : py_UpdateCount = PyLong_FromLong((uint16_t)object->UpdateCount);
12641 0 : return py_UpdateCount;
12642 : }
12643 :
12644 0 : static int py_nbt_browse_domain_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
12645 : {
12646 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12647 0 : if (value == NULL) {
12648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpdateCount");
12649 0 : return -1;
12650 : }
12651 : {
12652 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
12653 0 : if (PyLong_Check(value)) {
12654 0 : unsigned long long test_var;
12655 0 : test_var = PyLong_AsUnsignedLongLong(value);
12656 0 : if (PyErr_Occurred() != NULL) {
12657 0 : return -1;
12658 : }
12659 0 : if (test_var > uint_max) {
12660 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12661 : PyLong_Type.tp_name, uint_max, test_var);
12662 0 : return -1;
12663 : }
12664 0 : object->UpdateCount = test_var;
12665 : } else {
12666 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12667 : PyLong_Type.tp_name);
12668 0 : return -1;
12669 : }
12670 : }
12671 0 : return 0;
12672 : }
12673 :
12674 0 : static PyObject *py_nbt_browse_domain_announcement_get_Periodicity(PyObject *obj, void *closure)
12675 : {
12676 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12677 0 : PyObject *py_Periodicity;
12678 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)object->Periodicity);
12679 0 : return py_Periodicity;
12680 : }
12681 :
12682 0 : static int py_nbt_browse_domain_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
12683 : {
12684 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12685 0 : if (value == NULL) {
12686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Periodicity");
12687 0 : return -1;
12688 : }
12689 : {
12690 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
12691 0 : if (PyLong_Check(value)) {
12692 0 : unsigned long long test_var;
12693 0 : test_var = PyLong_AsUnsignedLongLong(value);
12694 0 : if (PyErr_Occurred() != NULL) {
12695 0 : return -1;
12696 : }
12697 0 : if (test_var > uint_max) {
12698 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12699 : PyLong_Type.tp_name, uint_max, test_var);
12700 0 : return -1;
12701 : }
12702 0 : object->Periodicity = test_var;
12703 : } else {
12704 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12705 : PyLong_Type.tp_name);
12706 0 : return -1;
12707 : }
12708 : }
12709 0 : return 0;
12710 : }
12711 :
12712 0 : static PyObject *py_nbt_browse_domain_announcement_get_ServerName(PyObject *obj, void *closure)
12713 : {
12714 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12715 0 : PyObject *py_ServerName;
12716 0 : if (object->ServerName == NULL) {
12717 0 : py_ServerName = Py_None;
12718 0 : Py_INCREF(py_ServerName);
12719 : } else {
12720 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
12721 : }
12722 0 : return py_ServerName;
12723 : }
12724 :
12725 0 : static int py_nbt_browse_domain_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
12726 : {
12727 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12728 0 : if (value == NULL) {
12729 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
12730 0 : return -1;
12731 : }
12732 : {
12733 0 : const char *test_str;
12734 0 : const char *talloc_str;
12735 0 : PyObject *unicode = NULL;
12736 0 : if (PyUnicode_Check(value)) {
12737 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12738 0 : if (unicode == NULL) {
12739 0 : return -1;
12740 : }
12741 0 : test_str = PyBytes_AS_STRING(unicode);
12742 0 : } else if (PyBytes_Check(value)) {
12743 0 : test_str = PyBytes_AS_STRING(value);
12744 : } else {
12745 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12746 0 : return -1;
12747 : }
12748 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12749 0 : if (unicode != NULL) {
12750 0 : Py_DECREF(unicode);
12751 : }
12752 0 : if (talloc_str == NULL) {
12753 0 : PyErr_NoMemory();
12754 0 : return -1;
12755 : }
12756 0 : object->ServerName = talloc_str;
12757 : }
12758 0 : return 0;
12759 : }
12760 :
12761 0 : static PyObject *py_nbt_browse_domain_announcement_get_OSMajor(PyObject *obj, void *closure)
12762 : {
12763 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12764 0 : PyObject *py_OSMajor;
12765 0 : py_OSMajor = PyLong_FromLong((uint16_t)object->OSMajor);
12766 0 : return py_OSMajor;
12767 : }
12768 :
12769 0 : static int py_nbt_browse_domain_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
12770 : {
12771 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12772 0 : if (value == NULL) {
12773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMajor");
12774 0 : return -1;
12775 : }
12776 : {
12777 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
12778 0 : if (PyLong_Check(value)) {
12779 0 : unsigned long long test_var;
12780 0 : test_var = PyLong_AsUnsignedLongLong(value);
12781 0 : if (PyErr_Occurred() != NULL) {
12782 0 : return -1;
12783 : }
12784 0 : if (test_var > uint_max) {
12785 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12786 : PyLong_Type.tp_name, uint_max, test_var);
12787 0 : return -1;
12788 : }
12789 0 : object->OSMajor = test_var;
12790 : } else {
12791 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12792 : PyLong_Type.tp_name);
12793 0 : return -1;
12794 : }
12795 : }
12796 0 : return 0;
12797 : }
12798 :
12799 0 : static PyObject *py_nbt_browse_domain_announcement_get_OSMinor(PyObject *obj, void *closure)
12800 : {
12801 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12802 0 : PyObject *py_OSMinor;
12803 0 : py_OSMinor = PyLong_FromLong((uint16_t)object->OSMinor);
12804 0 : return py_OSMinor;
12805 : }
12806 :
12807 0 : static int py_nbt_browse_domain_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
12808 : {
12809 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12810 0 : if (value == NULL) {
12811 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMinor");
12812 0 : return -1;
12813 : }
12814 : {
12815 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
12816 0 : if (PyLong_Check(value)) {
12817 0 : unsigned long long test_var;
12818 0 : test_var = PyLong_AsUnsignedLongLong(value);
12819 0 : if (PyErr_Occurred() != NULL) {
12820 0 : return -1;
12821 : }
12822 0 : if (test_var > uint_max) {
12823 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12824 : PyLong_Type.tp_name, uint_max, test_var);
12825 0 : return -1;
12826 : }
12827 0 : object->OSMinor = test_var;
12828 : } else {
12829 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12830 : PyLong_Type.tp_name);
12831 0 : return -1;
12832 : }
12833 : }
12834 0 : return 0;
12835 : }
12836 :
12837 0 : static PyObject *py_nbt_browse_domain_announcement_get_ServerType(PyObject *obj, void *closure)
12838 : {
12839 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12840 0 : PyObject *py_ServerType;
12841 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)object->ServerType);
12842 0 : return py_ServerType;
12843 : }
12844 :
12845 0 : static int py_nbt_browse_domain_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
12846 : {
12847 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12848 0 : if (value == NULL) {
12849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerType");
12850 0 : return -1;
12851 : }
12852 : {
12853 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
12854 0 : if (PyLong_Check(value)) {
12855 0 : unsigned long long test_var;
12856 0 : test_var = PyLong_AsUnsignedLongLong(value);
12857 0 : if (PyErr_Occurred() != NULL) {
12858 0 : return -1;
12859 : }
12860 0 : if (test_var > uint_max) {
12861 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12862 : PyLong_Type.tp_name, uint_max, test_var);
12863 0 : return -1;
12864 : }
12865 0 : object->ServerType = test_var;
12866 : } else {
12867 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12868 : PyLong_Type.tp_name);
12869 0 : return -1;
12870 : }
12871 : }
12872 0 : return 0;
12873 : }
12874 :
12875 0 : static PyObject *py_nbt_browse_domain_announcement_get_MysteriousField(PyObject *obj, void *closure)
12876 : {
12877 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12878 0 : PyObject *py_MysteriousField;
12879 0 : py_MysteriousField = PyLong_FromUnsignedLongLong((uint32_t)object->MysteriousField);
12880 0 : return py_MysteriousField;
12881 : }
12882 :
12883 0 : static int py_nbt_browse_domain_announcement_set_MysteriousField(PyObject *py_obj, PyObject *value, void *closure)
12884 : {
12885 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12886 0 : if (value == NULL) {
12887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MysteriousField");
12888 0 : return -1;
12889 : }
12890 : {
12891 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MysteriousField));
12892 0 : if (PyLong_Check(value)) {
12893 0 : unsigned long long test_var;
12894 0 : test_var = PyLong_AsUnsignedLongLong(value);
12895 0 : if (PyErr_Occurred() != NULL) {
12896 0 : return -1;
12897 : }
12898 0 : if (test_var > uint_max) {
12899 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12900 : PyLong_Type.tp_name, uint_max, test_var);
12901 0 : return -1;
12902 : }
12903 0 : object->MysteriousField = test_var;
12904 : } else {
12905 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12906 : PyLong_Type.tp_name);
12907 0 : return -1;
12908 : }
12909 : }
12910 0 : return 0;
12911 : }
12912 :
12913 0 : static PyObject *py_nbt_browse_domain_announcement_get_Comment(PyObject *obj, void *closure)
12914 : {
12915 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12916 0 : PyObject *py_Comment;
12917 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
12918 0 : return py_Comment;
12919 : }
12920 :
12921 0 : static int py_nbt_browse_domain_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
12922 : {
12923 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12924 0 : if (value == NULL) {
12925 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Comment");
12926 0 : return -1;
12927 : }
12928 : {
12929 0 : const char *test_str;
12930 0 : const char *talloc_str;
12931 0 : PyObject *unicode = NULL;
12932 0 : if (PyUnicode_Check(value)) {
12933 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12934 0 : if (unicode == NULL) {
12935 0 : return -1;
12936 : }
12937 0 : test_str = PyBytes_AS_STRING(unicode);
12938 0 : } else if (PyBytes_Check(value)) {
12939 0 : test_str = PyBytes_AS_STRING(value);
12940 : } else {
12941 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12942 0 : return -1;
12943 : }
12944 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12945 0 : if (unicode != NULL) {
12946 0 : Py_DECREF(unicode);
12947 : }
12948 0 : if (talloc_str == NULL) {
12949 0 : PyErr_NoMemory();
12950 0 : return -1;
12951 : }
12952 0 : object->Comment = talloc_str;
12953 : }
12954 0 : return 0;
12955 : }
12956 :
12957 : static PyGetSetDef py_nbt_browse_domain_announcement_getsetters[] = {
12958 : {
12959 : .name = discard_const_p(char, "UpdateCount"),
12960 : .get = py_nbt_browse_domain_announcement_get_UpdateCount,
12961 : .set = py_nbt_browse_domain_announcement_set_UpdateCount,
12962 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12963 : },
12964 : {
12965 : .name = discard_const_p(char, "Periodicity"),
12966 : .get = py_nbt_browse_domain_announcement_get_Periodicity,
12967 : .set = py_nbt_browse_domain_announcement_set_Periodicity,
12968 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12969 : },
12970 : {
12971 : .name = discard_const_p(char, "ServerName"),
12972 : .get = py_nbt_browse_domain_announcement_get_ServerName,
12973 : .set = py_nbt_browse_domain_announcement_set_ServerName,
12974 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12975 : },
12976 : {
12977 : .name = discard_const_p(char, "OSMajor"),
12978 : .get = py_nbt_browse_domain_announcement_get_OSMajor,
12979 : .set = py_nbt_browse_domain_announcement_set_OSMajor,
12980 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12981 : },
12982 : {
12983 : .name = discard_const_p(char, "OSMinor"),
12984 : .get = py_nbt_browse_domain_announcement_get_OSMinor,
12985 : .set = py_nbt_browse_domain_announcement_set_OSMinor,
12986 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12987 : },
12988 : {
12989 : .name = discard_const_p(char, "ServerType"),
12990 : .get = py_nbt_browse_domain_announcement_get_ServerType,
12991 : .set = py_nbt_browse_domain_announcement_set_ServerType,
12992 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
12993 : },
12994 : {
12995 : .name = discard_const_p(char, "MysteriousField"),
12996 : .get = py_nbt_browse_domain_announcement_get_MysteriousField,
12997 : .set = py_nbt_browse_domain_announcement_set_MysteriousField,
12998 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12999 : },
13000 : {
13001 : .name = discard_const_p(char, "Comment"),
13002 : .get = py_nbt_browse_domain_announcement_get_Comment,
13003 : .set = py_nbt_browse_domain_announcement_set_Comment,
13004 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13005 : },
13006 : { .name = NULL }
13007 : };
13008 :
13009 0 : static PyObject *py_nbt_browse_domain_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13010 : {
13011 0 : return pytalloc_new(struct nbt_browse_domain_announcement, type);
13012 : }
13013 :
13014 :
13015 : static PyTypeObject nbt_browse_domain_announcement_Type = {
13016 : PyVarObject_HEAD_INIT(NULL, 0)
13017 : .tp_name = "nbt.browse_domain_announcement",
13018 : .tp_getset = py_nbt_browse_domain_announcement_getsetters,
13019 : .tp_methods = NULL,
13020 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13021 : .tp_new = py_nbt_browse_domain_announcement_new,
13022 : };
13023 :
13024 :
13025 0 : static PyObject *py_nbt_browse_master_announcement_get_ServerName(PyObject *obj, void *closure)
13026 : {
13027 0 : struct nbt_browse_master_announcement *object = (struct nbt_browse_master_announcement *)pytalloc_get_ptr(obj);
13028 0 : PyObject *py_ServerName;
13029 0 : py_ServerName = PyString_FromStringOrNULL(object->ServerName);
13030 0 : return py_ServerName;
13031 : }
13032 :
13033 0 : static int py_nbt_browse_master_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
13034 : {
13035 0 : struct nbt_browse_master_announcement *object = (struct nbt_browse_master_announcement *)pytalloc_get_ptr(py_obj);
13036 0 : if (value == NULL) {
13037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
13038 0 : return -1;
13039 : }
13040 : {
13041 0 : const char *test_str;
13042 0 : const char *talloc_str;
13043 0 : PyObject *unicode = NULL;
13044 0 : if (PyUnicode_Check(value)) {
13045 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13046 0 : if (unicode == NULL) {
13047 0 : return -1;
13048 : }
13049 0 : test_str = PyBytes_AS_STRING(unicode);
13050 0 : } else if (PyBytes_Check(value)) {
13051 0 : test_str = PyBytes_AS_STRING(value);
13052 : } else {
13053 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13054 0 : return -1;
13055 : }
13056 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13057 0 : if (unicode != NULL) {
13058 0 : Py_DECREF(unicode);
13059 : }
13060 0 : if (talloc_str == NULL) {
13061 0 : PyErr_NoMemory();
13062 0 : return -1;
13063 : }
13064 0 : object->ServerName = talloc_str;
13065 : }
13066 0 : return 0;
13067 : }
13068 :
13069 : static PyGetSetDef py_nbt_browse_master_announcement_getsetters[] = {
13070 : {
13071 : .name = discard_const_p(char, "ServerName"),
13072 : .get = py_nbt_browse_master_announcement_get_ServerName,
13073 : .set = py_nbt_browse_master_announcement_set_ServerName,
13074 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13075 : },
13076 : { .name = NULL }
13077 : };
13078 :
13079 0 : static PyObject *py_nbt_browse_master_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13080 : {
13081 0 : return pytalloc_new(struct nbt_browse_master_announcement, type);
13082 : }
13083 :
13084 :
13085 : static PyTypeObject nbt_browse_master_announcement_Type = {
13086 : PyVarObject_HEAD_INIT(NULL, 0)
13087 : .tp_name = "nbt.browse_master_announcement",
13088 : .tp_getset = py_nbt_browse_master_announcement_getsetters,
13089 : .tp_methods = NULL,
13090 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13091 : .tp_new = py_nbt_browse_master_announcement_new,
13092 : };
13093 :
13094 :
13095 0 : static PyObject *py_nbt_browse_reset_state_get_Command(PyObject *obj, void *closure)
13096 : {
13097 0 : struct nbt_browse_reset_state *object = (struct nbt_browse_reset_state *)pytalloc_get_ptr(obj);
13098 0 : PyObject *py_Command;
13099 0 : py_Command = PyLong_FromLong((uint16_t)object->Command);
13100 0 : return py_Command;
13101 : }
13102 :
13103 0 : static int py_nbt_browse_reset_state_set_Command(PyObject *py_obj, PyObject *value, void *closure)
13104 : {
13105 0 : struct nbt_browse_reset_state *object = (struct nbt_browse_reset_state *)pytalloc_get_ptr(py_obj);
13106 0 : if (value == NULL) {
13107 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Command");
13108 0 : return -1;
13109 : }
13110 : {
13111 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Command));
13112 0 : if (PyLong_Check(value)) {
13113 0 : unsigned long long test_var;
13114 0 : test_var = PyLong_AsUnsignedLongLong(value);
13115 0 : if (PyErr_Occurred() != NULL) {
13116 0 : return -1;
13117 : }
13118 0 : if (test_var > uint_max) {
13119 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13120 : PyLong_Type.tp_name, uint_max, test_var);
13121 0 : return -1;
13122 : }
13123 0 : object->Command = test_var;
13124 : } else {
13125 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13126 : PyLong_Type.tp_name);
13127 0 : return -1;
13128 : }
13129 : }
13130 0 : return 0;
13131 : }
13132 :
13133 : static PyGetSetDef py_nbt_browse_reset_state_getsetters[] = {
13134 : {
13135 : .name = discard_const_p(char, "Command"),
13136 : .get = py_nbt_browse_reset_state_get_Command,
13137 : .set = py_nbt_browse_reset_state_set_Command,
13138 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13139 : },
13140 : { .name = NULL }
13141 : };
13142 :
13143 0 : static PyObject *py_nbt_browse_reset_state_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13144 : {
13145 0 : return pytalloc_new(struct nbt_browse_reset_state, type);
13146 : }
13147 :
13148 :
13149 : static PyTypeObject nbt_browse_reset_state_Type = {
13150 : PyVarObject_HEAD_INIT(NULL, 0)
13151 : .tp_name = "nbt.browse_reset_state",
13152 : .tp_getset = py_nbt_browse_reset_state_getsetters,
13153 : .tp_methods = NULL,
13154 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13155 : .tp_new = py_nbt_browse_reset_state_new,
13156 : };
13157 :
13158 :
13159 0 : static PyObject *py_nbt_browse_local_master_announcement_get_UpdateCount(PyObject *obj, void *closure)
13160 : {
13161 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13162 0 : PyObject *py_UpdateCount;
13163 0 : py_UpdateCount = PyLong_FromLong((uint16_t)object->UpdateCount);
13164 0 : return py_UpdateCount;
13165 : }
13166 :
13167 0 : static int py_nbt_browse_local_master_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
13168 : {
13169 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13170 0 : if (value == NULL) {
13171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpdateCount");
13172 0 : return -1;
13173 : }
13174 : {
13175 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
13176 0 : if (PyLong_Check(value)) {
13177 0 : unsigned long long test_var;
13178 0 : test_var = PyLong_AsUnsignedLongLong(value);
13179 0 : if (PyErr_Occurred() != NULL) {
13180 0 : return -1;
13181 : }
13182 0 : if (test_var > uint_max) {
13183 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13184 : PyLong_Type.tp_name, uint_max, test_var);
13185 0 : return -1;
13186 : }
13187 0 : object->UpdateCount = test_var;
13188 : } else {
13189 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13190 : PyLong_Type.tp_name);
13191 0 : return -1;
13192 : }
13193 : }
13194 0 : return 0;
13195 : }
13196 :
13197 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Periodicity(PyObject *obj, void *closure)
13198 : {
13199 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13200 0 : PyObject *py_Periodicity;
13201 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)object->Periodicity);
13202 0 : return py_Periodicity;
13203 : }
13204 :
13205 0 : static int py_nbt_browse_local_master_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
13206 : {
13207 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13208 0 : if (value == NULL) {
13209 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Periodicity");
13210 0 : return -1;
13211 : }
13212 : {
13213 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
13214 0 : if (PyLong_Check(value)) {
13215 0 : unsigned long long test_var;
13216 0 : test_var = PyLong_AsUnsignedLongLong(value);
13217 0 : if (PyErr_Occurred() != NULL) {
13218 0 : return -1;
13219 : }
13220 0 : if (test_var > uint_max) {
13221 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13222 : PyLong_Type.tp_name, uint_max, test_var);
13223 0 : return -1;
13224 : }
13225 0 : object->Periodicity = test_var;
13226 : } else {
13227 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13228 : PyLong_Type.tp_name);
13229 0 : return -1;
13230 : }
13231 : }
13232 0 : return 0;
13233 : }
13234 :
13235 0 : static PyObject *py_nbt_browse_local_master_announcement_get_ServerName(PyObject *obj, void *closure)
13236 : {
13237 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13238 0 : PyObject *py_ServerName;
13239 0 : if (object->ServerName == NULL) {
13240 0 : py_ServerName = Py_None;
13241 0 : Py_INCREF(py_ServerName);
13242 : } else {
13243 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
13244 : }
13245 0 : return py_ServerName;
13246 : }
13247 :
13248 0 : static int py_nbt_browse_local_master_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
13249 : {
13250 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13251 0 : if (value == NULL) {
13252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
13253 0 : return -1;
13254 : }
13255 : {
13256 0 : const char *test_str;
13257 0 : const char *talloc_str;
13258 0 : PyObject *unicode = NULL;
13259 0 : if (PyUnicode_Check(value)) {
13260 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13261 0 : if (unicode == NULL) {
13262 0 : return -1;
13263 : }
13264 0 : test_str = PyBytes_AS_STRING(unicode);
13265 0 : } else if (PyBytes_Check(value)) {
13266 0 : test_str = PyBytes_AS_STRING(value);
13267 : } else {
13268 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13269 0 : return -1;
13270 : }
13271 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13272 0 : if (unicode != NULL) {
13273 0 : Py_DECREF(unicode);
13274 : }
13275 0 : if (talloc_str == NULL) {
13276 0 : PyErr_NoMemory();
13277 0 : return -1;
13278 : }
13279 0 : object->ServerName = talloc_str;
13280 : }
13281 0 : return 0;
13282 : }
13283 :
13284 0 : static PyObject *py_nbt_browse_local_master_announcement_get_OSMajor(PyObject *obj, void *closure)
13285 : {
13286 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13287 0 : PyObject *py_OSMajor;
13288 0 : py_OSMajor = PyLong_FromLong((uint16_t)object->OSMajor);
13289 0 : return py_OSMajor;
13290 : }
13291 :
13292 0 : static int py_nbt_browse_local_master_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
13293 : {
13294 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13295 0 : if (value == NULL) {
13296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMajor");
13297 0 : return -1;
13298 : }
13299 : {
13300 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
13301 0 : if (PyLong_Check(value)) {
13302 0 : unsigned long long test_var;
13303 0 : test_var = PyLong_AsUnsignedLongLong(value);
13304 0 : if (PyErr_Occurred() != NULL) {
13305 0 : return -1;
13306 : }
13307 0 : if (test_var > uint_max) {
13308 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13309 : PyLong_Type.tp_name, uint_max, test_var);
13310 0 : return -1;
13311 : }
13312 0 : object->OSMajor = test_var;
13313 : } else {
13314 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13315 : PyLong_Type.tp_name);
13316 0 : return -1;
13317 : }
13318 : }
13319 0 : return 0;
13320 : }
13321 :
13322 0 : static PyObject *py_nbt_browse_local_master_announcement_get_OSMinor(PyObject *obj, void *closure)
13323 : {
13324 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13325 0 : PyObject *py_OSMinor;
13326 0 : py_OSMinor = PyLong_FromLong((uint16_t)object->OSMinor);
13327 0 : return py_OSMinor;
13328 : }
13329 :
13330 0 : static int py_nbt_browse_local_master_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
13331 : {
13332 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13333 0 : if (value == NULL) {
13334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMinor");
13335 0 : return -1;
13336 : }
13337 : {
13338 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
13339 0 : if (PyLong_Check(value)) {
13340 0 : unsigned long long test_var;
13341 0 : test_var = PyLong_AsUnsignedLongLong(value);
13342 0 : if (PyErr_Occurred() != NULL) {
13343 0 : return -1;
13344 : }
13345 0 : if (test_var > uint_max) {
13346 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13347 : PyLong_Type.tp_name, uint_max, test_var);
13348 0 : return -1;
13349 : }
13350 0 : object->OSMinor = test_var;
13351 : } else {
13352 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13353 : PyLong_Type.tp_name);
13354 0 : return -1;
13355 : }
13356 : }
13357 0 : return 0;
13358 : }
13359 :
13360 0 : static PyObject *py_nbt_browse_local_master_announcement_get_ServerType(PyObject *obj, void *closure)
13361 : {
13362 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13363 0 : PyObject *py_ServerType;
13364 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)object->ServerType);
13365 0 : return py_ServerType;
13366 : }
13367 :
13368 0 : static int py_nbt_browse_local_master_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
13369 : {
13370 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13371 0 : if (value == NULL) {
13372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerType");
13373 0 : return -1;
13374 : }
13375 : {
13376 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
13377 0 : if (PyLong_Check(value)) {
13378 0 : unsigned long long test_var;
13379 0 : test_var = PyLong_AsUnsignedLongLong(value);
13380 0 : if (PyErr_Occurred() != NULL) {
13381 0 : return -1;
13382 : }
13383 0 : if (test_var > uint_max) {
13384 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13385 : PyLong_Type.tp_name, uint_max, test_var);
13386 0 : return -1;
13387 : }
13388 0 : object->ServerType = test_var;
13389 : } else {
13390 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13391 : PyLong_Type.tp_name);
13392 0 : return -1;
13393 : }
13394 : }
13395 0 : return 0;
13396 : }
13397 :
13398 0 : static PyObject *py_nbt_browse_local_master_announcement_get_BroMajorVer(PyObject *obj, void *closure)
13399 : {
13400 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13401 0 : PyObject *py_BroMajorVer;
13402 0 : py_BroMajorVer = PyLong_FromLong((uint16_t)object->BroMajorVer);
13403 0 : return py_BroMajorVer;
13404 : }
13405 :
13406 0 : static int py_nbt_browse_local_master_announcement_set_BroMajorVer(PyObject *py_obj, PyObject *value, void *closure)
13407 : {
13408 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13409 0 : if (value == NULL) {
13410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMajorVer");
13411 0 : return -1;
13412 : }
13413 : {
13414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMajorVer));
13415 0 : if (PyLong_Check(value)) {
13416 0 : unsigned long long test_var;
13417 0 : test_var = PyLong_AsUnsignedLongLong(value);
13418 0 : if (PyErr_Occurred() != NULL) {
13419 0 : return -1;
13420 : }
13421 0 : if (test_var > uint_max) {
13422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13423 : PyLong_Type.tp_name, uint_max, test_var);
13424 0 : return -1;
13425 : }
13426 0 : object->BroMajorVer = test_var;
13427 : } else {
13428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13429 : PyLong_Type.tp_name);
13430 0 : return -1;
13431 : }
13432 : }
13433 0 : return 0;
13434 : }
13435 :
13436 0 : static PyObject *py_nbt_browse_local_master_announcement_get_BroMinorVer(PyObject *obj, void *closure)
13437 : {
13438 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13439 0 : PyObject *py_BroMinorVer;
13440 0 : py_BroMinorVer = PyLong_FromLong((uint16_t)object->BroMinorVer);
13441 0 : return py_BroMinorVer;
13442 : }
13443 :
13444 0 : static int py_nbt_browse_local_master_announcement_set_BroMinorVer(PyObject *py_obj, PyObject *value, void *closure)
13445 : {
13446 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13447 0 : if (value == NULL) {
13448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMinorVer");
13449 0 : return -1;
13450 : }
13451 : {
13452 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMinorVer));
13453 0 : if (PyLong_Check(value)) {
13454 0 : unsigned long long test_var;
13455 0 : test_var = PyLong_AsUnsignedLongLong(value);
13456 0 : if (PyErr_Occurred() != NULL) {
13457 0 : return -1;
13458 : }
13459 0 : if (test_var > uint_max) {
13460 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13461 : PyLong_Type.tp_name, uint_max, test_var);
13462 0 : return -1;
13463 : }
13464 0 : object->BroMinorVer = test_var;
13465 : } else {
13466 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13467 : PyLong_Type.tp_name);
13468 0 : return -1;
13469 : }
13470 : }
13471 0 : return 0;
13472 : }
13473 :
13474 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Signature(PyObject *obj, void *closure)
13475 : {
13476 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13477 0 : PyObject *py_Signature;
13478 0 : py_Signature = PyLong_FromLong((uint16_t)object->Signature);
13479 0 : return py_Signature;
13480 : }
13481 :
13482 0 : static int py_nbt_browse_local_master_announcement_set_Signature(PyObject *py_obj, PyObject *value, void *closure)
13483 : {
13484 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13485 0 : if (value == NULL) {
13486 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Signature");
13487 0 : return -1;
13488 : }
13489 : {
13490 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Signature));
13491 0 : if (PyLong_Check(value)) {
13492 0 : unsigned long long test_var;
13493 0 : test_var = PyLong_AsUnsignedLongLong(value);
13494 0 : if (PyErr_Occurred() != NULL) {
13495 0 : return -1;
13496 : }
13497 0 : if (test_var > uint_max) {
13498 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13499 : PyLong_Type.tp_name, uint_max, test_var);
13500 0 : return -1;
13501 : }
13502 0 : object->Signature = test_var;
13503 : } else {
13504 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13505 : PyLong_Type.tp_name);
13506 0 : return -1;
13507 : }
13508 : }
13509 0 : return 0;
13510 : }
13511 :
13512 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Comment(PyObject *obj, void *closure)
13513 : {
13514 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13515 0 : PyObject *py_Comment;
13516 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
13517 0 : return py_Comment;
13518 : }
13519 :
13520 0 : static int py_nbt_browse_local_master_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
13521 : {
13522 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13523 0 : if (value == NULL) {
13524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Comment");
13525 0 : return -1;
13526 : }
13527 : {
13528 0 : const char *test_str;
13529 0 : const char *talloc_str;
13530 0 : PyObject *unicode = NULL;
13531 0 : if (PyUnicode_Check(value)) {
13532 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13533 0 : if (unicode == NULL) {
13534 0 : return -1;
13535 : }
13536 0 : test_str = PyBytes_AS_STRING(unicode);
13537 0 : } else if (PyBytes_Check(value)) {
13538 0 : test_str = PyBytes_AS_STRING(value);
13539 : } else {
13540 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13541 0 : return -1;
13542 : }
13543 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13544 0 : if (unicode != NULL) {
13545 0 : Py_DECREF(unicode);
13546 : }
13547 0 : if (talloc_str == NULL) {
13548 0 : PyErr_NoMemory();
13549 0 : return -1;
13550 : }
13551 0 : object->Comment = talloc_str;
13552 : }
13553 0 : return 0;
13554 : }
13555 :
13556 : static PyGetSetDef py_nbt_browse_local_master_announcement_getsetters[] = {
13557 : {
13558 : .name = discard_const_p(char, "UpdateCount"),
13559 : .get = py_nbt_browse_local_master_announcement_get_UpdateCount,
13560 : .set = py_nbt_browse_local_master_announcement_set_UpdateCount,
13561 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13562 : },
13563 : {
13564 : .name = discard_const_p(char, "Periodicity"),
13565 : .get = py_nbt_browse_local_master_announcement_get_Periodicity,
13566 : .set = py_nbt_browse_local_master_announcement_set_Periodicity,
13567 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13568 : },
13569 : {
13570 : .name = discard_const_p(char, "ServerName"),
13571 : .get = py_nbt_browse_local_master_announcement_get_ServerName,
13572 : .set = py_nbt_browse_local_master_announcement_set_ServerName,
13573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13574 : },
13575 : {
13576 : .name = discard_const_p(char, "OSMajor"),
13577 : .get = py_nbt_browse_local_master_announcement_get_OSMajor,
13578 : .set = py_nbt_browse_local_master_announcement_set_OSMajor,
13579 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13580 : },
13581 : {
13582 : .name = discard_const_p(char, "OSMinor"),
13583 : .get = py_nbt_browse_local_master_announcement_get_OSMinor,
13584 : .set = py_nbt_browse_local_master_announcement_set_OSMinor,
13585 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13586 : },
13587 : {
13588 : .name = discard_const_p(char, "ServerType"),
13589 : .get = py_nbt_browse_local_master_announcement_get_ServerType,
13590 : .set = py_nbt_browse_local_master_announcement_set_ServerType,
13591 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
13592 : },
13593 : {
13594 : .name = discard_const_p(char, "BroMajorVer"),
13595 : .get = py_nbt_browse_local_master_announcement_get_BroMajorVer,
13596 : .set = py_nbt_browse_local_master_announcement_set_BroMajorVer,
13597 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13598 : },
13599 : {
13600 : .name = discard_const_p(char, "BroMinorVer"),
13601 : .get = py_nbt_browse_local_master_announcement_get_BroMinorVer,
13602 : .set = py_nbt_browse_local_master_announcement_set_BroMinorVer,
13603 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13604 : },
13605 : {
13606 : .name = discard_const_p(char, "Signature"),
13607 : .get = py_nbt_browse_local_master_announcement_get_Signature,
13608 : .set = py_nbt_browse_local_master_announcement_set_Signature,
13609 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13610 : },
13611 : {
13612 : .name = discard_const_p(char, "Comment"),
13613 : .get = py_nbt_browse_local_master_announcement_get_Comment,
13614 : .set = py_nbt_browse_local_master_announcement_set_Comment,
13615 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13616 : },
13617 : { .name = NULL }
13618 : };
13619 :
13620 0 : static PyObject *py_nbt_browse_local_master_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13621 : {
13622 0 : return pytalloc_new(struct nbt_browse_local_master_announcement, type);
13623 : }
13624 :
13625 :
13626 : static PyTypeObject nbt_browse_local_master_announcement_Type = {
13627 : PyVarObject_HEAD_INIT(NULL, 0)
13628 : .tp_name = "nbt.browse_local_master_announcement",
13629 : .tp_getset = py_nbt_browse_local_master_announcement_getsetters,
13630 : .tp_methods = NULL,
13631 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13632 : .tp_new = py_nbt_browse_local_master_announcement_new,
13633 : };
13634 :
13635 0 : static PyObject *py_import_nbt_browse_payload(TALLOC_CTX *mem_ctx, int level, union nbt_browse_payload *in)
13636 : {
13637 0 : PyObject *ret;
13638 :
13639 0 : switch (level) {
13640 0 : case HostAnnouncement:
13641 0 : ret = pytalloc_reference_ex(&nbt_browse_host_announcement_Type, mem_ctx, &in->host_annoucement);
13642 0 : return ret;
13643 :
13644 0 : case AnnouncementRequest:
13645 0 : ret = pytalloc_reference_ex(&nbt_browse_announcement_request_Type, mem_ctx, &in->announcement_request);
13646 0 : return ret;
13647 :
13648 0 : case Election:
13649 0 : ret = pytalloc_reference_ex(&nbt_browse_election_request_Type, mem_ctx, &in->election_request);
13650 0 : return ret;
13651 :
13652 0 : case GetBackupListReq:
13653 0 : ret = pytalloc_reference_ex(&nbt_browse_backup_list_request_Type, mem_ctx, &in->backup_list_request);
13654 0 : return ret;
13655 :
13656 0 : case GetBackupListResp:
13657 0 : ret = pytalloc_reference_ex(&nbt_browse_backup_list_response_Type, mem_ctx, &in->backup_list_response);
13658 0 : return ret;
13659 :
13660 0 : case BecomeBackup:
13661 0 : ret = pytalloc_reference_ex(&nbt_browse_become_backup_Type, mem_ctx, &in->become_backup);
13662 0 : return ret;
13663 :
13664 0 : case DomainAnnouncement:
13665 0 : ret = pytalloc_reference_ex(&nbt_browse_domain_announcement_Type, mem_ctx, &in->domain_announcement);
13666 0 : return ret;
13667 :
13668 0 : case MasterAnnouncement:
13669 0 : ret = pytalloc_reference_ex(&nbt_browse_master_announcement_Type, mem_ctx, &in->master_announcement);
13670 0 : return ret;
13671 :
13672 0 : case ResetBrowserState:
13673 0 : ret = pytalloc_reference_ex(&nbt_browse_reset_state_Type, mem_ctx, &in->reset_browser_state);
13674 0 : return ret;
13675 :
13676 0 : case LocalMasterAnnouncement:
13677 0 : ret = pytalloc_reference_ex(&nbt_browse_local_master_announcement_Type, mem_ctx, &in->local_master_announcement);
13678 0 : return ret;
13679 :
13680 : }
13681 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
13682 0 : return NULL;
13683 : }
13684 :
13685 0 : static union nbt_browse_payload *py_export_nbt_browse_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in)
13686 : {
13687 0 : union nbt_browse_payload *ret = talloc_zero(mem_ctx, union nbt_browse_payload);
13688 0 : switch (level) {
13689 0 : case HostAnnouncement:
13690 0 : if (in == NULL) {
13691 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->host_annoucement");
13692 0 : talloc_free(ret); return NULL;
13693 : }
13694 0 : PY_CHECK_TYPE(&nbt_browse_host_announcement_Type, in, talloc_free(ret); return NULL;);
13695 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13696 0 : PyErr_NoMemory();
13697 0 : talloc_free(ret); return NULL;
13698 : }
13699 0 : ret->host_annoucement = *(struct nbt_browse_host_announcement *)pytalloc_get_ptr(in);
13700 0 : break;
13701 :
13702 0 : case AnnouncementRequest:
13703 0 : if (in == NULL) {
13704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->announcement_request");
13705 0 : talloc_free(ret); return NULL;
13706 : }
13707 0 : PY_CHECK_TYPE(&nbt_browse_announcement_request_Type, in, talloc_free(ret); return NULL;);
13708 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13709 0 : PyErr_NoMemory();
13710 0 : talloc_free(ret); return NULL;
13711 : }
13712 0 : ret->announcement_request = *(struct nbt_browse_announcement_request *)pytalloc_get_ptr(in);
13713 0 : break;
13714 :
13715 0 : case Election:
13716 0 : if (in == NULL) {
13717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->election_request");
13718 0 : talloc_free(ret); return NULL;
13719 : }
13720 0 : PY_CHECK_TYPE(&nbt_browse_election_request_Type, in, talloc_free(ret); return NULL;);
13721 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13722 0 : PyErr_NoMemory();
13723 0 : talloc_free(ret); return NULL;
13724 : }
13725 0 : ret->election_request = *(struct nbt_browse_election_request *)pytalloc_get_ptr(in);
13726 0 : break;
13727 :
13728 0 : case GetBackupListReq:
13729 0 : if (in == NULL) {
13730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->backup_list_request");
13731 0 : talloc_free(ret); return NULL;
13732 : }
13733 0 : PY_CHECK_TYPE(&nbt_browse_backup_list_request_Type, in, talloc_free(ret); return NULL;);
13734 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13735 0 : PyErr_NoMemory();
13736 0 : talloc_free(ret); return NULL;
13737 : }
13738 0 : ret->backup_list_request = *(struct nbt_browse_backup_list_request *)pytalloc_get_ptr(in);
13739 0 : break;
13740 :
13741 0 : case GetBackupListResp:
13742 0 : if (in == NULL) {
13743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->backup_list_response");
13744 0 : talloc_free(ret); return NULL;
13745 : }
13746 0 : PY_CHECK_TYPE(&nbt_browse_backup_list_response_Type, in, talloc_free(ret); return NULL;);
13747 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13748 0 : PyErr_NoMemory();
13749 0 : talloc_free(ret); return NULL;
13750 : }
13751 0 : ret->backup_list_response = *(struct nbt_browse_backup_list_response *)pytalloc_get_ptr(in);
13752 0 : break;
13753 :
13754 0 : case BecomeBackup:
13755 0 : if (in == NULL) {
13756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->become_backup");
13757 0 : talloc_free(ret); return NULL;
13758 : }
13759 0 : PY_CHECK_TYPE(&nbt_browse_become_backup_Type, in, talloc_free(ret); return NULL;);
13760 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13761 0 : PyErr_NoMemory();
13762 0 : talloc_free(ret); return NULL;
13763 : }
13764 0 : ret->become_backup = *(struct nbt_browse_become_backup *)pytalloc_get_ptr(in);
13765 0 : break;
13766 :
13767 0 : case DomainAnnouncement:
13768 0 : if (in == NULL) {
13769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain_announcement");
13770 0 : talloc_free(ret); return NULL;
13771 : }
13772 0 : PY_CHECK_TYPE(&nbt_browse_domain_announcement_Type, in, talloc_free(ret); return NULL;);
13773 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13774 0 : PyErr_NoMemory();
13775 0 : talloc_free(ret); return NULL;
13776 : }
13777 0 : ret->domain_announcement = *(struct nbt_browse_domain_announcement *)pytalloc_get_ptr(in);
13778 0 : break;
13779 :
13780 0 : case MasterAnnouncement:
13781 0 : if (in == NULL) {
13782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->master_announcement");
13783 0 : talloc_free(ret); return NULL;
13784 : }
13785 0 : PY_CHECK_TYPE(&nbt_browse_master_announcement_Type, in, talloc_free(ret); return NULL;);
13786 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13787 0 : PyErr_NoMemory();
13788 0 : talloc_free(ret); return NULL;
13789 : }
13790 0 : ret->master_announcement = *(struct nbt_browse_master_announcement *)pytalloc_get_ptr(in);
13791 0 : break;
13792 :
13793 0 : case ResetBrowserState:
13794 0 : if (in == NULL) {
13795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->reset_browser_state");
13796 0 : talloc_free(ret); return NULL;
13797 : }
13798 0 : PY_CHECK_TYPE(&nbt_browse_reset_state_Type, in, talloc_free(ret); return NULL;);
13799 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13800 0 : PyErr_NoMemory();
13801 0 : talloc_free(ret); return NULL;
13802 : }
13803 0 : ret->reset_browser_state = *(struct nbt_browse_reset_state *)pytalloc_get_ptr(in);
13804 0 : break;
13805 :
13806 0 : case LocalMasterAnnouncement:
13807 0 : if (in == NULL) {
13808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->local_master_announcement");
13809 0 : talloc_free(ret); return NULL;
13810 : }
13811 0 : PY_CHECK_TYPE(&nbt_browse_local_master_announcement_Type, in, talloc_free(ret); return NULL;);
13812 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13813 0 : PyErr_NoMemory();
13814 0 : talloc_free(ret); return NULL;
13815 : }
13816 0 : ret->local_master_announcement = *(struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(in);
13817 0 : break;
13818 :
13819 0 : default:
13820 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
13821 0 : talloc_free(ret);
13822 0 : ret = NULL;
13823 : }
13824 :
13825 0 : return ret;
13826 : }
13827 :
13828 0 : static PyObject *py_nbt_browse_payload_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13829 : {
13830 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13831 0 : PyObject *mem_ctx_obj = NULL;
13832 0 : TALLOC_CTX *mem_ctx = NULL;
13833 0 : int level = 0;
13834 0 : PyObject *in_obj = NULL;
13835 0 : union nbt_browse_payload *in = NULL;
13836 :
13837 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
13838 : discard_const_p(char *, kwnames),
13839 : &mem_ctx_obj,
13840 : &level,
13841 : &in_obj)) {
13842 0 : return NULL;
13843 : }
13844 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13845 0 : if (mem_ctx == NULL) {
13846 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13847 0 : return NULL;
13848 : }
13849 0 : in = (union nbt_browse_payload *)pytalloc_get_ptr(in_obj);
13850 0 : if (in == NULL) {
13851 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_browse_payload!");
13852 0 : return NULL;
13853 : }
13854 :
13855 0 : return py_import_nbt_browse_payload(mem_ctx, level, in);
13856 : }
13857 :
13858 0 : static PyObject *py_nbt_browse_payload_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13859 : {
13860 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13861 0 : PyObject *mem_ctx_obj = NULL;
13862 0 : TALLOC_CTX *mem_ctx = NULL;
13863 0 : int level = 0;
13864 0 : PyObject *in = NULL;
13865 0 : union nbt_browse_payload *out = NULL;
13866 :
13867 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
13868 : discard_const_p(char *, kwnames),
13869 : &mem_ctx_obj,
13870 : &level,
13871 : &in)) {
13872 0 : return NULL;
13873 : }
13874 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13875 0 : if (mem_ctx == NULL) {
13876 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13877 0 : return NULL;
13878 : }
13879 :
13880 0 : out = py_export_nbt_browse_payload(mem_ctx, level, in);
13881 0 : if (out == NULL) {
13882 0 : return NULL;
13883 : }
13884 :
13885 0 : return pytalloc_GenericObject_reference(out);
13886 : }
13887 :
13888 : static PyMethodDef py_nbt_browse_payload_methods[] = {
13889 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_payload_import),
13890 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13891 : "T.__import__(mem_ctx, level, in) => ret." },
13892 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_payload_export),
13893 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13894 : "T.__export__(mem_ctx, level, in) => ret." },
13895 : { NULL, NULL, 0, NULL }
13896 : };
13897 :
13898 0 : static PyObject *py_nbt_browse_payload_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13899 : {
13900 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
13901 0 : return NULL;
13902 : }
13903 :
13904 :
13905 : static PyTypeObject nbt_browse_payload_Type = {
13906 : PyVarObject_HEAD_INIT(NULL, 0)
13907 : .tp_name = "nbt.browse_payload",
13908 : .tp_getset = NULL,
13909 : .tp_methods = py_nbt_browse_payload_methods,
13910 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13911 : .tp_new = py_nbt_browse_payload_new,
13912 : };
13913 :
13914 :
13915 0 : static PyObject *py_nbt_browse_packet_get_opcode(PyObject *obj, void *closure)
13916 : {
13917 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(obj);
13918 0 : PyObject *py_opcode;
13919 0 : py_opcode = PyLong_FromLong((uint16_t)object->opcode);
13920 0 : return py_opcode;
13921 : }
13922 :
13923 0 : static int py_nbt_browse_packet_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
13924 : {
13925 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
13926 0 : if (value == NULL) {
13927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->opcode");
13928 0 : return -1;
13929 : }
13930 : {
13931 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
13932 0 : if (PyLong_Check(value)) {
13933 0 : unsigned long long test_var;
13934 0 : test_var = PyLong_AsUnsignedLongLong(value);
13935 0 : if (PyErr_Occurred() != NULL) {
13936 0 : return -1;
13937 : }
13938 0 : if (test_var > uint_max) {
13939 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13940 : PyLong_Type.tp_name, uint_max, test_var);
13941 0 : return -1;
13942 : }
13943 0 : object->opcode = test_var;
13944 : } else {
13945 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13946 : PyLong_Type.tp_name);
13947 0 : return -1;
13948 : }
13949 : }
13950 0 : return 0;
13951 : }
13952 :
13953 0 : static PyObject *py_nbt_browse_packet_get_payload(PyObject *obj, void *closure)
13954 : {
13955 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(obj);
13956 0 : PyObject *py_payload;
13957 0 : py_payload = pyrpc_import_union(&nbt_browse_payload_Type, pytalloc_get_mem_ctx(obj), object->opcode, &object->payload, "union nbt_browse_payload");
13958 0 : if (py_payload == NULL) {
13959 0 : return NULL;
13960 : }
13961 0 : return py_payload;
13962 : }
13963 :
13964 0 : static int py_nbt_browse_packet_set_payload(PyObject *py_obj, PyObject *value, void *closure)
13965 : {
13966 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
13967 0 : if (value == NULL) {
13968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->payload");
13969 0 : return -1;
13970 : }
13971 : {
13972 0 : union nbt_browse_payload *payload_switch_0;
13973 0 : payload_switch_0 = (union nbt_browse_payload *)pyrpc_export_union(&nbt_browse_payload_Type, pytalloc_get_mem_ctx(py_obj), object->opcode, value, "union nbt_browse_payload");
13974 0 : if (payload_switch_0 == NULL) {
13975 0 : return -1;
13976 : }
13977 0 : object->payload = *payload_switch_0;
13978 : }
13979 0 : return 0;
13980 : }
13981 :
13982 : static PyGetSetDef py_nbt_browse_packet_getsetters[] = {
13983 : {
13984 : .name = discard_const_p(char, "opcode"),
13985 : .get = py_nbt_browse_packet_get_opcode,
13986 : .set = py_nbt_browse_packet_set_opcode,
13987 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_browse_opcode")
13988 : },
13989 : {
13990 : .name = discard_const_p(char, "payload"),
13991 : .get = py_nbt_browse_packet_get_payload,
13992 : .set = py_nbt_browse_packet_set_payload,
13993 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_browse_payload")
13994 : },
13995 : { .name = NULL }
13996 : };
13997 :
13998 0 : static PyObject *py_nbt_browse_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13999 : {
14000 0 : return pytalloc_new(struct nbt_browse_packet, type);
14001 : }
14002 :
14003 0 : static PyObject *py_nbt_browse_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14004 : {
14005 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14006 0 : PyObject *ret = NULL;
14007 0 : DATA_BLOB blob;
14008 0 : enum ndr_err_code err;
14009 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
14010 0 : if (tmp_ctx == NULL) {
14011 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14012 0 : return NULL;
14013 : }
14014 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_browse_packet);
14015 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14016 0 : TALLOC_FREE(tmp_ctx);
14017 0 : PyErr_SetNdrError(err);
14018 0 : return NULL;
14019 : }
14020 :
14021 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14022 0 : TALLOC_FREE(tmp_ctx);
14023 0 : return ret;
14024 : }
14025 :
14026 0 : static PyObject *py_nbt_browse_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14027 : {
14028 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14029 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
14030 0 : Py_ssize_t blob_length = 0;
14031 0 : enum ndr_err_code err;
14032 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
14033 0 : PyObject *allow_remaining_obj = NULL;
14034 0 : bool allow_remaining = false;
14035 :
14036 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
14037 : discard_const_p(char *, kwnames),
14038 : &blob.data, &blob_length,
14039 : &allow_remaining_obj)) {
14040 0 : return NULL;
14041 : }
14042 0 : blob.length = blob_length;
14043 :
14044 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14045 0 : allow_remaining = true;
14046 : }
14047 :
14048 0 : if (allow_remaining) {
14049 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_browse_packet);
14050 : } else {
14051 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_browse_packet);
14052 : }
14053 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14054 0 : PyErr_SetNdrError(err);
14055 0 : return NULL;
14056 : }
14057 :
14058 0 : Py_RETURN_NONE;
14059 : }
14060 :
14061 0 : static PyObject *py_nbt_browse_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14062 : {
14063 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14064 0 : PyObject *ret;
14065 0 : char *retstr;
14066 :
14067 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_browse_packet, "nbt_browse_packet", object);
14068 0 : ret = PyUnicode_FromString(retstr);
14069 0 : talloc_free(retstr);
14070 :
14071 0 : return ret;
14072 : }
14073 :
14074 : static PyMethodDef py_nbt_browse_packet_methods[] = {
14075 : { "__ndr_pack__", (PyCFunction)py_nbt_browse_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
14076 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
14077 : { "__ndr_print__", (PyCFunction)py_nbt_browse_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
14078 : { NULL, NULL, 0, NULL }
14079 : };
14080 :
14081 :
14082 : static PyTypeObject nbt_browse_packet_Type = {
14083 : PyVarObject_HEAD_INIT(NULL, 0)
14084 : .tp_name = "nbt.browse_packet",
14085 : .tp_getset = py_nbt_browse_packet_getsetters,
14086 : .tp_methods = py_nbt_browse_packet_methods,
14087 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14088 : .tp_new = py_nbt_browse_packet_new,
14089 : };
14090 :
14091 :
14092 : const struct PyNdrRpcMethodDef py_ndr_nbt_methods[] = {
14093 : {0}
14094 : };
14095 :
14096 0 : static PyObject *interface_nbt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14097 : {
14098 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_nbt);
14099 : }
14100 :
14101 : #define PY_DOC_NBT "NBT messages"
14102 : static PyTypeObject nbt_InterfaceType = {
14103 : PyVarObject_HEAD_INIT(NULL, 0)
14104 : .tp_name = "nbt.nbt",
14105 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
14106 : .tp_doc = "nbt(binding, lp_ctx=None, credentials=None) -> connection\n"
14107 : "\n"
14108 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
14109 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
14110 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_NBT,
14111 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14112 : .tp_new = interface_nbt_new,
14113 : };
14114 :
14115 0 : static PyObject *syntax_nbt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14116 : {
14117 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_nbt.syntax_id);
14118 : }
14119 :
14120 : #define PY_DOC_NBT_SYNTAX "NBT messages"
14121 : static PyTypeObject nbt_SyntaxType = {
14122 : PyVarObject_HEAD_INIT(NULL, 0)
14123 : .tp_name = "nbt.nbt_abstract_syntax",
14124 : .tp_doc = "nbt_abstract_syntax()\n"PY_DOC_NBT_SYNTAX,
14125 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14126 : .tp_new = syntax_nbt_new,
14127 : };
14128 :
14129 : static PyMethodDef nbt_methods[] = {
14130 : { NULL, NULL, 0, NULL }
14131 : };
14132 :
14133 : static struct PyModuleDef moduledef = {
14134 : PyModuleDef_HEAD_INIT,
14135 : .m_name = "nbt",
14136 : .m_doc = "nbt DCE/RPC",
14137 : .m_size = -1,
14138 : .m_methods = nbt_methods,
14139 : };
14140 4620 : MODULE_INIT_FUNC(nbt)
14141 : {
14142 4620 : PyObject *m = NULL;
14143 4620 : PyObject *dep_samba_dcerpc_misc = NULL;
14144 4620 : PyObject *dep_samba_dcerpc_security = NULL;
14145 4620 : PyObject *dep_talloc = NULL;
14146 4620 : PyObject *dep_samba_dcerpc_base = NULL;
14147 :
14148 4620 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
14149 4620 : if (dep_samba_dcerpc_misc == NULL)
14150 0 : goto out;
14151 :
14152 4620 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
14153 4620 : if (dep_samba_dcerpc_security == NULL)
14154 0 : goto out;
14155 :
14156 4620 : dep_talloc = PyImport_ImportModule("talloc");
14157 4620 : if (dep_talloc == NULL)
14158 0 : goto out;
14159 :
14160 4620 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
14161 4620 : if (dep_samba_dcerpc_base == NULL)
14162 0 : goto out;
14163 :
14164 4620 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
14165 4620 : if (BaseObject_Type == NULL)
14166 0 : goto out;
14167 :
14168 4620 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
14169 4620 : if (dom_sid_Type == NULL)
14170 0 : goto out;
14171 :
14172 4620 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
14173 4620 : if (GUID_Type == NULL)
14174 0 : goto out;
14175 :
14176 4620 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
14177 4620 : if (ClientConnection_Type == NULL)
14178 0 : goto out;
14179 :
14180 4620 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
14181 4620 : if (ndr_syntax_id_Type == NULL)
14182 0 : goto out;
14183 :
14184 4620 : nbt_name_Type.tp_base = BaseObject_Type;
14185 4620 : nbt_name_Type.tp_basicsize = pytalloc_BaseObject_size();
14186 :
14187 4620 : nbt_name_question_Type.tp_base = BaseObject_Type;
14188 4620 : nbt_name_question_Type.tp_basicsize = pytalloc_BaseObject_size();
14189 :
14190 4620 : nbt_rdata_address_Type.tp_base = BaseObject_Type;
14191 4620 : nbt_rdata_address_Type.tp_basicsize = pytalloc_BaseObject_size();
14192 :
14193 4620 : nbt_rdata_netbios_Type.tp_base = BaseObject_Type;
14194 4620 : nbt_rdata_netbios_Type.tp_basicsize = pytalloc_BaseObject_size();
14195 :
14196 4620 : nbt_statistics_Type.tp_base = BaseObject_Type;
14197 4620 : nbt_statistics_Type.tp_basicsize = pytalloc_BaseObject_size();
14198 :
14199 4620 : nbt_status_name_Type.tp_base = BaseObject_Type;
14200 4620 : nbt_status_name_Type.tp_basicsize = pytalloc_BaseObject_size();
14201 :
14202 4620 : nbt_rdata_status_Type.tp_base = BaseObject_Type;
14203 4620 : nbt_rdata_status_Type.tp_basicsize = pytalloc_BaseObject_size();
14204 :
14205 4620 : nbt_rdata_data_Type.tp_base = BaseObject_Type;
14206 4620 : nbt_rdata_data_Type.tp_basicsize = pytalloc_BaseObject_size();
14207 :
14208 4620 : nbt_rdata_Type.tp_base = BaseObject_Type;
14209 4620 : nbt_rdata_Type.tp_basicsize = pytalloc_BaseObject_size();
14210 :
14211 4620 : nbt_res_rec_Type.tp_base = BaseObject_Type;
14212 4620 : nbt_res_rec_Type.tp_basicsize = pytalloc_BaseObject_size();
14213 :
14214 4620 : nbt_name_packet_Type.tp_base = BaseObject_Type;
14215 4620 : nbt_name_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14216 :
14217 4620 : smb_trans_body_Type.tp_base = BaseObject_Type;
14218 4620 : smb_trans_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14219 :
14220 4620 : smb_body_Type.tp_base = BaseObject_Type;
14221 4620 : smb_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14222 :
14223 4620 : dgram_smb_packet_Type.tp_base = BaseObject_Type;
14224 4620 : dgram_smb_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14225 :
14226 4620 : dgram_message_body_Type.tp_base = BaseObject_Type;
14227 4620 : dgram_message_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14228 :
14229 4620 : dgram_message_Type.tp_base = BaseObject_Type;
14230 4620 : dgram_message_Type.tp_basicsize = pytalloc_BaseObject_size();
14231 :
14232 4620 : dgram_data_Type.tp_base = BaseObject_Type;
14233 4620 : dgram_data_Type.tp_basicsize = pytalloc_BaseObject_size();
14234 :
14235 4620 : nbt_dgram_packet_Type.tp_base = BaseObject_Type;
14236 4620 : nbt_dgram_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14237 :
14238 4620 : nbt_sockaddr_Type.tp_base = BaseObject_Type;
14239 4620 : nbt_sockaddr_Type.tp_basicsize = pytalloc_BaseObject_size();
14240 :
14241 4620 : NETLOGON_SAM_LOGON_REQUEST_Type.tp_base = BaseObject_Type;
14242 4620 : NETLOGON_SAM_LOGON_REQUEST_Type.tp_basicsize = pytalloc_BaseObject_size();
14243 :
14244 4620 : NETLOGON_LOGON_REQUEST_Type.tp_base = BaseObject_Type;
14245 4620 : NETLOGON_LOGON_REQUEST_Type.tp_basicsize = pytalloc_BaseObject_size();
14246 :
14247 4620 : NETLOGON_SAM_LOGON_RESPONSE_NT40_Type.tp_base = BaseObject_Type;
14248 4620 : NETLOGON_SAM_LOGON_RESPONSE_NT40_Type.tp_basicsize = pytalloc_BaseObject_size();
14249 :
14250 4620 : NETLOGON_SAM_LOGON_RESPONSE_Type.tp_base = BaseObject_Type;
14251 4620 : NETLOGON_SAM_LOGON_RESPONSE_Type.tp_basicsize = pytalloc_BaseObject_size();
14252 :
14253 4620 : NETLOGON_SAM_LOGON_RESPONSE_EX_Type.tp_base = BaseObject_Type;
14254 4620 : NETLOGON_SAM_LOGON_RESPONSE_EX_Type.tp_basicsize = pytalloc_BaseObject_size();
14255 :
14256 4620 : netlogon_samlogon_response_union_Type.tp_base = BaseObject_Type;
14257 4620 : netlogon_samlogon_response_union_Type.tp_basicsize = pytalloc_BaseObject_size();
14258 :
14259 4620 : netlogon_samlogon_response_Type.tp_base = BaseObject_Type;
14260 4620 : netlogon_samlogon_response_Type.tp_basicsize = pytalloc_BaseObject_size();
14261 :
14262 4620 : nbt_netlogon_query_for_pdc_Type.tp_base = BaseObject_Type;
14263 4620 : nbt_netlogon_query_for_pdc_Type.tp_basicsize = pytalloc_BaseObject_size();
14264 :
14265 4620 : nbt_netlogon_response_from_pdc_Type.tp_base = BaseObject_Type;
14266 4620 : nbt_netlogon_response_from_pdc_Type.tp_basicsize = pytalloc_BaseObject_size();
14267 :
14268 4620 : nbt_netlogon_response2_Type.tp_base = BaseObject_Type;
14269 4620 : nbt_netlogon_response2_Type.tp_basicsize = pytalloc_BaseObject_size();
14270 :
14271 4620 : nbt_db_change_info_Type.tp_base = BaseObject_Type;
14272 4620 : nbt_db_change_info_Type.tp_basicsize = pytalloc_BaseObject_size();
14273 :
14274 4620 : NETLOGON_DB_CHANGE_Type.tp_base = BaseObject_Type;
14275 4620 : NETLOGON_DB_CHANGE_Type.tp_basicsize = pytalloc_BaseObject_size();
14276 :
14277 4620 : nbt_netlogon_request_Type.tp_base = BaseObject_Type;
14278 4620 : nbt_netlogon_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14279 :
14280 4620 : nbt_netlogon_packet_Type.tp_base = BaseObject_Type;
14281 4620 : nbt_netlogon_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14282 :
14283 4620 : nbt_browse_host_announcement_Type.tp_base = BaseObject_Type;
14284 4620 : nbt_browse_host_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14285 :
14286 4620 : nbt_browse_announcement_request_Type.tp_base = BaseObject_Type;
14287 4620 : nbt_browse_announcement_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14288 :
14289 4620 : nbt_browse_election_request_Type.tp_base = BaseObject_Type;
14290 4620 : nbt_browse_election_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14291 :
14292 4620 : nbt_browse_backup_list_request_Type.tp_base = BaseObject_Type;
14293 4620 : nbt_browse_backup_list_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14294 :
14295 4620 : nbt_browse_backup_list_response_Type.tp_base = BaseObject_Type;
14296 4620 : nbt_browse_backup_list_response_Type.tp_basicsize = pytalloc_BaseObject_size();
14297 :
14298 4620 : nbt_browse_become_backup_Type.tp_base = BaseObject_Type;
14299 4620 : nbt_browse_become_backup_Type.tp_basicsize = pytalloc_BaseObject_size();
14300 :
14301 4620 : nbt_browse_domain_announcement_Type.tp_base = BaseObject_Type;
14302 4620 : nbt_browse_domain_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14303 :
14304 4620 : nbt_browse_master_announcement_Type.tp_base = BaseObject_Type;
14305 4620 : nbt_browse_master_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14306 :
14307 4620 : nbt_browse_reset_state_Type.tp_base = BaseObject_Type;
14308 4620 : nbt_browse_reset_state_Type.tp_basicsize = pytalloc_BaseObject_size();
14309 :
14310 4620 : nbt_browse_local_master_announcement_Type.tp_base = BaseObject_Type;
14311 4620 : nbt_browse_local_master_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14312 :
14313 4620 : nbt_browse_payload_Type.tp_base = BaseObject_Type;
14314 4620 : nbt_browse_payload_Type.tp_basicsize = pytalloc_BaseObject_size();
14315 :
14316 4620 : nbt_browse_packet_Type.tp_base = BaseObject_Type;
14317 4620 : nbt_browse_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14318 :
14319 4620 : nbt_InterfaceType.tp_base = ClientConnection_Type;
14320 :
14321 4620 : nbt_SyntaxType.tp_base = ndr_syntax_id_Type;
14322 4620 : nbt_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
14323 :
14324 4620 : if (PyType_Ready(&nbt_name_Type) < 0)
14325 0 : goto out;
14326 4620 : if (PyType_Ready(&nbt_name_question_Type) < 0)
14327 0 : goto out;
14328 4620 : if (PyType_Ready(&nbt_rdata_address_Type) < 0)
14329 0 : goto out;
14330 4620 : if (PyType_Ready(&nbt_rdata_netbios_Type) < 0)
14331 0 : goto out;
14332 4620 : if (PyType_Ready(&nbt_statistics_Type) < 0)
14333 0 : goto out;
14334 4620 : if (PyType_Ready(&nbt_status_name_Type) < 0)
14335 0 : goto out;
14336 4620 : if (PyType_Ready(&nbt_rdata_status_Type) < 0)
14337 0 : goto out;
14338 4620 : if (PyType_Ready(&nbt_rdata_data_Type) < 0)
14339 0 : goto out;
14340 4620 : if (PyType_Ready(&nbt_rdata_Type) < 0)
14341 0 : goto out;
14342 4620 : if (PyType_Ready(&nbt_res_rec_Type) < 0)
14343 0 : goto out;
14344 4620 : if (PyType_Ready(&nbt_name_packet_Type) < 0)
14345 0 : goto out;
14346 4620 : if (PyType_Ready(&smb_trans_body_Type) < 0)
14347 0 : goto out;
14348 4620 : if (PyType_Ready(&smb_body_Type) < 0)
14349 0 : goto out;
14350 4620 : if (PyType_Ready(&dgram_smb_packet_Type) < 0)
14351 0 : goto out;
14352 4620 : if (PyType_Ready(&dgram_message_body_Type) < 0)
14353 0 : goto out;
14354 4620 : if (PyType_Ready(&dgram_message_Type) < 0)
14355 0 : goto out;
14356 4620 : if (PyType_Ready(&dgram_data_Type) < 0)
14357 0 : goto out;
14358 4620 : if (PyType_Ready(&nbt_dgram_packet_Type) < 0)
14359 0 : goto out;
14360 4620 : if (PyType_Ready(&nbt_sockaddr_Type) < 0)
14361 0 : goto out;
14362 4620 : if (PyType_Ready(&NETLOGON_SAM_LOGON_REQUEST_Type) < 0)
14363 0 : goto out;
14364 4620 : if (PyType_Ready(&NETLOGON_LOGON_REQUEST_Type) < 0)
14365 0 : goto out;
14366 4620 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type) < 0)
14367 0 : goto out;
14368 4620 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_Type) < 0)
14369 0 : goto out;
14370 4620 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type) < 0)
14371 0 : goto out;
14372 4620 : if (PyType_Ready(&netlogon_samlogon_response_union_Type) < 0)
14373 0 : goto out;
14374 4620 : if (PyType_Ready(&netlogon_samlogon_response_Type) < 0)
14375 0 : goto out;
14376 4620 : if (PyType_Ready(&nbt_netlogon_query_for_pdc_Type) < 0)
14377 0 : goto out;
14378 4620 : if (PyType_Ready(&nbt_netlogon_response_from_pdc_Type) < 0)
14379 0 : goto out;
14380 4620 : if (PyType_Ready(&nbt_netlogon_response2_Type) < 0)
14381 0 : goto out;
14382 4620 : if (PyType_Ready(&nbt_db_change_info_Type) < 0)
14383 0 : goto out;
14384 4620 : if (PyType_Ready(&NETLOGON_DB_CHANGE_Type) < 0)
14385 0 : goto out;
14386 4620 : if (PyType_Ready(&nbt_netlogon_request_Type) < 0)
14387 0 : goto out;
14388 4620 : if (PyType_Ready(&nbt_netlogon_packet_Type) < 0)
14389 0 : goto out;
14390 4620 : if (PyType_Ready(&nbt_browse_host_announcement_Type) < 0)
14391 0 : goto out;
14392 4620 : if (PyType_Ready(&nbt_browse_announcement_request_Type) < 0)
14393 0 : goto out;
14394 4620 : if (PyType_Ready(&nbt_browse_election_request_Type) < 0)
14395 0 : goto out;
14396 4620 : if (PyType_Ready(&nbt_browse_backup_list_request_Type) < 0)
14397 0 : goto out;
14398 4620 : if (PyType_Ready(&nbt_browse_backup_list_response_Type) < 0)
14399 0 : goto out;
14400 4620 : if (PyType_Ready(&nbt_browse_become_backup_Type) < 0)
14401 0 : goto out;
14402 4620 : if (PyType_Ready(&nbt_browse_domain_announcement_Type) < 0)
14403 0 : goto out;
14404 4620 : if (PyType_Ready(&nbt_browse_master_announcement_Type) < 0)
14405 0 : goto out;
14406 4620 : if (PyType_Ready(&nbt_browse_reset_state_Type) < 0)
14407 0 : goto out;
14408 4620 : if (PyType_Ready(&nbt_browse_local_master_announcement_Type) < 0)
14409 0 : goto out;
14410 4620 : if (PyType_Ready(&nbt_browse_payload_Type) < 0)
14411 0 : goto out;
14412 4620 : if (PyType_Ready(&nbt_browse_packet_Type) < 0)
14413 0 : goto out;
14414 4620 : if (PyType_Ready(&nbt_InterfaceType) < 0)
14415 0 : goto out;
14416 4620 : if (PyType_Ready(&nbt_SyntaxType) < 0)
14417 0 : goto out;
14418 4620 : if (!PyInterface_AddNdrRpcMethods(&nbt_InterfaceType, py_ndr_nbt_methods))
14419 0 : return NULL;
14420 :
14421 : #ifdef PY_NAME_PATCH
14422 : PY_NAME_PATCH(&nbt_name_Type);
14423 : #endif
14424 : #ifdef PY_NAME_QUESTION_PATCH
14425 : PY_NAME_QUESTION_PATCH(&nbt_name_question_Type);
14426 : #endif
14427 : #ifdef PY_RDATA_ADDRESS_PATCH
14428 : PY_RDATA_ADDRESS_PATCH(&nbt_rdata_address_Type);
14429 : #endif
14430 : #ifdef PY_RDATA_NETBIOS_PATCH
14431 : PY_RDATA_NETBIOS_PATCH(&nbt_rdata_netbios_Type);
14432 : #endif
14433 : #ifdef PY_STATISTICS_PATCH
14434 : PY_STATISTICS_PATCH(&nbt_statistics_Type);
14435 : #endif
14436 : #ifdef PY_STATUS_NAME_PATCH
14437 : PY_STATUS_NAME_PATCH(&nbt_status_name_Type);
14438 : #endif
14439 : #ifdef PY_RDATA_STATUS_PATCH
14440 : PY_RDATA_STATUS_PATCH(&nbt_rdata_status_Type);
14441 : #endif
14442 : #ifdef PY_RDATA_DATA_PATCH
14443 : PY_RDATA_DATA_PATCH(&nbt_rdata_data_Type);
14444 : #endif
14445 : #ifdef PY_RDATA_PATCH
14446 : PY_RDATA_PATCH(&nbt_rdata_Type);
14447 : #endif
14448 : #ifdef PY_RES_REC_PATCH
14449 : PY_RES_REC_PATCH(&nbt_res_rec_Type);
14450 : #endif
14451 : #ifdef PY_NAME_PACKET_PATCH
14452 : PY_NAME_PACKET_PATCH(&nbt_name_packet_Type);
14453 : #endif
14454 : #ifdef PY_SMB_TRANS_BODY_PATCH
14455 : PY_SMB_TRANS_BODY_PATCH(&smb_trans_body_Type);
14456 : #endif
14457 : #ifdef PY_SMB_BODY_PATCH
14458 : PY_SMB_BODY_PATCH(&smb_body_Type);
14459 : #endif
14460 : #ifdef PY_DGRAM_SMB_PACKET_PATCH
14461 : PY_DGRAM_SMB_PACKET_PATCH(&dgram_smb_packet_Type);
14462 : #endif
14463 : #ifdef PY_DGRAM_MESSAGE_BODY_PATCH
14464 : PY_DGRAM_MESSAGE_BODY_PATCH(&dgram_message_body_Type);
14465 : #endif
14466 : #ifdef PY_DGRAM_MESSAGE_PATCH
14467 : PY_DGRAM_MESSAGE_PATCH(&dgram_message_Type);
14468 : #endif
14469 : #ifdef PY_DGRAM_DATA_PATCH
14470 : PY_DGRAM_DATA_PATCH(&dgram_data_Type);
14471 : #endif
14472 : #ifdef PY_DGRAM_PACKET_PATCH
14473 : PY_DGRAM_PACKET_PATCH(&nbt_dgram_packet_Type);
14474 : #endif
14475 : #ifdef PY_SOCKADDR_PATCH
14476 : PY_SOCKADDR_PATCH(&nbt_sockaddr_Type);
14477 : #endif
14478 : #ifdef PY_NETLOGON_SAM_LOGON_REQUEST_PATCH
14479 : PY_NETLOGON_SAM_LOGON_REQUEST_PATCH(&NETLOGON_SAM_LOGON_REQUEST_Type);
14480 : #endif
14481 : #ifdef PY_NETLOGON_LOGON_REQUEST_PATCH
14482 : PY_NETLOGON_LOGON_REQUEST_PATCH(&NETLOGON_LOGON_REQUEST_Type);
14483 : #endif
14484 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_NT40_PATCH
14485 : PY_NETLOGON_SAM_LOGON_RESPONSE_NT40_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14486 : #endif
14487 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_PATCH
14488 : PY_NETLOGON_SAM_LOGON_RESPONSE_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_Type);
14489 : #endif
14490 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_EX_PATCH
14491 : PY_NETLOGON_SAM_LOGON_RESPONSE_EX_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14492 : #endif
14493 : #ifdef PY_NETLOGON_SAMLOGON_RESPONSE_UNION_PATCH
14494 : PY_NETLOGON_SAMLOGON_RESPONSE_UNION_PATCH(&netlogon_samlogon_response_union_Type);
14495 : #endif
14496 : #ifdef PY_NETLOGON_SAMLOGON_RESPONSE_PATCH
14497 : PY_NETLOGON_SAMLOGON_RESPONSE_PATCH(&netlogon_samlogon_response_Type);
14498 : #endif
14499 : #ifdef PY_NETLOGON_QUERY_FOR_PDC_PATCH
14500 : PY_NETLOGON_QUERY_FOR_PDC_PATCH(&nbt_netlogon_query_for_pdc_Type);
14501 : #endif
14502 : #ifdef PY_NETLOGON_RESPONSE_FROM_PDC_PATCH
14503 : PY_NETLOGON_RESPONSE_FROM_PDC_PATCH(&nbt_netlogon_response_from_pdc_Type);
14504 : #endif
14505 : #ifdef PY_NETLOGON_RESPONSE2_PATCH
14506 : PY_NETLOGON_RESPONSE2_PATCH(&nbt_netlogon_response2_Type);
14507 : #endif
14508 : #ifdef PY_DB_CHANGE_INFO_PATCH
14509 : PY_DB_CHANGE_INFO_PATCH(&nbt_db_change_info_Type);
14510 : #endif
14511 : #ifdef PY_NETLOGON_DB_CHANGE_PATCH
14512 : PY_NETLOGON_DB_CHANGE_PATCH(&NETLOGON_DB_CHANGE_Type);
14513 : #endif
14514 : #ifdef PY_NETLOGON_REQUEST_PATCH
14515 : PY_NETLOGON_REQUEST_PATCH(&nbt_netlogon_request_Type);
14516 : #endif
14517 : #ifdef PY_NETLOGON_PACKET_PATCH
14518 : PY_NETLOGON_PACKET_PATCH(&nbt_netlogon_packet_Type);
14519 : #endif
14520 : #ifdef PY_BROWSE_HOST_ANNOUNCEMENT_PATCH
14521 : PY_BROWSE_HOST_ANNOUNCEMENT_PATCH(&nbt_browse_host_announcement_Type);
14522 : #endif
14523 : #ifdef PY_BROWSE_ANNOUNCEMENT_REQUEST_PATCH
14524 : PY_BROWSE_ANNOUNCEMENT_REQUEST_PATCH(&nbt_browse_announcement_request_Type);
14525 : #endif
14526 : #ifdef PY_BROWSE_ELECTION_REQUEST_PATCH
14527 : PY_BROWSE_ELECTION_REQUEST_PATCH(&nbt_browse_election_request_Type);
14528 : #endif
14529 : #ifdef PY_BROWSE_BACKUP_LIST_REQUEST_PATCH
14530 : PY_BROWSE_BACKUP_LIST_REQUEST_PATCH(&nbt_browse_backup_list_request_Type);
14531 : #endif
14532 : #ifdef PY_BROWSE_BACKUP_LIST_RESPONSE_PATCH
14533 : PY_BROWSE_BACKUP_LIST_RESPONSE_PATCH(&nbt_browse_backup_list_response_Type);
14534 : #endif
14535 : #ifdef PY_BROWSE_BECOME_BACKUP_PATCH
14536 : PY_BROWSE_BECOME_BACKUP_PATCH(&nbt_browse_become_backup_Type);
14537 : #endif
14538 : #ifdef PY_BROWSE_DOMAIN_ANNOUNCEMENT_PATCH
14539 : PY_BROWSE_DOMAIN_ANNOUNCEMENT_PATCH(&nbt_browse_domain_announcement_Type);
14540 : #endif
14541 : #ifdef PY_BROWSE_MASTER_ANNOUNCEMENT_PATCH
14542 : PY_BROWSE_MASTER_ANNOUNCEMENT_PATCH(&nbt_browse_master_announcement_Type);
14543 : #endif
14544 : #ifdef PY_BROWSE_RESET_STATE_PATCH
14545 : PY_BROWSE_RESET_STATE_PATCH(&nbt_browse_reset_state_Type);
14546 : #endif
14547 : #ifdef PY_BROWSE_LOCAL_MASTER_ANNOUNCEMENT_PATCH
14548 : PY_BROWSE_LOCAL_MASTER_ANNOUNCEMENT_PATCH(&nbt_browse_local_master_announcement_Type);
14549 : #endif
14550 : #ifdef PY_BROWSE_PAYLOAD_PATCH
14551 : PY_BROWSE_PAYLOAD_PATCH(&nbt_browse_payload_Type);
14552 : #endif
14553 : #ifdef PY_BROWSE_PACKET_PATCH
14554 : PY_BROWSE_PACKET_PATCH(&nbt_browse_packet_Type);
14555 : #endif
14556 : #ifdef PY_NBT_PATCH
14557 : PY_NBT_PATCH(&nbt_InterfaceType);
14558 : #endif
14559 : #ifdef PY_NBT_ABSTRACT_SYNTAX_PATCH
14560 : PY_NBT_ABSTRACT_SYNTAX_PATCH(&nbt_SyntaxType);
14561 : #endif
14562 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
14563 : PY_ABSTRACT_SYNTAX_PATCH(&nbt_SyntaxType);
14564 : #endif
14565 :
14566 4620 : m = PyModule_Create(&moduledef);
14567 4620 : if (m == NULL)
14568 0 : goto out;
14569 :
14570 4620 : PyModule_AddObject(m, "NBT_NAME_SERVICE_PORT", PyLong_FromUnsignedLongLong(137));
14571 4620 : PyModule_AddObject(m, "NBT_DGRAM_SERVICE_PORT", PyLong_FromUnsignedLongLong(138));
14572 4620 : PyModule_AddObject(m, "NBT_MAILSLOT_NETLOGON", PyUnicode_FromString("\\MAILSLOT\\NET\\NETLOGON"));
14573 4620 : PyModule_AddObject(m, "NBT_MAILSLOT_NTLOGON", PyUnicode_FromString("\\MAILSLOT\\NET\\NTLOGON"));
14574 4620 : PyModule_AddObject(m, "NBT_MAILSLOT_GETDC", PyUnicode_FromString("\\MAILSLOT\\NET\\GETDC"));
14575 4620 : PyModule_AddObject(m, "NBT_MAILSLOT_BROWSE", PyUnicode_FromString("\\MAILSLOT\\BROWSE"));
14576 4620 : PyModule_AddObject(m, "DGRAM_SMB", PyLong_FromUnsignedLongLong(0xff534d42));
14577 4620 : PyModule_AddObject(m, "NBT_RCODE", PyLong_FromLong((uint16_t)NBT_RCODE));
14578 4620 : PyModule_AddObject(m, "NBT_FLAG_BROADCAST", PyLong_FromLong((uint16_t)NBT_FLAG_BROADCAST));
14579 4620 : PyModule_AddObject(m, "NBT_FLAG_RECURSION_AVAIL", PyLong_FromLong((uint16_t)NBT_FLAG_RECURSION_AVAIL));
14580 4620 : PyModule_AddObject(m, "NBT_FLAG_RECURSION_DESIRED", PyLong_FromLong((uint16_t)NBT_FLAG_RECURSION_DESIRED));
14581 4620 : PyModule_AddObject(m, "NBT_FLAG_TRUNCATION", PyLong_FromLong((uint16_t)NBT_FLAG_TRUNCATION));
14582 4620 : PyModule_AddObject(m, "NBT_FLAG_AUTHORITATIVE", PyLong_FromLong((uint16_t)NBT_FLAG_AUTHORITATIVE));
14583 4620 : PyModule_AddObject(m, "NBT_OPCODE", PyLong_FromLong((uint16_t)NBT_OPCODE));
14584 4620 : PyModule_AddObject(m, "NBT_FLAG_REPLY", PyLong_FromLong((uint16_t)NBT_FLAG_REPLY));
14585 4620 : PyModule_AddObject(m, "NBT_OPCODE_QUERY", PyLong_FromLong((uint16_t)NBT_OPCODE_QUERY));
14586 4620 : PyModule_AddObject(m, "NBT_OPCODE_REGISTER", PyLong_FromLong((uint16_t)NBT_OPCODE_REGISTER));
14587 4620 : PyModule_AddObject(m, "NBT_OPCODE_RELEASE", PyLong_FromLong((uint16_t)NBT_OPCODE_RELEASE));
14588 4620 : PyModule_AddObject(m, "NBT_OPCODE_WACK", PyLong_FromLong((uint16_t)NBT_OPCODE_WACK));
14589 4620 : PyModule_AddObject(m, "NBT_OPCODE_REFRESH", PyLong_FromLong((uint16_t)NBT_OPCODE_REFRESH));
14590 4620 : PyModule_AddObject(m, "NBT_OPCODE_REFRESH2", PyLong_FromLong((uint16_t)NBT_OPCODE_REFRESH2));
14591 4620 : PyModule_AddObject(m, "NBT_OPCODE_MULTI_HOME_REG", PyLong_FromLong((uint16_t)NBT_OPCODE_MULTI_HOME_REG));
14592 4620 : PyModule_AddObject(m, "NBT_RCODE_OK", PyLong_FromLong((uint16_t)NBT_RCODE_OK));
14593 4620 : PyModule_AddObject(m, "NBT_RCODE_FMT", PyLong_FromLong((uint16_t)NBT_RCODE_FMT));
14594 4620 : PyModule_AddObject(m, "NBT_RCODE_SVR", PyLong_FromLong((uint16_t)NBT_RCODE_SVR));
14595 4620 : PyModule_AddObject(m, "NBT_RCODE_NAM", PyLong_FromLong((uint16_t)NBT_RCODE_NAM));
14596 4620 : PyModule_AddObject(m, "NBT_RCODE_IMP", PyLong_FromLong((uint16_t)NBT_RCODE_IMP));
14597 4620 : PyModule_AddObject(m, "NBT_RCODE_RFS", PyLong_FromLong((uint16_t)NBT_RCODE_RFS));
14598 4620 : PyModule_AddObject(m, "NBT_RCODE_ACT", PyLong_FromLong((uint16_t)NBT_RCODE_ACT));
14599 4620 : PyModule_AddObject(m, "NBT_RCODE_CFT", PyLong_FromLong((uint16_t)NBT_RCODE_CFT));
14600 4620 : PyModule_AddObject(m, "NBT_NAME_CLIENT", PyLong_FromLong((uint16_t)NBT_NAME_CLIENT));
14601 4620 : PyModule_AddObject(m, "NBT_NAME_MS", PyLong_FromLong((uint16_t)NBT_NAME_MS));
14602 4620 : PyModule_AddObject(m, "NBT_NAME_USER", PyLong_FromLong((uint16_t)NBT_NAME_USER));
14603 4620 : PyModule_AddObject(m, "NBT_NAME_SERVER", PyLong_FromLong((uint16_t)NBT_NAME_SERVER));
14604 4620 : PyModule_AddObject(m, "NBT_NAME_PDC", PyLong_FromLong((uint16_t)NBT_NAME_PDC));
14605 4620 : PyModule_AddObject(m, "NBT_NAME_LOGON", PyLong_FromLong((uint16_t)NBT_NAME_LOGON));
14606 4620 : PyModule_AddObject(m, "NBT_NAME_MASTER", PyLong_FromLong((uint16_t)NBT_NAME_MASTER));
14607 4620 : PyModule_AddObject(m, "NBT_NAME_BROWSER", PyLong_FromLong((uint16_t)NBT_NAME_BROWSER));
14608 4620 : PyModule_AddObject(m, "NBT_QCLASS_IP", PyLong_FromLong((uint16_t)NBT_QCLASS_IP));
14609 4620 : PyModule_AddObject(m, "NBT_QTYPE_ADDRESS", PyLong_FromLong((uint16_t)NBT_QTYPE_ADDRESS));
14610 4620 : PyModule_AddObject(m, "NBT_QTYPE_NAMESERVICE", PyLong_FromLong((uint16_t)NBT_QTYPE_NAMESERVICE));
14611 4620 : PyModule_AddObject(m, "NBT_QTYPE_NULL", PyLong_FromLong((uint16_t)NBT_QTYPE_NULL));
14612 4620 : PyModule_AddObject(m, "NBT_QTYPE_NETBIOS", PyLong_FromLong((uint16_t)NBT_QTYPE_NETBIOS));
14613 4620 : PyModule_AddObject(m, "NBT_QTYPE_STATUS", PyLong_FromLong((uint16_t)NBT_QTYPE_STATUS));
14614 4620 : PyModule_AddObject(m, "NBT_QTYPE_WACK", PyLong_FromLong((uint16_t)NBT_QTYPE_WACK));
14615 4620 : PyModule_AddObject(m, "NBT_NODE_B", PyLong_FromLong((uint16_t)NBT_NODE_B));
14616 4620 : PyModule_AddObject(m, "NBT_NODE_P", PyLong_FromLong((uint16_t)NBT_NODE_P));
14617 4620 : PyModule_AddObject(m, "NBT_NODE_M", PyLong_FromLong((uint16_t)NBT_NODE_M));
14618 4620 : PyModule_AddObject(m, "NBT_NODE_H", PyLong_FromLong((uint16_t)NBT_NODE_H));
14619 4620 : PyModule_AddObject(m, "NBT_NM_PERMANENT", PyLong_FromLong((uint16_t)NBT_NM_PERMANENT));
14620 4620 : PyModule_AddObject(m, "NBT_NM_ACTIVE", PyLong_FromLong((uint16_t)NBT_NM_ACTIVE));
14621 4620 : PyModule_AddObject(m, "NBT_NM_CONFLICT", PyLong_FromLong((uint16_t)NBT_NM_CONFLICT));
14622 4620 : PyModule_AddObject(m, "NBT_NM_DEREGISTER", PyLong_FromLong((uint16_t)NBT_NM_DEREGISTER));
14623 4620 : PyModule_AddObject(m, "NBT_NM_OWNER_TYPE", PyLong_FromLong((uint16_t)NBT_NM_OWNER_TYPE));
14624 4620 : PyModule_AddObject(m, "NBT_NM_GROUP", PyLong_FromLong((uint16_t)NBT_NM_GROUP));
14625 4620 : PyModule_AddObject(m, "DGRAM_DIRECT_UNIQUE", PyLong_FromLong((uint16_t)DGRAM_DIRECT_UNIQUE));
14626 4620 : PyModule_AddObject(m, "DGRAM_DIRECT_GROUP", PyLong_FromLong((uint16_t)DGRAM_DIRECT_GROUP));
14627 4620 : PyModule_AddObject(m, "DGRAM_BCAST", PyLong_FromLong((uint16_t)DGRAM_BCAST));
14628 4620 : PyModule_AddObject(m, "DGRAM_ERROR", PyLong_FromLong((uint16_t)DGRAM_ERROR));
14629 4620 : PyModule_AddObject(m, "DGRAM_QUERY", PyLong_FromLong((uint16_t)DGRAM_QUERY));
14630 4620 : PyModule_AddObject(m, "DGRAM_QUERY_POSITIVE", PyLong_FromLong((uint16_t)DGRAM_QUERY_POSITIVE));
14631 4620 : PyModule_AddObject(m, "DGRAM_QUERY_NEGATIVE", PyLong_FromLong((uint16_t)DGRAM_QUERY_NEGATIVE));
14632 4620 : PyModule_AddObject(m, "DGRAM_FLAG_MORE", PyLong_FromLong((uint16_t)DGRAM_FLAG_MORE));
14633 4620 : PyModule_AddObject(m, "DGRAM_FLAG_FIRST", PyLong_FromLong((uint16_t)DGRAM_FLAG_FIRST));
14634 4620 : PyModule_AddObject(m, "DGRAM_FLAG_NODE_TYPE", PyLong_FromLong((uint16_t)DGRAM_FLAG_NODE_TYPE));
14635 4620 : PyModule_AddObject(m, "DGRAM_NODE_B", PyLong_FromLong((uint16_t)DGRAM_NODE_B));
14636 4620 : PyModule_AddObject(m, "DGRAM_NODE_P", PyLong_FromLong((uint16_t)DGRAM_NODE_P));
14637 4620 : PyModule_AddObject(m, "DGRAM_NODE_M", PyLong_FromLong((uint16_t)DGRAM_NODE_M));
14638 4620 : PyModule_AddObject(m, "DGRAM_NODE_NBDD", PyLong_FromLong((uint16_t)DGRAM_NODE_NBDD));
14639 4620 : PyModule_AddObject(m, "SMB_TRANSACTION", PyLong_FromLong((uint16_t)SMB_TRANSACTION));
14640 4620 : PyModule_AddObject(m, "DGRAM_ERROR_NAME_NOT_PRESENT", PyLong_FromLong((uint16_t)DGRAM_ERROR_NAME_NOT_PRESENT));
14641 4620 : PyModule_AddObject(m, "DGRAM_ERROR_INVALID_SOURCE", PyLong_FromLong((uint16_t)DGRAM_ERROR_INVALID_SOURCE));
14642 4620 : PyModule_AddObject(m, "DGRAM_ERROR_INVALID_DEST", PyLong_FromLong((uint16_t)DGRAM_ERROR_INVALID_DEST));
14643 4620 : PyModule_AddObject(m, "NBT_SERVER_PDC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_PDC));
14644 4620 : PyModule_AddObject(m, "NBT_SERVER_GC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_GC));
14645 4620 : PyModule_AddObject(m, "NBT_SERVER_LDAP", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_LDAP));
14646 4620 : PyModule_AddObject(m, "NBT_SERVER_DS", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_DS));
14647 4620 : PyModule_AddObject(m, "NBT_SERVER_KDC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_KDC));
14648 4620 : PyModule_AddObject(m, "NBT_SERVER_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_TIMESERV));
14649 4620 : PyModule_AddObject(m, "NBT_SERVER_CLOSEST", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_CLOSEST));
14650 4620 : PyModule_AddObject(m, "NBT_SERVER_WRITABLE", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_WRITABLE));
14651 4620 : PyModule_AddObject(m, "NBT_SERVER_GOOD_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_GOOD_TIMESERV));
14652 4620 : PyModule_AddObject(m, "NBT_SERVER_NDNC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_NDNC));
14653 4620 : PyModule_AddObject(m, "NBT_SERVER_SELECT_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_SELECT_SECRET_DOMAIN_6));
14654 4620 : PyModule_AddObject(m, "NBT_SERVER_FULL_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_FULL_SECRET_DOMAIN_6));
14655 4620 : PyModule_AddObject(m, "NBT_SERVER_ADS_WEB_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_ADS_WEB_SERVICE));
14656 4620 : PyModule_AddObject(m, "NBT_SERVER_DS_8", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_DS_8));
14657 4620 : PyModule_AddObject(m, "NBT_SERVER_DS_9", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_DS_9));
14658 4620 : PyModule_AddObject(m, "NBT_SERVER_DS_10", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_DS_10));
14659 4620 : PyModule_AddObject(m, "NBT_SERVER_HAS_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_HAS_DNS_NAME));
14660 4620 : PyModule_AddObject(m, "NBT_SERVER_IS_DEFAULT_NC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_IS_DEFAULT_NC));
14661 4620 : PyModule_AddObject(m, "NBT_SERVER_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_FOREST_ROOT));
14662 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_1", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_1));
14663 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_5));
14664 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5EX", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_5EX));
14665 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5EX_WITH_IP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_5EX_WITH_IP));
14666 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_WITH_CLOSEST_SITE));
14667 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_AVOID_NT4EMUL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_AVOID_NT4EMUL));
14668 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_PDC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_PDC));
14669 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_IP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_IP));
14670 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_LOCAL));
14671 4620 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_GC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_GC));
14672 4620 : PyModule_AddObject(m, "LOGON_REQUEST", PyLong_FromLong((uint16_t)LOGON_REQUEST));
14673 4620 : PyModule_AddObject(m, "LOGON_RESPONSE2", PyLong_FromLong((uint16_t)LOGON_RESPONSE2));
14674 4620 : PyModule_AddObject(m, "LOGON_PRIMARY_QUERY", PyLong_FromLong((uint16_t)LOGON_PRIMARY_QUERY));
14675 4620 : PyModule_AddObject(m, "NETLOGON_ANNOUNCE_UAS", PyLong_FromLong((uint16_t)NETLOGON_ANNOUNCE_UAS));
14676 4620 : PyModule_AddObject(m, "NETLOGON_RESPONSE_FROM_PDC", PyLong_FromLong((uint16_t)NETLOGON_RESPONSE_FROM_PDC));
14677 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_REQUEST", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_REQUEST));
14678 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_RESPONSE", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_RESPONSE));
14679 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_PAUSE_RESPONSE", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_PAUSE_RESPONSE));
14680 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_USER_UNKNOWN", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_USER_UNKNOWN));
14681 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_RESPONSE_EX", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_RESPONSE_EX));
14682 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_PAUSE_RESPONSE_EX));
14683 4620 : PyModule_AddObject(m, "LOGON_SAM_LOGON_USER_UNKNOWN_EX", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_USER_UNKNOWN_EX));
14684 4620 : PyModule_AddObject(m, "HostAnnouncement", PyLong_FromLong((uint16_t)HostAnnouncement));
14685 4620 : PyModule_AddObject(m, "AnnouncementRequest", PyLong_FromLong((uint16_t)AnnouncementRequest));
14686 4620 : PyModule_AddObject(m, "Election", PyLong_FromLong((uint16_t)Election));
14687 4620 : PyModule_AddObject(m, "GetBackupListReq", PyLong_FromLong((uint16_t)GetBackupListReq));
14688 4620 : PyModule_AddObject(m, "GetBackupListResp", PyLong_FromLong((uint16_t)GetBackupListResp));
14689 4620 : PyModule_AddObject(m, "BecomeBackup", PyLong_FromLong((uint16_t)BecomeBackup));
14690 4620 : PyModule_AddObject(m, "DomainAnnouncement", PyLong_FromLong((uint16_t)DomainAnnouncement));
14691 4620 : PyModule_AddObject(m, "MasterAnnouncement", PyLong_FromLong((uint16_t)MasterAnnouncement));
14692 4620 : PyModule_AddObject(m, "ResetBrowserState", PyLong_FromLong((uint16_t)ResetBrowserState));
14693 4620 : PyModule_AddObject(m, "LocalMasterAnnouncement", PyLong_FromLong((uint16_t)LocalMasterAnnouncement));
14694 3520 : Py_INCREF((PyObject *)(void *)&nbt_name_Type);
14695 4620 : PyModule_AddObject(m, "name", (PyObject *)(void *)&nbt_name_Type);
14696 3520 : Py_INCREF((PyObject *)(void *)&nbt_name_question_Type);
14697 4620 : PyModule_AddObject(m, "name_question", (PyObject *)(void *)&nbt_name_question_Type);
14698 3520 : Py_INCREF((PyObject *)(void *)&nbt_rdata_address_Type);
14699 4620 : PyModule_AddObject(m, "rdata_address", (PyObject *)(void *)&nbt_rdata_address_Type);
14700 3520 : Py_INCREF((PyObject *)(void *)&nbt_rdata_netbios_Type);
14701 4620 : PyModule_AddObject(m, "rdata_netbios", (PyObject *)(void *)&nbt_rdata_netbios_Type);
14702 3520 : Py_INCREF((PyObject *)(void *)&nbt_statistics_Type);
14703 4620 : PyModule_AddObject(m, "statistics", (PyObject *)(void *)&nbt_statistics_Type);
14704 3520 : Py_INCREF((PyObject *)(void *)&nbt_status_name_Type);
14705 4620 : PyModule_AddObject(m, "status_name", (PyObject *)(void *)&nbt_status_name_Type);
14706 3520 : Py_INCREF((PyObject *)(void *)&nbt_rdata_status_Type);
14707 4620 : PyModule_AddObject(m, "rdata_status", (PyObject *)(void *)&nbt_rdata_status_Type);
14708 3520 : Py_INCREF((PyObject *)(void *)&nbt_rdata_data_Type);
14709 4620 : PyModule_AddObject(m, "rdata_data", (PyObject *)(void *)&nbt_rdata_data_Type);
14710 3520 : Py_INCREF((PyObject *)(void *)&nbt_rdata_Type);
14711 4620 : PyModule_AddObject(m, "rdata", (PyObject *)(void *)&nbt_rdata_Type);
14712 3520 : Py_INCREF((PyObject *)(void *)&nbt_res_rec_Type);
14713 4620 : PyModule_AddObject(m, "res_rec", (PyObject *)(void *)&nbt_res_rec_Type);
14714 3520 : Py_INCREF((PyObject *)(void *)&nbt_name_packet_Type);
14715 4620 : PyModule_AddObject(m, "name_packet", (PyObject *)(void *)&nbt_name_packet_Type);
14716 3520 : Py_INCREF((PyObject *)(void *)&smb_trans_body_Type);
14717 4620 : PyModule_AddObject(m, "smb_trans_body", (PyObject *)(void *)&smb_trans_body_Type);
14718 3520 : Py_INCREF((PyObject *)(void *)&smb_body_Type);
14719 4620 : PyModule_AddObject(m, "smb_body", (PyObject *)(void *)&smb_body_Type);
14720 3520 : Py_INCREF((PyObject *)(void *)&dgram_smb_packet_Type);
14721 4620 : PyModule_AddObject(m, "dgram_smb_packet", (PyObject *)(void *)&dgram_smb_packet_Type);
14722 3520 : Py_INCREF((PyObject *)(void *)&dgram_message_body_Type);
14723 4620 : PyModule_AddObject(m, "dgram_message_body", (PyObject *)(void *)&dgram_message_body_Type);
14724 3520 : Py_INCREF((PyObject *)(void *)&dgram_message_Type);
14725 4620 : PyModule_AddObject(m, "dgram_message", (PyObject *)(void *)&dgram_message_Type);
14726 3520 : Py_INCREF((PyObject *)(void *)&dgram_data_Type);
14727 4620 : PyModule_AddObject(m, "dgram_data", (PyObject *)(void *)&dgram_data_Type);
14728 3520 : Py_INCREF((PyObject *)(void *)&nbt_dgram_packet_Type);
14729 4620 : PyModule_AddObject(m, "dgram_packet", (PyObject *)(void *)&nbt_dgram_packet_Type);
14730 3520 : Py_INCREF((PyObject *)(void *)&nbt_sockaddr_Type);
14731 4620 : PyModule_AddObject(m, "sockaddr", (PyObject *)(void *)&nbt_sockaddr_Type);
14732 3520 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_REQUEST_Type);
14733 4620 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_REQUEST", (PyObject *)(void *)&NETLOGON_SAM_LOGON_REQUEST_Type);
14734 3520 : Py_INCREF((PyObject *)(void *)&NETLOGON_LOGON_REQUEST_Type);
14735 4620 : PyModule_AddObject(m, "NETLOGON_LOGON_REQUEST", (PyObject *)(void *)&NETLOGON_LOGON_REQUEST_Type);
14736 3520 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14737 4620 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE_NT40", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14738 3520 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_Type);
14739 4620 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_Type);
14740 3520 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14741 4620 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE_EX", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14742 3520 : Py_INCREF((PyObject *)(void *)&netlogon_samlogon_response_union_Type);
14743 4620 : PyModule_AddObject(m, "netlogon_samlogon_response_union", (PyObject *)(void *)&netlogon_samlogon_response_union_Type);
14744 3520 : Py_INCREF((PyObject *)(void *)&netlogon_samlogon_response_Type);
14745 4620 : PyModule_AddObject(m, "netlogon_samlogon_response", (PyObject *)(void *)&netlogon_samlogon_response_Type);
14746 3520 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_query_for_pdc_Type);
14747 4620 : PyModule_AddObject(m, "netlogon_query_for_pdc", (PyObject *)(void *)&nbt_netlogon_query_for_pdc_Type);
14748 3520 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_response_from_pdc_Type);
14749 4620 : PyModule_AddObject(m, "netlogon_response_from_pdc", (PyObject *)(void *)&nbt_netlogon_response_from_pdc_Type);
14750 3520 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_response2_Type);
14751 4620 : PyModule_AddObject(m, "netlogon_response2", (PyObject *)(void *)&nbt_netlogon_response2_Type);
14752 3520 : Py_INCREF((PyObject *)(void *)&nbt_db_change_info_Type);
14753 4620 : PyModule_AddObject(m, "db_change_info", (PyObject *)(void *)&nbt_db_change_info_Type);
14754 3520 : Py_INCREF((PyObject *)(void *)&NETLOGON_DB_CHANGE_Type);
14755 4620 : PyModule_AddObject(m, "NETLOGON_DB_CHANGE", (PyObject *)(void *)&NETLOGON_DB_CHANGE_Type);
14756 3520 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_request_Type);
14757 4620 : PyModule_AddObject(m, "netlogon_request", (PyObject *)(void *)&nbt_netlogon_request_Type);
14758 3520 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_packet_Type);
14759 4620 : PyModule_AddObject(m, "netlogon_packet", (PyObject *)(void *)&nbt_netlogon_packet_Type);
14760 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_host_announcement_Type);
14761 4620 : PyModule_AddObject(m, "browse_host_announcement", (PyObject *)(void *)&nbt_browse_host_announcement_Type);
14762 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_announcement_request_Type);
14763 4620 : PyModule_AddObject(m, "browse_announcement_request", (PyObject *)(void *)&nbt_browse_announcement_request_Type);
14764 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_election_request_Type);
14765 4620 : PyModule_AddObject(m, "browse_election_request", (PyObject *)(void *)&nbt_browse_election_request_Type);
14766 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_backup_list_request_Type);
14767 4620 : PyModule_AddObject(m, "browse_backup_list_request", (PyObject *)(void *)&nbt_browse_backup_list_request_Type);
14768 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_backup_list_response_Type);
14769 4620 : PyModule_AddObject(m, "browse_backup_list_response", (PyObject *)(void *)&nbt_browse_backup_list_response_Type);
14770 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_become_backup_Type);
14771 4620 : PyModule_AddObject(m, "browse_become_backup", (PyObject *)(void *)&nbt_browse_become_backup_Type);
14772 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_domain_announcement_Type);
14773 4620 : PyModule_AddObject(m, "browse_domain_announcement", (PyObject *)(void *)&nbt_browse_domain_announcement_Type);
14774 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_master_announcement_Type);
14775 4620 : PyModule_AddObject(m, "browse_master_announcement", (PyObject *)(void *)&nbt_browse_master_announcement_Type);
14776 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_reset_state_Type);
14777 4620 : PyModule_AddObject(m, "browse_reset_state", (PyObject *)(void *)&nbt_browse_reset_state_Type);
14778 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_local_master_announcement_Type);
14779 4620 : PyModule_AddObject(m, "browse_local_master_announcement", (PyObject *)(void *)&nbt_browse_local_master_announcement_Type);
14780 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_payload_Type);
14781 4620 : PyModule_AddObject(m, "browse_payload", (PyObject *)(void *)&nbt_browse_payload_Type);
14782 3520 : Py_INCREF((PyObject *)(void *)&nbt_browse_packet_Type);
14783 4620 : PyModule_AddObject(m, "browse_packet", (PyObject *)(void *)&nbt_browse_packet_Type);
14784 3520 : Py_INCREF((PyObject *)(void *)&nbt_InterfaceType);
14785 4620 : PyModule_AddObject(m, "nbt", (PyObject *)(void *)&nbt_InterfaceType);
14786 3520 : Py_INCREF((PyObject *)(void *)&nbt_SyntaxType);
14787 4620 : PyModule_AddObject(m, "nbt_abstract_syntax", (PyObject *)(void *)&nbt_SyntaxType);
14788 3520 : Py_INCREF((PyObject *)(void *)&nbt_SyntaxType);
14789 4620 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&nbt_SyntaxType);
14790 : #ifdef PY_MOD_NBT_PATCH
14791 : PY_MOD_NBT_PATCH(m);
14792 : #endif
14793 4620 : out:
14794 4620 : Py_XDECREF(dep_samba_dcerpc_misc);
14795 4620 : Py_XDECREF(dep_samba_dcerpc_security);
14796 4620 : Py_XDECREF(dep_talloc);
14797 4620 : Py_XDECREF(dep_samba_dcerpc_base);
14798 4490 : return m;
14799 :
14800 : }
|