Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include <Python.h>
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_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 : 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 : const char *test_str;
136 : 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 : PyErr_NoMemory();
142 0 : return -1;
143 : }
144 0 : test_str = PyBytes_AS_STRING(unicode);
145 0 : } else if (PyBytes_Check(value)) {
146 0 : test_str = PyBytes_AS_STRING(value);
147 : } else {
148 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
149 0 : return -1;
150 : }
151 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
152 0 : if (unicode != NULL) {
153 0 : Py_DECREF(unicode);
154 : }
155 0 : if (talloc_str == NULL) {
156 0 : PyErr_NoMemory();
157 0 : return -1;
158 : }
159 0 : object->name = talloc_str;
160 : }
161 0 : return 0;
162 : }
163 :
164 0 : static PyObject *py_nbt_name_get_scope(PyObject *obj, void *closure)
165 : {
166 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
167 : PyObject *py_scope;
168 0 : py_scope = PyString_FromStringOrNULL(object->scope);
169 0 : return py_scope;
170 : }
171 :
172 0 : static int py_nbt_name_set_scope(PyObject *py_obj, PyObject *value, void *closure)
173 : {
174 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
175 0 : if (value == NULL) {
176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->scope");
177 0 : return -1;
178 : }
179 : {
180 : const char *test_str;
181 : const char *talloc_str;
182 0 : PyObject *unicode = NULL;
183 0 : if (PyUnicode_Check(value)) {
184 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
185 0 : if (unicode == NULL) {
186 0 : PyErr_NoMemory();
187 0 : return -1;
188 : }
189 0 : test_str = PyBytes_AS_STRING(unicode);
190 0 : } else if (PyBytes_Check(value)) {
191 0 : test_str = PyBytes_AS_STRING(value);
192 : } else {
193 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
194 0 : return -1;
195 : }
196 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
197 0 : if (unicode != NULL) {
198 0 : Py_DECREF(unicode);
199 : }
200 0 : if (talloc_str == NULL) {
201 0 : PyErr_NoMemory();
202 0 : return -1;
203 : }
204 0 : object->scope = talloc_str;
205 : }
206 0 : return 0;
207 : }
208 :
209 0 : static PyObject *py_nbt_name_get_type(PyObject *obj, void *closure)
210 : {
211 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
212 : PyObject *py_type;
213 0 : py_type = PyLong_FromLong((uint16_t)object->type);
214 0 : return py_type;
215 : }
216 :
217 0 : static int py_nbt_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
218 : {
219 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
220 0 : if (value == NULL) {
221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
222 0 : return -1;
223 : }
224 : {
225 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
226 0 : if (PyLong_Check(value)) {
227 : unsigned long long test_var;
228 0 : test_var = PyLong_AsUnsignedLongLong(value);
229 0 : if (PyErr_Occurred() != NULL) {
230 0 : return -1;
231 : }
232 0 : if (test_var > uint_max) {
233 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
234 : PyLong_Type.tp_name, uint_max, test_var);
235 0 : return -1;
236 : }
237 0 : object->type = test_var;
238 : } else {
239 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
240 : PyLong_Type.tp_name);
241 0 : return -1;
242 : }
243 : }
244 0 : return 0;
245 : }
246 :
247 : static PyGetSetDef py_nbt_name_getsetters[] = {
248 : {
249 : .name = discard_const_p(char, "name"),
250 : .get = py_nbt_name_get_name,
251 : .set = py_nbt_name_set_name,
252 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
253 : },
254 : {
255 : .name = discard_const_p(char, "scope"),
256 : .get = py_nbt_name_get_scope,
257 : .set = py_nbt_name_set_scope,
258 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
259 : },
260 : {
261 : .name = discard_const_p(char, "type"),
262 : .get = py_nbt_name_get_type,
263 : .set = py_nbt_name_set_type,
264 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
265 : },
266 : { .name = NULL }
267 : };
268 :
269 0 : static PyObject *py_nbt_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
270 : {
271 0 : return pytalloc_new(struct nbt_name, type);
272 : }
273 :
274 0 : static PyObject *py_nbt_name_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
275 : {
276 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
277 0 : PyObject *ret = NULL;
278 : DATA_BLOB blob;
279 : enum ndr_err_code err;
280 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
281 0 : if (tmp_ctx == NULL) {
282 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
283 0 : return NULL;
284 : }
285 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name);
286 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
287 0 : TALLOC_FREE(tmp_ctx);
288 0 : PyErr_SetNdrError(err);
289 0 : return NULL;
290 : }
291 :
292 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
293 0 : TALLOC_FREE(tmp_ctx);
294 0 : return ret;
295 : }
296 :
297 0 : static PyObject *py_nbt_name_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
298 : {
299 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
300 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
301 0 : Py_ssize_t blob_length = 0;
302 : enum ndr_err_code err;
303 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
304 0 : PyObject *allow_remaining_obj = NULL;
305 0 : bool allow_remaining = false;
306 :
307 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
308 : discard_const_p(char *, kwnames),
309 : &blob.data, &blob_length,
310 : &allow_remaining_obj)) {
311 0 : return NULL;
312 : }
313 0 : blob.length = blob_length;
314 :
315 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
316 0 : allow_remaining = true;
317 : }
318 :
319 0 : if (allow_remaining) {
320 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
321 : } else {
322 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
323 : }
324 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
325 0 : PyErr_SetNdrError(err);
326 0 : return NULL;
327 : }
328 :
329 0 : Py_RETURN_NONE;
330 : }
331 :
332 0 : static PyObject *py_nbt_name_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
333 : {
334 0 : struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
335 : PyObject *ret;
336 : char *retstr;
337 :
338 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name, "nbt_name", object);
339 0 : ret = PyUnicode_FromString(retstr);
340 0 : talloc_free(retstr);
341 :
342 0 : return ret;
343 : }
344 :
345 : static PyMethodDef py_nbt_name_methods[] = {
346 : { "__ndr_pack__", (PyCFunction)py_nbt_name_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
347 : { "__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" },
348 : { "__ndr_print__", (PyCFunction)py_nbt_name_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
349 : { NULL, NULL, 0, NULL }
350 : };
351 :
352 :
353 : static PyTypeObject nbt_name_Type = {
354 : PyVarObject_HEAD_INIT(NULL, 0)
355 : .tp_name = "nbt.name",
356 : .tp_getset = py_nbt_name_getsetters,
357 : .tp_methods = py_nbt_name_methods,
358 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
359 : .tp_new = py_nbt_name_new,
360 : };
361 :
362 :
363 0 : static PyObject *py_nbt_name_question_get_name(PyObject *obj, void *closure)
364 : {
365 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
366 : PyObject *py_name;
367 0 : py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
368 0 : return py_name;
369 : }
370 :
371 0 : static int py_nbt_name_question_set_name(PyObject *py_obj, PyObject *value, void *closure)
372 : {
373 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
374 0 : if (value == NULL) {
375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
376 0 : return -1;
377 : }
378 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
379 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
380 0 : PyErr_NoMemory();
381 0 : return -1;
382 : }
383 0 : object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
384 0 : return 0;
385 : }
386 :
387 0 : static PyObject *py_nbt_name_question_get_question_type(PyObject *obj, void *closure)
388 : {
389 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
390 : PyObject *py_question_type;
391 0 : py_question_type = PyLong_FromLong((uint16_t)object->question_type);
392 0 : return py_question_type;
393 : }
394 :
395 0 : static int py_nbt_name_question_set_question_type(PyObject *py_obj, PyObject *value, void *closure)
396 : {
397 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
398 0 : if (value == NULL) {
399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->question_type");
400 0 : return -1;
401 : }
402 : {
403 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_type));
404 0 : if (PyLong_Check(value)) {
405 : unsigned long long test_var;
406 0 : test_var = PyLong_AsUnsignedLongLong(value);
407 0 : if (PyErr_Occurred() != NULL) {
408 0 : return -1;
409 : }
410 0 : if (test_var > uint_max) {
411 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
412 : PyLong_Type.tp_name, uint_max, test_var);
413 0 : return -1;
414 : }
415 0 : object->question_type = test_var;
416 : } else {
417 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
418 : PyLong_Type.tp_name);
419 0 : return -1;
420 : }
421 : }
422 0 : return 0;
423 : }
424 :
425 0 : static PyObject *py_nbt_name_question_get_question_class(PyObject *obj, void *closure)
426 : {
427 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
428 : PyObject *py_question_class;
429 0 : py_question_class = PyLong_FromLong((uint16_t)object->question_class);
430 0 : return py_question_class;
431 : }
432 :
433 0 : static int py_nbt_name_question_set_question_class(PyObject *py_obj, PyObject *value, void *closure)
434 : {
435 0 : struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
436 0 : if (value == NULL) {
437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->question_class");
438 0 : return -1;
439 : }
440 : {
441 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_class));
442 0 : if (PyLong_Check(value)) {
443 : unsigned long long test_var;
444 0 : test_var = PyLong_AsUnsignedLongLong(value);
445 0 : if (PyErr_Occurred() != NULL) {
446 0 : return -1;
447 : }
448 0 : if (test_var > uint_max) {
449 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
450 : PyLong_Type.tp_name, uint_max, test_var);
451 0 : return -1;
452 : }
453 0 : object->question_class = test_var;
454 : } else {
455 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
456 : PyLong_Type.tp_name);
457 0 : return -1;
458 : }
459 : }
460 0 : return 0;
461 : }
462 :
463 : static PyGetSetDef py_nbt_name_question_getsetters[] = {
464 : {
465 : .name = discard_const_p(char, "name"),
466 : .get = py_nbt_name_question_get_name,
467 : .set = py_nbt_name_question_set_name,
468 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
469 : },
470 : {
471 : .name = discard_const_p(char, "question_type"),
472 : .get = py_nbt_name_question_get_question_type,
473 : .set = py_nbt_name_question_set_question_type,
474 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
475 : },
476 : {
477 : .name = discard_const_p(char, "question_class"),
478 : .get = py_nbt_name_question_get_question_class,
479 : .set = py_nbt_name_question_set_question_class,
480 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
481 : },
482 : { .name = NULL }
483 : };
484 :
485 0 : static PyObject *py_nbt_name_question_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
486 : {
487 0 : return pytalloc_new(struct nbt_name_question, type);
488 : }
489 :
490 :
491 : static PyTypeObject nbt_name_question_Type = {
492 : PyVarObject_HEAD_INIT(NULL, 0)
493 : .tp_name = "nbt.name_question",
494 : .tp_getset = py_nbt_name_question_getsetters,
495 : .tp_methods = NULL,
496 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
497 : .tp_new = py_nbt_name_question_new,
498 : };
499 :
500 :
501 0 : static PyObject *py_nbt_rdata_address_get_nb_flags(PyObject *obj, void *closure)
502 : {
503 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(obj);
504 : PyObject *py_nb_flags;
505 0 : py_nb_flags = PyLong_FromLong((uint16_t)object->nb_flags);
506 0 : return py_nb_flags;
507 : }
508 :
509 0 : static int py_nbt_rdata_address_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
510 : {
511 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(py_obj);
512 0 : if (value == NULL) {
513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nb_flags");
514 0 : return -1;
515 : }
516 : {
517 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
518 0 : if (PyLong_Check(value)) {
519 : unsigned long long test_var;
520 0 : test_var = PyLong_AsUnsignedLongLong(value);
521 0 : if (PyErr_Occurred() != NULL) {
522 0 : return -1;
523 : }
524 0 : if (test_var > uint_max) {
525 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
526 : PyLong_Type.tp_name, uint_max, test_var);
527 0 : return -1;
528 : }
529 0 : object->nb_flags = test_var;
530 : } else {
531 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
532 : PyLong_Type.tp_name);
533 0 : return -1;
534 : }
535 : }
536 0 : return 0;
537 : }
538 :
539 0 : static PyObject *py_nbt_rdata_address_get_ipaddr(PyObject *obj, void *closure)
540 : {
541 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(obj);
542 : PyObject *py_ipaddr;
543 0 : py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
544 0 : return py_ipaddr;
545 : }
546 :
547 0 : static int py_nbt_rdata_address_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
548 : {
549 0 : struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(py_obj);
550 0 : if (value == NULL) {
551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipaddr");
552 0 : return -1;
553 : }
554 : {
555 : const char *test_str;
556 : const char *talloc_str;
557 0 : PyObject *unicode = NULL;
558 0 : if (PyUnicode_Check(value)) {
559 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
560 0 : if (unicode == NULL) {
561 0 : PyErr_NoMemory();
562 0 : return -1;
563 : }
564 0 : test_str = PyBytes_AS_STRING(unicode);
565 0 : } else if (PyBytes_Check(value)) {
566 0 : test_str = PyBytes_AS_STRING(value);
567 : } else {
568 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
569 0 : return -1;
570 : }
571 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
572 0 : if (unicode != NULL) {
573 0 : Py_DECREF(unicode);
574 : }
575 0 : if (talloc_str == NULL) {
576 0 : PyErr_NoMemory();
577 0 : return -1;
578 : }
579 0 : object->ipaddr = talloc_str;
580 : }
581 0 : return 0;
582 : }
583 :
584 : static PyGetSetDef py_nbt_rdata_address_getsetters[] = {
585 : {
586 : .name = discard_const_p(char, "nb_flags"),
587 : .get = py_nbt_rdata_address_get_nb_flags,
588 : .set = py_nbt_rdata_address_set_nb_flags,
589 : .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
590 : },
591 : {
592 : .name = discard_const_p(char, "ipaddr"),
593 : .get = py_nbt_rdata_address_get_ipaddr,
594 : .set = py_nbt_rdata_address_set_ipaddr,
595 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
596 : },
597 : { .name = NULL }
598 : };
599 :
600 0 : static PyObject *py_nbt_rdata_address_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
601 : {
602 0 : return pytalloc_new(struct nbt_rdata_address, type);
603 : }
604 :
605 :
606 : static PyTypeObject nbt_rdata_address_Type = {
607 : PyVarObject_HEAD_INIT(NULL, 0)
608 : .tp_name = "nbt.rdata_address",
609 : .tp_getset = py_nbt_rdata_address_getsetters,
610 : .tp_methods = NULL,
611 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
612 : .tp_new = py_nbt_rdata_address_new,
613 : };
614 :
615 :
616 0 : static PyObject *py_nbt_rdata_netbios_get_length(PyObject *obj, void *closure)
617 : {
618 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(obj);
619 : PyObject *py_length;
620 0 : py_length = PyLong_FromLong((uint16_t)object->length);
621 0 : return py_length;
622 : }
623 :
624 0 : static int py_nbt_rdata_netbios_set_length(PyObject *py_obj, PyObject *value, void *closure)
625 : {
626 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(py_obj);
627 0 : if (value == NULL) {
628 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
629 0 : return -1;
630 : }
631 : {
632 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
633 0 : if (PyLong_Check(value)) {
634 : unsigned long long test_var;
635 0 : test_var = PyLong_AsUnsignedLongLong(value);
636 0 : if (PyErr_Occurred() != NULL) {
637 0 : return -1;
638 : }
639 0 : if (test_var > uint_max) {
640 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
641 : PyLong_Type.tp_name, uint_max, test_var);
642 0 : return -1;
643 : }
644 0 : object->length = test_var;
645 : } else {
646 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
647 : PyLong_Type.tp_name);
648 0 : return -1;
649 : }
650 : }
651 0 : return 0;
652 : }
653 :
654 0 : static PyObject *py_nbt_rdata_netbios_get_addresses(PyObject *obj, void *closure)
655 : {
656 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(obj);
657 : PyObject *py_addresses;
658 0 : py_addresses = PyList_New(object->length / 6);
659 0 : if (py_addresses == NULL) {
660 0 : return NULL;
661 : }
662 : {
663 : int addresses_cntr_0;
664 0 : for (addresses_cntr_0 = 0; addresses_cntr_0 < (object->length / 6); addresses_cntr_0++) {
665 : PyObject *py_addresses_0;
666 0 : py_addresses_0 = pytalloc_reference_ex(&nbt_rdata_address_Type, object->addresses, &object->addresses[addresses_cntr_0]);
667 0 : PyList_SetItem(py_addresses, addresses_cntr_0, py_addresses_0);
668 : }
669 : }
670 0 : return py_addresses;
671 : }
672 :
673 0 : static int py_nbt_rdata_netbios_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
674 : {
675 0 : struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(py_obj);
676 0 : if (value == NULL) {
677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses");
678 0 : return -1;
679 : }
680 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
681 : {
682 : int addresses_cntr_0;
683 0 : object->addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addresses, PyList_GET_SIZE(value));
684 0 : if (!object->addresses) { return -1;; }
685 0 : talloc_set_name_const(object->addresses, "ARRAY: object->addresses");
686 0 : for (addresses_cntr_0 = 0; addresses_cntr_0 < PyList_GET_SIZE(value); addresses_cntr_0++) {
687 0 : if (PyList_GET_ITEM(value, addresses_cntr_0) == NULL) {
688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses[addresses_cntr_0]");
689 0 : return -1;
690 : }
691 0 : PY_CHECK_TYPE(&nbt_rdata_address_Type, PyList_GET_ITEM(value, addresses_cntr_0), return -1;);
692 0 : if (talloc_reference(object->addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_0))) == NULL) {
693 0 : PyErr_NoMemory();
694 0 : return -1;
695 : }
696 0 : object->addresses[addresses_cntr_0] = *(struct nbt_rdata_address *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_0));
697 : }
698 : }
699 0 : return 0;
700 : }
701 :
702 : static PyGetSetDef py_nbt_rdata_netbios_getsetters[] = {
703 : {
704 : .name = discard_const_p(char, "length"),
705 : .get = py_nbt_rdata_netbios_get_length,
706 : .set = py_nbt_rdata_netbios_set_length,
707 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
708 : },
709 : {
710 : .name = discard_const_p(char, "addresses"),
711 : .get = py_nbt_rdata_netbios_get_addresses,
712 : .set = py_nbt_rdata_netbios_set_addresses,
713 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata_address")
714 : },
715 : { .name = NULL }
716 : };
717 :
718 0 : static PyObject *py_nbt_rdata_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
719 : {
720 0 : return pytalloc_new(struct nbt_rdata_netbios, type);
721 : }
722 :
723 :
724 : static PyTypeObject nbt_rdata_netbios_Type = {
725 : PyVarObject_HEAD_INIT(NULL, 0)
726 : .tp_name = "nbt.rdata_netbios",
727 : .tp_getset = py_nbt_rdata_netbios_getsetters,
728 : .tp_methods = NULL,
729 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
730 : .tp_new = py_nbt_rdata_netbios_new,
731 : };
732 :
733 :
734 0 : static PyObject *py_nbt_statistics_get_unit_id(PyObject *obj, void *closure)
735 : {
736 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
737 : PyObject *py_unit_id;
738 0 : py_unit_id = PyList_New(6);
739 0 : if (py_unit_id == NULL) {
740 0 : return NULL;
741 : }
742 : {
743 : int unit_id_cntr_0;
744 0 : for (unit_id_cntr_0 = 0; unit_id_cntr_0 < (6); unit_id_cntr_0++) {
745 : PyObject *py_unit_id_0;
746 0 : py_unit_id_0 = PyLong_FromLong((uint16_t)object->unit_id[unit_id_cntr_0]);
747 0 : PyList_SetItem(py_unit_id, unit_id_cntr_0, py_unit_id_0);
748 : }
749 : }
750 0 : return py_unit_id;
751 : }
752 :
753 0 : static int py_nbt_statistics_set_unit_id(PyObject *py_obj, PyObject *value, void *closure)
754 : {
755 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
756 0 : if (value == NULL) {
757 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unit_id");
758 0 : return -1;
759 : }
760 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
761 : {
762 : int unit_id_cntr_0;
763 0 : if (ARRAY_SIZE(object->unit_id) != PyList_GET_SIZE(value)) {
764 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));
765 0 : return -1;
766 : }
767 0 : for (unit_id_cntr_0 = 0; unit_id_cntr_0 < PyList_GET_SIZE(value); unit_id_cntr_0++) {
768 0 : if (PyList_GET_ITEM(value, unit_id_cntr_0) == NULL) {
769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unit_id[unit_id_cntr_0]");
770 0 : return -1;
771 : }
772 : {
773 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unit_id[unit_id_cntr_0]));
774 0 : if (PyLong_Check(PyList_GET_ITEM(value, unit_id_cntr_0))) {
775 : unsigned long long test_var;
776 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unit_id_cntr_0));
777 0 : if (PyErr_Occurred() != NULL) {
778 0 : return -1;
779 : }
780 0 : if (test_var > uint_max) {
781 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
782 : PyLong_Type.tp_name, uint_max, test_var);
783 0 : return -1;
784 : }
785 0 : object->unit_id[unit_id_cntr_0] = test_var;
786 : } else {
787 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
788 : PyLong_Type.tp_name);
789 0 : return -1;
790 : }
791 : }
792 : }
793 : }
794 0 : return 0;
795 : }
796 :
797 0 : static PyObject *py_nbt_statistics_get_jumpers(PyObject *obj, void *closure)
798 : {
799 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
800 : PyObject *py_jumpers;
801 0 : py_jumpers = PyLong_FromLong((uint16_t)object->jumpers);
802 0 : return py_jumpers;
803 : }
804 :
805 0 : static int py_nbt_statistics_set_jumpers(PyObject *py_obj, PyObject *value, void *closure)
806 : {
807 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
808 0 : if (value == NULL) {
809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->jumpers");
810 0 : return -1;
811 : }
812 : {
813 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->jumpers));
814 0 : if (PyLong_Check(value)) {
815 : unsigned long long test_var;
816 0 : test_var = PyLong_AsUnsignedLongLong(value);
817 0 : if (PyErr_Occurred() != NULL) {
818 0 : return -1;
819 : }
820 0 : if (test_var > uint_max) {
821 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
822 : PyLong_Type.tp_name, uint_max, test_var);
823 0 : return -1;
824 : }
825 0 : object->jumpers = test_var;
826 : } else {
827 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
828 : PyLong_Type.tp_name);
829 0 : return -1;
830 : }
831 : }
832 0 : return 0;
833 : }
834 :
835 0 : static PyObject *py_nbt_statistics_get_test_result(PyObject *obj, void *closure)
836 : {
837 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
838 : PyObject *py_test_result;
839 0 : py_test_result = PyLong_FromLong((uint16_t)object->test_result);
840 0 : return py_test_result;
841 : }
842 :
843 0 : static int py_nbt_statistics_set_test_result(PyObject *py_obj, PyObject *value, void *closure)
844 : {
845 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
846 0 : if (value == NULL) {
847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->test_result");
848 0 : return -1;
849 : }
850 : {
851 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->test_result));
852 0 : if (PyLong_Check(value)) {
853 : unsigned long long test_var;
854 0 : test_var = PyLong_AsUnsignedLongLong(value);
855 0 : if (PyErr_Occurred() != NULL) {
856 0 : return -1;
857 : }
858 0 : if (test_var > uint_max) {
859 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
860 : PyLong_Type.tp_name, uint_max, test_var);
861 0 : return -1;
862 : }
863 0 : object->test_result = test_var;
864 : } else {
865 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
866 : PyLong_Type.tp_name);
867 0 : return -1;
868 : }
869 : }
870 0 : return 0;
871 : }
872 :
873 0 : static PyObject *py_nbt_statistics_get_version_number(PyObject *obj, void *closure)
874 : {
875 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
876 : PyObject *py_version_number;
877 0 : py_version_number = PyLong_FromLong((uint16_t)object->version_number);
878 0 : return py_version_number;
879 : }
880 :
881 0 : static int py_nbt_statistics_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
882 : {
883 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
884 0 : if (value == NULL) {
885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version_number");
886 0 : return -1;
887 : }
888 : {
889 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_number));
890 0 : if (PyLong_Check(value)) {
891 : unsigned long long test_var;
892 0 : test_var = PyLong_AsUnsignedLongLong(value);
893 0 : if (PyErr_Occurred() != NULL) {
894 0 : return -1;
895 : }
896 0 : if (test_var > uint_max) {
897 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
898 : PyLong_Type.tp_name, uint_max, test_var);
899 0 : return -1;
900 : }
901 0 : object->version_number = test_var;
902 : } else {
903 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
904 : PyLong_Type.tp_name);
905 0 : return -1;
906 : }
907 : }
908 0 : return 0;
909 : }
910 :
911 0 : static PyObject *py_nbt_statistics_get_period_of_statistics(PyObject *obj, void *closure)
912 : {
913 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
914 : PyObject *py_period_of_statistics;
915 0 : py_period_of_statistics = PyLong_FromLong((uint16_t)object->period_of_statistics);
916 0 : return py_period_of_statistics;
917 : }
918 :
919 0 : static int py_nbt_statistics_set_period_of_statistics(PyObject *py_obj, PyObject *value, void *closure)
920 : {
921 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
922 0 : if (value == NULL) {
923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->period_of_statistics");
924 0 : return -1;
925 : }
926 : {
927 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->period_of_statistics));
928 0 : if (PyLong_Check(value)) {
929 : unsigned long long test_var;
930 0 : test_var = PyLong_AsUnsignedLongLong(value);
931 0 : if (PyErr_Occurred() != NULL) {
932 0 : return -1;
933 : }
934 0 : if (test_var > uint_max) {
935 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
936 : PyLong_Type.tp_name, uint_max, test_var);
937 0 : return -1;
938 : }
939 0 : object->period_of_statistics = test_var;
940 : } else {
941 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
942 : PyLong_Type.tp_name);
943 0 : return -1;
944 : }
945 : }
946 0 : return 0;
947 : }
948 :
949 0 : static PyObject *py_nbt_statistics_get_number_of_crcs(PyObject *obj, void *closure)
950 : {
951 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
952 : PyObject *py_number_of_crcs;
953 0 : py_number_of_crcs = PyLong_FromLong((uint16_t)object->number_of_crcs);
954 0 : return py_number_of_crcs;
955 : }
956 :
957 0 : static int py_nbt_statistics_set_number_of_crcs(PyObject *py_obj, PyObject *value, void *closure)
958 : {
959 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
960 0 : if (value == NULL) {
961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_of_crcs");
962 0 : return -1;
963 : }
964 : {
965 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_crcs));
966 0 : if (PyLong_Check(value)) {
967 : unsigned long long test_var;
968 0 : test_var = PyLong_AsUnsignedLongLong(value);
969 0 : if (PyErr_Occurred() != NULL) {
970 0 : return -1;
971 : }
972 0 : if (test_var > uint_max) {
973 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
974 : PyLong_Type.tp_name, uint_max, test_var);
975 0 : return -1;
976 : }
977 0 : object->number_of_crcs = test_var;
978 : } else {
979 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
980 : PyLong_Type.tp_name);
981 0 : return -1;
982 : }
983 : }
984 0 : return 0;
985 : }
986 :
987 0 : static PyObject *py_nbt_statistics_get_number_alignment_errors(PyObject *obj, void *closure)
988 : {
989 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
990 : PyObject *py_number_alignment_errors;
991 0 : py_number_alignment_errors = PyLong_FromLong((uint16_t)object->number_alignment_errors);
992 0 : return py_number_alignment_errors;
993 : }
994 :
995 0 : static int py_nbt_statistics_set_number_alignment_errors(PyObject *py_obj, PyObject *value, void *closure)
996 : {
997 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
998 0 : if (value == NULL) {
999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_alignment_errors");
1000 0 : return -1;
1001 : }
1002 : {
1003 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_alignment_errors));
1004 0 : if (PyLong_Check(value)) {
1005 : unsigned long long test_var;
1006 0 : test_var = PyLong_AsUnsignedLongLong(value);
1007 0 : if (PyErr_Occurred() != NULL) {
1008 0 : return -1;
1009 : }
1010 0 : if (test_var > uint_max) {
1011 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1012 : PyLong_Type.tp_name, uint_max, test_var);
1013 0 : return -1;
1014 : }
1015 0 : object->number_alignment_errors = test_var;
1016 : } else {
1017 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1018 : PyLong_Type.tp_name);
1019 0 : return -1;
1020 : }
1021 : }
1022 0 : return 0;
1023 : }
1024 :
1025 0 : static PyObject *py_nbt_statistics_get_number_of_collisions(PyObject *obj, void *closure)
1026 : {
1027 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1028 : PyObject *py_number_of_collisions;
1029 0 : py_number_of_collisions = PyLong_FromLong((uint16_t)object->number_of_collisions);
1030 0 : return py_number_of_collisions;
1031 : }
1032 :
1033 0 : static int py_nbt_statistics_set_number_of_collisions(PyObject *py_obj, PyObject *value, void *closure)
1034 : {
1035 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1036 0 : if (value == NULL) {
1037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_of_collisions");
1038 0 : return -1;
1039 : }
1040 : {
1041 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_collisions));
1042 0 : if (PyLong_Check(value)) {
1043 : unsigned long long test_var;
1044 0 : test_var = PyLong_AsUnsignedLongLong(value);
1045 0 : if (PyErr_Occurred() != NULL) {
1046 0 : return -1;
1047 : }
1048 0 : if (test_var > uint_max) {
1049 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1050 : PyLong_Type.tp_name, uint_max, test_var);
1051 0 : return -1;
1052 : }
1053 0 : object->number_of_collisions = test_var;
1054 : } else {
1055 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1056 : PyLong_Type.tp_name);
1057 0 : return -1;
1058 : }
1059 : }
1060 0 : return 0;
1061 : }
1062 :
1063 0 : static PyObject *py_nbt_statistics_get_number_send_aborts(PyObject *obj, void *closure)
1064 : {
1065 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1066 : PyObject *py_number_send_aborts;
1067 0 : py_number_send_aborts = PyLong_FromLong((uint16_t)object->number_send_aborts);
1068 0 : return py_number_send_aborts;
1069 : }
1070 :
1071 0 : static int py_nbt_statistics_set_number_send_aborts(PyObject *py_obj, PyObject *value, void *closure)
1072 : {
1073 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1074 0 : if (value == NULL) {
1075 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_send_aborts");
1076 0 : return -1;
1077 : }
1078 : {
1079 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_send_aborts));
1080 0 : if (PyLong_Check(value)) {
1081 : unsigned long long test_var;
1082 0 : test_var = PyLong_AsUnsignedLongLong(value);
1083 0 : if (PyErr_Occurred() != NULL) {
1084 0 : return -1;
1085 : }
1086 0 : if (test_var > uint_max) {
1087 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1088 : PyLong_Type.tp_name, uint_max, test_var);
1089 0 : return -1;
1090 : }
1091 0 : object->number_send_aborts = test_var;
1092 : } else {
1093 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1094 : PyLong_Type.tp_name);
1095 0 : return -1;
1096 : }
1097 : }
1098 0 : return 0;
1099 : }
1100 :
1101 0 : static PyObject *py_nbt_statistics_get_number_good_sends(PyObject *obj, void *closure)
1102 : {
1103 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1104 : PyObject *py_number_good_sends;
1105 0 : py_number_good_sends = PyLong_FromUnsignedLongLong((uint32_t)object->number_good_sends);
1106 0 : return py_number_good_sends;
1107 : }
1108 :
1109 0 : static int py_nbt_statistics_set_number_good_sends(PyObject *py_obj, PyObject *value, void *closure)
1110 : {
1111 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1112 0 : if (value == NULL) {
1113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_good_sends");
1114 0 : return -1;
1115 : }
1116 : {
1117 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_sends));
1118 0 : if (PyLong_Check(value)) {
1119 : unsigned long long test_var;
1120 0 : test_var = PyLong_AsUnsignedLongLong(value);
1121 0 : if (PyErr_Occurred() != NULL) {
1122 0 : return -1;
1123 : }
1124 0 : if (test_var > uint_max) {
1125 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1126 : PyLong_Type.tp_name, uint_max, test_var);
1127 0 : return -1;
1128 : }
1129 0 : object->number_good_sends = test_var;
1130 : } else {
1131 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1132 : PyLong_Type.tp_name);
1133 0 : return -1;
1134 : }
1135 : }
1136 0 : return 0;
1137 : }
1138 :
1139 0 : static PyObject *py_nbt_statistics_get_number_good_receives(PyObject *obj, void *closure)
1140 : {
1141 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1142 : PyObject *py_number_good_receives;
1143 0 : py_number_good_receives = PyLong_FromUnsignedLongLong((uint32_t)object->number_good_receives);
1144 0 : return py_number_good_receives;
1145 : }
1146 :
1147 0 : static int py_nbt_statistics_set_number_good_receives(PyObject *py_obj, PyObject *value, void *closure)
1148 : {
1149 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1150 0 : if (value == NULL) {
1151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_good_receives");
1152 0 : return -1;
1153 : }
1154 : {
1155 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_receives));
1156 0 : if (PyLong_Check(value)) {
1157 : unsigned long long test_var;
1158 0 : test_var = PyLong_AsUnsignedLongLong(value);
1159 0 : if (PyErr_Occurred() != NULL) {
1160 0 : return -1;
1161 : }
1162 0 : if (test_var > uint_max) {
1163 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1164 : PyLong_Type.tp_name, uint_max, test_var);
1165 0 : return -1;
1166 : }
1167 0 : object->number_good_receives = test_var;
1168 : } else {
1169 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1170 : PyLong_Type.tp_name);
1171 0 : return -1;
1172 : }
1173 : }
1174 0 : return 0;
1175 : }
1176 :
1177 0 : static PyObject *py_nbt_statistics_get_number_retransmits(PyObject *obj, void *closure)
1178 : {
1179 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1180 : PyObject *py_number_retransmits;
1181 0 : py_number_retransmits = PyLong_FromLong((uint16_t)object->number_retransmits);
1182 0 : return py_number_retransmits;
1183 : }
1184 :
1185 0 : static int py_nbt_statistics_set_number_retransmits(PyObject *py_obj, PyObject *value, void *closure)
1186 : {
1187 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1188 0 : if (value == NULL) {
1189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_retransmits");
1190 0 : return -1;
1191 : }
1192 : {
1193 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_retransmits));
1194 0 : if (PyLong_Check(value)) {
1195 : unsigned long long test_var;
1196 0 : test_var = PyLong_AsUnsignedLongLong(value);
1197 0 : if (PyErr_Occurred() != NULL) {
1198 0 : return -1;
1199 : }
1200 0 : if (test_var > uint_max) {
1201 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1202 : PyLong_Type.tp_name, uint_max, test_var);
1203 0 : return -1;
1204 : }
1205 0 : object->number_retransmits = test_var;
1206 : } else {
1207 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1208 : PyLong_Type.tp_name);
1209 0 : return -1;
1210 : }
1211 : }
1212 0 : return 0;
1213 : }
1214 :
1215 0 : static PyObject *py_nbt_statistics_get_number_no_resource_conditions(PyObject *obj, void *closure)
1216 : {
1217 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1218 : PyObject *py_number_no_resource_conditions;
1219 0 : py_number_no_resource_conditions = PyLong_FromLong((uint16_t)object->number_no_resource_conditions);
1220 0 : return py_number_no_resource_conditions;
1221 : }
1222 :
1223 0 : static int py_nbt_statistics_set_number_no_resource_conditions(PyObject *py_obj, PyObject *value, void *closure)
1224 : {
1225 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1226 0 : if (value == NULL) {
1227 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_no_resource_conditions");
1228 0 : return -1;
1229 : }
1230 : {
1231 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_no_resource_conditions));
1232 0 : if (PyLong_Check(value)) {
1233 : unsigned long long test_var;
1234 0 : test_var = PyLong_AsUnsignedLongLong(value);
1235 0 : if (PyErr_Occurred() != NULL) {
1236 0 : return -1;
1237 : }
1238 0 : if (test_var > uint_max) {
1239 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1240 : PyLong_Type.tp_name, uint_max, test_var);
1241 0 : return -1;
1242 : }
1243 0 : object->number_no_resource_conditions = test_var;
1244 : } else {
1245 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1246 : PyLong_Type.tp_name);
1247 0 : return -1;
1248 : }
1249 : }
1250 0 : return 0;
1251 : }
1252 :
1253 0 : static PyObject *py_nbt_statistics_get_number_free_command_blocks(PyObject *obj, void *closure)
1254 : {
1255 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1256 : PyObject *py_number_free_command_blocks;
1257 0 : py_number_free_command_blocks = PyLong_FromLong((uint16_t)object->number_free_command_blocks);
1258 0 : return py_number_free_command_blocks;
1259 : }
1260 :
1261 0 : static int py_nbt_statistics_set_number_free_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1262 : {
1263 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1264 0 : if (value == NULL) {
1265 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_free_command_blocks");
1266 0 : return -1;
1267 : }
1268 : {
1269 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_free_command_blocks));
1270 0 : if (PyLong_Check(value)) {
1271 : unsigned long long test_var;
1272 0 : test_var = PyLong_AsUnsignedLongLong(value);
1273 0 : if (PyErr_Occurred() != NULL) {
1274 0 : return -1;
1275 : }
1276 0 : if (test_var > uint_max) {
1277 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1278 : PyLong_Type.tp_name, uint_max, test_var);
1279 0 : return -1;
1280 : }
1281 0 : object->number_free_command_blocks = test_var;
1282 : } else {
1283 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1284 : PyLong_Type.tp_name);
1285 0 : return -1;
1286 : }
1287 : }
1288 0 : return 0;
1289 : }
1290 :
1291 0 : static PyObject *py_nbt_statistics_get_total_number_command_blocks(PyObject *obj, void *closure)
1292 : {
1293 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1294 : PyObject *py_total_number_command_blocks;
1295 0 : py_total_number_command_blocks = PyLong_FromLong((uint16_t)object->total_number_command_blocks);
1296 0 : return py_total_number_command_blocks;
1297 : }
1298 :
1299 0 : static int py_nbt_statistics_set_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1300 : {
1301 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1302 0 : if (value == NULL) {
1303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_number_command_blocks");
1304 0 : return -1;
1305 : }
1306 : {
1307 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_number_command_blocks));
1308 0 : if (PyLong_Check(value)) {
1309 : unsigned long long test_var;
1310 0 : test_var = PyLong_AsUnsignedLongLong(value);
1311 0 : if (PyErr_Occurred() != NULL) {
1312 0 : return -1;
1313 : }
1314 0 : if (test_var > uint_max) {
1315 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1316 : PyLong_Type.tp_name, uint_max, test_var);
1317 0 : return -1;
1318 : }
1319 0 : object->total_number_command_blocks = test_var;
1320 : } else {
1321 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1322 : PyLong_Type.tp_name);
1323 0 : return -1;
1324 : }
1325 : }
1326 0 : return 0;
1327 : }
1328 :
1329 0 : static PyObject *py_nbt_statistics_get_max_total_number_command_blocks(PyObject *obj, void *closure)
1330 : {
1331 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1332 : PyObject *py_max_total_number_command_blocks;
1333 0 : py_max_total_number_command_blocks = PyLong_FromLong((uint16_t)object->max_total_number_command_blocks);
1334 0 : return py_max_total_number_command_blocks;
1335 : }
1336 :
1337 0 : static int py_nbt_statistics_set_max_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1338 : {
1339 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1340 0 : if (value == NULL) {
1341 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_total_number_command_blocks");
1342 0 : return -1;
1343 : }
1344 : {
1345 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_number_command_blocks));
1346 0 : if (PyLong_Check(value)) {
1347 : unsigned long long test_var;
1348 0 : test_var = PyLong_AsUnsignedLongLong(value);
1349 0 : if (PyErr_Occurred() != NULL) {
1350 0 : return -1;
1351 : }
1352 0 : if (test_var > uint_max) {
1353 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1354 : PyLong_Type.tp_name, uint_max, test_var);
1355 0 : return -1;
1356 : }
1357 0 : object->max_total_number_command_blocks = test_var;
1358 : } else {
1359 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1360 : PyLong_Type.tp_name);
1361 0 : return -1;
1362 : }
1363 : }
1364 0 : return 0;
1365 : }
1366 :
1367 0 : static PyObject *py_nbt_statistics_get_number_pending_sessions(PyObject *obj, void *closure)
1368 : {
1369 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1370 : PyObject *py_number_pending_sessions;
1371 0 : py_number_pending_sessions = PyLong_FromLong((uint16_t)object->number_pending_sessions);
1372 0 : return py_number_pending_sessions;
1373 : }
1374 :
1375 0 : static int py_nbt_statistics_set_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
1376 : {
1377 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1378 0 : if (value == NULL) {
1379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_pending_sessions");
1380 0 : return -1;
1381 : }
1382 : {
1383 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_pending_sessions));
1384 0 : if (PyLong_Check(value)) {
1385 : unsigned long long test_var;
1386 0 : test_var = PyLong_AsUnsignedLongLong(value);
1387 0 : if (PyErr_Occurred() != NULL) {
1388 0 : return -1;
1389 : }
1390 0 : if (test_var > uint_max) {
1391 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1392 : PyLong_Type.tp_name, uint_max, test_var);
1393 0 : return -1;
1394 : }
1395 0 : object->number_pending_sessions = test_var;
1396 : } else {
1397 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1398 : PyLong_Type.tp_name);
1399 0 : return -1;
1400 : }
1401 : }
1402 0 : return 0;
1403 : }
1404 :
1405 0 : static PyObject *py_nbt_statistics_get_max_number_pending_sessions(PyObject *obj, void *closure)
1406 : {
1407 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1408 : PyObject *py_max_number_pending_sessions;
1409 0 : py_max_number_pending_sessions = PyLong_FromLong((uint16_t)object->max_number_pending_sessions);
1410 0 : return py_max_number_pending_sessions;
1411 : }
1412 :
1413 0 : static int py_nbt_statistics_set_max_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
1414 : {
1415 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1416 0 : if (value == NULL) {
1417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_number_pending_sessions");
1418 0 : return -1;
1419 : }
1420 : {
1421 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_number_pending_sessions));
1422 0 : if (PyLong_Check(value)) {
1423 : unsigned long long test_var;
1424 0 : test_var = PyLong_AsUnsignedLongLong(value);
1425 0 : if (PyErr_Occurred() != NULL) {
1426 0 : return -1;
1427 : }
1428 0 : if (test_var > uint_max) {
1429 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1430 : PyLong_Type.tp_name, uint_max, test_var);
1431 0 : return -1;
1432 : }
1433 0 : object->max_number_pending_sessions = test_var;
1434 : } else {
1435 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1436 : PyLong_Type.tp_name);
1437 0 : return -1;
1438 : }
1439 : }
1440 0 : return 0;
1441 : }
1442 :
1443 0 : static PyObject *py_nbt_statistics_get_max_total_sessions_possible(PyObject *obj, void *closure)
1444 : {
1445 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1446 : PyObject *py_max_total_sessions_possible;
1447 0 : py_max_total_sessions_possible = PyLong_FromLong((uint16_t)object->max_total_sessions_possible);
1448 0 : return py_max_total_sessions_possible;
1449 : }
1450 :
1451 0 : static int py_nbt_statistics_set_max_total_sessions_possible(PyObject *py_obj, PyObject *value, void *closure)
1452 : {
1453 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1454 0 : if (value == NULL) {
1455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_total_sessions_possible");
1456 0 : return -1;
1457 : }
1458 : {
1459 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_sessions_possible));
1460 0 : if (PyLong_Check(value)) {
1461 : unsigned long long test_var;
1462 0 : test_var = PyLong_AsUnsignedLongLong(value);
1463 0 : if (PyErr_Occurred() != NULL) {
1464 0 : return -1;
1465 : }
1466 0 : if (test_var > uint_max) {
1467 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1468 : PyLong_Type.tp_name, uint_max, test_var);
1469 0 : return -1;
1470 : }
1471 0 : object->max_total_sessions_possible = test_var;
1472 : } else {
1473 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1474 : PyLong_Type.tp_name);
1475 0 : return -1;
1476 : }
1477 : }
1478 0 : return 0;
1479 : }
1480 :
1481 0 : static PyObject *py_nbt_statistics_get_session_data_packet_size(PyObject *obj, void *closure)
1482 : {
1483 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
1484 : PyObject *py_session_data_packet_size;
1485 0 : py_session_data_packet_size = PyLong_FromLong((uint16_t)object->session_data_packet_size);
1486 0 : return py_session_data_packet_size;
1487 : }
1488 :
1489 0 : static int py_nbt_statistics_set_session_data_packet_size(PyObject *py_obj, PyObject *value, void *closure)
1490 : {
1491 0 : struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
1492 0 : if (value == NULL) {
1493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->session_data_packet_size");
1494 0 : return -1;
1495 : }
1496 : {
1497 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->session_data_packet_size));
1498 0 : if (PyLong_Check(value)) {
1499 : unsigned long long test_var;
1500 0 : test_var = PyLong_AsUnsignedLongLong(value);
1501 0 : if (PyErr_Occurred() != NULL) {
1502 0 : return -1;
1503 : }
1504 0 : if (test_var > uint_max) {
1505 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1506 : PyLong_Type.tp_name, uint_max, test_var);
1507 0 : return -1;
1508 : }
1509 0 : object->session_data_packet_size = test_var;
1510 : } else {
1511 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1512 : PyLong_Type.tp_name);
1513 0 : return -1;
1514 : }
1515 : }
1516 0 : return 0;
1517 : }
1518 :
1519 : static PyGetSetDef py_nbt_statistics_getsetters[] = {
1520 : {
1521 : .name = discard_const_p(char, "unit_id"),
1522 : .get = py_nbt_statistics_get_unit_id,
1523 : .set = py_nbt_statistics_set_unit_id,
1524 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1525 : },
1526 : {
1527 : .name = discard_const_p(char, "jumpers"),
1528 : .get = py_nbt_statistics_get_jumpers,
1529 : .set = py_nbt_statistics_set_jumpers,
1530 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1531 : },
1532 : {
1533 : .name = discard_const_p(char, "test_result"),
1534 : .get = py_nbt_statistics_get_test_result,
1535 : .set = py_nbt_statistics_set_test_result,
1536 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1537 : },
1538 : {
1539 : .name = discard_const_p(char, "version_number"),
1540 : .get = py_nbt_statistics_get_version_number,
1541 : .set = py_nbt_statistics_set_version_number,
1542 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1543 : },
1544 : {
1545 : .name = discard_const_p(char, "period_of_statistics"),
1546 : .get = py_nbt_statistics_get_period_of_statistics,
1547 : .set = py_nbt_statistics_set_period_of_statistics,
1548 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1549 : },
1550 : {
1551 : .name = discard_const_p(char, "number_of_crcs"),
1552 : .get = py_nbt_statistics_get_number_of_crcs,
1553 : .set = py_nbt_statistics_set_number_of_crcs,
1554 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1555 : },
1556 : {
1557 : .name = discard_const_p(char, "number_alignment_errors"),
1558 : .get = py_nbt_statistics_get_number_alignment_errors,
1559 : .set = py_nbt_statistics_set_number_alignment_errors,
1560 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1561 : },
1562 : {
1563 : .name = discard_const_p(char, "number_of_collisions"),
1564 : .get = py_nbt_statistics_get_number_of_collisions,
1565 : .set = py_nbt_statistics_set_number_of_collisions,
1566 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1567 : },
1568 : {
1569 : .name = discard_const_p(char, "number_send_aborts"),
1570 : .get = py_nbt_statistics_get_number_send_aborts,
1571 : .set = py_nbt_statistics_set_number_send_aborts,
1572 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1573 : },
1574 : {
1575 : .name = discard_const_p(char, "number_good_sends"),
1576 : .get = py_nbt_statistics_get_number_good_sends,
1577 : .set = py_nbt_statistics_set_number_good_sends,
1578 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1579 : },
1580 : {
1581 : .name = discard_const_p(char, "number_good_receives"),
1582 : .get = py_nbt_statistics_get_number_good_receives,
1583 : .set = py_nbt_statistics_set_number_good_receives,
1584 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1585 : },
1586 : {
1587 : .name = discard_const_p(char, "number_retransmits"),
1588 : .get = py_nbt_statistics_get_number_retransmits,
1589 : .set = py_nbt_statistics_set_number_retransmits,
1590 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1591 : },
1592 : {
1593 : .name = discard_const_p(char, "number_no_resource_conditions"),
1594 : .get = py_nbt_statistics_get_number_no_resource_conditions,
1595 : .set = py_nbt_statistics_set_number_no_resource_conditions,
1596 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1597 : },
1598 : {
1599 : .name = discard_const_p(char, "number_free_command_blocks"),
1600 : .get = py_nbt_statistics_get_number_free_command_blocks,
1601 : .set = py_nbt_statistics_set_number_free_command_blocks,
1602 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1603 : },
1604 : {
1605 : .name = discard_const_p(char, "total_number_command_blocks"),
1606 : .get = py_nbt_statistics_get_total_number_command_blocks,
1607 : .set = py_nbt_statistics_set_total_number_command_blocks,
1608 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1609 : },
1610 : {
1611 : .name = discard_const_p(char, "max_total_number_command_blocks"),
1612 : .get = py_nbt_statistics_get_max_total_number_command_blocks,
1613 : .set = py_nbt_statistics_set_max_total_number_command_blocks,
1614 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1615 : },
1616 : {
1617 : .name = discard_const_p(char, "number_pending_sessions"),
1618 : .get = py_nbt_statistics_get_number_pending_sessions,
1619 : .set = py_nbt_statistics_set_number_pending_sessions,
1620 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1621 : },
1622 : {
1623 : .name = discard_const_p(char, "max_number_pending_sessions"),
1624 : .get = py_nbt_statistics_get_max_number_pending_sessions,
1625 : .set = py_nbt_statistics_set_max_number_pending_sessions,
1626 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1627 : },
1628 : {
1629 : .name = discard_const_p(char, "max_total_sessions_possible"),
1630 : .get = py_nbt_statistics_get_max_total_sessions_possible,
1631 : .set = py_nbt_statistics_set_max_total_sessions_possible,
1632 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1633 : },
1634 : {
1635 : .name = discard_const_p(char, "session_data_packet_size"),
1636 : .get = py_nbt_statistics_get_session_data_packet_size,
1637 : .set = py_nbt_statistics_set_session_data_packet_size,
1638 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1639 : },
1640 : { .name = NULL }
1641 : };
1642 :
1643 0 : static PyObject *py_nbt_statistics_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1644 : {
1645 0 : return pytalloc_new(struct nbt_statistics, type);
1646 : }
1647 :
1648 :
1649 : static PyTypeObject nbt_statistics_Type = {
1650 : PyVarObject_HEAD_INIT(NULL, 0)
1651 : .tp_name = "nbt.statistics",
1652 : .tp_getset = py_nbt_statistics_getsetters,
1653 : .tp_methods = NULL,
1654 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1655 : .tp_new = py_nbt_statistics_new,
1656 : };
1657 :
1658 :
1659 0 : static PyObject *py_nbt_status_name_get_name(PyObject *obj, void *closure)
1660 : {
1661 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
1662 : PyObject *py_name;
1663 0 : if (object->name == NULL) {
1664 0 : py_name = Py_None;
1665 0 : Py_INCREF(py_name);
1666 : } else {
1667 0 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
1668 : }
1669 0 : return py_name;
1670 : }
1671 :
1672 0 : static int py_nbt_status_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
1673 : {
1674 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
1675 0 : if (value == NULL) {
1676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
1677 0 : return -1;
1678 : }
1679 : {
1680 : const char *test_str;
1681 : const char *talloc_str;
1682 0 : PyObject *unicode = NULL;
1683 0 : if (PyUnicode_Check(value)) {
1684 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1685 0 : if (unicode == NULL) {
1686 0 : PyErr_NoMemory();
1687 0 : return -1;
1688 : }
1689 0 : test_str = PyBytes_AS_STRING(unicode);
1690 0 : } else if (PyBytes_Check(value)) {
1691 0 : test_str = PyBytes_AS_STRING(value);
1692 : } else {
1693 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1694 0 : return -1;
1695 : }
1696 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1697 0 : if (unicode != NULL) {
1698 0 : Py_DECREF(unicode);
1699 : }
1700 0 : if (talloc_str == NULL) {
1701 0 : PyErr_NoMemory();
1702 0 : return -1;
1703 : }
1704 0 : object->name = talloc_str;
1705 : }
1706 0 : return 0;
1707 : }
1708 :
1709 0 : static PyObject *py_nbt_status_name_get_type(PyObject *obj, void *closure)
1710 : {
1711 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
1712 : PyObject *py_type;
1713 0 : py_type = PyLong_FromLong((uint16_t)object->type);
1714 0 : return py_type;
1715 : }
1716 :
1717 0 : static int py_nbt_status_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
1718 : {
1719 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
1720 0 : if (value == NULL) {
1721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
1722 0 : return -1;
1723 : }
1724 : {
1725 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1726 0 : if (PyLong_Check(value)) {
1727 : unsigned long long test_var;
1728 0 : test_var = PyLong_AsUnsignedLongLong(value);
1729 0 : if (PyErr_Occurred() != NULL) {
1730 0 : return -1;
1731 : }
1732 0 : if (test_var > uint_max) {
1733 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1734 : PyLong_Type.tp_name, uint_max, test_var);
1735 0 : return -1;
1736 : }
1737 0 : object->type = test_var;
1738 : } else {
1739 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1740 : PyLong_Type.tp_name);
1741 0 : return -1;
1742 : }
1743 : }
1744 0 : return 0;
1745 : }
1746 :
1747 0 : static PyObject *py_nbt_status_name_get_nb_flags(PyObject *obj, void *closure)
1748 : {
1749 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
1750 : PyObject *py_nb_flags;
1751 0 : py_nb_flags = PyLong_FromLong((uint16_t)object->nb_flags);
1752 0 : return py_nb_flags;
1753 : }
1754 :
1755 0 : static int py_nbt_status_name_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
1756 : {
1757 0 : struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
1758 0 : if (value == NULL) {
1759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nb_flags");
1760 0 : return -1;
1761 : }
1762 : {
1763 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
1764 0 : if (PyLong_Check(value)) {
1765 : unsigned long long test_var;
1766 0 : test_var = PyLong_AsUnsignedLongLong(value);
1767 0 : if (PyErr_Occurred() != NULL) {
1768 0 : return -1;
1769 : }
1770 0 : if (test_var > uint_max) {
1771 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1772 : PyLong_Type.tp_name, uint_max, test_var);
1773 0 : return -1;
1774 : }
1775 0 : object->nb_flags = test_var;
1776 : } else {
1777 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1778 : PyLong_Type.tp_name);
1779 0 : return -1;
1780 : }
1781 : }
1782 0 : return 0;
1783 : }
1784 :
1785 : static PyGetSetDef py_nbt_status_name_getsetters[] = {
1786 : {
1787 : .name = discard_const_p(char, "name"),
1788 : .get = py_nbt_status_name_get_name,
1789 : .set = py_nbt_status_name_set_name,
1790 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1791 : },
1792 : {
1793 : .name = discard_const_p(char, "type"),
1794 : .get = py_nbt_status_name_get_type,
1795 : .set = py_nbt_status_name_set_type,
1796 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
1797 : },
1798 : {
1799 : .name = discard_const_p(char, "nb_flags"),
1800 : .get = py_nbt_status_name_get_nb_flags,
1801 : .set = py_nbt_status_name_set_nb_flags,
1802 : .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
1803 : },
1804 : { .name = NULL }
1805 : };
1806 :
1807 0 : static PyObject *py_nbt_status_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1808 : {
1809 0 : return pytalloc_new(struct nbt_status_name, type);
1810 : }
1811 :
1812 :
1813 : static PyTypeObject nbt_status_name_Type = {
1814 : PyVarObject_HEAD_INIT(NULL, 0)
1815 : .tp_name = "nbt.status_name",
1816 : .tp_getset = py_nbt_status_name_getsetters,
1817 : .tp_methods = NULL,
1818 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1819 : .tp_new = py_nbt_status_name_new,
1820 : };
1821 :
1822 :
1823 0 : static PyObject *py_nbt_rdata_status_get_length(PyObject *obj, void *closure)
1824 : {
1825 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1826 : PyObject *py_length;
1827 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1828 0 : return py_length;
1829 : }
1830 :
1831 0 : static int py_nbt_rdata_status_set_length(PyObject *py_obj, PyObject *value, void *closure)
1832 : {
1833 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1834 0 : if (value == NULL) {
1835 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1836 0 : return -1;
1837 : }
1838 : {
1839 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1840 0 : if (PyLong_Check(value)) {
1841 : unsigned long long test_var;
1842 0 : test_var = PyLong_AsUnsignedLongLong(value);
1843 0 : if (PyErr_Occurred() != NULL) {
1844 0 : return -1;
1845 : }
1846 0 : if (test_var > uint_max) {
1847 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1848 : PyLong_Type.tp_name, uint_max, test_var);
1849 0 : return -1;
1850 : }
1851 0 : object->length = test_var;
1852 : } else {
1853 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1854 : PyLong_Type.tp_name);
1855 0 : return -1;
1856 : }
1857 : }
1858 0 : return 0;
1859 : }
1860 :
1861 0 : static PyObject *py_nbt_rdata_status_get_num_names(PyObject *obj, void *closure)
1862 : {
1863 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1864 : PyObject *py_num_names;
1865 0 : py_num_names = PyLong_FromLong((uint16_t)object->num_names);
1866 0 : return py_num_names;
1867 : }
1868 :
1869 0 : static int py_nbt_rdata_status_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
1870 : {
1871 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1872 0 : if (value == NULL) {
1873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_names");
1874 0 : return -1;
1875 : }
1876 : {
1877 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_names));
1878 0 : if (PyLong_Check(value)) {
1879 : unsigned long long test_var;
1880 0 : test_var = PyLong_AsUnsignedLongLong(value);
1881 0 : if (PyErr_Occurred() != NULL) {
1882 0 : return -1;
1883 : }
1884 0 : if (test_var > uint_max) {
1885 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1886 : PyLong_Type.tp_name, uint_max, test_var);
1887 0 : return -1;
1888 : }
1889 0 : object->num_names = test_var;
1890 : } else {
1891 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1892 : PyLong_Type.tp_name);
1893 0 : return -1;
1894 : }
1895 : }
1896 0 : return 0;
1897 : }
1898 :
1899 0 : static PyObject *py_nbt_rdata_status_get_names(PyObject *obj, void *closure)
1900 : {
1901 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1902 : PyObject *py_names;
1903 0 : py_names = PyList_New(object->num_names);
1904 0 : if (py_names == NULL) {
1905 0 : return NULL;
1906 : }
1907 : {
1908 : int names_cntr_0;
1909 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->num_names); names_cntr_0++) {
1910 : PyObject *py_names_0;
1911 0 : py_names_0 = pytalloc_reference_ex(&nbt_status_name_Type, object->names, &object->names[names_cntr_0]);
1912 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
1913 : }
1914 : }
1915 0 : return py_names;
1916 : }
1917 :
1918 0 : static int py_nbt_rdata_status_set_names(PyObject *py_obj, PyObject *value, void *closure)
1919 : {
1920 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1921 0 : if (value == NULL) {
1922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
1923 0 : return -1;
1924 : }
1925 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1926 : {
1927 : int names_cntr_0;
1928 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
1929 0 : if (!object->names) { return -1;; }
1930 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
1931 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
1932 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
1933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_0]");
1934 0 : return -1;
1935 : }
1936 0 : PY_CHECK_TYPE(&nbt_status_name_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
1937 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
1938 0 : PyErr_NoMemory();
1939 0 : return -1;
1940 : }
1941 0 : object->names[names_cntr_0] = *(struct nbt_status_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
1942 : }
1943 : }
1944 0 : return 0;
1945 : }
1946 :
1947 0 : static PyObject *py_nbt_rdata_status_get_statistics(PyObject *obj, void *closure)
1948 : {
1949 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
1950 : PyObject *py_statistics;
1951 0 : py_statistics = pytalloc_reference_ex(&nbt_statistics_Type, pytalloc_get_mem_ctx(obj), &object->statistics);
1952 0 : return py_statistics;
1953 : }
1954 :
1955 0 : static int py_nbt_rdata_status_set_statistics(PyObject *py_obj, PyObject *value, void *closure)
1956 : {
1957 0 : struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
1958 0 : if (value == NULL) {
1959 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->statistics");
1960 0 : return -1;
1961 : }
1962 0 : PY_CHECK_TYPE(&nbt_statistics_Type, value, return -1;);
1963 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1964 0 : PyErr_NoMemory();
1965 0 : return -1;
1966 : }
1967 0 : object->statistics = *(struct nbt_statistics *)pytalloc_get_ptr(value);
1968 0 : return 0;
1969 : }
1970 :
1971 : static PyGetSetDef py_nbt_rdata_status_getsetters[] = {
1972 : {
1973 : .name = discard_const_p(char, "length"),
1974 : .get = py_nbt_rdata_status_get_length,
1975 : .set = py_nbt_rdata_status_set_length,
1976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1977 : },
1978 : {
1979 : .name = discard_const_p(char, "num_names"),
1980 : .get = py_nbt_rdata_status_get_num_names,
1981 : .set = py_nbt_rdata_status_set_num_names,
1982 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1983 : },
1984 : {
1985 : .name = discard_const_p(char, "names"),
1986 : .get = py_nbt_rdata_status_get_names,
1987 : .set = py_nbt_rdata_status_set_names,
1988 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_status_name")
1989 : },
1990 : {
1991 : .name = discard_const_p(char, "statistics"),
1992 : .get = py_nbt_rdata_status_get_statistics,
1993 : .set = py_nbt_rdata_status_set_statistics,
1994 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_statistics")
1995 : },
1996 : { .name = NULL }
1997 : };
1998 :
1999 0 : static PyObject *py_nbt_rdata_status_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2000 : {
2001 0 : return pytalloc_new(struct nbt_rdata_status, type);
2002 : }
2003 :
2004 :
2005 : static PyTypeObject nbt_rdata_status_Type = {
2006 : PyVarObject_HEAD_INIT(NULL, 0)
2007 : .tp_name = "nbt.rdata_status",
2008 : .tp_getset = py_nbt_rdata_status_getsetters,
2009 : .tp_methods = NULL,
2010 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2011 : .tp_new = py_nbt_rdata_status_new,
2012 : };
2013 :
2014 :
2015 0 : static PyObject *py_nbt_rdata_data_get_length(PyObject *obj, void *closure)
2016 : {
2017 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(obj);
2018 : PyObject *py_length;
2019 0 : py_length = PyLong_FromLong((uint16_t)object->length);
2020 0 : return py_length;
2021 : }
2022 :
2023 0 : static int py_nbt_rdata_data_set_length(PyObject *py_obj, PyObject *value, void *closure)
2024 : {
2025 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(py_obj);
2026 0 : if (value == NULL) {
2027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
2028 0 : return -1;
2029 : }
2030 : {
2031 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
2032 0 : if (PyLong_Check(value)) {
2033 : unsigned long long test_var;
2034 0 : test_var = PyLong_AsUnsignedLongLong(value);
2035 0 : if (PyErr_Occurred() != NULL) {
2036 0 : return -1;
2037 : }
2038 0 : if (test_var > uint_max) {
2039 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2040 : PyLong_Type.tp_name, uint_max, test_var);
2041 0 : return -1;
2042 : }
2043 0 : object->length = test_var;
2044 : } else {
2045 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2046 : PyLong_Type.tp_name);
2047 0 : return -1;
2048 : }
2049 : }
2050 0 : return 0;
2051 : }
2052 :
2053 0 : static PyObject *py_nbt_rdata_data_get_data(PyObject *obj, void *closure)
2054 : {
2055 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(obj);
2056 : PyObject *py_data;
2057 0 : py_data = PyList_New(object->length);
2058 0 : if (py_data == NULL) {
2059 0 : return NULL;
2060 : }
2061 : {
2062 : int data_cntr_0;
2063 0 : for (data_cntr_0 = 0; data_cntr_0 < (object->length); data_cntr_0++) {
2064 : PyObject *py_data_0;
2065 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
2066 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
2067 : }
2068 : }
2069 0 : return py_data;
2070 : }
2071 :
2072 0 : static int py_nbt_rdata_data_set_data(PyObject *py_obj, PyObject *value, void *closure)
2073 : {
2074 0 : struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(py_obj);
2075 0 : if (value == NULL) {
2076 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
2077 0 : return -1;
2078 : }
2079 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2080 : {
2081 : int data_cntr_0;
2082 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
2083 0 : if (!object->data) { return -1;; }
2084 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
2085 0 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
2086 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
2087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
2088 0 : return -1;
2089 : }
2090 : {
2091 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
2092 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
2093 : unsigned long long test_var;
2094 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
2095 0 : if (PyErr_Occurred() != NULL) {
2096 0 : return -1;
2097 : }
2098 0 : if (test_var > uint_max) {
2099 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2100 : PyLong_Type.tp_name, uint_max, test_var);
2101 0 : return -1;
2102 : }
2103 0 : object->data[data_cntr_0] = test_var;
2104 : } else {
2105 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2106 : PyLong_Type.tp_name);
2107 0 : return -1;
2108 : }
2109 : }
2110 : }
2111 : }
2112 0 : return 0;
2113 : }
2114 :
2115 : static PyGetSetDef py_nbt_rdata_data_getsetters[] = {
2116 : {
2117 : .name = discard_const_p(char, "length"),
2118 : .get = py_nbt_rdata_data_get_length,
2119 : .set = py_nbt_rdata_data_set_length,
2120 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2121 : },
2122 : {
2123 : .name = discard_const_p(char, "data"),
2124 : .get = py_nbt_rdata_data_get_data,
2125 : .set = py_nbt_rdata_data_set_data,
2126 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2127 : },
2128 : { .name = NULL }
2129 : };
2130 :
2131 0 : static PyObject *py_nbt_rdata_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2132 : {
2133 0 : return pytalloc_new(struct nbt_rdata_data, type);
2134 : }
2135 :
2136 :
2137 : static PyTypeObject nbt_rdata_data_Type = {
2138 : PyVarObject_HEAD_INIT(NULL, 0)
2139 : .tp_name = "nbt.rdata_data",
2140 : .tp_getset = py_nbt_rdata_data_getsetters,
2141 : .tp_methods = NULL,
2142 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2143 : .tp_new = py_nbt_rdata_data_new,
2144 : };
2145 :
2146 0 : static PyObject *py_import_nbt_rdata(TALLOC_CTX *mem_ctx, int level, union nbt_rdata *in)
2147 : {
2148 : PyObject *ret;
2149 :
2150 0 : switch (level) {
2151 0 : case NBT_QTYPE_NETBIOS:
2152 0 : ret = pytalloc_reference_ex(&nbt_rdata_netbios_Type, mem_ctx, &in->netbios);
2153 0 : return ret;
2154 :
2155 0 : case NBT_QTYPE_STATUS:
2156 0 : ret = pytalloc_reference_ex(&nbt_rdata_status_Type, mem_ctx, &in->status);
2157 0 : return ret;
2158 :
2159 0 : default:
2160 0 : ret = pytalloc_reference_ex(&nbt_rdata_data_Type, mem_ctx, &in->data);
2161 0 : return ret;
2162 :
2163 : }
2164 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2165 : return NULL;
2166 : }
2167 :
2168 0 : static union nbt_rdata *py_export_nbt_rdata(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2169 : {
2170 0 : union nbt_rdata *ret = talloc_zero(mem_ctx, union nbt_rdata);
2171 0 : switch (level) {
2172 0 : case NBT_QTYPE_NETBIOS:
2173 0 : if (in == NULL) {
2174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->netbios");
2175 0 : talloc_free(ret); return NULL;
2176 : }
2177 0 : PY_CHECK_TYPE(&nbt_rdata_netbios_Type, in, talloc_free(ret); return NULL;);
2178 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2179 0 : PyErr_NoMemory();
2180 0 : talloc_free(ret); return NULL;
2181 : }
2182 0 : ret->netbios = *(struct nbt_rdata_netbios *)pytalloc_get_ptr(in);
2183 0 : break;
2184 :
2185 0 : case NBT_QTYPE_STATUS:
2186 0 : if (in == NULL) {
2187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->status");
2188 0 : talloc_free(ret); return NULL;
2189 : }
2190 0 : PY_CHECK_TYPE(&nbt_rdata_status_Type, in, talloc_free(ret); return NULL;);
2191 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2192 0 : PyErr_NoMemory();
2193 0 : talloc_free(ret); return NULL;
2194 : }
2195 0 : ret->status = *(struct nbt_rdata_status *)pytalloc_get_ptr(in);
2196 0 : break;
2197 :
2198 0 : default:
2199 0 : if (in == NULL) {
2200 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
2201 0 : talloc_free(ret); return NULL;
2202 : }
2203 0 : PY_CHECK_TYPE(&nbt_rdata_data_Type, in, talloc_free(ret); return NULL;);
2204 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2205 0 : PyErr_NoMemory();
2206 0 : talloc_free(ret); return NULL;
2207 : }
2208 0 : ret->data = *(struct nbt_rdata_data *)pytalloc_get_ptr(in);
2209 0 : break;
2210 :
2211 : }
2212 :
2213 0 : return ret;
2214 : }
2215 :
2216 0 : static PyObject *py_nbt_rdata_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2217 : {
2218 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2219 0 : PyObject *mem_ctx_obj = NULL;
2220 0 : TALLOC_CTX *mem_ctx = NULL;
2221 0 : int level = 0;
2222 0 : PyObject *in_obj = NULL;
2223 0 : union nbt_rdata *in = NULL;
2224 :
2225 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2226 : discard_const_p(char *, kwnames),
2227 : &mem_ctx_obj,
2228 : &level,
2229 : &in_obj)) {
2230 0 : return NULL;
2231 : }
2232 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2233 0 : if (mem_ctx == NULL) {
2234 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2235 0 : return NULL;
2236 : }
2237 0 : in = (union nbt_rdata *)pytalloc_get_ptr(in_obj);
2238 0 : if (in == NULL) {
2239 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_rdata!");
2240 0 : return NULL;
2241 : }
2242 :
2243 0 : return py_import_nbt_rdata(mem_ctx, level, in);
2244 : }
2245 :
2246 0 : static PyObject *py_nbt_rdata_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2247 : {
2248 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2249 0 : PyObject *mem_ctx_obj = NULL;
2250 0 : TALLOC_CTX *mem_ctx = NULL;
2251 0 : int level = 0;
2252 0 : PyObject *in = NULL;
2253 0 : union nbt_rdata *out = NULL;
2254 :
2255 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2256 : discard_const_p(char *, kwnames),
2257 : &mem_ctx_obj,
2258 : &level,
2259 : &in)) {
2260 0 : return NULL;
2261 : }
2262 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2263 0 : if (mem_ctx == NULL) {
2264 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2265 0 : return NULL;
2266 : }
2267 :
2268 0 : out = py_export_nbt_rdata(mem_ctx, level, in);
2269 0 : if (out == NULL) {
2270 0 : return NULL;
2271 : }
2272 :
2273 0 : return pytalloc_GenericObject_reference(out);
2274 : }
2275 :
2276 : static PyMethodDef py_nbt_rdata_methods[] = {
2277 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_import),
2278 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2279 : "T.__import__(mem_ctx, level, in) => ret." },
2280 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_export),
2281 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2282 : "T.__export__(mem_ctx, level, in) => ret." },
2283 : { NULL, NULL, 0, NULL }
2284 : };
2285 :
2286 0 : static PyObject *py_nbt_rdata_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2287 : {
2288 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2289 0 : return NULL;
2290 : }
2291 :
2292 :
2293 : static PyTypeObject nbt_rdata_Type = {
2294 : PyVarObject_HEAD_INIT(NULL, 0)
2295 : .tp_name = "nbt.rdata",
2296 : .tp_getset = NULL,
2297 : .tp_methods = py_nbt_rdata_methods,
2298 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2299 : .tp_new = py_nbt_rdata_new,
2300 : };
2301 :
2302 :
2303 0 : static PyObject *py_nbt_res_rec_get_name(PyObject *obj, void *closure)
2304 : {
2305 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2306 : PyObject *py_name;
2307 0 : py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
2308 0 : return py_name;
2309 : }
2310 :
2311 0 : static int py_nbt_res_rec_set_name(PyObject *py_obj, PyObject *value, void *closure)
2312 : {
2313 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2314 0 : if (value == NULL) {
2315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
2316 0 : return -1;
2317 : }
2318 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
2319 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2320 0 : PyErr_NoMemory();
2321 0 : return -1;
2322 : }
2323 0 : object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
2324 0 : return 0;
2325 : }
2326 :
2327 0 : static PyObject *py_nbt_res_rec_get_rr_type(PyObject *obj, void *closure)
2328 : {
2329 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2330 : PyObject *py_rr_type;
2331 0 : py_rr_type = PyLong_FromLong((uint16_t)object->rr_type);
2332 0 : return py_rr_type;
2333 : }
2334 :
2335 0 : static int py_nbt_res_rec_set_rr_type(PyObject *py_obj, PyObject *value, void *closure)
2336 : {
2337 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2338 0 : if (value == NULL) {
2339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rr_type");
2340 0 : return -1;
2341 : }
2342 : {
2343 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_type));
2344 0 : if (PyLong_Check(value)) {
2345 : unsigned long long test_var;
2346 0 : test_var = PyLong_AsUnsignedLongLong(value);
2347 0 : if (PyErr_Occurred() != NULL) {
2348 0 : return -1;
2349 : }
2350 0 : if (test_var > uint_max) {
2351 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2352 : PyLong_Type.tp_name, uint_max, test_var);
2353 0 : return -1;
2354 : }
2355 0 : object->rr_type = test_var;
2356 : } else {
2357 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2358 : PyLong_Type.tp_name);
2359 0 : return -1;
2360 : }
2361 : }
2362 0 : return 0;
2363 : }
2364 :
2365 0 : static PyObject *py_nbt_res_rec_get_rr_class(PyObject *obj, void *closure)
2366 : {
2367 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2368 : PyObject *py_rr_class;
2369 0 : py_rr_class = PyLong_FromLong((uint16_t)object->rr_class);
2370 0 : return py_rr_class;
2371 : }
2372 :
2373 0 : static int py_nbt_res_rec_set_rr_class(PyObject *py_obj, PyObject *value, void *closure)
2374 : {
2375 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2376 0 : if (value == NULL) {
2377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rr_class");
2378 0 : return -1;
2379 : }
2380 : {
2381 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_class));
2382 0 : if (PyLong_Check(value)) {
2383 : unsigned long long test_var;
2384 0 : test_var = PyLong_AsUnsignedLongLong(value);
2385 0 : if (PyErr_Occurred() != NULL) {
2386 0 : return -1;
2387 : }
2388 0 : if (test_var > uint_max) {
2389 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2390 : PyLong_Type.tp_name, uint_max, test_var);
2391 0 : return -1;
2392 : }
2393 0 : object->rr_class = test_var;
2394 : } else {
2395 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2396 : PyLong_Type.tp_name);
2397 0 : return -1;
2398 : }
2399 : }
2400 0 : return 0;
2401 : }
2402 :
2403 0 : static PyObject *py_nbt_res_rec_get_ttl(PyObject *obj, void *closure)
2404 : {
2405 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2406 : PyObject *py_ttl;
2407 0 : py_ttl = PyLong_FromUnsignedLongLong((uint32_t)object->ttl);
2408 0 : return py_ttl;
2409 : }
2410 :
2411 0 : static int py_nbt_res_rec_set_ttl(PyObject *py_obj, PyObject *value, void *closure)
2412 : {
2413 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2414 0 : if (value == NULL) {
2415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ttl");
2416 0 : return -1;
2417 : }
2418 : {
2419 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ttl));
2420 0 : if (PyLong_Check(value)) {
2421 : unsigned long long test_var;
2422 0 : test_var = PyLong_AsUnsignedLongLong(value);
2423 0 : if (PyErr_Occurred() != NULL) {
2424 0 : return -1;
2425 : }
2426 0 : if (test_var > uint_max) {
2427 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2428 : PyLong_Type.tp_name, uint_max, test_var);
2429 0 : return -1;
2430 : }
2431 0 : object->ttl = test_var;
2432 : } else {
2433 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2434 : PyLong_Type.tp_name);
2435 0 : return -1;
2436 : }
2437 : }
2438 0 : return 0;
2439 : }
2440 :
2441 0 : static PyObject *py_nbt_res_rec_get_rdata(PyObject *obj, void *closure)
2442 : {
2443 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
2444 : PyObject *py_rdata;
2445 0 : py_rdata = pyrpc_import_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(obj), object->rr_type, &object->rdata, "union nbt_rdata");
2446 0 : if (py_rdata == NULL) {
2447 0 : return NULL;
2448 : }
2449 0 : return py_rdata;
2450 : }
2451 :
2452 0 : static int py_nbt_res_rec_set_rdata(PyObject *py_obj, PyObject *value, void *closure)
2453 : {
2454 0 : struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
2455 0 : if (value == NULL) {
2456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rdata");
2457 0 : return -1;
2458 : }
2459 : {
2460 : union nbt_rdata *rdata_switch_0;
2461 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");
2462 0 : if (rdata_switch_0 == NULL) {
2463 0 : return -1;
2464 : }
2465 0 : object->rdata = *rdata_switch_0;
2466 : }
2467 0 : return 0;
2468 : }
2469 :
2470 : static PyGetSetDef py_nbt_res_rec_getsetters[] = {
2471 : {
2472 : .name = discard_const_p(char, "name"),
2473 : .get = py_nbt_res_rec_get_name,
2474 : .set = py_nbt_res_rec_set_name,
2475 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
2476 : },
2477 : {
2478 : .name = discard_const_p(char, "rr_type"),
2479 : .get = py_nbt_res_rec_get_rr_type,
2480 : .set = py_nbt_res_rec_set_rr_type,
2481 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
2482 : },
2483 : {
2484 : .name = discard_const_p(char, "rr_class"),
2485 : .get = py_nbt_res_rec_get_rr_class,
2486 : .set = py_nbt_res_rec_set_rr_class,
2487 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
2488 : },
2489 : {
2490 : .name = discard_const_p(char, "ttl"),
2491 : .get = py_nbt_res_rec_get_ttl,
2492 : .set = py_nbt_res_rec_set_ttl,
2493 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2494 : },
2495 : {
2496 : .name = discard_const_p(char, "rdata"),
2497 : .get = py_nbt_res_rec_get_rdata,
2498 : .set = py_nbt_res_rec_set_rdata,
2499 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata")
2500 : },
2501 : { .name = NULL }
2502 : };
2503 :
2504 0 : static PyObject *py_nbt_res_rec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2505 : {
2506 0 : return pytalloc_new(struct nbt_res_rec, type);
2507 : }
2508 :
2509 :
2510 : static PyTypeObject nbt_res_rec_Type = {
2511 : PyVarObject_HEAD_INIT(NULL, 0)
2512 : .tp_name = "nbt.res_rec",
2513 : .tp_getset = py_nbt_res_rec_getsetters,
2514 : .tp_methods = NULL,
2515 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2516 : .tp_new = py_nbt_res_rec_new,
2517 : };
2518 :
2519 :
2520 0 : static PyObject *py_nbt_name_packet_get_name_trn_id(PyObject *obj, void *closure)
2521 : {
2522 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2523 : PyObject *py_name_trn_id;
2524 0 : py_name_trn_id = PyLong_FromLong((uint16_t)object->name_trn_id);
2525 0 : return py_name_trn_id;
2526 : }
2527 :
2528 0 : static int py_nbt_name_packet_set_name_trn_id(PyObject *py_obj, PyObject *value, void *closure)
2529 : {
2530 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2531 0 : if (value == NULL) {
2532 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name_trn_id");
2533 0 : return -1;
2534 : }
2535 : {
2536 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_trn_id));
2537 0 : if (PyLong_Check(value)) {
2538 : unsigned long long test_var;
2539 0 : test_var = PyLong_AsUnsignedLongLong(value);
2540 0 : if (PyErr_Occurred() != NULL) {
2541 0 : return -1;
2542 : }
2543 0 : if (test_var > uint_max) {
2544 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2545 : PyLong_Type.tp_name, uint_max, test_var);
2546 0 : return -1;
2547 : }
2548 0 : object->name_trn_id = test_var;
2549 : } else {
2550 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2551 : PyLong_Type.tp_name);
2552 0 : return -1;
2553 : }
2554 : }
2555 0 : return 0;
2556 : }
2557 :
2558 0 : static PyObject *py_nbt_name_packet_get_operation(PyObject *obj, void *closure)
2559 : {
2560 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2561 : PyObject *py_operation;
2562 0 : py_operation = PyLong_FromLong((uint16_t)object->operation);
2563 0 : return py_operation;
2564 : }
2565 :
2566 0 : static int py_nbt_name_packet_set_operation(PyObject *py_obj, PyObject *value, void *closure)
2567 : {
2568 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2569 0 : if (value == NULL) {
2570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->operation");
2571 0 : return -1;
2572 : }
2573 : {
2574 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->operation));
2575 0 : if (PyLong_Check(value)) {
2576 : unsigned long long test_var;
2577 0 : test_var = PyLong_AsUnsignedLongLong(value);
2578 0 : if (PyErr_Occurred() != NULL) {
2579 0 : return -1;
2580 : }
2581 0 : if (test_var > uint_max) {
2582 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2583 : PyLong_Type.tp_name, uint_max, test_var);
2584 0 : return -1;
2585 : }
2586 0 : object->operation = test_var;
2587 : } else {
2588 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2589 : PyLong_Type.tp_name);
2590 0 : return -1;
2591 : }
2592 : }
2593 0 : return 0;
2594 : }
2595 :
2596 0 : static PyObject *py_nbt_name_packet_get_qdcount(PyObject *obj, void *closure)
2597 : {
2598 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2599 : PyObject *py_qdcount;
2600 0 : py_qdcount = PyLong_FromLong((uint16_t)object->qdcount);
2601 0 : return py_qdcount;
2602 : }
2603 :
2604 0 : static int py_nbt_name_packet_set_qdcount(PyObject *py_obj, PyObject *value, void *closure)
2605 : {
2606 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2607 0 : if (value == NULL) {
2608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->qdcount");
2609 0 : return -1;
2610 : }
2611 : {
2612 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->qdcount));
2613 0 : if (PyLong_Check(value)) {
2614 : unsigned long long test_var;
2615 0 : test_var = PyLong_AsUnsignedLongLong(value);
2616 0 : if (PyErr_Occurred() != NULL) {
2617 0 : return -1;
2618 : }
2619 0 : if (test_var > uint_max) {
2620 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2621 : PyLong_Type.tp_name, uint_max, test_var);
2622 0 : return -1;
2623 : }
2624 0 : object->qdcount = test_var;
2625 : } else {
2626 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2627 : PyLong_Type.tp_name);
2628 0 : return -1;
2629 : }
2630 : }
2631 0 : return 0;
2632 : }
2633 :
2634 0 : static PyObject *py_nbt_name_packet_get_ancount(PyObject *obj, void *closure)
2635 : {
2636 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2637 : PyObject *py_ancount;
2638 0 : py_ancount = PyLong_FromLong((uint16_t)object->ancount);
2639 0 : return py_ancount;
2640 : }
2641 :
2642 0 : static int py_nbt_name_packet_set_ancount(PyObject *py_obj, PyObject *value, void *closure)
2643 : {
2644 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2645 0 : if (value == NULL) {
2646 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ancount");
2647 0 : return -1;
2648 : }
2649 : {
2650 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ancount));
2651 0 : if (PyLong_Check(value)) {
2652 : unsigned long long test_var;
2653 0 : test_var = PyLong_AsUnsignedLongLong(value);
2654 0 : if (PyErr_Occurred() != NULL) {
2655 0 : return -1;
2656 : }
2657 0 : if (test_var > uint_max) {
2658 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2659 : PyLong_Type.tp_name, uint_max, test_var);
2660 0 : return -1;
2661 : }
2662 0 : object->ancount = test_var;
2663 : } else {
2664 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2665 : PyLong_Type.tp_name);
2666 0 : return -1;
2667 : }
2668 : }
2669 0 : return 0;
2670 : }
2671 :
2672 0 : static PyObject *py_nbt_name_packet_get_nscount(PyObject *obj, void *closure)
2673 : {
2674 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2675 : PyObject *py_nscount;
2676 0 : py_nscount = PyLong_FromLong((uint16_t)object->nscount);
2677 0 : return py_nscount;
2678 : }
2679 :
2680 0 : static int py_nbt_name_packet_set_nscount(PyObject *py_obj, PyObject *value, void *closure)
2681 : {
2682 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2683 0 : if (value == NULL) {
2684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nscount");
2685 0 : return -1;
2686 : }
2687 : {
2688 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nscount));
2689 0 : if (PyLong_Check(value)) {
2690 : unsigned long long test_var;
2691 0 : test_var = PyLong_AsUnsignedLongLong(value);
2692 0 : if (PyErr_Occurred() != NULL) {
2693 0 : return -1;
2694 : }
2695 0 : if (test_var > uint_max) {
2696 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2697 : PyLong_Type.tp_name, uint_max, test_var);
2698 0 : return -1;
2699 : }
2700 0 : object->nscount = test_var;
2701 : } else {
2702 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2703 : PyLong_Type.tp_name);
2704 0 : return -1;
2705 : }
2706 : }
2707 0 : return 0;
2708 : }
2709 :
2710 0 : static PyObject *py_nbt_name_packet_get_arcount(PyObject *obj, void *closure)
2711 : {
2712 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2713 : PyObject *py_arcount;
2714 0 : py_arcount = PyLong_FromLong((uint16_t)object->arcount);
2715 0 : return py_arcount;
2716 : }
2717 :
2718 0 : static int py_nbt_name_packet_set_arcount(PyObject *py_obj, PyObject *value, void *closure)
2719 : {
2720 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2721 0 : if (value == NULL) {
2722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->arcount");
2723 0 : return -1;
2724 : }
2725 : {
2726 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->arcount));
2727 0 : if (PyLong_Check(value)) {
2728 : unsigned long long test_var;
2729 0 : test_var = PyLong_AsUnsignedLongLong(value);
2730 0 : if (PyErr_Occurred() != NULL) {
2731 0 : return -1;
2732 : }
2733 0 : if (test_var > uint_max) {
2734 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2735 : PyLong_Type.tp_name, uint_max, test_var);
2736 0 : return -1;
2737 : }
2738 0 : object->arcount = test_var;
2739 : } else {
2740 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2741 : PyLong_Type.tp_name);
2742 0 : return -1;
2743 : }
2744 : }
2745 0 : return 0;
2746 : }
2747 :
2748 0 : static PyObject *py_nbt_name_packet_get_questions(PyObject *obj, void *closure)
2749 : {
2750 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2751 : PyObject *py_questions;
2752 0 : py_questions = PyList_New(object->qdcount);
2753 0 : if (py_questions == NULL) {
2754 0 : return NULL;
2755 : }
2756 : {
2757 : int questions_cntr_0;
2758 0 : for (questions_cntr_0 = 0; questions_cntr_0 < (object->qdcount); questions_cntr_0++) {
2759 : PyObject *py_questions_0;
2760 0 : py_questions_0 = pytalloc_reference_ex(&nbt_name_question_Type, object->questions, &object->questions[questions_cntr_0]);
2761 0 : PyList_SetItem(py_questions, questions_cntr_0, py_questions_0);
2762 : }
2763 : }
2764 0 : return py_questions;
2765 : }
2766 :
2767 0 : static int py_nbt_name_packet_set_questions(PyObject *py_obj, PyObject *value, void *closure)
2768 : {
2769 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2770 0 : if (value == NULL) {
2771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->questions");
2772 0 : return -1;
2773 : }
2774 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2775 : {
2776 : int questions_cntr_0;
2777 0 : object->questions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->questions, PyList_GET_SIZE(value));
2778 0 : if (!object->questions) { return -1;; }
2779 0 : talloc_set_name_const(object->questions, "ARRAY: object->questions");
2780 0 : for (questions_cntr_0 = 0; questions_cntr_0 < PyList_GET_SIZE(value); questions_cntr_0++) {
2781 0 : if (PyList_GET_ITEM(value, questions_cntr_0) == NULL) {
2782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->questions[questions_cntr_0]");
2783 0 : return -1;
2784 : }
2785 0 : PY_CHECK_TYPE(&nbt_name_question_Type, PyList_GET_ITEM(value, questions_cntr_0), return -1;);
2786 0 : if (talloc_reference(object->questions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, questions_cntr_0))) == NULL) {
2787 0 : PyErr_NoMemory();
2788 0 : return -1;
2789 : }
2790 0 : object->questions[questions_cntr_0] = *(struct nbt_name_question *)pytalloc_get_ptr(PyList_GET_ITEM(value, questions_cntr_0));
2791 : }
2792 : }
2793 0 : return 0;
2794 : }
2795 :
2796 0 : static PyObject *py_nbt_name_packet_get_answers(PyObject *obj, void *closure)
2797 : {
2798 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2799 : PyObject *py_answers;
2800 0 : py_answers = PyList_New(object->ancount);
2801 0 : if (py_answers == NULL) {
2802 0 : return NULL;
2803 : }
2804 : {
2805 : int answers_cntr_0;
2806 0 : for (answers_cntr_0 = 0; answers_cntr_0 < (object->ancount); answers_cntr_0++) {
2807 : PyObject *py_answers_0;
2808 0 : py_answers_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->answers, &object->answers[answers_cntr_0]);
2809 0 : PyList_SetItem(py_answers, answers_cntr_0, py_answers_0);
2810 : }
2811 : }
2812 0 : return py_answers;
2813 : }
2814 :
2815 0 : static int py_nbt_name_packet_set_answers(PyObject *py_obj, PyObject *value, void *closure)
2816 : {
2817 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2818 0 : if (value == NULL) {
2819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->answers");
2820 0 : return -1;
2821 : }
2822 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2823 : {
2824 : int answers_cntr_0;
2825 0 : object->answers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->answers, PyList_GET_SIZE(value));
2826 0 : if (!object->answers) { return -1;; }
2827 0 : talloc_set_name_const(object->answers, "ARRAY: object->answers");
2828 0 : for (answers_cntr_0 = 0; answers_cntr_0 < PyList_GET_SIZE(value); answers_cntr_0++) {
2829 0 : if (PyList_GET_ITEM(value, answers_cntr_0) == NULL) {
2830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->answers[answers_cntr_0]");
2831 0 : return -1;
2832 : }
2833 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, answers_cntr_0), return -1;);
2834 0 : if (talloc_reference(object->answers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, answers_cntr_0))) == NULL) {
2835 0 : PyErr_NoMemory();
2836 0 : return -1;
2837 : }
2838 0 : object->answers[answers_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, answers_cntr_0));
2839 : }
2840 : }
2841 0 : return 0;
2842 : }
2843 :
2844 0 : static PyObject *py_nbt_name_packet_get_nsrecs(PyObject *obj, void *closure)
2845 : {
2846 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2847 : PyObject *py_nsrecs;
2848 0 : py_nsrecs = PyList_New(object->nscount);
2849 0 : if (py_nsrecs == NULL) {
2850 0 : return NULL;
2851 : }
2852 : {
2853 : int nsrecs_cntr_0;
2854 0 : for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < (object->nscount); nsrecs_cntr_0++) {
2855 : PyObject *py_nsrecs_0;
2856 0 : py_nsrecs_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->nsrecs, &object->nsrecs[nsrecs_cntr_0]);
2857 0 : PyList_SetItem(py_nsrecs, nsrecs_cntr_0, py_nsrecs_0);
2858 : }
2859 : }
2860 0 : return py_nsrecs;
2861 : }
2862 :
2863 0 : static int py_nbt_name_packet_set_nsrecs(PyObject *py_obj, PyObject *value, void *closure)
2864 : {
2865 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2866 0 : if (value == NULL) {
2867 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nsrecs");
2868 0 : return -1;
2869 : }
2870 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2871 : {
2872 : int nsrecs_cntr_0;
2873 0 : object->nsrecs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nsrecs, PyList_GET_SIZE(value));
2874 0 : if (!object->nsrecs) { return -1;; }
2875 0 : talloc_set_name_const(object->nsrecs, "ARRAY: object->nsrecs");
2876 0 : for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < PyList_GET_SIZE(value); nsrecs_cntr_0++) {
2877 0 : if (PyList_GET_ITEM(value, nsrecs_cntr_0) == NULL) {
2878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nsrecs[nsrecs_cntr_0]");
2879 0 : return -1;
2880 : }
2881 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, nsrecs_cntr_0), return -1;);
2882 0 : if (talloc_reference(object->nsrecs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, nsrecs_cntr_0))) == NULL) {
2883 0 : PyErr_NoMemory();
2884 0 : return -1;
2885 : }
2886 0 : object->nsrecs[nsrecs_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, nsrecs_cntr_0));
2887 : }
2888 : }
2889 0 : return 0;
2890 : }
2891 :
2892 0 : static PyObject *py_nbt_name_packet_get_additional(PyObject *obj, void *closure)
2893 : {
2894 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2895 : PyObject *py_additional;
2896 0 : py_additional = PyList_New(object->arcount);
2897 0 : if (py_additional == NULL) {
2898 0 : return NULL;
2899 : }
2900 : {
2901 : int additional_cntr_0;
2902 0 : for (additional_cntr_0 = 0; additional_cntr_0 < (object->arcount); additional_cntr_0++) {
2903 : PyObject *py_additional_0;
2904 0 : py_additional_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->additional, &object->additional[additional_cntr_0]);
2905 0 : PyList_SetItem(py_additional, additional_cntr_0, py_additional_0);
2906 : }
2907 : }
2908 0 : return py_additional;
2909 : }
2910 :
2911 0 : static int py_nbt_name_packet_set_additional(PyObject *py_obj, PyObject *value, void *closure)
2912 : {
2913 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2914 0 : if (value == NULL) {
2915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->additional");
2916 0 : return -1;
2917 : }
2918 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2919 : {
2920 : int additional_cntr_0;
2921 0 : object->additional = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->additional, PyList_GET_SIZE(value));
2922 0 : if (!object->additional) { return -1;; }
2923 0 : talloc_set_name_const(object->additional, "ARRAY: object->additional");
2924 0 : for (additional_cntr_0 = 0; additional_cntr_0 < PyList_GET_SIZE(value); additional_cntr_0++) {
2925 0 : if (PyList_GET_ITEM(value, additional_cntr_0) == NULL) {
2926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->additional[additional_cntr_0]");
2927 0 : return -1;
2928 : }
2929 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, additional_cntr_0), return -1;);
2930 0 : if (talloc_reference(object->additional, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, additional_cntr_0))) == NULL) {
2931 0 : PyErr_NoMemory();
2932 0 : return -1;
2933 : }
2934 0 : object->additional[additional_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, additional_cntr_0));
2935 : }
2936 : }
2937 0 : return 0;
2938 : }
2939 :
2940 0 : static PyObject *py_nbt_name_packet_get_padding(PyObject *obj, void *closure)
2941 : {
2942 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
2943 : PyObject *py_padding;
2944 0 : py_padding = PyBytes_FromStringAndSize((char *)(object->padding).data, (object->padding).length);
2945 0 : return py_padding;
2946 : }
2947 :
2948 0 : static int py_nbt_name_packet_set_padding(PyObject *py_obj, PyObject *value, void *closure)
2949 : {
2950 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
2951 0 : if (value == NULL) {
2952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding");
2953 0 : return -1;
2954 : }
2955 0 : object->padding = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2956 0 : return 0;
2957 : }
2958 :
2959 : static PyGetSetDef py_nbt_name_packet_getsetters[] = {
2960 : {
2961 : .name = discard_const_p(char, "name_trn_id"),
2962 : .get = py_nbt_name_packet_get_name_trn_id,
2963 : .set = py_nbt_name_packet_set_name_trn_id,
2964 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2965 : },
2966 : {
2967 : .name = discard_const_p(char, "operation"),
2968 : .get = py_nbt_name_packet_get_operation,
2969 : .set = py_nbt_name_packet_set_operation,
2970 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_operation")
2971 : },
2972 : {
2973 : .name = discard_const_p(char, "qdcount"),
2974 : .get = py_nbt_name_packet_get_qdcount,
2975 : .set = py_nbt_name_packet_set_qdcount,
2976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2977 : },
2978 : {
2979 : .name = discard_const_p(char, "ancount"),
2980 : .get = py_nbt_name_packet_get_ancount,
2981 : .set = py_nbt_name_packet_set_ancount,
2982 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2983 : },
2984 : {
2985 : .name = discard_const_p(char, "nscount"),
2986 : .get = py_nbt_name_packet_get_nscount,
2987 : .set = py_nbt_name_packet_set_nscount,
2988 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2989 : },
2990 : {
2991 : .name = discard_const_p(char, "arcount"),
2992 : .get = py_nbt_name_packet_get_arcount,
2993 : .set = py_nbt_name_packet_set_arcount,
2994 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2995 : },
2996 : {
2997 : .name = discard_const_p(char, "questions"),
2998 : .get = py_nbt_name_packet_get_questions,
2999 : .set = py_nbt_name_packet_set_questions,
3000 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_question")
3001 : },
3002 : {
3003 : .name = discard_const_p(char, "answers"),
3004 : .get = py_nbt_name_packet_get_answers,
3005 : .set = py_nbt_name_packet_set_answers,
3006 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3007 : },
3008 : {
3009 : .name = discard_const_p(char, "nsrecs"),
3010 : .get = py_nbt_name_packet_get_nsrecs,
3011 : .set = py_nbt_name_packet_set_nsrecs,
3012 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3013 : },
3014 : {
3015 : .name = discard_const_p(char, "additional"),
3016 : .get = py_nbt_name_packet_get_additional,
3017 : .set = py_nbt_name_packet_set_additional,
3018 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3019 : },
3020 : {
3021 : .name = discard_const_p(char, "padding"),
3022 : .get = py_nbt_name_packet_get_padding,
3023 : .set = py_nbt_name_packet_set_padding,
3024 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
3025 : },
3026 : { .name = NULL }
3027 : };
3028 :
3029 0 : static PyObject *py_nbt_name_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3030 : {
3031 0 : return pytalloc_new(struct nbt_name_packet, type);
3032 : }
3033 :
3034 0 : static PyObject *py_nbt_name_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3035 : {
3036 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
3037 0 : PyObject *ret = NULL;
3038 : DATA_BLOB blob;
3039 : enum ndr_err_code err;
3040 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3041 0 : if (tmp_ctx == NULL) {
3042 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3043 0 : return NULL;
3044 : }
3045 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name_packet);
3046 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3047 0 : TALLOC_FREE(tmp_ctx);
3048 0 : PyErr_SetNdrError(err);
3049 0 : return NULL;
3050 : }
3051 :
3052 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3053 0 : TALLOC_FREE(tmp_ctx);
3054 0 : return ret;
3055 : }
3056 :
3057 0 : static PyObject *py_nbt_name_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3058 : {
3059 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
3060 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3061 0 : Py_ssize_t blob_length = 0;
3062 : enum ndr_err_code err;
3063 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3064 0 : PyObject *allow_remaining_obj = NULL;
3065 0 : bool allow_remaining = false;
3066 :
3067 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3068 : discard_const_p(char *, kwnames),
3069 : &blob.data, &blob_length,
3070 : &allow_remaining_obj)) {
3071 0 : return NULL;
3072 : }
3073 0 : blob.length = blob_length;
3074 :
3075 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3076 0 : allow_remaining = true;
3077 : }
3078 :
3079 0 : if (allow_remaining) {
3080 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
3081 : } else {
3082 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);
3083 : }
3084 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3085 0 : PyErr_SetNdrError(err);
3086 0 : return NULL;
3087 : }
3088 :
3089 0 : Py_RETURN_NONE;
3090 : }
3091 :
3092 0 : static PyObject *py_nbt_name_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3093 : {
3094 0 : struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
3095 : PyObject *ret;
3096 : char *retstr;
3097 :
3098 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);
3099 0 : ret = PyUnicode_FromString(retstr);
3100 0 : talloc_free(retstr);
3101 :
3102 0 : return ret;
3103 : }
3104 :
3105 : static PyMethodDef py_nbt_name_packet_methods[] = {
3106 : { "__ndr_pack__", (PyCFunction)py_nbt_name_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3107 : { "__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" },
3108 : { "__ndr_print__", (PyCFunction)py_nbt_name_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3109 : { NULL, NULL, 0, NULL }
3110 : };
3111 :
3112 :
3113 : static PyTypeObject nbt_name_packet_Type = {
3114 : PyVarObject_HEAD_INIT(NULL, 0)
3115 : .tp_name = "nbt.name_packet",
3116 : .tp_getset = py_nbt_name_packet_getsetters,
3117 : .tp_methods = py_nbt_name_packet_methods,
3118 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3119 : .tp_new = py_nbt_name_packet_new,
3120 : };
3121 :
3122 :
3123 0 : static PyObject *py_smb_trans_body_get_wct(PyObject *obj, void *closure)
3124 : {
3125 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3126 : PyObject *py_wct;
3127 0 : py_wct = PyLong_FromLong((uint16_t)object->wct);
3128 0 : return py_wct;
3129 : }
3130 :
3131 0 : static int py_smb_trans_body_set_wct(PyObject *py_obj, PyObject *value, void *closure)
3132 : {
3133 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3134 0 : if (value == NULL) {
3135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->wct");
3136 0 : return -1;
3137 : }
3138 : {
3139 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wct));
3140 0 : if (PyLong_Check(value)) {
3141 : unsigned long long test_var;
3142 0 : test_var = PyLong_AsUnsignedLongLong(value);
3143 0 : if (PyErr_Occurred() != NULL) {
3144 0 : return -1;
3145 : }
3146 0 : if (test_var > uint_max) {
3147 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3148 : PyLong_Type.tp_name, uint_max, test_var);
3149 0 : return -1;
3150 : }
3151 0 : object->wct = test_var;
3152 : } else {
3153 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3154 : PyLong_Type.tp_name);
3155 0 : return -1;
3156 : }
3157 : }
3158 0 : return 0;
3159 : }
3160 :
3161 0 : static PyObject *py_smb_trans_body_get_total_param_count(PyObject *obj, void *closure)
3162 : {
3163 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3164 : PyObject *py_total_param_count;
3165 0 : py_total_param_count = PyLong_FromLong((uint16_t)object->total_param_count);
3166 0 : return py_total_param_count;
3167 : }
3168 :
3169 0 : static int py_smb_trans_body_set_total_param_count(PyObject *py_obj, PyObject *value, void *closure)
3170 : {
3171 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3172 0 : if (value == NULL) {
3173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_param_count");
3174 0 : return -1;
3175 : }
3176 : {
3177 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_param_count));
3178 0 : if (PyLong_Check(value)) {
3179 : unsigned long long test_var;
3180 0 : test_var = PyLong_AsUnsignedLongLong(value);
3181 0 : if (PyErr_Occurred() != NULL) {
3182 0 : return -1;
3183 : }
3184 0 : if (test_var > uint_max) {
3185 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3186 : PyLong_Type.tp_name, uint_max, test_var);
3187 0 : return -1;
3188 : }
3189 0 : object->total_param_count = test_var;
3190 : } else {
3191 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3192 : PyLong_Type.tp_name);
3193 0 : return -1;
3194 : }
3195 : }
3196 0 : return 0;
3197 : }
3198 :
3199 0 : static PyObject *py_smb_trans_body_get_total_data_count(PyObject *obj, void *closure)
3200 : {
3201 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3202 : PyObject *py_total_data_count;
3203 0 : py_total_data_count = PyLong_FromLong((uint16_t)object->total_data_count);
3204 0 : return py_total_data_count;
3205 : }
3206 :
3207 0 : static int py_smb_trans_body_set_total_data_count(PyObject *py_obj, PyObject *value, void *closure)
3208 : {
3209 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3210 0 : if (value == NULL) {
3211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_data_count");
3212 0 : return -1;
3213 : }
3214 : {
3215 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_data_count));
3216 0 : if (PyLong_Check(value)) {
3217 : unsigned long long test_var;
3218 0 : test_var = PyLong_AsUnsignedLongLong(value);
3219 0 : if (PyErr_Occurred() != NULL) {
3220 0 : return -1;
3221 : }
3222 0 : if (test_var > uint_max) {
3223 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3224 : PyLong_Type.tp_name, uint_max, test_var);
3225 0 : return -1;
3226 : }
3227 0 : object->total_data_count = test_var;
3228 : } else {
3229 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3230 : PyLong_Type.tp_name);
3231 0 : return -1;
3232 : }
3233 : }
3234 0 : return 0;
3235 : }
3236 :
3237 0 : static PyObject *py_smb_trans_body_get_max_param_count(PyObject *obj, void *closure)
3238 : {
3239 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3240 : PyObject *py_max_param_count;
3241 0 : py_max_param_count = PyLong_FromLong((uint16_t)object->max_param_count);
3242 0 : return py_max_param_count;
3243 : }
3244 :
3245 0 : static int py_smb_trans_body_set_max_param_count(PyObject *py_obj, PyObject *value, void *closure)
3246 : {
3247 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3248 0 : if (value == NULL) {
3249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_param_count");
3250 0 : return -1;
3251 : }
3252 : {
3253 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_param_count));
3254 0 : if (PyLong_Check(value)) {
3255 : unsigned long long test_var;
3256 0 : test_var = PyLong_AsUnsignedLongLong(value);
3257 0 : if (PyErr_Occurred() != NULL) {
3258 0 : return -1;
3259 : }
3260 0 : if (test_var > uint_max) {
3261 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3262 : PyLong_Type.tp_name, uint_max, test_var);
3263 0 : return -1;
3264 : }
3265 0 : object->max_param_count = test_var;
3266 : } else {
3267 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3268 : PyLong_Type.tp_name);
3269 0 : return -1;
3270 : }
3271 : }
3272 0 : return 0;
3273 : }
3274 :
3275 0 : static PyObject *py_smb_trans_body_get_max_data_count(PyObject *obj, void *closure)
3276 : {
3277 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3278 : PyObject *py_max_data_count;
3279 0 : py_max_data_count = PyLong_FromLong((uint16_t)object->max_data_count);
3280 0 : return py_max_data_count;
3281 : }
3282 :
3283 0 : static int py_smb_trans_body_set_max_data_count(PyObject *py_obj, PyObject *value, void *closure)
3284 : {
3285 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3286 0 : if (value == NULL) {
3287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_data_count");
3288 0 : return -1;
3289 : }
3290 : {
3291 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_data_count));
3292 0 : if (PyLong_Check(value)) {
3293 : unsigned long long test_var;
3294 0 : test_var = PyLong_AsUnsignedLongLong(value);
3295 0 : if (PyErr_Occurred() != NULL) {
3296 0 : return -1;
3297 : }
3298 0 : if (test_var > uint_max) {
3299 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3300 : PyLong_Type.tp_name, uint_max, test_var);
3301 0 : return -1;
3302 : }
3303 0 : object->max_data_count = test_var;
3304 : } else {
3305 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3306 : PyLong_Type.tp_name);
3307 0 : return -1;
3308 : }
3309 : }
3310 0 : return 0;
3311 : }
3312 :
3313 0 : static PyObject *py_smb_trans_body_get_max_setup_count(PyObject *obj, void *closure)
3314 : {
3315 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3316 : PyObject *py_max_setup_count;
3317 0 : py_max_setup_count = PyLong_FromLong((uint16_t)object->max_setup_count);
3318 0 : return py_max_setup_count;
3319 : }
3320 :
3321 0 : static int py_smb_trans_body_set_max_setup_count(PyObject *py_obj, PyObject *value, void *closure)
3322 : {
3323 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3324 0 : if (value == NULL) {
3325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_setup_count");
3326 0 : return -1;
3327 : }
3328 : {
3329 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_setup_count));
3330 0 : if (PyLong_Check(value)) {
3331 : unsigned long long test_var;
3332 0 : test_var = PyLong_AsUnsignedLongLong(value);
3333 0 : if (PyErr_Occurred() != NULL) {
3334 0 : return -1;
3335 : }
3336 0 : if (test_var > uint_max) {
3337 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3338 : PyLong_Type.tp_name, uint_max, test_var);
3339 0 : return -1;
3340 : }
3341 0 : object->max_setup_count = test_var;
3342 : } else {
3343 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3344 : PyLong_Type.tp_name);
3345 0 : return -1;
3346 : }
3347 : }
3348 0 : return 0;
3349 : }
3350 :
3351 0 : static PyObject *py_smb_trans_body_get_pad(PyObject *obj, void *closure)
3352 : {
3353 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3354 : PyObject *py_pad;
3355 0 : py_pad = PyLong_FromLong((uint16_t)object->pad);
3356 0 : return py_pad;
3357 : }
3358 :
3359 0 : static int py_smb_trans_body_set_pad(PyObject *py_obj, PyObject *value, void *closure)
3360 : {
3361 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3362 0 : if (value == NULL) {
3363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad");
3364 0 : return -1;
3365 : }
3366 : {
3367 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
3368 0 : if (PyLong_Check(value)) {
3369 : unsigned long long test_var;
3370 0 : test_var = PyLong_AsUnsignedLongLong(value);
3371 0 : if (PyErr_Occurred() != NULL) {
3372 0 : return -1;
3373 : }
3374 0 : if (test_var > uint_max) {
3375 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3376 : PyLong_Type.tp_name, uint_max, test_var);
3377 0 : return -1;
3378 : }
3379 0 : object->pad = test_var;
3380 : } else {
3381 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3382 : PyLong_Type.tp_name);
3383 0 : return -1;
3384 : }
3385 : }
3386 0 : return 0;
3387 : }
3388 :
3389 0 : static PyObject *py_smb_trans_body_get_trans_flags(PyObject *obj, void *closure)
3390 : {
3391 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3392 : PyObject *py_trans_flags;
3393 0 : py_trans_flags = PyLong_FromLong((uint16_t)object->trans_flags);
3394 0 : return py_trans_flags;
3395 : }
3396 :
3397 0 : static int py_smb_trans_body_set_trans_flags(PyObject *py_obj, PyObject *value, void *closure)
3398 : {
3399 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3400 0 : if (value == NULL) {
3401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trans_flags");
3402 0 : return -1;
3403 : }
3404 : {
3405 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trans_flags));
3406 0 : if (PyLong_Check(value)) {
3407 : unsigned long long test_var;
3408 0 : test_var = PyLong_AsUnsignedLongLong(value);
3409 0 : if (PyErr_Occurred() != NULL) {
3410 0 : return -1;
3411 : }
3412 0 : if (test_var > uint_max) {
3413 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3414 : PyLong_Type.tp_name, uint_max, test_var);
3415 0 : return -1;
3416 : }
3417 0 : object->trans_flags = test_var;
3418 : } else {
3419 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3420 : PyLong_Type.tp_name);
3421 0 : return -1;
3422 : }
3423 : }
3424 0 : return 0;
3425 : }
3426 :
3427 0 : static PyObject *py_smb_trans_body_get_timeout(PyObject *obj, void *closure)
3428 : {
3429 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3430 : PyObject *py_timeout;
3431 0 : py_timeout = PyLong_FromUnsignedLongLong((uint32_t)object->timeout);
3432 0 : return py_timeout;
3433 : }
3434 :
3435 0 : static int py_smb_trans_body_set_timeout(PyObject *py_obj, PyObject *value, void *closure)
3436 : {
3437 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3438 0 : if (value == NULL) {
3439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timeout");
3440 0 : return -1;
3441 : }
3442 : {
3443 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timeout));
3444 0 : if (PyLong_Check(value)) {
3445 : unsigned long long test_var;
3446 0 : test_var = PyLong_AsUnsignedLongLong(value);
3447 0 : if (PyErr_Occurred() != NULL) {
3448 0 : return -1;
3449 : }
3450 0 : if (test_var > uint_max) {
3451 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3452 : PyLong_Type.tp_name, uint_max, test_var);
3453 0 : return -1;
3454 : }
3455 0 : object->timeout = test_var;
3456 : } else {
3457 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3458 : PyLong_Type.tp_name);
3459 0 : return -1;
3460 : }
3461 : }
3462 0 : return 0;
3463 : }
3464 :
3465 0 : static PyObject *py_smb_trans_body_get_reserved(PyObject *obj, void *closure)
3466 : {
3467 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3468 : PyObject *py_reserved;
3469 0 : py_reserved = PyLong_FromLong((uint16_t)object->reserved);
3470 0 : return py_reserved;
3471 : }
3472 :
3473 0 : static int py_smb_trans_body_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3474 : {
3475 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3476 0 : if (value == NULL) {
3477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
3478 0 : return -1;
3479 : }
3480 : {
3481 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
3482 0 : if (PyLong_Check(value)) {
3483 : unsigned long long test_var;
3484 0 : test_var = PyLong_AsUnsignedLongLong(value);
3485 0 : if (PyErr_Occurred() != NULL) {
3486 0 : return -1;
3487 : }
3488 0 : if (test_var > uint_max) {
3489 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3490 : PyLong_Type.tp_name, uint_max, test_var);
3491 0 : return -1;
3492 : }
3493 0 : object->reserved = test_var;
3494 : } else {
3495 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3496 : PyLong_Type.tp_name);
3497 0 : return -1;
3498 : }
3499 : }
3500 0 : return 0;
3501 : }
3502 :
3503 0 : static PyObject *py_smb_trans_body_get_param_count(PyObject *obj, void *closure)
3504 : {
3505 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3506 : PyObject *py_param_count;
3507 0 : py_param_count = PyLong_FromLong((uint16_t)object->param_count);
3508 0 : return py_param_count;
3509 : }
3510 :
3511 0 : static int py_smb_trans_body_set_param_count(PyObject *py_obj, PyObject *value, void *closure)
3512 : {
3513 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3514 0 : if (value == NULL) {
3515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->param_count");
3516 0 : return -1;
3517 : }
3518 : {
3519 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_count));
3520 0 : if (PyLong_Check(value)) {
3521 : unsigned long long test_var;
3522 0 : test_var = PyLong_AsUnsignedLongLong(value);
3523 0 : if (PyErr_Occurred() != NULL) {
3524 0 : return -1;
3525 : }
3526 0 : if (test_var > uint_max) {
3527 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3528 : PyLong_Type.tp_name, uint_max, test_var);
3529 0 : return -1;
3530 : }
3531 0 : object->param_count = test_var;
3532 : } else {
3533 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3534 : PyLong_Type.tp_name);
3535 0 : return -1;
3536 : }
3537 : }
3538 0 : return 0;
3539 : }
3540 :
3541 0 : static PyObject *py_smb_trans_body_get_param_offset(PyObject *obj, void *closure)
3542 : {
3543 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3544 : PyObject *py_param_offset;
3545 0 : py_param_offset = PyLong_FromLong((uint16_t)object->param_offset);
3546 0 : return py_param_offset;
3547 : }
3548 :
3549 0 : static int py_smb_trans_body_set_param_offset(PyObject *py_obj, PyObject *value, void *closure)
3550 : {
3551 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3552 0 : if (value == NULL) {
3553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->param_offset");
3554 0 : return -1;
3555 : }
3556 : {
3557 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_offset));
3558 0 : if (PyLong_Check(value)) {
3559 : unsigned long long test_var;
3560 0 : test_var = PyLong_AsUnsignedLongLong(value);
3561 0 : if (PyErr_Occurred() != NULL) {
3562 0 : return -1;
3563 : }
3564 0 : if (test_var > uint_max) {
3565 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3566 : PyLong_Type.tp_name, uint_max, test_var);
3567 0 : return -1;
3568 : }
3569 0 : object->param_offset = test_var;
3570 : } else {
3571 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3572 : PyLong_Type.tp_name);
3573 0 : return -1;
3574 : }
3575 : }
3576 0 : return 0;
3577 : }
3578 :
3579 0 : static PyObject *py_smb_trans_body_get_data_count(PyObject *obj, void *closure)
3580 : {
3581 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3582 : PyObject *py_data_count;
3583 0 : py_data_count = PyLong_FromLong((uint16_t)object->data_count);
3584 0 : return py_data_count;
3585 : }
3586 :
3587 0 : static int py_smb_trans_body_set_data_count(PyObject *py_obj, PyObject *value, void *closure)
3588 : {
3589 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3590 0 : if (value == NULL) {
3591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_count");
3592 0 : return -1;
3593 : }
3594 : {
3595 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_count));
3596 0 : if (PyLong_Check(value)) {
3597 : unsigned long long test_var;
3598 0 : test_var = PyLong_AsUnsignedLongLong(value);
3599 0 : if (PyErr_Occurred() != NULL) {
3600 0 : return -1;
3601 : }
3602 0 : if (test_var > uint_max) {
3603 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3604 : PyLong_Type.tp_name, uint_max, test_var);
3605 0 : return -1;
3606 : }
3607 0 : object->data_count = test_var;
3608 : } else {
3609 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3610 : PyLong_Type.tp_name);
3611 0 : return -1;
3612 : }
3613 : }
3614 0 : return 0;
3615 : }
3616 :
3617 0 : static PyObject *py_smb_trans_body_get_data_offset(PyObject *obj, void *closure)
3618 : {
3619 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3620 : PyObject *py_data_offset;
3621 0 : py_data_offset = PyLong_FromLong((uint16_t)object->data_offset);
3622 0 : return py_data_offset;
3623 : }
3624 :
3625 0 : static int py_smb_trans_body_set_data_offset(PyObject *py_obj, PyObject *value, void *closure)
3626 : {
3627 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3628 0 : if (value == NULL) {
3629 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_offset");
3630 0 : return -1;
3631 : }
3632 : {
3633 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_offset));
3634 0 : if (PyLong_Check(value)) {
3635 : unsigned long long test_var;
3636 0 : test_var = PyLong_AsUnsignedLongLong(value);
3637 0 : if (PyErr_Occurred() != NULL) {
3638 0 : return -1;
3639 : }
3640 0 : if (test_var > uint_max) {
3641 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3642 : PyLong_Type.tp_name, uint_max, test_var);
3643 0 : return -1;
3644 : }
3645 0 : object->data_offset = test_var;
3646 : } else {
3647 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3648 : PyLong_Type.tp_name);
3649 0 : return -1;
3650 : }
3651 : }
3652 0 : return 0;
3653 : }
3654 :
3655 0 : static PyObject *py_smb_trans_body_get_setup_count(PyObject *obj, void *closure)
3656 : {
3657 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3658 : PyObject *py_setup_count;
3659 0 : py_setup_count = PyLong_FromLong((uint16_t)object->setup_count);
3660 0 : return py_setup_count;
3661 : }
3662 :
3663 0 : static int py_smb_trans_body_set_setup_count(PyObject *py_obj, PyObject *value, void *closure)
3664 : {
3665 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3666 0 : if (value == NULL) {
3667 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->setup_count");
3668 0 : return -1;
3669 : }
3670 : {
3671 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->setup_count));
3672 0 : if (PyLong_Check(value)) {
3673 : unsigned long long test_var;
3674 0 : test_var = PyLong_AsUnsignedLongLong(value);
3675 0 : if (PyErr_Occurred() != NULL) {
3676 0 : return -1;
3677 : }
3678 0 : if (test_var > uint_max) {
3679 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3680 : PyLong_Type.tp_name, uint_max, test_var);
3681 0 : return -1;
3682 : }
3683 0 : object->setup_count = test_var;
3684 : } else {
3685 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3686 : PyLong_Type.tp_name);
3687 0 : return -1;
3688 : }
3689 : }
3690 0 : return 0;
3691 : }
3692 :
3693 0 : static PyObject *py_smb_trans_body_get_pad2(PyObject *obj, void *closure)
3694 : {
3695 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3696 : PyObject *py_pad2;
3697 0 : py_pad2 = PyLong_FromLong((uint16_t)object->pad2);
3698 0 : return py_pad2;
3699 : }
3700 :
3701 0 : static int py_smb_trans_body_set_pad2(PyObject *py_obj, PyObject *value, void *closure)
3702 : {
3703 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3704 0 : if (value == NULL) {
3705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad2");
3706 0 : return -1;
3707 : }
3708 : {
3709 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad2));
3710 0 : if (PyLong_Check(value)) {
3711 : unsigned long long test_var;
3712 0 : test_var = PyLong_AsUnsignedLongLong(value);
3713 0 : if (PyErr_Occurred() != NULL) {
3714 0 : return -1;
3715 : }
3716 0 : if (test_var > uint_max) {
3717 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3718 : PyLong_Type.tp_name, uint_max, test_var);
3719 0 : return -1;
3720 : }
3721 0 : object->pad2 = test_var;
3722 : } else {
3723 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3724 : PyLong_Type.tp_name);
3725 0 : return -1;
3726 : }
3727 : }
3728 0 : return 0;
3729 : }
3730 :
3731 0 : static PyObject *py_smb_trans_body_get_opcode(PyObject *obj, void *closure)
3732 : {
3733 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3734 : PyObject *py_opcode;
3735 0 : py_opcode = PyLong_FromLong((uint16_t)object->opcode);
3736 0 : return py_opcode;
3737 : }
3738 :
3739 0 : static int py_smb_trans_body_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
3740 : {
3741 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3742 0 : if (value == NULL) {
3743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->opcode");
3744 0 : return -1;
3745 : }
3746 : {
3747 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
3748 0 : if (PyLong_Check(value)) {
3749 : unsigned long long test_var;
3750 0 : test_var = PyLong_AsUnsignedLongLong(value);
3751 0 : if (PyErr_Occurred() != NULL) {
3752 0 : return -1;
3753 : }
3754 0 : if (test_var > uint_max) {
3755 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3756 : PyLong_Type.tp_name, uint_max, test_var);
3757 0 : return -1;
3758 : }
3759 0 : object->opcode = test_var;
3760 : } else {
3761 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3762 : PyLong_Type.tp_name);
3763 0 : return -1;
3764 : }
3765 : }
3766 0 : return 0;
3767 : }
3768 :
3769 0 : static PyObject *py_smb_trans_body_get_priority(PyObject *obj, void *closure)
3770 : {
3771 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3772 : PyObject *py_priority;
3773 0 : py_priority = PyLong_FromLong((uint16_t)object->priority);
3774 0 : return py_priority;
3775 : }
3776 :
3777 0 : static int py_smb_trans_body_set_priority(PyObject *py_obj, PyObject *value, void *closure)
3778 : {
3779 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3780 0 : if (value == NULL) {
3781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priority");
3782 0 : return -1;
3783 : }
3784 : {
3785 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
3786 0 : if (PyLong_Check(value)) {
3787 : unsigned long long test_var;
3788 0 : test_var = PyLong_AsUnsignedLongLong(value);
3789 0 : if (PyErr_Occurred() != NULL) {
3790 0 : return -1;
3791 : }
3792 0 : if (test_var > uint_max) {
3793 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3794 : PyLong_Type.tp_name, uint_max, test_var);
3795 0 : return -1;
3796 : }
3797 0 : object->priority = test_var;
3798 : } else {
3799 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3800 : PyLong_Type.tp_name);
3801 0 : return -1;
3802 : }
3803 : }
3804 0 : return 0;
3805 : }
3806 :
3807 0 : static PyObject *py_smb_trans_body_get__class(PyObject *obj, void *closure)
3808 : {
3809 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3810 : PyObject *py__class;
3811 0 : py__class = PyLong_FromLong((uint16_t)object->_class);
3812 0 : return py__class;
3813 : }
3814 :
3815 0 : static int py_smb_trans_body_set__class(PyObject *py_obj, PyObject *value, void *closure)
3816 : {
3817 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3818 0 : if (value == NULL) {
3819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_class");
3820 0 : return -1;
3821 : }
3822 : {
3823 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_class));
3824 0 : if (PyLong_Check(value)) {
3825 : unsigned long long test_var;
3826 0 : test_var = PyLong_AsUnsignedLongLong(value);
3827 0 : if (PyErr_Occurred() != NULL) {
3828 0 : return -1;
3829 : }
3830 0 : if (test_var > uint_max) {
3831 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3832 : PyLong_Type.tp_name, uint_max, test_var);
3833 0 : return -1;
3834 : }
3835 0 : object->_class = test_var;
3836 : } else {
3837 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3838 : PyLong_Type.tp_name);
3839 0 : return -1;
3840 : }
3841 : }
3842 0 : return 0;
3843 : }
3844 :
3845 0 : static PyObject *py_smb_trans_body_get_byte_count(PyObject *obj, void *closure)
3846 : {
3847 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3848 : PyObject *py_byte_count;
3849 0 : py_byte_count = PyLong_FromLong((uint16_t)object->byte_count);
3850 0 : return py_byte_count;
3851 : }
3852 :
3853 0 : static int py_smb_trans_body_set_byte_count(PyObject *py_obj, PyObject *value, void *closure)
3854 : {
3855 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3856 0 : if (value == NULL) {
3857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->byte_count");
3858 0 : return -1;
3859 : }
3860 : {
3861 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->byte_count));
3862 0 : if (PyLong_Check(value)) {
3863 : unsigned long long test_var;
3864 0 : test_var = PyLong_AsUnsignedLongLong(value);
3865 0 : if (PyErr_Occurred() != NULL) {
3866 0 : return -1;
3867 : }
3868 0 : if (test_var > uint_max) {
3869 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3870 : PyLong_Type.tp_name, uint_max, test_var);
3871 0 : return -1;
3872 : }
3873 0 : object->byte_count = test_var;
3874 : } else {
3875 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3876 : PyLong_Type.tp_name);
3877 0 : return -1;
3878 : }
3879 : }
3880 0 : return 0;
3881 : }
3882 :
3883 0 : static PyObject *py_smb_trans_body_get_mailslot_name(PyObject *obj, void *closure)
3884 : {
3885 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3886 : PyObject *py_mailslot_name;
3887 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
3888 0 : return py_mailslot_name;
3889 : }
3890 :
3891 0 : static int py_smb_trans_body_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
3892 : {
3893 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3894 0 : if (value == NULL) {
3895 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
3896 0 : return -1;
3897 : }
3898 : {
3899 : const char *test_str;
3900 : const char *talloc_str;
3901 0 : PyObject *unicode = NULL;
3902 0 : if (PyUnicode_Check(value)) {
3903 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3904 0 : if (unicode == NULL) {
3905 0 : PyErr_NoMemory();
3906 0 : return -1;
3907 : }
3908 0 : test_str = PyBytes_AS_STRING(unicode);
3909 0 : } else if (PyBytes_Check(value)) {
3910 0 : test_str = PyBytes_AS_STRING(value);
3911 : } else {
3912 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3913 0 : return -1;
3914 : }
3915 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3916 0 : if (unicode != NULL) {
3917 0 : Py_DECREF(unicode);
3918 : }
3919 0 : if (talloc_str == NULL) {
3920 0 : PyErr_NoMemory();
3921 0 : return -1;
3922 : }
3923 0 : object->mailslot_name = talloc_str;
3924 : }
3925 0 : return 0;
3926 : }
3927 :
3928 0 : static PyObject *py_smb_trans_body_get_data(PyObject *obj, void *closure)
3929 : {
3930 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
3931 : PyObject *py_data;
3932 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
3933 0 : return py_data;
3934 : }
3935 :
3936 0 : static int py_smb_trans_body_set_data(PyObject *py_obj, PyObject *value, void *closure)
3937 : {
3938 0 : struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
3939 0 : if (value == NULL) {
3940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
3941 0 : return -1;
3942 : }
3943 0 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
3944 0 : return 0;
3945 : }
3946 :
3947 : static PyGetSetDef py_smb_trans_body_getsetters[] = {
3948 : {
3949 : .name = discard_const_p(char, "wct"),
3950 : .get = py_smb_trans_body_get_wct,
3951 : .set = py_smb_trans_body_set_wct,
3952 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3953 : },
3954 : {
3955 : .name = discard_const_p(char, "total_param_count"),
3956 : .get = py_smb_trans_body_get_total_param_count,
3957 : .set = py_smb_trans_body_set_total_param_count,
3958 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3959 : },
3960 : {
3961 : .name = discard_const_p(char, "total_data_count"),
3962 : .get = py_smb_trans_body_get_total_data_count,
3963 : .set = py_smb_trans_body_set_total_data_count,
3964 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3965 : },
3966 : {
3967 : .name = discard_const_p(char, "max_param_count"),
3968 : .get = py_smb_trans_body_get_max_param_count,
3969 : .set = py_smb_trans_body_set_max_param_count,
3970 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3971 : },
3972 : {
3973 : .name = discard_const_p(char, "max_data_count"),
3974 : .get = py_smb_trans_body_get_max_data_count,
3975 : .set = py_smb_trans_body_set_max_data_count,
3976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3977 : },
3978 : {
3979 : .name = discard_const_p(char, "max_setup_count"),
3980 : .get = py_smb_trans_body_get_max_setup_count,
3981 : .set = py_smb_trans_body_set_max_setup_count,
3982 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3983 : },
3984 : {
3985 : .name = discard_const_p(char, "pad"),
3986 : .get = py_smb_trans_body_get_pad,
3987 : .set = py_smb_trans_body_set_pad,
3988 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3989 : },
3990 : {
3991 : .name = discard_const_p(char, "trans_flags"),
3992 : .get = py_smb_trans_body_get_trans_flags,
3993 : .set = py_smb_trans_body_set_trans_flags,
3994 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3995 : },
3996 : {
3997 : .name = discard_const_p(char, "timeout"),
3998 : .get = py_smb_trans_body_get_timeout,
3999 : .set = py_smb_trans_body_set_timeout,
4000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4001 : },
4002 : {
4003 : .name = discard_const_p(char, "reserved"),
4004 : .get = py_smb_trans_body_get_reserved,
4005 : .set = py_smb_trans_body_set_reserved,
4006 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4007 : },
4008 : {
4009 : .name = discard_const_p(char, "param_count"),
4010 : .get = py_smb_trans_body_get_param_count,
4011 : .set = py_smb_trans_body_set_param_count,
4012 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4013 : },
4014 : {
4015 : .name = discard_const_p(char, "param_offset"),
4016 : .get = py_smb_trans_body_get_param_offset,
4017 : .set = py_smb_trans_body_set_param_offset,
4018 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4019 : },
4020 : {
4021 : .name = discard_const_p(char, "data_count"),
4022 : .get = py_smb_trans_body_get_data_count,
4023 : .set = py_smb_trans_body_set_data_count,
4024 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4025 : },
4026 : {
4027 : .name = discard_const_p(char, "data_offset"),
4028 : .get = py_smb_trans_body_get_data_offset,
4029 : .set = py_smb_trans_body_set_data_offset,
4030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4031 : },
4032 : {
4033 : .name = discard_const_p(char, "setup_count"),
4034 : .get = py_smb_trans_body_get_setup_count,
4035 : .set = py_smb_trans_body_set_setup_count,
4036 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4037 : },
4038 : {
4039 : .name = discard_const_p(char, "pad2"),
4040 : .get = py_smb_trans_body_get_pad2,
4041 : .set = py_smb_trans_body_set_pad2,
4042 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4043 : },
4044 : {
4045 : .name = discard_const_p(char, "opcode"),
4046 : .get = py_smb_trans_body_get_opcode,
4047 : .set = py_smb_trans_body_set_opcode,
4048 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4049 : },
4050 : {
4051 : .name = discard_const_p(char, "priority"),
4052 : .get = py_smb_trans_body_get_priority,
4053 : .set = py_smb_trans_body_set_priority,
4054 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4055 : },
4056 : {
4057 : .name = discard_const_p(char, "_class"),
4058 : .get = py_smb_trans_body_get__class,
4059 : .set = py_smb_trans_body_set__class,
4060 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4061 : },
4062 : {
4063 : .name = discard_const_p(char, "byte_count"),
4064 : .get = py_smb_trans_body_get_byte_count,
4065 : .set = py_smb_trans_body_set_byte_count,
4066 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4067 : },
4068 : {
4069 : .name = discard_const_p(char, "mailslot_name"),
4070 : .get = py_smb_trans_body_get_mailslot_name,
4071 : .set = py_smb_trans_body_set_mailslot_name,
4072 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
4073 : },
4074 : {
4075 : .name = discard_const_p(char, "data"),
4076 : .get = py_smb_trans_body_get_data,
4077 : .set = py_smb_trans_body_set_data,
4078 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
4079 : },
4080 : { .name = NULL }
4081 : };
4082 :
4083 0 : static PyObject *py_smb_trans_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4084 : {
4085 0 : return pytalloc_new(struct smb_trans_body, type);
4086 : }
4087 :
4088 :
4089 : static PyTypeObject smb_trans_body_Type = {
4090 : PyVarObject_HEAD_INIT(NULL, 0)
4091 : .tp_name = "nbt.smb_trans_body",
4092 : .tp_getset = py_smb_trans_body_getsetters,
4093 : .tp_methods = NULL,
4094 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4095 : .tp_new = py_smb_trans_body_new,
4096 : };
4097 :
4098 0 : static PyObject *py_import_smb_body(TALLOC_CTX *mem_ctx, int level, union smb_body *in)
4099 : {
4100 : PyObject *ret;
4101 :
4102 0 : switch (level) {
4103 0 : case SMB_TRANSACTION:
4104 0 : ret = pytalloc_reference_ex(&smb_trans_body_Type, mem_ctx, &in->trans);
4105 0 : return ret;
4106 :
4107 : }
4108 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4109 0 : return NULL;
4110 : }
4111 :
4112 0 : static union smb_body *py_export_smb_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4113 : {
4114 0 : union smb_body *ret = talloc_zero(mem_ctx, union smb_body);
4115 0 : switch (level) {
4116 0 : case SMB_TRANSACTION:
4117 0 : if (in == NULL) {
4118 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->trans");
4119 0 : talloc_free(ret); return NULL;
4120 : }
4121 0 : PY_CHECK_TYPE(&smb_trans_body_Type, in, talloc_free(ret); return NULL;);
4122 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4123 0 : PyErr_NoMemory();
4124 0 : talloc_free(ret); return NULL;
4125 : }
4126 0 : ret->trans = *(struct smb_trans_body *)pytalloc_get_ptr(in);
4127 0 : break;
4128 :
4129 0 : default:
4130 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4131 0 : talloc_free(ret);
4132 0 : ret = NULL;
4133 : }
4134 :
4135 0 : return ret;
4136 : }
4137 :
4138 0 : static PyObject *py_smb_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4139 : {
4140 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4141 0 : PyObject *mem_ctx_obj = NULL;
4142 0 : TALLOC_CTX *mem_ctx = NULL;
4143 0 : int level = 0;
4144 0 : PyObject *in_obj = NULL;
4145 0 : union smb_body *in = NULL;
4146 :
4147 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4148 : discard_const_p(char *, kwnames),
4149 : &mem_ctx_obj,
4150 : &level,
4151 : &in_obj)) {
4152 0 : return NULL;
4153 : }
4154 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4155 0 : if (mem_ctx == NULL) {
4156 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4157 0 : return NULL;
4158 : }
4159 0 : in = (union smb_body *)pytalloc_get_ptr(in_obj);
4160 0 : if (in == NULL) {
4161 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union smb_body!");
4162 0 : return NULL;
4163 : }
4164 :
4165 0 : return py_import_smb_body(mem_ctx, level, in);
4166 : }
4167 :
4168 0 : static PyObject *py_smb_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4169 : {
4170 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4171 0 : PyObject *mem_ctx_obj = NULL;
4172 0 : TALLOC_CTX *mem_ctx = NULL;
4173 0 : int level = 0;
4174 0 : PyObject *in = NULL;
4175 0 : union smb_body *out = NULL;
4176 :
4177 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4178 : discard_const_p(char *, kwnames),
4179 : &mem_ctx_obj,
4180 : &level,
4181 : &in)) {
4182 0 : return NULL;
4183 : }
4184 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4185 0 : if (mem_ctx == NULL) {
4186 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4187 0 : return NULL;
4188 : }
4189 :
4190 0 : out = py_export_smb_body(mem_ctx, level, in);
4191 0 : if (out == NULL) {
4192 0 : return NULL;
4193 : }
4194 :
4195 0 : return pytalloc_GenericObject_reference(out);
4196 : }
4197 :
4198 : static PyMethodDef py_smb_body_methods[] = {
4199 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_import),
4200 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4201 : "T.__import__(mem_ctx, level, in) => ret." },
4202 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_export),
4203 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4204 : "T.__export__(mem_ctx, level, in) => ret." },
4205 : { NULL, NULL, 0, NULL }
4206 : };
4207 :
4208 0 : static PyObject *py_smb_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4209 : {
4210 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4211 0 : return NULL;
4212 : }
4213 :
4214 :
4215 : static PyTypeObject smb_body_Type = {
4216 : PyVarObject_HEAD_INIT(NULL, 0)
4217 : .tp_name = "nbt.smb_body",
4218 : .tp_getset = NULL,
4219 : .tp_methods = py_smb_body_methods,
4220 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4221 : .tp_new = py_smb_body_new,
4222 : };
4223 :
4224 :
4225 0 : static PyObject *py_dgram_smb_packet_get_smb_command(PyObject *obj, void *closure)
4226 : {
4227 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4228 : PyObject *py_smb_command;
4229 0 : py_smb_command = PyLong_FromLong((uint16_t)object->smb_command);
4230 0 : return py_smb_command;
4231 : }
4232 :
4233 0 : static int py_dgram_smb_packet_set_smb_command(PyObject *py_obj, PyObject *value, void *closure)
4234 : {
4235 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4236 0 : if (value == NULL) {
4237 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->smb_command");
4238 0 : return -1;
4239 : }
4240 : {
4241 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->smb_command));
4242 0 : if (PyLong_Check(value)) {
4243 : unsigned long long test_var;
4244 0 : test_var = PyLong_AsUnsignedLongLong(value);
4245 0 : if (PyErr_Occurred() != NULL) {
4246 0 : return -1;
4247 : }
4248 0 : if (test_var > uint_max) {
4249 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4250 : PyLong_Type.tp_name, uint_max, test_var);
4251 0 : return -1;
4252 : }
4253 0 : object->smb_command = test_var;
4254 : } else {
4255 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4256 : PyLong_Type.tp_name);
4257 0 : return -1;
4258 : }
4259 : }
4260 0 : return 0;
4261 : }
4262 :
4263 0 : static PyObject *py_dgram_smb_packet_get_err_class(PyObject *obj, void *closure)
4264 : {
4265 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4266 : PyObject *py_err_class;
4267 0 : py_err_class = PyLong_FromLong((uint16_t)object->err_class);
4268 0 : return py_err_class;
4269 : }
4270 :
4271 0 : static int py_dgram_smb_packet_set_err_class(PyObject *py_obj, PyObject *value, void *closure)
4272 : {
4273 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4274 0 : if (value == NULL) {
4275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->err_class");
4276 0 : return -1;
4277 : }
4278 : {
4279 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_class));
4280 0 : if (PyLong_Check(value)) {
4281 : unsigned long long test_var;
4282 0 : test_var = PyLong_AsUnsignedLongLong(value);
4283 0 : if (PyErr_Occurred() != NULL) {
4284 0 : return -1;
4285 : }
4286 0 : if (test_var > uint_max) {
4287 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4288 : PyLong_Type.tp_name, uint_max, test_var);
4289 0 : return -1;
4290 : }
4291 0 : object->err_class = test_var;
4292 : } else {
4293 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4294 : PyLong_Type.tp_name);
4295 0 : return -1;
4296 : }
4297 : }
4298 0 : return 0;
4299 : }
4300 :
4301 0 : static PyObject *py_dgram_smb_packet_get_pad(PyObject *obj, void *closure)
4302 : {
4303 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4304 : PyObject *py_pad;
4305 0 : py_pad = PyLong_FromLong((uint16_t)object->pad);
4306 0 : return py_pad;
4307 : }
4308 :
4309 0 : static int py_dgram_smb_packet_set_pad(PyObject *py_obj, PyObject *value, void *closure)
4310 : {
4311 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4312 0 : if (value == NULL) {
4313 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad");
4314 0 : return -1;
4315 : }
4316 : {
4317 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
4318 0 : if (PyLong_Check(value)) {
4319 : unsigned long long test_var;
4320 0 : test_var = PyLong_AsUnsignedLongLong(value);
4321 0 : if (PyErr_Occurred() != NULL) {
4322 0 : return -1;
4323 : }
4324 0 : if (test_var > uint_max) {
4325 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4326 : PyLong_Type.tp_name, uint_max, test_var);
4327 0 : return -1;
4328 : }
4329 0 : object->pad = test_var;
4330 : } else {
4331 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4332 : PyLong_Type.tp_name);
4333 0 : return -1;
4334 : }
4335 : }
4336 0 : return 0;
4337 : }
4338 :
4339 0 : static PyObject *py_dgram_smb_packet_get_err_code(PyObject *obj, void *closure)
4340 : {
4341 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4342 : PyObject *py_err_code;
4343 0 : py_err_code = PyLong_FromLong((uint16_t)object->err_code);
4344 0 : return py_err_code;
4345 : }
4346 :
4347 0 : static int py_dgram_smb_packet_set_err_code(PyObject *py_obj, PyObject *value, void *closure)
4348 : {
4349 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4350 0 : if (value == NULL) {
4351 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->err_code");
4352 0 : return -1;
4353 : }
4354 : {
4355 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_code));
4356 0 : if (PyLong_Check(value)) {
4357 : unsigned long long test_var;
4358 0 : test_var = PyLong_AsUnsignedLongLong(value);
4359 0 : if (PyErr_Occurred() != NULL) {
4360 0 : return -1;
4361 : }
4362 0 : if (test_var > uint_max) {
4363 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4364 : PyLong_Type.tp_name, uint_max, test_var);
4365 0 : return -1;
4366 : }
4367 0 : object->err_code = test_var;
4368 : } else {
4369 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4370 : PyLong_Type.tp_name);
4371 0 : return -1;
4372 : }
4373 : }
4374 0 : return 0;
4375 : }
4376 :
4377 0 : static PyObject *py_dgram_smb_packet_get_flags(PyObject *obj, void *closure)
4378 : {
4379 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4380 : PyObject *py_flags;
4381 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
4382 0 : return py_flags;
4383 : }
4384 :
4385 0 : static int py_dgram_smb_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
4386 : {
4387 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4388 0 : if (value == NULL) {
4389 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
4390 0 : return -1;
4391 : }
4392 : {
4393 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
4394 0 : if (PyLong_Check(value)) {
4395 : unsigned long long test_var;
4396 0 : test_var = PyLong_AsUnsignedLongLong(value);
4397 0 : if (PyErr_Occurred() != NULL) {
4398 0 : return -1;
4399 : }
4400 0 : if (test_var > uint_max) {
4401 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4402 : PyLong_Type.tp_name, uint_max, test_var);
4403 0 : return -1;
4404 : }
4405 0 : object->flags = test_var;
4406 : } else {
4407 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4408 : PyLong_Type.tp_name);
4409 0 : return -1;
4410 : }
4411 : }
4412 0 : return 0;
4413 : }
4414 :
4415 0 : static PyObject *py_dgram_smb_packet_get_flags2(PyObject *obj, void *closure)
4416 : {
4417 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4418 : PyObject *py_flags2;
4419 0 : py_flags2 = PyLong_FromLong((uint16_t)object->flags2);
4420 0 : return py_flags2;
4421 : }
4422 :
4423 0 : static int py_dgram_smb_packet_set_flags2(PyObject *py_obj, PyObject *value, void *closure)
4424 : {
4425 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4426 0 : if (value == NULL) {
4427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags2");
4428 0 : return -1;
4429 : }
4430 : {
4431 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags2));
4432 0 : if (PyLong_Check(value)) {
4433 : unsigned long long test_var;
4434 0 : test_var = PyLong_AsUnsignedLongLong(value);
4435 0 : if (PyErr_Occurred() != NULL) {
4436 0 : return -1;
4437 : }
4438 0 : if (test_var > uint_max) {
4439 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4440 : PyLong_Type.tp_name, uint_max, test_var);
4441 0 : return -1;
4442 : }
4443 0 : object->flags2 = test_var;
4444 : } else {
4445 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4446 : PyLong_Type.tp_name);
4447 0 : return -1;
4448 : }
4449 : }
4450 0 : return 0;
4451 : }
4452 :
4453 0 : static PyObject *py_dgram_smb_packet_get_pid_high(PyObject *obj, void *closure)
4454 : {
4455 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4456 : PyObject *py_pid_high;
4457 0 : py_pid_high = PyLong_FromLong((uint16_t)object->pid_high);
4458 0 : return py_pid_high;
4459 : }
4460 :
4461 0 : static int py_dgram_smb_packet_set_pid_high(PyObject *py_obj, PyObject *value, void *closure)
4462 : {
4463 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4464 0 : if (value == NULL) {
4465 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid_high");
4466 0 : return -1;
4467 : }
4468 : {
4469 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid_high));
4470 0 : if (PyLong_Check(value)) {
4471 : unsigned long long test_var;
4472 0 : test_var = PyLong_AsUnsignedLongLong(value);
4473 0 : if (PyErr_Occurred() != NULL) {
4474 0 : return -1;
4475 : }
4476 0 : if (test_var > uint_max) {
4477 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4478 : PyLong_Type.tp_name, uint_max, test_var);
4479 0 : return -1;
4480 : }
4481 0 : object->pid_high = test_var;
4482 : } else {
4483 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4484 : PyLong_Type.tp_name);
4485 0 : return -1;
4486 : }
4487 : }
4488 0 : return 0;
4489 : }
4490 :
4491 0 : static PyObject *py_dgram_smb_packet_get_signature(PyObject *obj, void *closure)
4492 : {
4493 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4494 : PyObject *py_signature;
4495 0 : py_signature = PyList_New(8);
4496 0 : if (py_signature == NULL) {
4497 0 : return NULL;
4498 : }
4499 : {
4500 : int signature_cntr_0;
4501 0 : for (signature_cntr_0 = 0; signature_cntr_0 < (8); signature_cntr_0++) {
4502 : PyObject *py_signature_0;
4503 0 : py_signature_0 = PyLong_FromLong((uint16_t)object->signature[signature_cntr_0]);
4504 0 : PyList_SetItem(py_signature, signature_cntr_0, py_signature_0);
4505 : }
4506 : }
4507 0 : return py_signature;
4508 : }
4509 :
4510 0 : static int py_dgram_smb_packet_set_signature(PyObject *py_obj, PyObject *value, void *closure)
4511 : {
4512 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4513 0 : if (value == NULL) {
4514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature");
4515 0 : return -1;
4516 : }
4517 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4518 : {
4519 : int signature_cntr_0;
4520 0 : if (ARRAY_SIZE(object->signature) != PyList_GET_SIZE(value)) {
4521 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));
4522 0 : return -1;
4523 : }
4524 0 : for (signature_cntr_0 = 0; signature_cntr_0 < PyList_GET_SIZE(value); signature_cntr_0++) {
4525 0 : if (PyList_GET_ITEM(value, signature_cntr_0) == NULL) {
4526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature[signature_cntr_0]");
4527 0 : return -1;
4528 : }
4529 : {
4530 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->signature[signature_cntr_0]));
4531 0 : if (PyLong_Check(PyList_GET_ITEM(value, signature_cntr_0))) {
4532 : unsigned long long test_var;
4533 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, signature_cntr_0));
4534 0 : if (PyErr_Occurred() != NULL) {
4535 0 : return -1;
4536 : }
4537 0 : if (test_var > uint_max) {
4538 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4539 : PyLong_Type.tp_name, uint_max, test_var);
4540 0 : return -1;
4541 : }
4542 0 : object->signature[signature_cntr_0] = test_var;
4543 : } else {
4544 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4545 : PyLong_Type.tp_name);
4546 0 : return -1;
4547 : }
4548 : }
4549 : }
4550 : }
4551 0 : return 0;
4552 : }
4553 :
4554 0 : static PyObject *py_dgram_smb_packet_get_reserved(PyObject *obj, void *closure)
4555 : {
4556 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4557 : PyObject *py_reserved;
4558 0 : py_reserved = PyLong_FromLong((uint16_t)object->reserved);
4559 0 : return py_reserved;
4560 : }
4561 :
4562 0 : static int py_dgram_smb_packet_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
4563 : {
4564 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4565 0 : if (value == NULL) {
4566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
4567 0 : return -1;
4568 : }
4569 : {
4570 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
4571 0 : if (PyLong_Check(value)) {
4572 : unsigned long long test_var;
4573 0 : test_var = PyLong_AsUnsignedLongLong(value);
4574 0 : if (PyErr_Occurred() != NULL) {
4575 0 : return -1;
4576 : }
4577 0 : if (test_var > uint_max) {
4578 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4579 : PyLong_Type.tp_name, uint_max, test_var);
4580 0 : return -1;
4581 : }
4582 0 : object->reserved = test_var;
4583 : } else {
4584 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4585 : PyLong_Type.tp_name);
4586 0 : return -1;
4587 : }
4588 : }
4589 0 : return 0;
4590 : }
4591 :
4592 0 : static PyObject *py_dgram_smb_packet_get_tid(PyObject *obj, void *closure)
4593 : {
4594 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4595 : PyObject *py_tid;
4596 0 : py_tid = PyLong_FromLong((uint16_t)object->tid);
4597 0 : return py_tid;
4598 : }
4599 :
4600 0 : static int py_dgram_smb_packet_set_tid(PyObject *py_obj, PyObject *value, void *closure)
4601 : {
4602 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4603 0 : if (value == NULL) {
4604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tid");
4605 0 : return -1;
4606 : }
4607 : {
4608 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tid));
4609 0 : if (PyLong_Check(value)) {
4610 : unsigned long long test_var;
4611 0 : test_var = PyLong_AsUnsignedLongLong(value);
4612 0 : if (PyErr_Occurred() != NULL) {
4613 0 : return -1;
4614 : }
4615 0 : if (test_var > uint_max) {
4616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4617 : PyLong_Type.tp_name, uint_max, test_var);
4618 0 : return -1;
4619 : }
4620 0 : object->tid = test_var;
4621 : } else {
4622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4623 : PyLong_Type.tp_name);
4624 0 : return -1;
4625 : }
4626 : }
4627 0 : return 0;
4628 : }
4629 :
4630 0 : static PyObject *py_dgram_smb_packet_get_pid(PyObject *obj, void *closure)
4631 : {
4632 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4633 : PyObject *py_pid;
4634 0 : py_pid = PyLong_FromLong((uint16_t)object->pid);
4635 0 : return py_pid;
4636 : }
4637 :
4638 0 : static int py_dgram_smb_packet_set_pid(PyObject *py_obj, PyObject *value, void *closure)
4639 : {
4640 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4641 0 : if (value == NULL) {
4642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid");
4643 0 : return -1;
4644 : }
4645 : {
4646 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid));
4647 0 : if (PyLong_Check(value)) {
4648 : unsigned long long test_var;
4649 0 : test_var = PyLong_AsUnsignedLongLong(value);
4650 0 : if (PyErr_Occurred() != NULL) {
4651 0 : return -1;
4652 : }
4653 0 : if (test_var > uint_max) {
4654 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4655 : PyLong_Type.tp_name, uint_max, test_var);
4656 0 : return -1;
4657 : }
4658 0 : object->pid = test_var;
4659 : } else {
4660 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4661 : PyLong_Type.tp_name);
4662 0 : return -1;
4663 : }
4664 : }
4665 0 : return 0;
4666 : }
4667 :
4668 0 : static PyObject *py_dgram_smb_packet_get_vuid(PyObject *obj, void *closure)
4669 : {
4670 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4671 : PyObject *py_vuid;
4672 0 : py_vuid = PyLong_FromLong((uint16_t)object->vuid);
4673 0 : return py_vuid;
4674 : }
4675 :
4676 0 : static int py_dgram_smb_packet_set_vuid(PyObject *py_obj, PyObject *value, void *closure)
4677 : {
4678 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4679 0 : if (value == NULL) {
4680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->vuid");
4681 0 : return -1;
4682 : }
4683 : {
4684 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vuid));
4685 0 : if (PyLong_Check(value)) {
4686 : unsigned long long test_var;
4687 0 : test_var = PyLong_AsUnsignedLongLong(value);
4688 0 : if (PyErr_Occurred() != NULL) {
4689 0 : return -1;
4690 : }
4691 0 : if (test_var > uint_max) {
4692 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4693 : PyLong_Type.tp_name, uint_max, test_var);
4694 0 : return -1;
4695 : }
4696 0 : object->vuid = test_var;
4697 : } else {
4698 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4699 : PyLong_Type.tp_name);
4700 0 : return -1;
4701 : }
4702 : }
4703 0 : return 0;
4704 : }
4705 :
4706 0 : static PyObject *py_dgram_smb_packet_get_mid(PyObject *obj, void *closure)
4707 : {
4708 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4709 : PyObject *py_mid;
4710 0 : py_mid = PyLong_FromLong((uint16_t)object->mid);
4711 0 : return py_mid;
4712 : }
4713 :
4714 0 : static int py_dgram_smb_packet_set_mid(PyObject *py_obj, PyObject *value, void *closure)
4715 : {
4716 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4717 0 : if (value == NULL) {
4718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mid");
4719 0 : return -1;
4720 : }
4721 : {
4722 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mid));
4723 0 : if (PyLong_Check(value)) {
4724 : unsigned long long test_var;
4725 0 : test_var = PyLong_AsUnsignedLongLong(value);
4726 0 : if (PyErr_Occurred() != NULL) {
4727 0 : return -1;
4728 : }
4729 0 : if (test_var > uint_max) {
4730 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4731 : PyLong_Type.tp_name, uint_max, test_var);
4732 0 : return -1;
4733 : }
4734 0 : object->mid = test_var;
4735 : } else {
4736 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4737 : PyLong_Type.tp_name);
4738 0 : return -1;
4739 : }
4740 : }
4741 0 : return 0;
4742 : }
4743 :
4744 0 : static PyObject *py_dgram_smb_packet_get_body(PyObject *obj, void *closure)
4745 : {
4746 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
4747 : PyObject *py_body;
4748 0 : py_body = pyrpc_import_union(&smb_body_Type, pytalloc_get_mem_ctx(obj), object->smb_command, &object->body, "union smb_body");
4749 0 : if (py_body == NULL) {
4750 0 : return NULL;
4751 : }
4752 0 : return py_body;
4753 : }
4754 :
4755 0 : static int py_dgram_smb_packet_set_body(PyObject *py_obj, PyObject *value, void *closure)
4756 : {
4757 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4758 0 : if (value == NULL) {
4759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->body");
4760 0 : return -1;
4761 : }
4762 : {
4763 : union smb_body *body_switch_0;
4764 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");
4765 0 : if (body_switch_0 == NULL) {
4766 0 : return -1;
4767 : }
4768 0 : object->body = *body_switch_0;
4769 : }
4770 0 : return 0;
4771 : }
4772 :
4773 : static PyGetSetDef py_dgram_smb_packet_getsetters[] = {
4774 : {
4775 : .name = discard_const_p(char, "smb_command"),
4776 : .get = py_dgram_smb_packet_get_smb_command,
4777 : .set = py_dgram_smb_packet_set_smb_command,
4778 : .doc = discard_const_p(char, "PIDL-generated element of base type smb_command")
4779 : },
4780 : {
4781 : .name = discard_const_p(char, "err_class"),
4782 : .get = py_dgram_smb_packet_get_err_class,
4783 : .set = py_dgram_smb_packet_set_err_class,
4784 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4785 : },
4786 : {
4787 : .name = discard_const_p(char, "pad"),
4788 : .get = py_dgram_smb_packet_get_pad,
4789 : .set = py_dgram_smb_packet_set_pad,
4790 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4791 : },
4792 : {
4793 : .name = discard_const_p(char, "err_code"),
4794 : .get = py_dgram_smb_packet_get_err_code,
4795 : .set = py_dgram_smb_packet_set_err_code,
4796 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4797 : },
4798 : {
4799 : .name = discard_const_p(char, "flags"),
4800 : .get = py_dgram_smb_packet_get_flags,
4801 : .set = py_dgram_smb_packet_set_flags,
4802 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4803 : },
4804 : {
4805 : .name = discard_const_p(char, "flags2"),
4806 : .get = py_dgram_smb_packet_get_flags2,
4807 : .set = py_dgram_smb_packet_set_flags2,
4808 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4809 : },
4810 : {
4811 : .name = discard_const_p(char, "pid_high"),
4812 : .get = py_dgram_smb_packet_get_pid_high,
4813 : .set = py_dgram_smb_packet_set_pid_high,
4814 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4815 : },
4816 : {
4817 : .name = discard_const_p(char, "signature"),
4818 : .get = py_dgram_smb_packet_get_signature,
4819 : .set = py_dgram_smb_packet_set_signature,
4820 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4821 : },
4822 : {
4823 : .name = discard_const_p(char, "reserved"),
4824 : .get = py_dgram_smb_packet_get_reserved,
4825 : .set = py_dgram_smb_packet_set_reserved,
4826 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4827 : },
4828 : {
4829 : .name = discard_const_p(char, "tid"),
4830 : .get = py_dgram_smb_packet_get_tid,
4831 : .set = py_dgram_smb_packet_set_tid,
4832 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4833 : },
4834 : {
4835 : .name = discard_const_p(char, "pid"),
4836 : .get = py_dgram_smb_packet_get_pid,
4837 : .set = py_dgram_smb_packet_set_pid,
4838 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4839 : },
4840 : {
4841 : .name = discard_const_p(char, "vuid"),
4842 : .get = py_dgram_smb_packet_get_vuid,
4843 : .set = py_dgram_smb_packet_set_vuid,
4844 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4845 : },
4846 : {
4847 : .name = discard_const_p(char, "mid"),
4848 : .get = py_dgram_smb_packet_get_mid,
4849 : .set = py_dgram_smb_packet_set_mid,
4850 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4851 : },
4852 : {
4853 : .name = discard_const_p(char, "body"),
4854 : .get = py_dgram_smb_packet_get_body,
4855 : .set = py_dgram_smb_packet_set_body,
4856 : .doc = discard_const_p(char, "PIDL-generated element of base type smb_body")
4857 : },
4858 : { .name = NULL }
4859 : };
4860 :
4861 0 : static PyObject *py_dgram_smb_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4862 : {
4863 0 : return pytalloc_new(struct dgram_smb_packet, type);
4864 : }
4865 :
4866 0 : static PyObject *py_dgram_smb_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4867 : {
4868 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4869 0 : PyObject *ret = NULL;
4870 : DATA_BLOB blob;
4871 : enum ndr_err_code err;
4872 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4873 0 : if (tmp_ctx == NULL) {
4874 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4875 0 : return NULL;
4876 : }
4877 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dgram_smb_packet);
4878 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4879 0 : TALLOC_FREE(tmp_ctx);
4880 0 : PyErr_SetNdrError(err);
4881 0 : return NULL;
4882 : }
4883 :
4884 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4885 0 : TALLOC_FREE(tmp_ctx);
4886 0 : return ret;
4887 : }
4888 :
4889 0 : static PyObject *py_dgram_smb_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4890 : {
4891 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4892 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4893 0 : Py_ssize_t blob_length = 0;
4894 : enum ndr_err_code err;
4895 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4896 0 : PyObject *allow_remaining_obj = NULL;
4897 0 : bool allow_remaining = false;
4898 :
4899 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4900 : discard_const_p(char *, kwnames),
4901 : &blob.data, &blob_length,
4902 : &allow_remaining_obj)) {
4903 0 : return NULL;
4904 : }
4905 0 : blob.length = blob_length;
4906 :
4907 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4908 0 : allow_remaining = true;
4909 : }
4910 :
4911 0 : if (allow_remaining) {
4912 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
4913 : } else {
4914 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);
4915 : }
4916 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4917 0 : PyErr_SetNdrError(err);
4918 0 : return NULL;
4919 : }
4920 :
4921 0 : Py_RETURN_NONE;
4922 : }
4923 :
4924 0 : static PyObject *py_dgram_smb_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4925 : {
4926 0 : struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
4927 : PyObject *ret;
4928 : char *retstr;
4929 :
4930 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);
4931 0 : ret = PyUnicode_FromString(retstr);
4932 0 : talloc_free(retstr);
4933 :
4934 0 : return ret;
4935 : }
4936 :
4937 : static PyMethodDef py_dgram_smb_packet_methods[] = {
4938 : { "__ndr_pack__", (PyCFunction)py_dgram_smb_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4939 : { "__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" },
4940 : { "__ndr_print__", (PyCFunction)py_dgram_smb_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4941 : { NULL, NULL, 0, NULL }
4942 : };
4943 :
4944 :
4945 : static PyTypeObject dgram_smb_packet_Type = {
4946 : PyVarObject_HEAD_INIT(NULL, 0)
4947 : .tp_name = "nbt.dgram_smb_packet",
4948 : .tp_getset = py_dgram_smb_packet_getsetters,
4949 : .tp_methods = py_dgram_smb_packet_methods,
4950 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4951 : .tp_new = py_dgram_smb_packet_new,
4952 : };
4953 :
4954 0 : static PyObject *py_import_dgram_message_body(TALLOC_CTX *mem_ctx, int level, union dgram_message_body *in)
4955 : {
4956 : PyObject *ret;
4957 :
4958 0 : switch (level) {
4959 0 : case DGRAM_SMB:
4960 0 : ret = pytalloc_reference_ex(&dgram_smb_packet_Type, mem_ctx, &in->smb);
4961 0 : return ret;
4962 :
4963 : }
4964 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4965 0 : return NULL;
4966 : }
4967 :
4968 0 : static union dgram_message_body *py_export_dgram_message_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4969 : {
4970 0 : union dgram_message_body *ret = talloc_zero(mem_ctx, union dgram_message_body);
4971 0 : switch (level) {
4972 0 : case DGRAM_SMB:
4973 0 : if (in == NULL) {
4974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->smb");
4975 0 : talloc_free(ret); return NULL;
4976 : }
4977 0 : PY_CHECK_TYPE(&dgram_smb_packet_Type, in, talloc_free(ret); return NULL;);
4978 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4979 0 : PyErr_NoMemory();
4980 0 : talloc_free(ret); return NULL;
4981 : }
4982 0 : ret->smb = *(struct dgram_smb_packet *)pytalloc_get_ptr(in);
4983 0 : break;
4984 :
4985 0 : default:
4986 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4987 0 : talloc_free(ret);
4988 0 : ret = NULL;
4989 : }
4990 :
4991 0 : return ret;
4992 : }
4993 :
4994 0 : static PyObject *py_dgram_message_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4995 : {
4996 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4997 0 : PyObject *mem_ctx_obj = NULL;
4998 0 : TALLOC_CTX *mem_ctx = NULL;
4999 0 : int level = 0;
5000 0 : PyObject *in_obj = NULL;
5001 0 : union dgram_message_body *in = NULL;
5002 :
5003 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
5004 : discard_const_p(char *, kwnames),
5005 : &mem_ctx_obj,
5006 : &level,
5007 : &in_obj)) {
5008 0 : return NULL;
5009 : }
5010 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5011 0 : if (mem_ctx == NULL) {
5012 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5013 0 : return NULL;
5014 : }
5015 0 : in = (union dgram_message_body *)pytalloc_get_ptr(in_obj);
5016 0 : if (in == NULL) {
5017 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_message_body!");
5018 0 : return NULL;
5019 : }
5020 :
5021 0 : return py_import_dgram_message_body(mem_ctx, level, in);
5022 : }
5023 :
5024 0 : static PyObject *py_dgram_message_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5025 : {
5026 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5027 0 : PyObject *mem_ctx_obj = NULL;
5028 0 : TALLOC_CTX *mem_ctx = NULL;
5029 0 : int level = 0;
5030 0 : PyObject *in = NULL;
5031 0 : union dgram_message_body *out = NULL;
5032 :
5033 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5034 : discard_const_p(char *, kwnames),
5035 : &mem_ctx_obj,
5036 : &level,
5037 : &in)) {
5038 0 : return NULL;
5039 : }
5040 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5041 0 : if (mem_ctx == NULL) {
5042 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5043 0 : return NULL;
5044 : }
5045 :
5046 0 : out = py_export_dgram_message_body(mem_ctx, level, in);
5047 0 : if (out == NULL) {
5048 0 : return NULL;
5049 : }
5050 :
5051 0 : return pytalloc_GenericObject_reference(out);
5052 : }
5053 :
5054 : static PyMethodDef py_dgram_message_body_methods[] = {
5055 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_import),
5056 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5057 : "T.__import__(mem_ctx, level, in) => ret." },
5058 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_export),
5059 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5060 : "T.__export__(mem_ctx, level, in) => ret." },
5061 : { NULL, NULL, 0, NULL }
5062 : };
5063 :
5064 0 : static PyObject *py_dgram_message_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5065 : {
5066 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5067 0 : return NULL;
5068 : }
5069 :
5070 :
5071 : static PyTypeObject dgram_message_body_Type = {
5072 : PyVarObject_HEAD_INIT(NULL, 0)
5073 : .tp_name = "nbt.dgram_message_body",
5074 : .tp_getset = NULL,
5075 : .tp_methods = py_dgram_message_body_methods,
5076 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5077 : .tp_new = py_dgram_message_body_new,
5078 : };
5079 :
5080 :
5081 0 : static PyObject *py_dgram_message_get_length(PyObject *obj, void *closure)
5082 : {
5083 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5084 : PyObject *py_length;
5085 0 : py_length = PyLong_FromLong((uint16_t)object->length);
5086 0 : return py_length;
5087 : }
5088 :
5089 0 : static int py_dgram_message_set_length(PyObject *py_obj, PyObject *value, void *closure)
5090 : {
5091 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5092 0 : if (value == NULL) {
5093 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
5094 0 : return -1;
5095 : }
5096 : {
5097 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
5098 0 : if (PyLong_Check(value)) {
5099 : unsigned long long test_var;
5100 0 : test_var = PyLong_AsUnsignedLongLong(value);
5101 0 : if (PyErr_Occurred() != NULL) {
5102 0 : return -1;
5103 : }
5104 0 : if (test_var > uint_max) {
5105 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5106 : PyLong_Type.tp_name, uint_max, test_var);
5107 0 : return -1;
5108 : }
5109 0 : object->length = test_var;
5110 : } else {
5111 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5112 : PyLong_Type.tp_name);
5113 0 : return -1;
5114 : }
5115 : }
5116 0 : return 0;
5117 : }
5118 :
5119 0 : static PyObject *py_dgram_message_get_offset(PyObject *obj, void *closure)
5120 : {
5121 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5122 : PyObject *py_offset;
5123 0 : py_offset = PyLong_FromLong((uint16_t)object->offset);
5124 0 : return py_offset;
5125 : }
5126 :
5127 0 : static int py_dgram_message_set_offset(PyObject *py_obj, PyObject *value, void *closure)
5128 : {
5129 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5130 0 : if (value == NULL) {
5131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->offset");
5132 0 : return -1;
5133 : }
5134 : {
5135 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->offset));
5136 0 : if (PyLong_Check(value)) {
5137 : unsigned long long test_var;
5138 0 : test_var = PyLong_AsUnsignedLongLong(value);
5139 0 : if (PyErr_Occurred() != NULL) {
5140 0 : return -1;
5141 : }
5142 0 : if (test_var > uint_max) {
5143 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5144 : PyLong_Type.tp_name, uint_max, test_var);
5145 0 : return -1;
5146 : }
5147 0 : object->offset = test_var;
5148 : } else {
5149 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5150 : PyLong_Type.tp_name);
5151 0 : return -1;
5152 : }
5153 : }
5154 0 : return 0;
5155 : }
5156 :
5157 0 : static PyObject *py_dgram_message_get_source_name(PyObject *obj, void *closure)
5158 : {
5159 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5160 : PyObject *py_source_name;
5161 0 : py_source_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->source_name);
5162 0 : return py_source_name;
5163 : }
5164 :
5165 0 : static int py_dgram_message_set_source_name(PyObject *py_obj, PyObject *value, void *closure)
5166 : {
5167 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5168 0 : if (value == NULL) {
5169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_name");
5170 0 : return -1;
5171 : }
5172 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
5173 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5174 0 : PyErr_NoMemory();
5175 0 : return -1;
5176 : }
5177 0 : object->source_name = *(struct nbt_name *)pytalloc_get_ptr(value);
5178 0 : return 0;
5179 : }
5180 :
5181 0 : static PyObject *py_dgram_message_get_dest_name(PyObject *obj, void *closure)
5182 : {
5183 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5184 : PyObject *py_dest_name;
5185 0 : py_dest_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->dest_name);
5186 0 : return py_dest_name;
5187 : }
5188 :
5189 0 : static int py_dgram_message_set_dest_name(PyObject *py_obj, PyObject *value, void *closure)
5190 : {
5191 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5192 0 : if (value == NULL) {
5193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dest_name");
5194 0 : return -1;
5195 : }
5196 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
5197 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5198 0 : PyErr_NoMemory();
5199 0 : return -1;
5200 : }
5201 0 : object->dest_name = *(struct nbt_name *)pytalloc_get_ptr(value);
5202 0 : return 0;
5203 : }
5204 :
5205 0 : static PyObject *py_dgram_message_get_dgram_body_type(PyObject *obj, void *closure)
5206 : {
5207 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5208 : PyObject *py_dgram_body_type;
5209 0 : py_dgram_body_type = PyLong_FromUnsignedLongLong((uint32_t)object->dgram_body_type);
5210 0 : return py_dgram_body_type;
5211 : }
5212 :
5213 0 : static int py_dgram_message_set_dgram_body_type(PyObject *py_obj, PyObject *value, void *closure)
5214 : {
5215 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5216 0 : if (value == NULL) {
5217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dgram_body_type");
5218 0 : return -1;
5219 : }
5220 : {
5221 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_body_type));
5222 0 : if (PyLong_Check(value)) {
5223 : unsigned long long test_var;
5224 0 : test_var = PyLong_AsUnsignedLongLong(value);
5225 0 : if (PyErr_Occurred() != NULL) {
5226 0 : return -1;
5227 : }
5228 0 : if (test_var > uint_max) {
5229 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5230 : PyLong_Type.tp_name, uint_max, test_var);
5231 0 : return -1;
5232 : }
5233 0 : object->dgram_body_type = test_var;
5234 : } else {
5235 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5236 : PyLong_Type.tp_name);
5237 0 : return -1;
5238 : }
5239 : }
5240 0 : return 0;
5241 : }
5242 :
5243 0 : static PyObject *py_dgram_message_get_body(PyObject *obj, void *closure)
5244 : {
5245 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
5246 : PyObject *py_body;
5247 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");
5248 0 : if (py_body == NULL) {
5249 0 : return NULL;
5250 : }
5251 0 : return py_body;
5252 : }
5253 :
5254 0 : static int py_dgram_message_set_body(PyObject *py_obj, PyObject *value, void *closure)
5255 : {
5256 0 : struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
5257 0 : if (value == NULL) {
5258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->body");
5259 0 : return -1;
5260 : }
5261 : {
5262 : union dgram_message_body *body_switch_0;
5263 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");
5264 0 : if (body_switch_0 == NULL) {
5265 0 : return -1;
5266 : }
5267 0 : object->body = *body_switch_0;
5268 : }
5269 0 : return 0;
5270 : }
5271 :
5272 : static PyGetSetDef py_dgram_message_getsetters[] = {
5273 : {
5274 : .name = discard_const_p(char, "length"),
5275 : .get = py_dgram_message_get_length,
5276 : .set = py_dgram_message_set_length,
5277 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5278 : },
5279 : {
5280 : .name = discard_const_p(char, "offset"),
5281 : .get = py_dgram_message_get_offset,
5282 : .set = py_dgram_message_set_offset,
5283 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5284 : },
5285 : {
5286 : .name = discard_const_p(char, "source_name"),
5287 : .get = py_dgram_message_get_source_name,
5288 : .set = py_dgram_message_set_source_name,
5289 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
5290 : },
5291 : {
5292 : .name = discard_const_p(char, "dest_name"),
5293 : .get = py_dgram_message_get_dest_name,
5294 : .set = py_dgram_message_set_dest_name,
5295 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
5296 : },
5297 : {
5298 : .name = discard_const_p(char, "dgram_body_type"),
5299 : .get = py_dgram_message_get_dgram_body_type,
5300 : .set = py_dgram_message_set_dgram_body_type,
5301 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5302 : },
5303 : {
5304 : .name = discard_const_p(char, "body"),
5305 : .get = py_dgram_message_get_body,
5306 : .set = py_dgram_message_set_body,
5307 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_message_body")
5308 : },
5309 : { .name = NULL }
5310 : };
5311 :
5312 0 : static PyObject *py_dgram_message_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5313 : {
5314 0 : return pytalloc_new(struct dgram_message, type);
5315 : }
5316 :
5317 :
5318 : static PyTypeObject dgram_message_Type = {
5319 : PyVarObject_HEAD_INIT(NULL, 0)
5320 : .tp_name = "nbt.dgram_message",
5321 : .tp_getset = py_dgram_message_getsetters,
5322 : .tp_methods = NULL,
5323 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5324 : .tp_new = py_dgram_message_new,
5325 : };
5326 :
5327 0 : static PyObject *py_import_dgram_data(TALLOC_CTX *mem_ctx, int level, union dgram_data *in)
5328 : {
5329 : PyObject *ret;
5330 :
5331 0 : switch (level) {
5332 0 : case DGRAM_DIRECT_UNIQUE:
5333 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5334 0 : return ret;
5335 :
5336 0 : case DGRAM_DIRECT_GROUP:
5337 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5338 0 : return ret;
5339 :
5340 0 : case DGRAM_BCAST:
5341 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5342 0 : return ret;
5343 :
5344 0 : case DGRAM_ERROR:
5345 0 : ret = PyLong_FromLong((uint16_t)in->error);
5346 0 : return ret;
5347 :
5348 0 : case DGRAM_QUERY:
5349 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5350 0 : return ret;
5351 :
5352 0 : case DGRAM_QUERY_POSITIVE:
5353 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5354 0 : return ret;
5355 :
5356 0 : case DGRAM_QUERY_NEGATIVE:
5357 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5358 0 : return ret;
5359 :
5360 : }
5361 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
5362 0 : return NULL;
5363 : }
5364 :
5365 0 : static union dgram_data *py_export_dgram_data(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5366 : {
5367 0 : union dgram_data *ret = talloc_zero(mem_ctx, union dgram_data);
5368 0 : switch (level) {
5369 0 : case DGRAM_DIRECT_UNIQUE:
5370 0 : if (in == NULL) {
5371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
5372 0 : talloc_free(ret); return NULL;
5373 : }
5374 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5375 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5376 0 : PyErr_NoMemory();
5377 0 : talloc_free(ret); return NULL;
5378 : }
5379 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5380 0 : break;
5381 :
5382 0 : case DGRAM_DIRECT_GROUP:
5383 0 : if (in == NULL) {
5384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
5385 0 : talloc_free(ret); return NULL;
5386 : }
5387 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5388 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5389 0 : PyErr_NoMemory();
5390 0 : talloc_free(ret); return NULL;
5391 : }
5392 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5393 0 : break;
5394 :
5395 0 : case DGRAM_BCAST:
5396 0 : if (in == NULL) {
5397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
5398 0 : talloc_free(ret); return NULL;
5399 : }
5400 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5401 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5402 0 : PyErr_NoMemory();
5403 0 : talloc_free(ret); return NULL;
5404 : }
5405 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5406 0 : break;
5407 :
5408 0 : case DGRAM_ERROR:
5409 0 : if (in == NULL) {
5410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->error");
5411 0 : talloc_free(ret); return NULL;
5412 : }
5413 : {
5414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->error));
5415 0 : if (PyLong_Check(in)) {
5416 : unsigned long long test_var;
5417 0 : test_var = PyLong_AsUnsignedLongLong(in);
5418 0 : if (PyErr_Occurred() != NULL) {
5419 0 : talloc_free(ret); return NULL;
5420 : }
5421 0 : if (test_var > uint_max) {
5422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5423 : PyLong_Type.tp_name, uint_max, test_var);
5424 0 : talloc_free(ret); return NULL;
5425 : }
5426 0 : ret->error = test_var;
5427 : } else {
5428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5429 : PyLong_Type.tp_name);
5430 0 : talloc_free(ret); return NULL;
5431 : }
5432 : }
5433 0 : break;
5434 :
5435 0 : case DGRAM_QUERY:
5436 0 : if (in == NULL) {
5437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
5438 0 : talloc_free(ret); return NULL;
5439 : }
5440 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5441 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5442 0 : PyErr_NoMemory();
5443 0 : talloc_free(ret); return NULL;
5444 : }
5445 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5446 0 : break;
5447 :
5448 0 : case DGRAM_QUERY_POSITIVE:
5449 0 : if (in == NULL) {
5450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
5451 0 : talloc_free(ret); return NULL;
5452 : }
5453 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5454 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5455 0 : PyErr_NoMemory();
5456 0 : talloc_free(ret); return NULL;
5457 : }
5458 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5459 0 : break;
5460 :
5461 0 : case DGRAM_QUERY_NEGATIVE:
5462 0 : if (in == NULL) {
5463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
5464 0 : talloc_free(ret); return NULL;
5465 : }
5466 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5467 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5468 0 : PyErr_NoMemory();
5469 0 : talloc_free(ret); return NULL;
5470 : }
5471 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5472 0 : break;
5473 :
5474 0 : default:
5475 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
5476 0 : talloc_free(ret);
5477 0 : ret = NULL;
5478 : }
5479 :
5480 0 : return ret;
5481 : }
5482 :
5483 0 : static PyObject *py_dgram_data_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5484 : {
5485 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5486 0 : PyObject *mem_ctx_obj = NULL;
5487 0 : TALLOC_CTX *mem_ctx = NULL;
5488 0 : int level = 0;
5489 0 : PyObject *in_obj = NULL;
5490 0 : union dgram_data *in = NULL;
5491 :
5492 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
5493 : discard_const_p(char *, kwnames),
5494 : &mem_ctx_obj,
5495 : &level,
5496 : &in_obj)) {
5497 0 : return NULL;
5498 : }
5499 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5500 0 : if (mem_ctx == NULL) {
5501 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5502 0 : return NULL;
5503 : }
5504 0 : in = (union dgram_data *)pytalloc_get_ptr(in_obj);
5505 0 : if (in == NULL) {
5506 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_data!");
5507 0 : return NULL;
5508 : }
5509 :
5510 0 : return py_import_dgram_data(mem_ctx, level, in);
5511 : }
5512 :
5513 0 : static PyObject *py_dgram_data_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5514 : {
5515 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5516 0 : PyObject *mem_ctx_obj = NULL;
5517 0 : TALLOC_CTX *mem_ctx = NULL;
5518 0 : int level = 0;
5519 0 : PyObject *in = NULL;
5520 0 : union dgram_data *out = NULL;
5521 :
5522 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5523 : discard_const_p(char *, kwnames),
5524 : &mem_ctx_obj,
5525 : &level,
5526 : &in)) {
5527 0 : return NULL;
5528 : }
5529 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5530 0 : if (mem_ctx == NULL) {
5531 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5532 0 : return NULL;
5533 : }
5534 :
5535 0 : out = py_export_dgram_data(mem_ctx, level, in);
5536 0 : if (out == NULL) {
5537 0 : return NULL;
5538 : }
5539 :
5540 0 : return pytalloc_GenericObject_reference(out);
5541 : }
5542 :
5543 : static PyMethodDef py_dgram_data_methods[] = {
5544 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_import),
5545 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5546 : "T.__import__(mem_ctx, level, in) => ret." },
5547 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_export),
5548 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5549 : "T.__export__(mem_ctx, level, in) => ret." },
5550 : { NULL, NULL, 0, NULL }
5551 : };
5552 :
5553 0 : static PyObject *py_dgram_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5554 : {
5555 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5556 0 : return NULL;
5557 : }
5558 :
5559 :
5560 : static PyTypeObject dgram_data_Type = {
5561 : PyVarObject_HEAD_INIT(NULL, 0)
5562 : .tp_name = "nbt.dgram_data",
5563 : .tp_getset = NULL,
5564 : .tp_methods = py_dgram_data_methods,
5565 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5566 : .tp_new = py_dgram_data_new,
5567 : };
5568 :
5569 :
5570 0 : static PyObject *py_nbt_dgram_packet_get_msg_type(PyObject *obj, void *closure)
5571 : {
5572 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5573 : PyObject *py_msg_type;
5574 0 : py_msg_type = PyLong_FromLong((uint16_t)object->msg_type);
5575 0 : return py_msg_type;
5576 : }
5577 :
5578 0 : static int py_nbt_dgram_packet_set_msg_type(PyObject *py_obj, PyObject *value, void *closure)
5579 : {
5580 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5581 0 : if (value == NULL) {
5582 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->msg_type");
5583 0 : return -1;
5584 : }
5585 : {
5586 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->msg_type));
5587 0 : if (PyLong_Check(value)) {
5588 : unsigned long long test_var;
5589 0 : test_var = PyLong_AsUnsignedLongLong(value);
5590 0 : if (PyErr_Occurred() != NULL) {
5591 0 : return -1;
5592 : }
5593 0 : if (test_var > uint_max) {
5594 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5595 : PyLong_Type.tp_name, uint_max, test_var);
5596 0 : return -1;
5597 : }
5598 0 : object->msg_type = test_var;
5599 : } else {
5600 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5601 : PyLong_Type.tp_name);
5602 0 : return -1;
5603 : }
5604 : }
5605 0 : return 0;
5606 : }
5607 :
5608 0 : static PyObject *py_nbt_dgram_packet_get_flags(PyObject *obj, void *closure)
5609 : {
5610 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5611 : PyObject *py_flags;
5612 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
5613 0 : return py_flags;
5614 : }
5615 :
5616 0 : static int py_nbt_dgram_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
5617 : {
5618 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5619 0 : if (value == NULL) {
5620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
5621 0 : return -1;
5622 : }
5623 : {
5624 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
5625 0 : if (PyLong_Check(value)) {
5626 : unsigned long long test_var;
5627 0 : test_var = PyLong_AsUnsignedLongLong(value);
5628 0 : if (PyErr_Occurred() != NULL) {
5629 0 : return -1;
5630 : }
5631 0 : if (test_var > uint_max) {
5632 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5633 : PyLong_Type.tp_name, uint_max, test_var);
5634 0 : return -1;
5635 : }
5636 0 : object->flags = test_var;
5637 : } else {
5638 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5639 : PyLong_Type.tp_name);
5640 0 : return -1;
5641 : }
5642 : }
5643 0 : return 0;
5644 : }
5645 :
5646 0 : static PyObject *py_nbt_dgram_packet_get_dgram_id(PyObject *obj, void *closure)
5647 : {
5648 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5649 : PyObject *py_dgram_id;
5650 0 : py_dgram_id = PyLong_FromLong((uint16_t)object->dgram_id);
5651 0 : return py_dgram_id;
5652 : }
5653 :
5654 0 : static int py_nbt_dgram_packet_set_dgram_id(PyObject *py_obj, PyObject *value, void *closure)
5655 : {
5656 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5657 0 : if (value == NULL) {
5658 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dgram_id");
5659 0 : return -1;
5660 : }
5661 : {
5662 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_id));
5663 0 : if (PyLong_Check(value)) {
5664 : unsigned long long test_var;
5665 0 : test_var = PyLong_AsUnsignedLongLong(value);
5666 0 : if (PyErr_Occurred() != NULL) {
5667 0 : return -1;
5668 : }
5669 0 : if (test_var > uint_max) {
5670 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5671 : PyLong_Type.tp_name, uint_max, test_var);
5672 0 : return -1;
5673 : }
5674 0 : object->dgram_id = test_var;
5675 : } else {
5676 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5677 : PyLong_Type.tp_name);
5678 0 : return -1;
5679 : }
5680 : }
5681 0 : return 0;
5682 : }
5683 :
5684 0 : static PyObject *py_nbt_dgram_packet_get_src_addr(PyObject *obj, void *closure)
5685 : {
5686 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5687 : PyObject *py_src_addr;
5688 0 : py_src_addr = PyString_FromStringOrNULL(object->src_addr);
5689 0 : return py_src_addr;
5690 : }
5691 :
5692 0 : static int py_nbt_dgram_packet_set_src_addr(PyObject *py_obj, PyObject *value, void *closure)
5693 : {
5694 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5695 0 : if (value == NULL) {
5696 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->src_addr");
5697 0 : return -1;
5698 : }
5699 : {
5700 : const char *test_str;
5701 : const char *talloc_str;
5702 0 : PyObject *unicode = NULL;
5703 0 : if (PyUnicode_Check(value)) {
5704 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5705 0 : if (unicode == NULL) {
5706 0 : PyErr_NoMemory();
5707 0 : return -1;
5708 : }
5709 0 : test_str = PyBytes_AS_STRING(unicode);
5710 0 : } else if (PyBytes_Check(value)) {
5711 0 : test_str = PyBytes_AS_STRING(value);
5712 : } else {
5713 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5714 0 : return -1;
5715 : }
5716 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5717 0 : if (unicode != NULL) {
5718 0 : Py_DECREF(unicode);
5719 : }
5720 0 : if (talloc_str == NULL) {
5721 0 : PyErr_NoMemory();
5722 0 : return -1;
5723 : }
5724 0 : object->src_addr = talloc_str;
5725 : }
5726 0 : return 0;
5727 : }
5728 :
5729 0 : static PyObject *py_nbt_dgram_packet_get_src_port(PyObject *obj, void *closure)
5730 : {
5731 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5732 : PyObject *py_src_port;
5733 0 : py_src_port = PyLong_FromLong((uint16_t)object->src_port);
5734 0 : return py_src_port;
5735 : }
5736 :
5737 0 : static int py_nbt_dgram_packet_set_src_port(PyObject *py_obj, PyObject *value, void *closure)
5738 : {
5739 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5740 0 : if (value == NULL) {
5741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->src_port");
5742 0 : return -1;
5743 : }
5744 : {
5745 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->src_port));
5746 0 : if (PyLong_Check(value)) {
5747 : unsigned long long test_var;
5748 0 : test_var = PyLong_AsUnsignedLongLong(value);
5749 0 : if (PyErr_Occurred() != NULL) {
5750 0 : return -1;
5751 : }
5752 0 : if (test_var > uint_max) {
5753 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5754 : PyLong_Type.tp_name, uint_max, test_var);
5755 0 : return -1;
5756 : }
5757 0 : object->src_port = test_var;
5758 : } else {
5759 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5760 : PyLong_Type.tp_name);
5761 0 : return -1;
5762 : }
5763 : }
5764 0 : return 0;
5765 : }
5766 :
5767 0 : static PyObject *py_nbt_dgram_packet_get_data(PyObject *obj, void *closure)
5768 : {
5769 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
5770 : PyObject *py_data;
5771 0 : py_data = pyrpc_import_union(&dgram_data_Type, pytalloc_get_mem_ctx(obj), object->msg_type, &object->data, "union dgram_data");
5772 0 : if (py_data == NULL) {
5773 0 : return NULL;
5774 : }
5775 0 : return py_data;
5776 : }
5777 :
5778 0 : static int py_nbt_dgram_packet_set_data(PyObject *py_obj, PyObject *value, void *closure)
5779 : {
5780 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5781 0 : if (value == NULL) {
5782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
5783 0 : return -1;
5784 : }
5785 : {
5786 : union dgram_data *data_switch_0;
5787 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");
5788 0 : if (data_switch_0 == NULL) {
5789 0 : return -1;
5790 : }
5791 0 : object->data = *data_switch_0;
5792 : }
5793 0 : return 0;
5794 : }
5795 :
5796 : static PyGetSetDef py_nbt_dgram_packet_getsetters[] = {
5797 : {
5798 : .name = discard_const_p(char, "msg_type"),
5799 : .get = py_nbt_dgram_packet_get_msg_type,
5800 : .set = py_nbt_dgram_packet_set_msg_type,
5801 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_msg_type")
5802 : },
5803 : {
5804 : .name = discard_const_p(char, "flags"),
5805 : .get = py_nbt_dgram_packet_get_flags,
5806 : .set = py_nbt_dgram_packet_set_flags,
5807 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_flags")
5808 : },
5809 : {
5810 : .name = discard_const_p(char, "dgram_id"),
5811 : .get = py_nbt_dgram_packet_get_dgram_id,
5812 : .set = py_nbt_dgram_packet_set_dgram_id,
5813 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5814 : },
5815 : {
5816 : .name = discard_const_p(char, "src_addr"),
5817 : .get = py_nbt_dgram_packet_get_src_addr,
5818 : .set = py_nbt_dgram_packet_set_src_addr,
5819 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
5820 : },
5821 : {
5822 : .name = discard_const_p(char, "src_port"),
5823 : .get = py_nbt_dgram_packet_get_src_port,
5824 : .set = py_nbt_dgram_packet_set_src_port,
5825 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5826 : },
5827 : {
5828 : .name = discard_const_p(char, "data"),
5829 : .get = py_nbt_dgram_packet_get_data,
5830 : .set = py_nbt_dgram_packet_set_data,
5831 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_data")
5832 : },
5833 : { .name = NULL }
5834 : };
5835 :
5836 0 : static PyObject *py_nbt_dgram_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5837 : {
5838 0 : return pytalloc_new(struct nbt_dgram_packet, type);
5839 : }
5840 :
5841 0 : static PyObject *py_nbt_dgram_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5842 : {
5843 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5844 0 : PyObject *ret = NULL;
5845 : DATA_BLOB blob;
5846 : enum ndr_err_code err;
5847 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5848 0 : if (tmp_ctx == NULL) {
5849 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5850 0 : return NULL;
5851 : }
5852 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_dgram_packet);
5853 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5854 0 : TALLOC_FREE(tmp_ctx);
5855 0 : PyErr_SetNdrError(err);
5856 0 : return NULL;
5857 : }
5858 :
5859 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5860 0 : TALLOC_FREE(tmp_ctx);
5861 0 : return ret;
5862 : }
5863 :
5864 0 : static PyObject *py_nbt_dgram_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5865 : {
5866 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5867 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5868 0 : Py_ssize_t blob_length = 0;
5869 : enum ndr_err_code err;
5870 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5871 0 : PyObject *allow_remaining_obj = NULL;
5872 0 : bool allow_remaining = false;
5873 :
5874 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5875 : discard_const_p(char *, kwnames),
5876 : &blob.data, &blob_length,
5877 : &allow_remaining_obj)) {
5878 0 : return NULL;
5879 : }
5880 0 : blob.length = blob_length;
5881 :
5882 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5883 0 : allow_remaining = true;
5884 : }
5885 :
5886 0 : if (allow_remaining) {
5887 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
5888 : } else {
5889 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);
5890 : }
5891 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5892 0 : PyErr_SetNdrError(err);
5893 0 : return NULL;
5894 : }
5895 :
5896 0 : Py_RETURN_NONE;
5897 : }
5898 :
5899 0 : static PyObject *py_nbt_dgram_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5900 : {
5901 0 : struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
5902 : PyObject *ret;
5903 : char *retstr;
5904 :
5905 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);
5906 0 : ret = PyUnicode_FromString(retstr);
5907 0 : talloc_free(retstr);
5908 :
5909 0 : return ret;
5910 : }
5911 :
5912 : static PyMethodDef py_nbt_dgram_packet_methods[] = {
5913 : { "__ndr_pack__", (PyCFunction)py_nbt_dgram_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5914 : { "__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" },
5915 : { "__ndr_print__", (PyCFunction)py_nbt_dgram_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5916 : { NULL, NULL, 0, NULL }
5917 : };
5918 :
5919 :
5920 : static PyTypeObject nbt_dgram_packet_Type = {
5921 : PyVarObject_HEAD_INIT(NULL, 0)
5922 : .tp_name = "nbt.dgram_packet",
5923 : .tp_getset = py_nbt_dgram_packet_getsetters,
5924 : .tp_methods = py_nbt_dgram_packet_methods,
5925 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5926 : .tp_new = py_nbt_dgram_packet_new,
5927 : };
5928 :
5929 :
5930 0 : static PyObject *py_nbt_sockaddr_get_sockaddr_family(PyObject *obj, void *closure)
5931 : {
5932 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
5933 : PyObject *py_sockaddr_family;
5934 0 : py_sockaddr_family = PyLong_FromUnsignedLongLong((uint32_t)object->sockaddr_family);
5935 0 : return py_sockaddr_family;
5936 : }
5937 :
5938 0 : static int py_nbt_sockaddr_set_sockaddr_family(PyObject *py_obj, PyObject *value, void *closure)
5939 : {
5940 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
5941 0 : if (value == NULL) {
5942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr_family");
5943 0 : return -1;
5944 : }
5945 : {
5946 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_family));
5947 0 : if (PyLong_Check(value)) {
5948 : unsigned long long test_var;
5949 0 : test_var = PyLong_AsUnsignedLongLong(value);
5950 0 : if (PyErr_Occurred() != NULL) {
5951 0 : return -1;
5952 : }
5953 0 : if (test_var > uint_max) {
5954 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5955 : PyLong_Type.tp_name, uint_max, test_var);
5956 0 : return -1;
5957 : }
5958 0 : object->sockaddr_family = test_var;
5959 : } else {
5960 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5961 : PyLong_Type.tp_name);
5962 0 : return -1;
5963 : }
5964 : }
5965 0 : return 0;
5966 : }
5967 :
5968 0 : static PyObject *py_nbt_sockaddr_get_pdc_ip(PyObject *obj, void *closure)
5969 : {
5970 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
5971 : PyObject *py_pdc_ip;
5972 0 : py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
5973 0 : return py_pdc_ip;
5974 : }
5975 :
5976 0 : static int py_nbt_sockaddr_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
5977 : {
5978 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
5979 0 : if (value == NULL) {
5980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_ip");
5981 0 : return -1;
5982 : }
5983 : {
5984 : const char *test_str;
5985 : const char *talloc_str;
5986 0 : PyObject *unicode = NULL;
5987 0 : if (PyUnicode_Check(value)) {
5988 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5989 0 : if (unicode == NULL) {
5990 0 : PyErr_NoMemory();
5991 0 : return -1;
5992 : }
5993 0 : test_str = PyBytes_AS_STRING(unicode);
5994 0 : } else if (PyBytes_Check(value)) {
5995 0 : test_str = PyBytes_AS_STRING(value);
5996 : } else {
5997 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5998 0 : return -1;
5999 : }
6000 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6001 0 : if (unicode != NULL) {
6002 0 : Py_DECREF(unicode);
6003 : }
6004 0 : if (talloc_str == NULL) {
6005 0 : PyErr_NoMemory();
6006 0 : return -1;
6007 : }
6008 0 : object->pdc_ip = talloc_str;
6009 : }
6010 0 : return 0;
6011 : }
6012 :
6013 0 : static PyObject *py_nbt_sockaddr_get_remaining(PyObject *obj, void *closure)
6014 : {
6015 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
6016 : PyObject *py_remaining;
6017 0 : py_remaining = PyBytes_FromStringAndSize((char *)(object->remaining).data, (object->remaining).length);
6018 0 : return py_remaining;
6019 : }
6020 :
6021 0 : static int py_nbt_sockaddr_set_remaining(PyObject *py_obj, PyObject *value, void *closure)
6022 : {
6023 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6024 0 : if (value == NULL) {
6025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->remaining");
6026 0 : return -1;
6027 : }
6028 0 : object->remaining = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
6029 0 : return 0;
6030 : }
6031 :
6032 : static PyGetSetDef py_nbt_sockaddr_getsetters[] = {
6033 : {
6034 : .name = discard_const_p(char, "sockaddr_family"),
6035 : .get = py_nbt_sockaddr_get_sockaddr_family,
6036 : .set = py_nbt_sockaddr_set_sockaddr_family,
6037 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6038 : },
6039 : {
6040 : .name = discard_const_p(char, "pdc_ip"),
6041 : .get = py_nbt_sockaddr_get_pdc_ip,
6042 : .set = py_nbt_sockaddr_set_pdc_ip,
6043 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
6044 : },
6045 : {
6046 : .name = discard_const_p(char, "remaining"),
6047 : .get = py_nbt_sockaddr_get_remaining,
6048 : .set = py_nbt_sockaddr_set_remaining,
6049 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
6050 : },
6051 : { .name = NULL }
6052 : };
6053 :
6054 0 : static PyObject *py_nbt_sockaddr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6055 : {
6056 0 : return pytalloc_new(struct nbt_sockaddr, type);
6057 : }
6058 :
6059 0 : static PyObject *py_nbt_sockaddr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6060 : {
6061 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6062 0 : PyObject *ret = NULL;
6063 : DATA_BLOB blob;
6064 : enum ndr_err_code err;
6065 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6066 0 : if (tmp_ctx == NULL) {
6067 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6068 0 : return NULL;
6069 : }
6070 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr);
6071 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6072 0 : TALLOC_FREE(tmp_ctx);
6073 0 : PyErr_SetNdrError(err);
6074 0 : return NULL;
6075 : }
6076 :
6077 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6078 0 : TALLOC_FREE(tmp_ctx);
6079 0 : return ret;
6080 : }
6081 :
6082 0 : static PyObject *py_nbt_sockaddr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6083 : {
6084 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6085 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6086 0 : Py_ssize_t blob_length = 0;
6087 : enum ndr_err_code err;
6088 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6089 0 : PyObject *allow_remaining_obj = NULL;
6090 0 : bool allow_remaining = false;
6091 :
6092 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6093 : discard_const_p(char *, kwnames),
6094 : &blob.data, &blob_length,
6095 : &allow_remaining_obj)) {
6096 0 : return NULL;
6097 : }
6098 0 : blob.length = blob_length;
6099 :
6100 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6101 0 : allow_remaining = true;
6102 : }
6103 :
6104 0 : if (allow_remaining) {
6105 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
6106 : } else {
6107 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
6108 : }
6109 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6110 0 : PyErr_SetNdrError(err);
6111 0 : return NULL;
6112 : }
6113 :
6114 0 : Py_RETURN_NONE;
6115 : }
6116 :
6117 0 : static PyObject *py_nbt_sockaddr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6118 : {
6119 0 : struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
6120 : PyObject *ret;
6121 : char *retstr;
6122 :
6123 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_sockaddr, "nbt_sockaddr", object);
6124 0 : ret = PyUnicode_FromString(retstr);
6125 0 : talloc_free(retstr);
6126 :
6127 0 : return ret;
6128 : }
6129 :
6130 : static PyMethodDef py_nbt_sockaddr_methods[] = {
6131 : { "__ndr_pack__", (PyCFunction)py_nbt_sockaddr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6132 : { "__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" },
6133 : { "__ndr_print__", (PyCFunction)py_nbt_sockaddr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6134 : { NULL, NULL, 0, NULL }
6135 : };
6136 :
6137 :
6138 : static PyTypeObject nbt_sockaddr_Type = {
6139 : PyVarObject_HEAD_INIT(NULL, 0)
6140 : .tp_name = "nbt.sockaddr",
6141 : .tp_getset = py_nbt_sockaddr_getsetters,
6142 : .tp_methods = py_nbt_sockaddr_methods,
6143 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6144 : .tp_new = py_nbt_sockaddr_new,
6145 : };
6146 :
6147 :
6148 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
6149 : {
6150 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6151 : PyObject *py_request_count;
6152 0 : py_request_count = PyLong_FromLong((uint16_t)object->request_count);
6153 0 : return py_request_count;
6154 : }
6155 :
6156 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
6157 : {
6158 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6159 0 : if (value == NULL) {
6160 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->request_count");
6161 0 : return -1;
6162 : }
6163 : {
6164 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
6165 0 : if (PyLong_Check(value)) {
6166 : unsigned long long test_var;
6167 0 : test_var = PyLong_AsUnsignedLongLong(value);
6168 0 : if (PyErr_Occurred() != NULL) {
6169 0 : return -1;
6170 : }
6171 0 : if (test_var > uint_max) {
6172 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6173 : PyLong_Type.tp_name, uint_max, test_var);
6174 0 : return -1;
6175 : }
6176 0 : object->request_count = test_var;
6177 : } else {
6178 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6179 : PyLong_Type.tp_name);
6180 0 : return -1;
6181 : }
6182 : }
6183 0 : return 0;
6184 : }
6185 :
6186 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
6187 : {
6188 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6189 : PyObject *py_computer_name;
6190 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
6191 0 : return py_computer_name;
6192 : }
6193 :
6194 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
6195 : {
6196 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6197 0 : if (value == NULL) {
6198 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
6199 0 : return -1;
6200 : }
6201 : {
6202 : const char *test_str;
6203 : const char *talloc_str;
6204 0 : PyObject *unicode = NULL;
6205 0 : if (PyUnicode_Check(value)) {
6206 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6207 0 : if (unicode == NULL) {
6208 0 : PyErr_NoMemory();
6209 0 : return -1;
6210 : }
6211 0 : test_str = PyBytes_AS_STRING(unicode);
6212 0 : } else if (PyBytes_Check(value)) {
6213 0 : test_str = PyBytes_AS_STRING(value);
6214 : } else {
6215 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6216 0 : return -1;
6217 : }
6218 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6219 0 : if (unicode != NULL) {
6220 0 : Py_DECREF(unicode);
6221 : }
6222 0 : if (talloc_str == NULL) {
6223 0 : PyErr_NoMemory();
6224 0 : return -1;
6225 : }
6226 0 : object->computer_name = talloc_str;
6227 : }
6228 0 : return 0;
6229 : }
6230 :
6231 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
6232 : {
6233 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6234 : PyObject *py_user_name;
6235 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
6236 0 : return py_user_name;
6237 : }
6238 :
6239 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
6240 : {
6241 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6242 0 : if (value == NULL) {
6243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
6244 0 : return -1;
6245 : }
6246 : {
6247 : const char *test_str;
6248 : const char *talloc_str;
6249 0 : PyObject *unicode = NULL;
6250 0 : if (PyUnicode_Check(value)) {
6251 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6252 0 : if (unicode == NULL) {
6253 0 : PyErr_NoMemory();
6254 0 : return -1;
6255 : }
6256 0 : test_str = PyBytes_AS_STRING(unicode);
6257 0 : } else if (PyBytes_Check(value)) {
6258 0 : test_str = PyBytes_AS_STRING(value);
6259 : } else {
6260 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6261 0 : return -1;
6262 : }
6263 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6264 0 : if (unicode != NULL) {
6265 0 : Py_DECREF(unicode);
6266 : }
6267 0 : if (talloc_str == NULL) {
6268 0 : PyErr_NoMemory();
6269 0 : return -1;
6270 : }
6271 0 : object->user_name = talloc_str;
6272 : }
6273 0 : return 0;
6274 : }
6275 :
6276 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
6277 : {
6278 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6279 : PyObject *py_mailslot_name;
6280 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
6281 0 : return py_mailslot_name;
6282 : }
6283 :
6284 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
6285 : {
6286 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6287 0 : if (value == NULL) {
6288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
6289 0 : return -1;
6290 : }
6291 : {
6292 : const char *test_str;
6293 : const char *talloc_str;
6294 0 : PyObject *unicode = NULL;
6295 0 : if (PyUnicode_Check(value)) {
6296 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6297 0 : if (unicode == NULL) {
6298 0 : PyErr_NoMemory();
6299 0 : return -1;
6300 : }
6301 0 : test_str = PyBytes_AS_STRING(unicode);
6302 0 : } else if (PyBytes_Check(value)) {
6303 0 : test_str = PyBytes_AS_STRING(value);
6304 : } else {
6305 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6306 0 : return -1;
6307 : }
6308 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6309 0 : if (unicode != NULL) {
6310 0 : Py_DECREF(unicode);
6311 : }
6312 0 : if (talloc_str == NULL) {
6313 0 : PyErr_NoMemory();
6314 0 : return -1;
6315 : }
6316 0 : object->mailslot_name = talloc_str;
6317 : }
6318 0 : return 0;
6319 : }
6320 :
6321 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control(PyObject *obj, void *closure)
6322 : {
6323 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6324 : PyObject *py_acct_control;
6325 0 : py_acct_control = PyLong_FromUnsignedLongLong((uint32_t)object->acct_control);
6326 0 : return py_acct_control;
6327 : }
6328 :
6329 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control(PyObject *py_obj, PyObject *value, void *closure)
6330 : {
6331 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6332 0 : if (value == NULL) {
6333 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_control");
6334 0 : return -1;
6335 : }
6336 : {
6337 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_control));
6338 0 : if (PyLong_Check(value)) {
6339 : unsigned long long test_var;
6340 0 : test_var = PyLong_AsUnsignedLongLong(value);
6341 0 : if (PyErr_Occurred() != NULL) {
6342 0 : return -1;
6343 : }
6344 0 : if (test_var > uint_max) {
6345 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6346 : PyLong_Type.tp_name, uint_max, test_var);
6347 0 : return -1;
6348 : }
6349 0 : object->acct_control = test_var;
6350 : } else {
6351 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6352 : PyLong_Type.tp_name);
6353 0 : return -1;
6354 : }
6355 : }
6356 0 : return 0;
6357 : }
6358 :
6359 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size(PyObject *obj, void *closure)
6360 : {
6361 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6362 : PyObject *py_sid_size;
6363 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)object->sid_size);
6364 0 : return py_sid_size;
6365 : }
6366 :
6367 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
6368 : {
6369 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6370 0 : if (value == NULL) {
6371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_size");
6372 0 : return -1;
6373 : }
6374 : {
6375 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
6376 0 : if (PyLong_Check(value)) {
6377 : unsigned long long test_var;
6378 0 : test_var = PyLong_AsUnsignedLongLong(value);
6379 0 : if (PyErr_Occurred() != NULL) {
6380 0 : return -1;
6381 : }
6382 0 : if (test_var > uint_max) {
6383 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6384 : PyLong_Type.tp_name, uint_max, test_var);
6385 0 : return -1;
6386 : }
6387 0 : object->sid_size = test_var;
6388 : } else {
6389 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6390 : PyLong_Type.tp_name);
6391 0 : return -1;
6392 : }
6393 : }
6394 0 : return 0;
6395 : }
6396 :
6397 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get__pad(PyObject *obj, void *closure)
6398 : {
6399 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6400 : PyObject *py__pad;
6401 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
6402 0 : return py__pad;
6403 : }
6404 :
6405 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set__pad(PyObject *py_obj, PyObject *value, void *closure)
6406 : {
6407 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6408 0 : if (value == NULL) {
6409 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
6410 0 : return -1;
6411 : }
6412 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
6413 0 : return 0;
6414 : }
6415 :
6416 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid(PyObject *obj, void *closure)
6417 : {
6418 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6419 : PyObject *py_sid;
6420 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
6421 0 : return py_sid;
6422 : }
6423 :
6424 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6425 : {
6426 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6427 0 : if (value == NULL) {
6428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
6429 0 : return -1;
6430 : }
6431 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6432 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6433 0 : PyErr_NoMemory();
6434 0 : return -1;
6435 : }
6436 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
6437 0 : return 0;
6438 : }
6439 :
6440 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version(PyObject *obj, void *closure)
6441 : {
6442 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6443 : PyObject *py_nt_version;
6444 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
6445 0 : return py_nt_version;
6446 : }
6447 :
6448 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
6449 : {
6450 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6451 0 : if (value == NULL) {
6452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
6453 0 : return -1;
6454 : }
6455 : {
6456 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
6457 0 : if (PyLong_Check(value)) {
6458 : unsigned long long test_var;
6459 0 : test_var = PyLong_AsUnsignedLongLong(value);
6460 0 : if (PyErr_Occurred() != NULL) {
6461 0 : return -1;
6462 : }
6463 0 : if (test_var > uint_max) {
6464 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6465 : PyLong_Type.tp_name, uint_max, test_var);
6466 0 : return -1;
6467 : }
6468 0 : object->nt_version = test_var;
6469 : } else {
6470 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6471 : PyLong_Type.tp_name);
6472 0 : return -1;
6473 : }
6474 : }
6475 0 : return 0;
6476 : }
6477 :
6478 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
6479 : {
6480 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6481 : PyObject *py_lmnt_token;
6482 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
6483 0 : return py_lmnt_token;
6484 : }
6485 :
6486 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
6487 : {
6488 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6489 0 : if (value == NULL) {
6490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
6491 0 : return -1;
6492 : }
6493 : {
6494 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
6495 0 : if (PyLong_Check(value)) {
6496 : unsigned long long test_var;
6497 0 : test_var = PyLong_AsUnsignedLongLong(value);
6498 0 : if (PyErr_Occurred() != NULL) {
6499 0 : return -1;
6500 : }
6501 0 : if (test_var > uint_max) {
6502 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6503 : PyLong_Type.tp_name, uint_max, test_var);
6504 0 : return -1;
6505 : }
6506 0 : object->lmnt_token = test_var;
6507 : } else {
6508 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6509 : PyLong_Type.tp_name);
6510 0 : return -1;
6511 : }
6512 : }
6513 0 : return 0;
6514 : }
6515 :
6516 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
6517 : {
6518 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6519 : PyObject *py_lm20_token;
6520 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
6521 0 : return py_lm20_token;
6522 : }
6523 :
6524 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
6525 : {
6526 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6527 0 : if (value == NULL) {
6528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
6529 0 : return -1;
6530 : }
6531 : {
6532 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
6533 0 : if (PyLong_Check(value)) {
6534 : unsigned long long test_var;
6535 0 : test_var = PyLong_AsUnsignedLongLong(value);
6536 0 : if (PyErr_Occurred() != NULL) {
6537 0 : return -1;
6538 : }
6539 0 : if (test_var > uint_max) {
6540 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6541 : PyLong_Type.tp_name, uint_max, test_var);
6542 0 : return -1;
6543 : }
6544 0 : object->lm20_token = test_var;
6545 : } else {
6546 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6547 : PyLong_Type.tp_name);
6548 0 : return -1;
6549 : }
6550 : }
6551 0 : return 0;
6552 : }
6553 :
6554 : static PyGetSetDef py_NETLOGON_SAM_LOGON_REQUEST_getsetters[] = {
6555 : {
6556 : .name = discard_const_p(char, "request_count"),
6557 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_request_count,
6558 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_request_count,
6559 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6560 : },
6561 : {
6562 : .name = discard_const_p(char, "computer_name"),
6563 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name,
6564 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name,
6565 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6566 : },
6567 : {
6568 : .name = discard_const_p(char, "user_name"),
6569 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_user_name,
6570 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_user_name,
6571 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6572 : },
6573 : {
6574 : .name = discard_const_p(char, "mailslot_name"),
6575 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name,
6576 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name,
6577 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6578 : },
6579 : {
6580 : .name = discard_const_p(char, "acct_control"),
6581 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control,
6582 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control,
6583 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6584 : },
6585 : {
6586 : .name = discard_const_p(char, "sid_size"),
6587 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size,
6588 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size,
6589 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6590 : },
6591 : {
6592 : .name = discard_const_p(char, "_pad"),
6593 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get__pad,
6594 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set__pad,
6595 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
6596 : },
6597 : {
6598 : .name = discard_const_p(char, "sid"),
6599 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid,
6600 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid,
6601 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
6602 : },
6603 : {
6604 : .name = discard_const_p(char, "nt_version"),
6605 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version,
6606 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version,
6607 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
6608 : },
6609 : {
6610 : .name = discard_const_p(char, "lmnt_token"),
6611 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token,
6612 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token,
6613 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6614 : },
6615 : {
6616 : .name = discard_const_p(char, "lm20_token"),
6617 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token,
6618 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token,
6619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6620 : },
6621 : { .name = NULL }
6622 : };
6623 :
6624 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6625 : {
6626 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_REQUEST, type);
6627 : }
6628 :
6629 :
6630 : static PyTypeObject NETLOGON_SAM_LOGON_REQUEST_Type = {
6631 : PyVarObject_HEAD_INIT(NULL, 0)
6632 : .tp_name = "nbt.NETLOGON_SAM_LOGON_REQUEST",
6633 : .tp_getset = py_NETLOGON_SAM_LOGON_REQUEST_getsetters,
6634 : .tp_methods = NULL,
6635 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6636 : .tp_new = py_NETLOGON_SAM_LOGON_REQUEST_new,
6637 : };
6638 :
6639 :
6640 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
6641 : {
6642 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6643 : PyObject *py_computer_name;
6644 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
6645 0 : return py_computer_name;
6646 : }
6647 :
6648 0 : static int py_NETLOGON_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
6649 : {
6650 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6651 0 : if (value == NULL) {
6652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
6653 0 : return -1;
6654 : }
6655 : {
6656 : const char *test_str;
6657 : const char *talloc_str;
6658 0 : PyObject *unicode = NULL;
6659 0 : if (PyUnicode_Check(value)) {
6660 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6661 0 : if (unicode == NULL) {
6662 0 : PyErr_NoMemory();
6663 0 : return -1;
6664 : }
6665 0 : test_str = PyBytes_AS_STRING(unicode);
6666 0 : } else if (PyBytes_Check(value)) {
6667 0 : test_str = PyBytes_AS_STRING(value);
6668 : } else {
6669 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6670 0 : return -1;
6671 : }
6672 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6673 0 : if (unicode != NULL) {
6674 0 : Py_DECREF(unicode);
6675 : }
6676 0 : if (talloc_str == NULL) {
6677 0 : PyErr_NoMemory();
6678 0 : return -1;
6679 : }
6680 0 : object->computer_name = talloc_str;
6681 : }
6682 0 : return 0;
6683 : }
6684 :
6685 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
6686 : {
6687 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6688 : PyObject *py_user_name;
6689 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
6690 0 : return py_user_name;
6691 : }
6692 :
6693 0 : static int py_NETLOGON_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
6694 : {
6695 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6696 0 : if (value == NULL) {
6697 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
6698 0 : return -1;
6699 : }
6700 : {
6701 : const char *test_str;
6702 : const char *talloc_str;
6703 0 : PyObject *unicode = NULL;
6704 0 : if (PyUnicode_Check(value)) {
6705 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6706 0 : if (unicode == NULL) {
6707 0 : PyErr_NoMemory();
6708 0 : return -1;
6709 : }
6710 0 : test_str = PyBytes_AS_STRING(unicode);
6711 0 : } else if (PyBytes_Check(value)) {
6712 0 : test_str = PyBytes_AS_STRING(value);
6713 : } else {
6714 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6715 0 : return -1;
6716 : }
6717 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6718 0 : if (unicode != NULL) {
6719 0 : Py_DECREF(unicode);
6720 : }
6721 0 : if (talloc_str == NULL) {
6722 0 : PyErr_NoMemory();
6723 0 : return -1;
6724 : }
6725 0 : object->user_name = talloc_str;
6726 : }
6727 0 : return 0;
6728 : }
6729 :
6730 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
6731 : {
6732 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6733 : PyObject *py_mailslot_name;
6734 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
6735 0 : return py_mailslot_name;
6736 : }
6737 :
6738 0 : static int py_NETLOGON_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
6739 : {
6740 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6741 0 : if (value == NULL) {
6742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
6743 0 : return -1;
6744 : }
6745 : {
6746 : const char *test_str;
6747 : const char *talloc_str;
6748 0 : PyObject *unicode = NULL;
6749 0 : if (PyUnicode_Check(value)) {
6750 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6751 0 : if (unicode == NULL) {
6752 0 : PyErr_NoMemory();
6753 0 : return -1;
6754 : }
6755 0 : test_str = PyBytes_AS_STRING(unicode);
6756 0 : } else if (PyBytes_Check(value)) {
6757 0 : test_str = PyBytes_AS_STRING(value);
6758 : } else {
6759 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6760 0 : return -1;
6761 : }
6762 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6763 0 : if (unicode != NULL) {
6764 0 : Py_DECREF(unicode);
6765 : }
6766 0 : if (talloc_str == NULL) {
6767 0 : PyErr_NoMemory();
6768 0 : return -1;
6769 : }
6770 0 : object->mailslot_name = talloc_str;
6771 : }
6772 0 : return 0;
6773 : }
6774 :
6775 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
6776 : {
6777 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6778 : PyObject *py_request_count;
6779 0 : py_request_count = PyLong_FromLong((uint16_t)object->request_count);
6780 0 : return py_request_count;
6781 : }
6782 :
6783 0 : static int py_NETLOGON_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
6784 : {
6785 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6786 0 : if (value == NULL) {
6787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->request_count");
6788 0 : return -1;
6789 : }
6790 : {
6791 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
6792 0 : if (PyLong_Check(value)) {
6793 : unsigned long long test_var;
6794 0 : test_var = PyLong_AsUnsignedLongLong(value);
6795 0 : if (PyErr_Occurred() != NULL) {
6796 0 : return -1;
6797 : }
6798 0 : if (test_var > uint_max) {
6799 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6800 : PyLong_Type.tp_name, uint_max, test_var);
6801 0 : return -1;
6802 : }
6803 0 : object->request_count = test_var;
6804 : } else {
6805 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6806 : PyLong_Type.tp_name);
6807 0 : return -1;
6808 : }
6809 : }
6810 0 : return 0;
6811 : }
6812 :
6813 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
6814 : {
6815 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6816 : PyObject *py_lmnt_token;
6817 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
6818 0 : return py_lmnt_token;
6819 : }
6820 :
6821 0 : static int py_NETLOGON_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
6822 : {
6823 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6824 0 : if (value == NULL) {
6825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
6826 0 : return -1;
6827 : }
6828 : {
6829 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
6830 0 : if (PyLong_Check(value)) {
6831 : unsigned long long test_var;
6832 0 : test_var = PyLong_AsUnsignedLongLong(value);
6833 0 : if (PyErr_Occurred() != NULL) {
6834 0 : return -1;
6835 : }
6836 0 : if (test_var > uint_max) {
6837 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6838 : PyLong_Type.tp_name, uint_max, test_var);
6839 0 : return -1;
6840 : }
6841 0 : object->lmnt_token = test_var;
6842 : } else {
6843 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6844 : PyLong_Type.tp_name);
6845 0 : return -1;
6846 : }
6847 : }
6848 0 : return 0;
6849 : }
6850 :
6851 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
6852 : {
6853 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
6854 : PyObject *py_lm20_token;
6855 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
6856 0 : return py_lm20_token;
6857 : }
6858 :
6859 0 : static int py_NETLOGON_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
6860 : {
6861 0 : struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
6862 0 : if (value == NULL) {
6863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
6864 0 : return -1;
6865 : }
6866 : {
6867 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
6868 0 : if (PyLong_Check(value)) {
6869 : unsigned long long test_var;
6870 0 : test_var = PyLong_AsUnsignedLongLong(value);
6871 0 : if (PyErr_Occurred() != NULL) {
6872 0 : return -1;
6873 : }
6874 0 : if (test_var > uint_max) {
6875 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6876 : PyLong_Type.tp_name, uint_max, test_var);
6877 0 : return -1;
6878 : }
6879 0 : object->lm20_token = test_var;
6880 : } else {
6881 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6882 : PyLong_Type.tp_name);
6883 0 : return -1;
6884 : }
6885 : }
6886 0 : return 0;
6887 : }
6888 :
6889 : static PyGetSetDef py_NETLOGON_LOGON_REQUEST_getsetters[] = {
6890 : {
6891 : .name = discard_const_p(char, "computer_name"),
6892 : .get = py_NETLOGON_LOGON_REQUEST_get_computer_name,
6893 : .set = py_NETLOGON_LOGON_REQUEST_set_computer_name,
6894 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6895 : },
6896 : {
6897 : .name = discard_const_p(char, "user_name"),
6898 : .get = py_NETLOGON_LOGON_REQUEST_get_user_name,
6899 : .set = py_NETLOGON_LOGON_REQUEST_set_user_name,
6900 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6901 : },
6902 : {
6903 : .name = discard_const_p(char, "mailslot_name"),
6904 : .get = py_NETLOGON_LOGON_REQUEST_get_mailslot_name,
6905 : .set = py_NETLOGON_LOGON_REQUEST_set_mailslot_name,
6906 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6907 : },
6908 : {
6909 : .name = discard_const_p(char, "request_count"),
6910 : .get = py_NETLOGON_LOGON_REQUEST_get_request_count,
6911 : .set = py_NETLOGON_LOGON_REQUEST_set_request_count,
6912 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6913 : },
6914 : {
6915 : .name = discard_const_p(char, "lmnt_token"),
6916 : .get = py_NETLOGON_LOGON_REQUEST_get_lmnt_token,
6917 : .set = py_NETLOGON_LOGON_REQUEST_set_lmnt_token,
6918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6919 : },
6920 : {
6921 : .name = discard_const_p(char, "lm20_token"),
6922 : .get = py_NETLOGON_LOGON_REQUEST_get_lm20_token,
6923 : .set = py_NETLOGON_LOGON_REQUEST_set_lm20_token,
6924 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6925 : },
6926 : { .name = NULL }
6927 : };
6928 :
6929 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6930 : {
6931 0 : return pytalloc_new(struct NETLOGON_LOGON_REQUEST, type);
6932 : }
6933 :
6934 :
6935 : static PyTypeObject NETLOGON_LOGON_REQUEST_Type = {
6936 : PyVarObject_HEAD_INIT(NULL, 0)
6937 : .tp_name = "nbt.NETLOGON_LOGON_REQUEST",
6938 : .tp_getset = py_NETLOGON_LOGON_REQUEST_getsetters,
6939 : .tp_methods = NULL,
6940 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6941 : .tp_new = py_NETLOGON_LOGON_REQUEST_new,
6942 : };
6943 :
6944 :
6945 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command(PyObject *obj, void *closure)
6946 : {
6947 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
6948 : PyObject *py_command;
6949 0 : py_command = PyLong_FromLong((uint16_t)object->command);
6950 0 : return py_command;
6951 : }
6952 :
6953 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command(PyObject *py_obj, PyObject *value, void *closure)
6954 : {
6955 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
6956 0 : if (value == NULL) {
6957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
6958 0 : return -1;
6959 : }
6960 : {
6961 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
6962 0 : if (PyLong_Check(value)) {
6963 : unsigned long long test_var;
6964 0 : test_var = PyLong_AsUnsignedLongLong(value);
6965 0 : if (PyErr_Occurred() != NULL) {
6966 0 : return -1;
6967 : }
6968 0 : if (test_var > uint_max) {
6969 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6970 : PyLong_Type.tp_name, uint_max, test_var);
6971 0 : return -1;
6972 : }
6973 0 : object->command = test_var;
6974 : } else {
6975 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6976 : PyLong_Type.tp_name);
6977 0 : return -1;
6978 : }
6979 : }
6980 0 : return 0;
6981 : }
6982 :
6983 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name(PyObject *obj, void *closure)
6984 : {
6985 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
6986 : PyObject *py_pdc_name;
6987 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
6988 0 : return py_pdc_name;
6989 : }
6990 :
6991 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
6992 : {
6993 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
6994 0 : if (value == NULL) {
6995 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
6996 0 : return -1;
6997 : }
6998 : {
6999 : const char *test_str;
7000 : const char *talloc_str;
7001 0 : PyObject *unicode = NULL;
7002 0 : if (PyUnicode_Check(value)) {
7003 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7004 0 : if (unicode == NULL) {
7005 0 : PyErr_NoMemory();
7006 0 : return -1;
7007 : }
7008 0 : test_str = PyBytes_AS_STRING(unicode);
7009 0 : } else if (PyBytes_Check(value)) {
7010 0 : test_str = PyBytes_AS_STRING(value);
7011 : } else {
7012 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7013 0 : return -1;
7014 : }
7015 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7016 0 : if (unicode != NULL) {
7017 0 : Py_DECREF(unicode);
7018 : }
7019 0 : if (talloc_str == NULL) {
7020 0 : PyErr_NoMemory();
7021 0 : return -1;
7022 : }
7023 0 : object->pdc_name = talloc_str;
7024 : }
7025 0 : return 0;
7026 : }
7027 :
7028 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name(PyObject *obj, void *closure)
7029 : {
7030 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7031 : PyObject *py_user_name;
7032 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
7033 0 : return py_user_name;
7034 : }
7035 :
7036 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
7037 : {
7038 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7039 0 : if (value == NULL) {
7040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
7041 0 : return -1;
7042 : }
7043 : {
7044 : const char *test_str;
7045 : const char *talloc_str;
7046 0 : PyObject *unicode = NULL;
7047 0 : if (PyUnicode_Check(value)) {
7048 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7049 0 : if (unicode == NULL) {
7050 0 : PyErr_NoMemory();
7051 0 : return -1;
7052 : }
7053 0 : test_str = PyBytes_AS_STRING(unicode);
7054 0 : } else if (PyBytes_Check(value)) {
7055 0 : test_str = PyBytes_AS_STRING(value);
7056 : } else {
7057 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7058 0 : return -1;
7059 : }
7060 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7061 0 : if (unicode != NULL) {
7062 0 : Py_DECREF(unicode);
7063 : }
7064 0 : if (talloc_str == NULL) {
7065 0 : PyErr_NoMemory();
7066 0 : return -1;
7067 : }
7068 0 : object->user_name = talloc_str;
7069 : }
7070 0 : return 0;
7071 : }
7072 :
7073 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name(PyObject *obj, void *closure)
7074 : {
7075 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7076 : PyObject *py_domain_name;
7077 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
7078 0 : return py_domain_name;
7079 : }
7080 :
7081 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
7082 : {
7083 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7084 0 : if (value == NULL) {
7085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
7086 0 : return -1;
7087 : }
7088 : {
7089 : const char *test_str;
7090 : const char *talloc_str;
7091 0 : PyObject *unicode = NULL;
7092 0 : if (PyUnicode_Check(value)) {
7093 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7094 0 : if (unicode == NULL) {
7095 0 : PyErr_NoMemory();
7096 0 : return -1;
7097 : }
7098 0 : test_str = PyBytes_AS_STRING(unicode);
7099 0 : } else if (PyBytes_Check(value)) {
7100 0 : test_str = PyBytes_AS_STRING(value);
7101 : } else {
7102 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7103 0 : return -1;
7104 : }
7105 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7106 0 : if (unicode != NULL) {
7107 0 : Py_DECREF(unicode);
7108 : }
7109 0 : if (talloc_str == NULL) {
7110 0 : PyErr_NoMemory();
7111 0 : return -1;
7112 : }
7113 0 : object->domain_name = talloc_str;
7114 : }
7115 0 : return 0;
7116 : }
7117 :
7118 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version(PyObject *obj, void *closure)
7119 : {
7120 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7121 : PyObject *py_nt_version;
7122 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
7123 0 : return py_nt_version;
7124 : }
7125 :
7126 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
7127 : {
7128 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7129 0 : if (value == NULL) {
7130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
7131 0 : return -1;
7132 : }
7133 : {
7134 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
7135 0 : if (PyLong_Check(value)) {
7136 : unsigned long long test_var;
7137 0 : test_var = PyLong_AsUnsignedLongLong(value);
7138 0 : if (PyErr_Occurred() != NULL) {
7139 0 : return -1;
7140 : }
7141 0 : if (test_var > uint_max) {
7142 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7143 : PyLong_Type.tp_name, uint_max, test_var);
7144 0 : return -1;
7145 : }
7146 0 : object->nt_version = test_var;
7147 : } else {
7148 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7149 : PyLong_Type.tp_name);
7150 0 : return -1;
7151 : }
7152 : }
7153 0 : return 0;
7154 : }
7155 :
7156 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token(PyObject *obj, void *closure)
7157 : {
7158 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7159 : PyObject *py_lmnt_token;
7160 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
7161 0 : return py_lmnt_token;
7162 : }
7163 :
7164 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
7165 : {
7166 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7167 0 : if (value == NULL) {
7168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
7169 0 : return -1;
7170 : }
7171 : {
7172 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
7173 0 : if (PyLong_Check(value)) {
7174 : unsigned long long test_var;
7175 0 : test_var = PyLong_AsUnsignedLongLong(value);
7176 0 : if (PyErr_Occurred() != NULL) {
7177 0 : return -1;
7178 : }
7179 0 : if (test_var > uint_max) {
7180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7181 : PyLong_Type.tp_name, uint_max, test_var);
7182 0 : return -1;
7183 : }
7184 0 : object->lmnt_token = test_var;
7185 : } else {
7186 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7187 : PyLong_Type.tp_name);
7188 0 : return -1;
7189 : }
7190 : }
7191 0 : return 0;
7192 : }
7193 :
7194 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token(PyObject *obj, void *closure)
7195 : {
7196 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
7197 : PyObject *py_lm20_token;
7198 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
7199 0 : return py_lm20_token;
7200 : }
7201 :
7202 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
7203 : {
7204 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7205 0 : if (value == NULL) {
7206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
7207 0 : return -1;
7208 : }
7209 : {
7210 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
7211 0 : if (PyLong_Check(value)) {
7212 : unsigned long long test_var;
7213 0 : test_var = PyLong_AsUnsignedLongLong(value);
7214 0 : if (PyErr_Occurred() != NULL) {
7215 0 : return -1;
7216 : }
7217 0 : if (test_var > uint_max) {
7218 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7219 : PyLong_Type.tp_name, uint_max, test_var);
7220 0 : return -1;
7221 : }
7222 0 : object->lm20_token = test_var;
7223 : } else {
7224 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7225 : PyLong_Type.tp_name);
7226 0 : return -1;
7227 : }
7228 : }
7229 0 : return 0;
7230 : }
7231 :
7232 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters[] = {
7233 : {
7234 : .name = discard_const_p(char, "command"),
7235 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command,
7236 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command,
7237 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
7238 : },
7239 : {
7240 : .name = discard_const_p(char, "pdc_name"),
7241 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name,
7242 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name,
7243 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7244 : },
7245 : {
7246 : .name = discard_const_p(char, "user_name"),
7247 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name,
7248 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name,
7249 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7250 : },
7251 : {
7252 : .name = discard_const_p(char, "domain_name"),
7253 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name,
7254 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name,
7255 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7256 : },
7257 : {
7258 : .name = discard_const_p(char, "nt_version"),
7259 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version,
7260 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version,
7261 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
7262 : },
7263 : {
7264 : .name = discard_const_p(char, "lmnt_token"),
7265 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token,
7266 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token,
7267 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7268 : },
7269 : {
7270 : .name = discard_const_p(char, "lm20_token"),
7271 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token,
7272 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token,
7273 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7274 : },
7275 : { .name = NULL }
7276 : };
7277 :
7278 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7279 : {
7280 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_NT40, type);
7281 : }
7282 :
7283 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7284 : {
7285 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7286 0 : PyObject *ret = NULL;
7287 : DATA_BLOB blob;
7288 : enum ndr_err_code err;
7289 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7290 0 : if (tmp_ctx == NULL) {
7291 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7292 0 : return NULL;
7293 : }
7294 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7295 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7296 0 : TALLOC_FREE(tmp_ctx);
7297 0 : PyErr_SetNdrError(err);
7298 0 : return NULL;
7299 : }
7300 :
7301 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7302 0 : TALLOC_FREE(tmp_ctx);
7303 0 : return ret;
7304 : }
7305 :
7306 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7307 : {
7308 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7309 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7310 0 : Py_ssize_t blob_length = 0;
7311 : enum ndr_err_code err;
7312 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7313 0 : PyObject *allow_remaining_obj = NULL;
7314 0 : bool allow_remaining = false;
7315 :
7316 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7317 : discard_const_p(char *, kwnames),
7318 : &blob.data, &blob_length,
7319 : &allow_remaining_obj)) {
7320 0 : return NULL;
7321 : }
7322 0 : blob.length = blob_length;
7323 :
7324 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7325 0 : allow_remaining = true;
7326 : }
7327 :
7328 0 : if (allow_remaining) {
7329 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);
7330 : } else {
7331 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);
7332 : }
7333 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7334 0 : PyErr_SetNdrError(err);
7335 0 : return NULL;
7336 : }
7337 :
7338 0 : Py_RETURN_NONE;
7339 : }
7340 :
7341 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7342 : {
7343 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
7344 : PyObject *ret;
7345 : char *retstr;
7346 :
7347 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);
7348 0 : ret = PyUnicode_FromString(retstr);
7349 0 : talloc_free(retstr);
7350 :
7351 0 : return ret;
7352 : }
7353 :
7354 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods[] = {
7355 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7356 : { "__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" },
7357 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7358 : { NULL, NULL, 0, NULL }
7359 : };
7360 :
7361 :
7362 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_NT40_Type = {
7363 : PyVarObject_HEAD_INIT(NULL, 0)
7364 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40",
7365 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters,
7366 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods,
7367 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7368 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new,
7369 : };
7370 :
7371 :
7372 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_command(PyObject *obj, void *closure)
7373 : {
7374 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7375 : PyObject *py_command;
7376 0 : py_command = PyLong_FromLong((uint16_t)object->command);
7377 0 : return py_command;
7378 : }
7379 :
7380 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_command(PyObject *py_obj, PyObject *value, void *closure)
7381 : {
7382 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7383 0 : if (value == NULL) {
7384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
7385 0 : return -1;
7386 : }
7387 : {
7388 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
7389 0 : if (PyLong_Check(value)) {
7390 : unsigned long long test_var;
7391 0 : test_var = PyLong_AsUnsignedLongLong(value);
7392 0 : if (PyErr_Occurred() != NULL) {
7393 0 : return -1;
7394 : }
7395 0 : if (test_var > uint_max) {
7396 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7397 : PyLong_Type.tp_name, uint_max, test_var);
7398 0 : return -1;
7399 : }
7400 0 : object->command = test_var;
7401 : } else {
7402 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7403 : PyLong_Type.tp_name);
7404 0 : return -1;
7405 : }
7406 : }
7407 0 : return 0;
7408 : }
7409 :
7410 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name(PyObject *obj, void *closure)
7411 : {
7412 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7413 : PyObject *py_pdc_name;
7414 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
7415 0 : return py_pdc_name;
7416 : }
7417 :
7418 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
7419 : {
7420 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7421 0 : if (value == NULL) {
7422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
7423 0 : return -1;
7424 : }
7425 : {
7426 : const char *test_str;
7427 : const char *talloc_str;
7428 0 : PyObject *unicode = NULL;
7429 0 : if (PyUnicode_Check(value)) {
7430 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7431 0 : if (unicode == NULL) {
7432 0 : PyErr_NoMemory();
7433 0 : return -1;
7434 : }
7435 0 : test_str = PyBytes_AS_STRING(unicode);
7436 0 : } else if (PyBytes_Check(value)) {
7437 0 : test_str = PyBytes_AS_STRING(value);
7438 : } else {
7439 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7440 0 : return -1;
7441 : }
7442 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7443 0 : if (unicode != NULL) {
7444 0 : Py_DECREF(unicode);
7445 : }
7446 0 : if (talloc_str == NULL) {
7447 0 : PyErr_NoMemory();
7448 0 : return -1;
7449 : }
7450 0 : object->pdc_name = talloc_str;
7451 : }
7452 0 : return 0;
7453 : }
7454 :
7455 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name(PyObject *obj, void *closure)
7456 : {
7457 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7458 : PyObject *py_user_name;
7459 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
7460 0 : return py_user_name;
7461 : }
7462 :
7463 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
7464 : {
7465 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7466 0 : if (value == NULL) {
7467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
7468 0 : return -1;
7469 : }
7470 : {
7471 : const char *test_str;
7472 : const char *talloc_str;
7473 0 : PyObject *unicode = NULL;
7474 0 : if (PyUnicode_Check(value)) {
7475 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7476 0 : if (unicode == NULL) {
7477 0 : PyErr_NoMemory();
7478 0 : return -1;
7479 : }
7480 0 : test_str = PyBytes_AS_STRING(unicode);
7481 0 : } else if (PyBytes_Check(value)) {
7482 0 : test_str = PyBytes_AS_STRING(value);
7483 : } else {
7484 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7485 0 : return -1;
7486 : }
7487 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7488 0 : if (unicode != NULL) {
7489 0 : Py_DECREF(unicode);
7490 : }
7491 0 : if (talloc_str == NULL) {
7492 0 : PyErr_NoMemory();
7493 0 : return -1;
7494 : }
7495 0 : object->user_name = talloc_str;
7496 : }
7497 0 : return 0;
7498 : }
7499 :
7500 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name(PyObject *obj, void *closure)
7501 : {
7502 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7503 : PyObject *py_domain_name;
7504 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
7505 0 : return py_domain_name;
7506 : }
7507 :
7508 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
7509 : {
7510 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7511 0 : if (value == NULL) {
7512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
7513 0 : return -1;
7514 : }
7515 : {
7516 : const char *test_str;
7517 : const char *talloc_str;
7518 0 : PyObject *unicode = NULL;
7519 0 : if (PyUnicode_Check(value)) {
7520 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7521 0 : if (unicode == NULL) {
7522 0 : PyErr_NoMemory();
7523 0 : return -1;
7524 : }
7525 0 : test_str = PyBytes_AS_STRING(unicode);
7526 0 : } else if (PyBytes_Check(value)) {
7527 0 : test_str = PyBytes_AS_STRING(value);
7528 : } else {
7529 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7530 0 : return -1;
7531 : }
7532 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7533 0 : if (unicode != NULL) {
7534 0 : Py_DECREF(unicode);
7535 : }
7536 0 : if (talloc_str == NULL) {
7537 0 : PyErr_NoMemory();
7538 0 : return -1;
7539 : }
7540 0 : object->domain_name = talloc_str;
7541 : }
7542 0 : return 0;
7543 : }
7544 :
7545 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid(PyObject *obj, void *closure)
7546 : {
7547 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7548 : PyObject *py_domain_uuid;
7549 0 : py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
7550 0 : return py_domain_uuid;
7551 : }
7552 :
7553 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
7554 : {
7555 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7556 0 : if (value == NULL) {
7557 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_uuid");
7558 0 : return -1;
7559 : }
7560 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
7561 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7562 0 : PyErr_NoMemory();
7563 0 : return -1;
7564 : }
7565 0 : object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
7566 0 : return 0;
7567 : }
7568 :
7569 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid(PyObject *obj, void *closure)
7570 : {
7571 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7572 : PyObject *py_zero_uuid;
7573 0 : py_zero_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->zero_uuid);
7574 0 : return py_zero_uuid;
7575 : }
7576 :
7577 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid(PyObject *py_obj, PyObject *value, void *closure)
7578 : {
7579 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7580 0 : if (value == NULL) {
7581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->zero_uuid");
7582 0 : return -1;
7583 : }
7584 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
7585 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7586 0 : PyErr_NoMemory();
7587 0 : return -1;
7588 : }
7589 0 : object->zero_uuid = *(struct GUID *)pytalloc_get_ptr(value);
7590 0 : return 0;
7591 : }
7592 :
7593 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_forest(PyObject *obj, void *closure)
7594 : {
7595 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7596 : PyObject *py_forest;
7597 0 : py_forest = PyString_FromStringOrNULL(object->forest);
7598 0 : return py_forest;
7599 : }
7600 :
7601 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_forest(PyObject *py_obj, PyObject *value, void *closure)
7602 : {
7603 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7604 0 : if (value == NULL) {
7605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest");
7606 0 : return -1;
7607 : }
7608 : {
7609 : const char *test_str;
7610 : const char *talloc_str;
7611 0 : PyObject *unicode = NULL;
7612 0 : if (PyUnicode_Check(value)) {
7613 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7614 0 : if (unicode == NULL) {
7615 0 : PyErr_NoMemory();
7616 0 : return -1;
7617 : }
7618 0 : test_str = PyBytes_AS_STRING(unicode);
7619 0 : } else if (PyBytes_Check(value)) {
7620 0 : test_str = PyBytes_AS_STRING(value);
7621 : } else {
7622 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7623 0 : return -1;
7624 : }
7625 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7626 0 : if (unicode != NULL) {
7627 0 : Py_DECREF(unicode);
7628 : }
7629 0 : if (talloc_str == NULL) {
7630 0 : PyErr_NoMemory();
7631 0 : return -1;
7632 : }
7633 0 : object->forest = talloc_str;
7634 : }
7635 0 : return 0;
7636 : }
7637 :
7638 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain(PyObject *obj, void *closure)
7639 : {
7640 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7641 : PyObject *py_dns_domain;
7642 0 : py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
7643 0 : return py_dns_domain;
7644 : }
7645 :
7646 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
7647 : {
7648 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7649 0 : if (value == NULL) {
7650 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
7651 0 : return -1;
7652 : }
7653 : {
7654 : const char *test_str;
7655 : const char *talloc_str;
7656 0 : PyObject *unicode = NULL;
7657 0 : if (PyUnicode_Check(value)) {
7658 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7659 0 : if (unicode == NULL) {
7660 0 : PyErr_NoMemory();
7661 0 : return -1;
7662 : }
7663 0 : test_str = PyBytes_AS_STRING(unicode);
7664 0 : } else if (PyBytes_Check(value)) {
7665 0 : test_str = PyBytes_AS_STRING(value);
7666 : } else {
7667 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7668 0 : return -1;
7669 : }
7670 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7671 0 : if (unicode != NULL) {
7672 0 : Py_DECREF(unicode);
7673 : }
7674 0 : if (talloc_str == NULL) {
7675 0 : PyErr_NoMemory();
7676 0 : return -1;
7677 : }
7678 0 : object->dns_domain = talloc_str;
7679 : }
7680 0 : return 0;
7681 : }
7682 :
7683 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name(PyObject *obj, void *closure)
7684 : {
7685 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7686 : PyObject *py_pdc_dns_name;
7687 0 : py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
7688 0 : return py_pdc_dns_name;
7689 : }
7690 :
7691 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
7692 : {
7693 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7694 0 : if (value == NULL) {
7695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_dns_name");
7696 0 : return -1;
7697 : }
7698 : {
7699 : const char *test_str;
7700 : const char *talloc_str;
7701 0 : PyObject *unicode = NULL;
7702 0 : if (PyUnicode_Check(value)) {
7703 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7704 0 : if (unicode == NULL) {
7705 0 : PyErr_NoMemory();
7706 0 : return -1;
7707 : }
7708 0 : test_str = PyBytes_AS_STRING(unicode);
7709 0 : } else if (PyBytes_Check(value)) {
7710 0 : test_str = PyBytes_AS_STRING(value);
7711 : } else {
7712 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7713 0 : return -1;
7714 : }
7715 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7716 0 : if (unicode != NULL) {
7717 0 : Py_DECREF(unicode);
7718 : }
7719 0 : if (talloc_str == NULL) {
7720 0 : PyErr_NoMemory();
7721 0 : return -1;
7722 : }
7723 0 : object->pdc_dns_name = talloc_str;
7724 : }
7725 0 : return 0;
7726 : }
7727 :
7728 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip(PyObject *obj, void *closure)
7729 : {
7730 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7731 : PyObject *py_pdc_ip;
7732 0 : py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
7733 0 : return py_pdc_ip;
7734 : }
7735 :
7736 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
7737 : {
7738 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7739 0 : if (value == NULL) {
7740 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_ip");
7741 0 : return -1;
7742 : }
7743 : {
7744 : const char *test_str;
7745 : const char *talloc_str;
7746 0 : PyObject *unicode = NULL;
7747 0 : if (PyUnicode_Check(value)) {
7748 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7749 0 : if (unicode == NULL) {
7750 0 : PyErr_NoMemory();
7751 0 : return -1;
7752 : }
7753 0 : test_str = PyBytes_AS_STRING(unicode);
7754 0 : } else if (PyBytes_Check(value)) {
7755 0 : test_str = PyBytes_AS_STRING(value);
7756 : } else {
7757 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7758 0 : return -1;
7759 : }
7760 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7761 0 : if (unicode != NULL) {
7762 0 : Py_DECREF(unicode);
7763 : }
7764 0 : if (talloc_str == NULL) {
7765 0 : PyErr_NoMemory();
7766 0 : return -1;
7767 : }
7768 0 : object->pdc_ip = talloc_str;
7769 : }
7770 0 : return 0;
7771 : }
7772 :
7773 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type(PyObject *obj, void *closure)
7774 : {
7775 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7776 : PyObject *py_server_type;
7777 0 : py_server_type = PyLong_FromUnsignedLongLong((uint32_t)object->server_type);
7778 0 : return py_server_type;
7779 : }
7780 :
7781 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
7782 : {
7783 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7784 0 : if (value == NULL) {
7785 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_type");
7786 0 : return -1;
7787 : }
7788 : {
7789 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
7790 0 : if (PyLong_Check(value)) {
7791 : unsigned long long test_var;
7792 0 : test_var = PyLong_AsUnsignedLongLong(value);
7793 0 : if (PyErr_Occurred() != NULL) {
7794 0 : return -1;
7795 : }
7796 0 : if (test_var > uint_max) {
7797 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7798 : PyLong_Type.tp_name, uint_max, test_var);
7799 0 : return -1;
7800 : }
7801 0 : object->server_type = test_var;
7802 : } else {
7803 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7804 : PyLong_Type.tp_name);
7805 0 : return -1;
7806 : }
7807 : }
7808 0 : return 0;
7809 : }
7810 :
7811 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version(PyObject *obj, void *closure)
7812 : {
7813 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7814 : PyObject *py_nt_version;
7815 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
7816 0 : return py_nt_version;
7817 : }
7818 :
7819 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
7820 : {
7821 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7822 0 : if (value == NULL) {
7823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
7824 0 : return -1;
7825 : }
7826 : {
7827 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
7828 0 : if (PyLong_Check(value)) {
7829 : unsigned long long test_var;
7830 0 : test_var = PyLong_AsUnsignedLongLong(value);
7831 0 : if (PyErr_Occurred() != NULL) {
7832 0 : return -1;
7833 : }
7834 0 : if (test_var > uint_max) {
7835 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7836 : PyLong_Type.tp_name, uint_max, test_var);
7837 0 : return -1;
7838 : }
7839 0 : object->nt_version = test_var;
7840 : } else {
7841 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7842 : PyLong_Type.tp_name);
7843 0 : return -1;
7844 : }
7845 : }
7846 0 : return 0;
7847 : }
7848 :
7849 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token(PyObject *obj, void *closure)
7850 : {
7851 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7852 : PyObject *py_lmnt_token;
7853 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
7854 0 : return py_lmnt_token;
7855 : }
7856 :
7857 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
7858 : {
7859 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7860 0 : if (value == NULL) {
7861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
7862 0 : return -1;
7863 : }
7864 : {
7865 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
7866 0 : if (PyLong_Check(value)) {
7867 : unsigned long long test_var;
7868 0 : test_var = PyLong_AsUnsignedLongLong(value);
7869 0 : if (PyErr_Occurred() != NULL) {
7870 0 : return -1;
7871 : }
7872 0 : if (test_var > uint_max) {
7873 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7874 : PyLong_Type.tp_name, uint_max, test_var);
7875 0 : return -1;
7876 : }
7877 0 : object->lmnt_token = test_var;
7878 : } else {
7879 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7880 : PyLong_Type.tp_name);
7881 0 : return -1;
7882 : }
7883 : }
7884 0 : return 0;
7885 : }
7886 :
7887 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token(PyObject *obj, void *closure)
7888 : {
7889 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
7890 : PyObject *py_lm20_token;
7891 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
7892 0 : return py_lm20_token;
7893 : }
7894 :
7895 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
7896 : {
7897 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
7898 0 : if (value == NULL) {
7899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
7900 0 : return -1;
7901 : }
7902 : {
7903 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
7904 0 : if (PyLong_Check(value)) {
7905 : unsigned long long test_var;
7906 0 : test_var = PyLong_AsUnsignedLongLong(value);
7907 0 : if (PyErr_Occurred() != NULL) {
7908 0 : return -1;
7909 : }
7910 0 : if (test_var > uint_max) {
7911 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7912 : PyLong_Type.tp_name, uint_max, test_var);
7913 0 : return -1;
7914 : }
7915 0 : object->lm20_token = test_var;
7916 : } else {
7917 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7918 : PyLong_Type.tp_name);
7919 0 : return -1;
7920 : }
7921 : }
7922 0 : return 0;
7923 : }
7924 :
7925 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_getsetters[] = {
7926 : {
7927 : .name = discard_const_p(char, "command"),
7928 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_command,
7929 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_command,
7930 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
7931 : },
7932 : {
7933 : .name = discard_const_p(char, "pdc_name"),
7934 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name,
7935 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name,
7936 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7937 : },
7938 : {
7939 : .name = discard_const_p(char, "user_name"),
7940 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name,
7941 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name,
7942 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7943 : },
7944 : {
7945 : .name = discard_const_p(char, "domain_name"),
7946 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name,
7947 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name,
7948 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7949 : },
7950 : {
7951 : .name = discard_const_p(char, "domain_uuid"),
7952 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid,
7953 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid,
7954 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
7955 : },
7956 : {
7957 : .name = discard_const_p(char, "zero_uuid"),
7958 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid,
7959 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid,
7960 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
7961 : },
7962 : {
7963 : .name = discard_const_p(char, "forest"),
7964 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_forest,
7965 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_forest,
7966 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7967 : },
7968 : {
7969 : .name = discard_const_p(char, "dns_domain"),
7970 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain,
7971 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain,
7972 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7973 : },
7974 : {
7975 : .name = discard_const_p(char, "pdc_dns_name"),
7976 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name,
7977 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name,
7978 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7979 : },
7980 : {
7981 : .name = discard_const_p(char, "pdc_ip"),
7982 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip,
7983 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip,
7984 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
7985 : },
7986 : {
7987 : .name = discard_const_p(char, "server_type"),
7988 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type,
7989 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type,
7990 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
7991 : },
7992 : {
7993 : .name = discard_const_p(char, "nt_version"),
7994 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version,
7995 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version,
7996 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
7997 : },
7998 : {
7999 : .name = discard_const_p(char, "lmnt_token"),
8000 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token,
8001 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token,
8002 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8003 : },
8004 : {
8005 : .name = discard_const_p(char, "lm20_token"),
8006 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token,
8007 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token,
8008 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8009 : },
8010 : { .name = NULL }
8011 : };
8012 :
8013 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8014 : {
8015 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE, type);
8016 : }
8017 :
8018 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8019 : {
8020 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
8021 0 : PyObject *ret = NULL;
8022 : DATA_BLOB blob;
8023 : enum ndr_err_code err;
8024 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8025 0 : if (tmp_ctx == NULL) {
8026 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8027 0 : return NULL;
8028 : }
8029 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE);
8030 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8031 0 : TALLOC_FREE(tmp_ctx);
8032 0 : PyErr_SetNdrError(err);
8033 0 : return NULL;
8034 : }
8035 :
8036 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8037 0 : TALLOC_FREE(tmp_ctx);
8038 0 : return ret;
8039 : }
8040 :
8041 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8042 : {
8043 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
8044 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8045 0 : Py_ssize_t blob_length = 0;
8046 : enum ndr_err_code err;
8047 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8048 0 : PyObject *allow_remaining_obj = NULL;
8049 0 : bool allow_remaining = false;
8050 :
8051 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8052 : discard_const_p(char *, kwnames),
8053 : &blob.data, &blob_length,
8054 : &allow_remaining_obj)) {
8055 0 : return NULL;
8056 : }
8057 0 : blob.length = blob_length;
8058 :
8059 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8060 0 : allow_remaining = true;
8061 : }
8062 :
8063 0 : if (allow_remaining) {
8064 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);
8065 : } else {
8066 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);
8067 : }
8068 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8069 0 : PyErr_SetNdrError(err);
8070 0 : return NULL;
8071 : }
8072 :
8073 0 : Py_RETURN_NONE;
8074 : }
8075 :
8076 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8077 : {
8078 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
8079 : PyObject *ret;
8080 : char *retstr;
8081 :
8082 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);
8083 0 : ret = PyUnicode_FromString(retstr);
8084 0 : talloc_free(retstr);
8085 :
8086 0 : return ret;
8087 : }
8088 :
8089 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_methods[] = {
8090 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8091 : { "__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" },
8092 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8093 : { NULL, NULL, 0, NULL }
8094 : };
8095 :
8096 :
8097 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_Type = {
8098 : PyVarObject_HEAD_INIT(NULL, 0)
8099 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE",
8100 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_getsetters,
8101 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_methods,
8102 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8103 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_new,
8104 : };
8105 :
8106 :
8107 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command(PyObject *obj, void *closure)
8108 : {
8109 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8110 : PyObject *py_command;
8111 0 : py_command = PyLong_FromLong((uint16_t)object->command);
8112 0 : return py_command;
8113 : }
8114 :
8115 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command(PyObject *py_obj, PyObject *value, void *closure)
8116 : {
8117 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8118 0 : if (value == NULL) {
8119 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
8120 0 : return -1;
8121 : }
8122 : {
8123 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
8124 0 : if (PyLong_Check(value)) {
8125 : unsigned long long test_var;
8126 0 : test_var = PyLong_AsUnsignedLongLong(value);
8127 0 : if (PyErr_Occurred() != NULL) {
8128 0 : return -1;
8129 : }
8130 0 : if (test_var > uint_max) {
8131 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8132 : PyLong_Type.tp_name, uint_max, test_var);
8133 0 : return -1;
8134 : }
8135 0 : object->command = test_var;
8136 : } else {
8137 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8138 : PyLong_Type.tp_name);
8139 0 : return -1;
8140 : }
8141 : }
8142 0 : return 0;
8143 : }
8144 :
8145 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz(PyObject *obj, void *closure)
8146 : {
8147 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8148 : PyObject *py_sbz;
8149 0 : py_sbz = PyLong_FromLong((uint16_t)object->sbz);
8150 0 : return py_sbz;
8151 : }
8152 :
8153 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz(PyObject *py_obj, PyObject *value, void *closure)
8154 : {
8155 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8156 0 : if (value == NULL) {
8157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sbz");
8158 0 : return -1;
8159 : }
8160 : {
8161 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sbz));
8162 0 : if (PyLong_Check(value)) {
8163 : unsigned long long test_var;
8164 0 : test_var = PyLong_AsUnsignedLongLong(value);
8165 0 : if (PyErr_Occurred() != NULL) {
8166 0 : return -1;
8167 : }
8168 0 : if (test_var > uint_max) {
8169 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8170 : PyLong_Type.tp_name, uint_max, test_var);
8171 0 : return -1;
8172 : }
8173 0 : object->sbz = test_var;
8174 : } else {
8175 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8176 : PyLong_Type.tp_name);
8177 0 : return -1;
8178 : }
8179 : }
8180 0 : return 0;
8181 : }
8182 :
8183 21 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type(PyObject *obj, void *closure)
8184 : {
8185 21 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8186 : PyObject *py_server_type;
8187 21 : py_server_type = PyLong_FromUnsignedLongLong((uint32_t)object->server_type);
8188 21 : return py_server_type;
8189 : }
8190 :
8191 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
8192 : {
8193 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8194 0 : if (value == NULL) {
8195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_type");
8196 0 : return -1;
8197 : }
8198 : {
8199 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
8200 0 : if (PyLong_Check(value)) {
8201 : unsigned long long test_var;
8202 0 : test_var = PyLong_AsUnsignedLongLong(value);
8203 0 : if (PyErr_Occurred() != NULL) {
8204 0 : return -1;
8205 : }
8206 0 : if (test_var > uint_max) {
8207 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8208 : PyLong_Type.tp_name, uint_max, test_var);
8209 0 : return -1;
8210 : }
8211 0 : object->server_type = test_var;
8212 : } else {
8213 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8214 : PyLong_Type.tp_name);
8215 0 : return -1;
8216 : }
8217 : }
8218 0 : return 0;
8219 : }
8220 :
8221 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid(PyObject *obj, void *closure)
8222 : {
8223 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8224 : PyObject *py_domain_uuid;
8225 0 : py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
8226 0 : return py_domain_uuid;
8227 : }
8228 :
8229 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
8230 : {
8231 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8232 0 : if (value == NULL) {
8233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_uuid");
8234 0 : return -1;
8235 : }
8236 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
8237 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8238 0 : PyErr_NoMemory();
8239 0 : return -1;
8240 : }
8241 0 : object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
8242 0 : return 0;
8243 : }
8244 :
8245 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest(PyObject *obj, void *closure)
8246 : {
8247 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8248 : PyObject *py_forest;
8249 1 : py_forest = PyString_FromStringOrNULL(object->forest);
8250 1 : return py_forest;
8251 : }
8252 :
8253 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest(PyObject *py_obj, PyObject *value, void *closure)
8254 : {
8255 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8256 0 : if (value == NULL) {
8257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest");
8258 0 : return -1;
8259 : }
8260 : {
8261 : const char *test_str;
8262 : const char *talloc_str;
8263 0 : PyObject *unicode = NULL;
8264 0 : if (PyUnicode_Check(value)) {
8265 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8266 0 : if (unicode == NULL) {
8267 0 : PyErr_NoMemory();
8268 0 : return -1;
8269 : }
8270 0 : test_str = PyBytes_AS_STRING(unicode);
8271 0 : } else if (PyBytes_Check(value)) {
8272 0 : test_str = PyBytes_AS_STRING(value);
8273 : } else {
8274 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8275 0 : return -1;
8276 : }
8277 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8278 0 : if (unicode != NULL) {
8279 0 : Py_DECREF(unicode);
8280 : }
8281 0 : if (talloc_str == NULL) {
8282 0 : PyErr_NoMemory();
8283 0 : return -1;
8284 : }
8285 0 : object->forest = talloc_str;
8286 : }
8287 0 : return 0;
8288 : }
8289 :
8290 159 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain(PyObject *obj, void *closure)
8291 : {
8292 159 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8293 : PyObject *py_dns_domain;
8294 159 : py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
8295 159 : return py_dns_domain;
8296 : }
8297 :
8298 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
8299 : {
8300 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8301 0 : if (value == NULL) {
8302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
8303 0 : return -1;
8304 : }
8305 : {
8306 : const char *test_str;
8307 : const char *talloc_str;
8308 0 : PyObject *unicode = NULL;
8309 0 : if (PyUnicode_Check(value)) {
8310 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8311 0 : if (unicode == NULL) {
8312 0 : PyErr_NoMemory();
8313 0 : return -1;
8314 : }
8315 0 : test_str = PyBytes_AS_STRING(unicode);
8316 0 : } else if (PyBytes_Check(value)) {
8317 0 : test_str = PyBytes_AS_STRING(value);
8318 : } else {
8319 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8320 0 : return -1;
8321 : }
8322 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8323 0 : if (unicode != NULL) {
8324 0 : Py_DECREF(unicode);
8325 : }
8326 0 : if (talloc_str == NULL) {
8327 0 : PyErr_NoMemory();
8328 0 : return -1;
8329 : }
8330 0 : object->dns_domain = talloc_str;
8331 : }
8332 0 : return 0;
8333 : }
8334 :
8335 62 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name(PyObject *obj, void *closure)
8336 : {
8337 62 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8338 : PyObject *py_pdc_dns_name;
8339 62 : py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
8340 62 : return py_pdc_dns_name;
8341 : }
8342 :
8343 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
8344 : {
8345 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8346 0 : if (value == NULL) {
8347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_dns_name");
8348 0 : return -1;
8349 : }
8350 : {
8351 : const char *test_str;
8352 : const char *talloc_str;
8353 0 : PyObject *unicode = NULL;
8354 0 : if (PyUnicode_Check(value)) {
8355 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8356 0 : if (unicode == NULL) {
8357 0 : PyErr_NoMemory();
8358 0 : return -1;
8359 : }
8360 0 : test_str = PyBytes_AS_STRING(unicode);
8361 0 : } else if (PyBytes_Check(value)) {
8362 0 : test_str = PyBytes_AS_STRING(value);
8363 : } else {
8364 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8365 0 : return -1;
8366 : }
8367 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8368 0 : if (unicode != NULL) {
8369 0 : Py_DECREF(unicode);
8370 : }
8371 0 : if (talloc_str == NULL) {
8372 0 : PyErr_NoMemory();
8373 0 : return -1;
8374 : }
8375 0 : object->pdc_dns_name = talloc_str;
8376 : }
8377 0 : return 0;
8378 : }
8379 :
8380 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name(PyObject *obj, void *closure)
8381 : {
8382 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8383 : PyObject *py_domain_name;
8384 1 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
8385 1 : return py_domain_name;
8386 : }
8387 :
8388 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
8389 : {
8390 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8391 0 : if (value == NULL) {
8392 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
8393 0 : return -1;
8394 : }
8395 : {
8396 : const char *test_str;
8397 : const char *talloc_str;
8398 0 : PyObject *unicode = NULL;
8399 0 : if (PyUnicode_Check(value)) {
8400 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8401 0 : if (unicode == NULL) {
8402 0 : PyErr_NoMemory();
8403 0 : return -1;
8404 : }
8405 0 : test_str = PyBytes_AS_STRING(unicode);
8406 0 : } else if (PyBytes_Check(value)) {
8407 0 : test_str = PyBytes_AS_STRING(value);
8408 : } else {
8409 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8410 0 : return -1;
8411 : }
8412 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8413 0 : if (unicode != NULL) {
8414 0 : Py_DECREF(unicode);
8415 : }
8416 0 : if (talloc_str == NULL) {
8417 0 : PyErr_NoMemory();
8418 0 : return -1;
8419 : }
8420 0 : object->domain_name = talloc_str;
8421 : }
8422 0 : return 0;
8423 : }
8424 :
8425 22 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name(PyObject *obj, void *closure)
8426 : {
8427 22 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8428 : PyObject *py_pdc_name;
8429 22 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
8430 22 : return py_pdc_name;
8431 : }
8432 :
8433 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
8434 : {
8435 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8436 0 : if (value == NULL) {
8437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
8438 0 : return -1;
8439 : }
8440 : {
8441 : const char *test_str;
8442 : const char *talloc_str;
8443 0 : PyObject *unicode = NULL;
8444 0 : if (PyUnicode_Check(value)) {
8445 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8446 0 : if (unicode == NULL) {
8447 0 : PyErr_NoMemory();
8448 0 : return -1;
8449 : }
8450 0 : test_str = PyBytes_AS_STRING(unicode);
8451 0 : } else if (PyBytes_Check(value)) {
8452 0 : test_str = PyBytes_AS_STRING(value);
8453 : } else {
8454 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8455 0 : return -1;
8456 : }
8457 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8458 0 : if (unicode != NULL) {
8459 0 : Py_DECREF(unicode);
8460 : }
8461 0 : if (talloc_str == NULL) {
8462 0 : PyErr_NoMemory();
8463 0 : return -1;
8464 : }
8465 0 : object->pdc_name = talloc_str;
8466 : }
8467 0 : return 0;
8468 : }
8469 :
8470 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name(PyObject *obj, void *closure)
8471 : {
8472 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8473 : PyObject *py_user_name;
8474 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
8475 0 : return py_user_name;
8476 : }
8477 :
8478 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
8479 : {
8480 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8481 0 : if (value == NULL) {
8482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
8483 0 : return -1;
8484 : }
8485 : {
8486 : const char *test_str;
8487 : const char *talloc_str;
8488 0 : PyObject *unicode = NULL;
8489 0 : if (PyUnicode_Check(value)) {
8490 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8491 0 : if (unicode == NULL) {
8492 0 : PyErr_NoMemory();
8493 0 : return -1;
8494 : }
8495 0 : test_str = PyBytes_AS_STRING(unicode);
8496 0 : } else if (PyBytes_Check(value)) {
8497 0 : test_str = PyBytes_AS_STRING(value);
8498 : } else {
8499 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8500 0 : return -1;
8501 : }
8502 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8503 0 : if (unicode != NULL) {
8504 0 : Py_DECREF(unicode);
8505 : }
8506 0 : if (talloc_str == NULL) {
8507 0 : PyErr_NoMemory();
8508 0 : return -1;
8509 : }
8510 0 : object->user_name = talloc_str;
8511 : }
8512 0 : return 0;
8513 : }
8514 :
8515 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site(PyObject *obj, void *closure)
8516 : {
8517 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8518 : PyObject *py_server_site;
8519 1 : py_server_site = PyString_FromStringOrNULL(object->server_site);
8520 1 : return py_server_site;
8521 : }
8522 :
8523 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site(PyObject *py_obj, PyObject *value, void *closure)
8524 : {
8525 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8526 0 : if (value == NULL) {
8527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_site");
8528 0 : return -1;
8529 : }
8530 : {
8531 : const char *test_str;
8532 : const char *talloc_str;
8533 0 : PyObject *unicode = NULL;
8534 0 : if (PyUnicode_Check(value)) {
8535 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8536 0 : if (unicode == NULL) {
8537 0 : PyErr_NoMemory();
8538 0 : return -1;
8539 : }
8540 0 : test_str = PyBytes_AS_STRING(unicode);
8541 0 : } else if (PyBytes_Check(value)) {
8542 0 : test_str = PyBytes_AS_STRING(value);
8543 : } else {
8544 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8545 0 : return -1;
8546 : }
8547 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8548 0 : if (unicode != NULL) {
8549 0 : Py_DECREF(unicode);
8550 : }
8551 0 : if (talloc_str == NULL) {
8552 0 : PyErr_NoMemory();
8553 0 : return -1;
8554 : }
8555 0 : object->server_site = talloc_str;
8556 : }
8557 0 : return 0;
8558 : }
8559 :
8560 185 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site(PyObject *obj, void *closure)
8561 : {
8562 185 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8563 : PyObject *py_client_site;
8564 185 : py_client_site = PyString_FromStringOrNULL(object->client_site);
8565 185 : return py_client_site;
8566 : }
8567 :
8568 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site(PyObject *py_obj, PyObject *value, void *closure)
8569 : {
8570 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8571 0 : if (value == NULL) {
8572 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_site");
8573 0 : return -1;
8574 : }
8575 : {
8576 : const char *test_str;
8577 : const char *talloc_str;
8578 0 : PyObject *unicode = NULL;
8579 0 : if (PyUnicode_Check(value)) {
8580 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8581 0 : if (unicode == NULL) {
8582 0 : PyErr_NoMemory();
8583 0 : return -1;
8584 : }
8585 0 : test_str = PyBytes_AS_STRING(unicode);
8586 0 : } else if (PyBytes_Check(value)) {
8587 0 : test_str = PyBytes_AS_STRING(value);
8588 : } else {
8589 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8590 0 : return -1;
8591 : }
8592 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8593 0 : if (unicode != NULL) {
8594 0 : Py_DECREF(unicode);
8595 : }
8596 0 : if (talloc_str == NULL) {
8597 0 : PyErr_NoMemory();
8598 0 : return -1;
8599 : }
8600 0 : object->client_site = talloc_str;
8601 : }
8602 0 : return 0;
8603 : }
8604 :
8605 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size(PyObject *obj, void *closure)
8606 : {
8607 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8608 : PyObject *py_sockaddr_size;
8609 0 : py_sockaddr_size = PyLong_FromLong((uint16_t)object->sockaddr_size);
8610 0 : return py_sockaddr_size;
8611 : }
8612 :
8613 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size(PyObject *py_obj, PyObject *value, void *closure)
8614 : {
8615 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8616 0 : if (value == NULL) {
8617 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr_size");
8618 0 : return -1;
8619 : }
8620 : {
8621 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_size));
8622 0 : if (PyLong_Check(value)) {
8623 : unsigned long long test_var;
8624 0 : test_var = PyLong_AsUnsignedLongLong(value);
8625 0 : if (PyErr_Occurred() != NULL) {
8626 0 : return -1;
8627 : }
8628 0 : if (test_var > uint_max) {
8629 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8630 : PyLong_Type.tp_name, uint_max, test_var);
8631 0 : return -1;
8632 : }
8633 0 : object->sockaddr_size = test_var;
8634 : } else {
8635 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8636 : PyLong_Type.tp_name);
8637 0 : return -1;
8638 : }
8639 : }
8640 0 : return 0;
8641 : }
8642 :
8643 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr(PyObject *obj, void *closure)
8644 : {
8645 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8646 : PyObject *py_sockaddr;
8647 0 : py_sockaddr = pytalloc_reference_ex(&nbt_sockaddr_Type, pytalloc_get_mem_ctx(obj), &object->sockaddr);
8648 0 : return py_sockaddr;
8649 : }
8650 :
8651 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr(PyObject *py_obj, PyObject *value, void *closure)
8652 : {
8653 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8654 0 : if (value == NULL) {
8655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr");
8656 0 : return -1;
8657 : }
8658 0 : PY_CHECK_TYPE(&nbt_sockaddr_Type, value, return -1;);
8659 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8660 0 : PyErr_NoMemory();
8661 0 : return -1;
8662 : }
8663 0 : object->sockaddr = *(struct nbt_sockaddr *)pytalloc_get_ptr(value);
8664 0 : return 0;
8665 : }
8666 :
8667 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site(PyObject *obj, void *closure)
8668 : {
8669 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8670 : PyObject *py_next_closest_site;
8671 0 : py_next_closest_site = PyString_FromStringOrNULL(object->next_closest_site);
8672 0 : return py_next_closest_site;
8673 : }
8674 :
8675 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site(PyObject *py_obj, PyObject *value, void *closure)
8676 : {
8677 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8678 0 : if (value == NULL) {
8679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->next_closest_site");
8680 0 : return -1;
8681 : }
8682 : {
8683 : const char *test_str;
8684 : const char *talloc_str;
8685 0 : PyObject *unicode = NULL;
8686 0 : if (PyUnicode_Check(value)) {
8687 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8688 0 : if (unicode == NULL) {
8689 0 : PyErr_NoMemory();
8690 0 : return -1;
8691 : }
8692 0 : test_str = PyBytes_AS_STRING(unicode);
8693 0 : } else if (PyBytes_Check(value)) {
8694 0 : test_str = PyBytes_AS_STRING(value);
8695 : } else {
8696 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8697 0 : return -1;
8698 : }
8699 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8700 0 : if (unicode != NULL) {
8701 0 : Py_DECREF(unicode);
8702 : }
8703 0 : if (talloc_str == NULL) {
8704 0 : PyErr_NoMemory();
8705 0 : return -1;
8706 : }
8707 0 : object->next_closest_site = talloc_str;
8708 : }
8709 0 : return 0;
8710 : }
8711 :
8712 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version(PyObject *obj, void *closure)
8713 : {
8714 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8715 : PyObject *py_nt_version;
8716 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
8717 0 : return py_nt_version;
8718 : }
8719 :
8720 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
8721 : {
8722 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8723 0 : if (value == NULL) {
8724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
8725 0 : return -1;
8726 : }
8727 : {
8728 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
8729 0 : if (PyLong_Check(value)) {
8730 : unsigned long long test_var;
8731 0 : test_var = PyLong_AsUnsignedLongLong(value);
8732 0 : if (PyErr_Occurred() != NULL) {
8733 0 : return -1;
8734 : }
8735 0 : if (test_var > uint_max) {
8736 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8737 : PyLong_Type.tp_name, uint_max, test_var);
8738 0 : return -1;
8739 : }
8740 0 : object->nt_version = test_var;
8741 : } else {
8742 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8743 : PyLong_Type.tp_name);
8744 0 : return -1;
8745 : }
8746 : }
8747 0 : return 0;
8748 : }
8749 :
8750 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token(PyObject *obj, void *closure)
8751 : {
8752 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8753 : PyObject *py_lmnt_token;
8754 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
8755 0 : return py_lmnt_token;
8756 : }
8757 :
8758 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
8759 : {
8760 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8761 0 : if (value == NULL) {
8762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
8763 0 : return -1;
8764 : }
8765 : {
8766 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
8767 0 : if (PyLong_Check(value)) {
8768 : unsigned long long test_var;
8769 0 : test_var = PyLong_AsUnsignedLongLong(value);
8770 0 : if (PyErr_Occurred() != NULL) {
8771 0 : return -1;
8772 : }
8773 0 : if (test_var > uint_max) {
8774 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8775 : PyLong_Type.tp_name, uint_max, test_var);
8776 0 : return -1;
8777 : }
8778 0 : object->lmnt_token = test_var;
8779 : } else {
8780 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8781 : PyLong_Type.tp_name);
8782 0 : return -1;
8783 : }
8784 : }
8785 0 : return 0;
8786 : }
8787 :
8788 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token(PyObject *obj, void *closure)
8789 : {
8790 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
8791 : PyObject *py_lm20_token;
8792 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
8793 0 : return py_lm20_token;
8794 : }
8795 :
8796 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
8797 : {
8798 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8799 0 : if (value == NULL) {
8800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
8801 0 : return -1;
8802 : }
8803 : {
8804 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
8805 0 : if (PyLong_Check(value)) {
8806 : unsigned long long test_var;
8807 0 : test_var = PyLong_AsUnsignedLongLong(value);
8808 0 : if (PyErr_Occurred() != NULL) {
8809 0 : return -1;
8810 : }
8811 0 : if (test_var > uint_max) {
8812 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8813 : PyLong_Type.tp_name, uint_max, test_var);
8814 0 : return -1;
8815 : }
8816 0 : object->lm20_token = test_var;
8817 : } else {
8818 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8819 : PyLong_Type.tp_name);
8820 0 : return -1;
8821 : }
8822 : }
8823 0 : return 0;
8824 : }
8825 :
8826 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters[] = {
8827 : {
8828 : .name = discard_const_p(char, "command"),
8829 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command,
8830 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command,
8831 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
8832 : },
8833 : {
8834 : .name = discard_const_p(char, "sbz"),
8835 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz,
8836 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz,
8837 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8838 : },
8839 : {
8840 : .name = discard_const_p(char, "server_type"),
8841 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type,
8842 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type,
8843 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
8844 : },
8845 : {
8846 : .name = discard_const_p(char, "domain_uuid"),
8847 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid,
8848 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid,
8849 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
8850 : },
8851 : {
8852 : .name = discard_const_p(char, "forest"),
8853 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest,
8854 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest,
8855 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8856 : },
8857 : {
8858 : .name = discard_const_p(char, "dns_domain"),
8859 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain,
8860 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain,
8861 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8862 : },
8863 : {
8864 : .name = discard_const_p(char, "pdc_dns_name"),
8865 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name,
8866 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name,
8867 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8868 : },
8869 : {
8870 : .name = discard_const_p(char, "domain_name"),
8871 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name,
8872 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name,
8873 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8874 : },
8875 : {
8876 : .name = discard_const_p(char, "pdc_name"),
8877 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name,
8878 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name,
8879 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8880 : },
8881 : {
8882 : .name = discard_const_p(char, "user_name"),
8883 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name,
8884 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name,
8885 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8886 : },
8887 : {
8888 : .name = discard_const_p(char, "server_site"),
8889 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site,
8890 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site,
8891 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8892 : },
8893 : {
8894 : .name = discard_const_p(char, "client_site"),
8895 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site,
8896 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site,
8897 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8898 : },
8899 : {
8900 : .name = discard_const_p(char, "sockaddr_size"),
8901 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size,
8902 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size,
8903 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8904 : },
8905 : {
8906 : .name = discard_const_p(char, "sockaddr"),
8907 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr,
8908 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr,
8909 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_sockaddr")
8910 : },
8911 : {
8912 : .name = discard_const_p(char, "next_closest_site"),
8913 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site,
8914 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site,
8915 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8916 : },
8917 : {
8918 : .name = discard_const_p(char, "nt_version"),
8919 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version,
8920 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version,
8921 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
8922 : },
8923 : {
8924 : .name = discard_const_p(char, "lmnt_token"),
8925 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token,
8926 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token,
8927 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8928 : },
8929 : {
8930 : .name = discard_const_p(char, "lm20_token"),
8931 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token,
8932 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token,
8933 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8934 : },
8935 : { .name = NULL }
8936 : };
8937 :
8938 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8939 : {
8940 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_EX, type);
8941 : }
8942 :
8943 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8944 : {
8945 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8946 0 : PyObject *ret = NULL;
8947 : DATA_BLOB blob;
8948 : enum ndr_err_code err;
8949 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8950 0 : if (tmp_ctx == NULL) {
8951 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8952 0 : return NULL;
8953 : }
8954 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX);
8955 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8956 0 : TALLOC_FREE(tmp_ctx);
8957 0 : PyErr_SetNdrError(err);
8958 0 : return NULL;
8959 : }
8960 :
8961 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8962 0 : TALLOC_FREE(tmp_ctx);
8963 0 : return ret;
8964 : }
8965 :
8966 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8967 : {
8968 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
8969 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8970 0 : Py_ssize_t blob_length = 0;
8971 : enum ndr_err_code err;
8972 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8973 0 : PyObject *allow_remaining_obj = NULL;
8974 0 : bool allow_remaining = false;
8975 :
8976 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8977 : discard_const_p(char *, kwnames),
8978 : &blob.data, &blob_length,
8979 : &allow_remaining_obj)) {
8980 0 : return NULL;
8981 : }
8982 0 : blob.length = blob_length;
8983 :
8984 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8985 0 : allow_remaining = true;
8986 : }
8987 :
8988 0 : if (allow_remaining) {
8989 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);
8990 : } else {
8991 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);
8992 : }
8993 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8994 0 : PyErr_SetNdrError(err);
8995 0 : return NULL;
8996 : }
8997 :
8998 0 : Py_RETURN_NONE;
8999 : }
9000 :
9001 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9002 : {
9003 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
9004 : PyObject *ret;
9005 : char *retstr;
9006 :
9007 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);
9008 0 : ret = PyUnicode_FromString(retstr);
9009 0 : talloc_free(retstr);
9010 :
9011 0 : return ret;
9012 : }
9013 :
9014 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods[] = {
9015 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9016 : { "__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" },
9017 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
9018 : { NULL, NULL, 0, NULL }
9019 : };
9020 :
9021 :
9022 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_EX_Type = {
9023 : PyVarObject_HEAD_INIT(NULL, 0)
9024 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX",
9025 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters,
9026 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods,
9027 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9028 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_EX_new,
9029 : };
9030 :
9031 0 : static PyObject *py_import_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, union netlogon_samlogon_response_union *in)
9032 : {
9033 : PyObject *ret;
9034 :
9035 0 : switch (level) {
9036 0 : case NETLOGON_NT_VERSION_1:
9037 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, mem_ctx, &in->nt4);
9038 0 : return ret;
9039 :
9040 0 : case NETLOGON_NT_VERSION_5:
9041 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_Type, mem_ctx, &in->nt5);
9042 0 : return ret;
9043 :
9044 0 : case NETLOGON_NT_VERSION_5EX:
9045 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, mem_ctx, &in->nt5_ex);
9046 0 : return ret;
9047 :
9048 : }
9049 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9050 0 : return NULL;
9051 : }
9052 :
9053 0 : static union netlogon_samlogon_response_union *py_export_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9054 : {
9055 0 : union netlogon_samlogon_response_union *ret = talloc_zero(mem_ctx, union netlogon_samlogon_response_union);
9056 0 : switch (level) {
9057 0 : case NETLOGON_NT_VERSION_1:
9058 0 : if (in == NULL) {
9059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt4");
9060 0 : talloc_free(ret); return NULL;
9061 : }
9062 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, in, talloc_free(ret); return NULL;);
9063 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9064 0 : PyErr_NoMemory();
9065 0 : talloc_free(ret); return NULL;
9066 : }
9067 0 : ret->nt4 = *(struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(in);
9068 0 : break;
9069 :
9070 0 : case NETLOGON_NT_VERSION_5:
9071 0 : if (in == NULL) {
9072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt5");
9073 0 : talloc_free(ret); return NULL;
9074 : }
9075 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_Type, in, talloc_free(ret); return NULL;);
9076 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9077 0 : PyErr_NoMemory();
9078 0 : talloc_free(ret); return NULL;
9079 : }
9080 0 : ret->nt5 = *(struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(in);
9081 0 : break;
9082 :
9083 0 : case NETLOGON_NT_VERSION_5EX:
9084 0 : if (in == NULL) {
9085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt5_ex");
9086 0 : talloc_free(ret); return NULL;
9087 : }
9088 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, in, talloc_free(ret); return NULL;);
9089 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9090 0 : PyErr_NoMemory();
9091 0 : talloc_free(ret); return NULL;
9092 : }
9093 0 : ret->nt5_ex = *(struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(in);
9094 0 : break;
9095 :
9096 0 : default:
9097 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9098 0 : talloc_free(ret);
9099 0 : ret = NULL;
9100 : }
9101 :
9102 0 : return ret;
9103 : }
9104 :
9105 0 : static PyObject *py_netlogon_samlogon_response_union_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9106 : {
9107 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9108 0 : PyObject *mem_ctx_obj = NULL;
9109 0 : TALLOC_CTX *mem_ctx = NULL;
9110 0 : int level = 0;
9111 0 : PyObject *in_obj = NULL;
9112 0 : union netlogon_samlogon_response_union *in = NULL;
9113 :
9114 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9115 : discard_const_p(char *, kwnames),
9116 : &mem_ctx_obj,
9117 : &level,
9118 : &in_obj)) {
9119 0 : return NULL;
9120 : }
9121 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9122 0 : if (mem_ctx == NULL) {
9123 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9124 0 : return NULL;
9125 : }
9126 0 : in = (union netlogon_samlogon_response_union *)pytalloc_get_ptr(in_obj);
9127 0 : if (in == NULL) {
9128 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netlogon_samlogon_response_union!");
9129 0 : return NULL;
9130 : }
9131 :
9132 0 : return py_import_netlogon_samlogon_response_union(mem_ctx, level, in);
9133 : }
9134 :
9135 0 : static PyObject *py_netlogon_samlogon_response_union_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9136 : {
9137 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9138 0 : PyObject *mem_ctx_obj = NULL;
9139 0 : TALLOC_CTX *mem_ctx = NULL;
9140 0 : int level = 0;
9141 0 : PyObject *in = NULL;
9142 0 : union netlogon_samlogon_response_union *out = NULL;
9143 :
9144 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9145 : discard_const_p(char *, kwnames),
9146 : &mem_ctx_obj,
9147 : &level,
9148 : &in)) {
9149 0 : return NULL;
9150 : }
9151 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9152 0 : if (mem_ctx == NULL) {
9153 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9154 0 : return NULL;
9155 : }
9156 :
9157 0 : out = py_export_netlogon_samlogon_response_union(mem_ctx, level, in);
9158 0 : if (out == NULL) {
9159 0 : return NULL;
9160 : }
9161 :
9162 0 : return pytalloc_GenericObject_reference(out);
9163 : }
9164 :
9165 : static PyMethodDef py_netlogon_samlogon_response_union_methods[] = {
9166 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_import),
9167 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9168 : "T.__import__(mem_ctx, level, in) => ret." },
9169 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_export),
9170 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9171 : "T.__export__(mem_ctx, level, in) => ret." },
9172 : { NULL, NULL, 0, NULL }
9173 : };
9174 :
9175 0 : static PyObject *py_netlogon_samlogon_response_union_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9176 : {
9177 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9178 0 : return NULL;
9179 : }
9180 :
9181 :
9182 : static PyTypeObject netlogon_samlogon_response_union_Type = {
9183 : PyVarObject_HEAD_INIT(NULL, 0)
9184 : .tp_name = "nbt.netlogon_samlogon_response_union",
9185 : .tp_getset = NULL,
9186 : .tp_methods = py_netlogon_samlogon_response_union_methods,
9187 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9188 : .tp_new = py_netlogon_samlogon_response_union_new,
9189 : };
9190 :
9191 :
9192 0 : static PyObject *py_netlogon_samlogon_response_get_ntver(PyObject *obj, void *closure)
9193 : {
9194 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(obj);
9195 : PyObject *py_ntver;
9196 0 : py_ntver = PyLong_FromUnsignedLongLong((uint32_t)object->ntver);
9197 0 : return py_ntver;
9198 : }
9199 :
9200 0 : static int py_netlogon_samlogon_response_set_ntver(PyObject *py_obj, PyObject *value, void *closure)
9201 : {
9202 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(py_obj);
9203 0 : if (value == NULL) {
9204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntver");
9205 0 : return -1;
9206 : }
9207 : {
9208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ntver));
9209 0 : if (PyLong_Check(value)) {
9210 : unsigned long long test_var;
9211 0 : test_var = PyLong_AsUnsignedLongLong(value);
9212 0 : if (PyErr_Occurred() != NULL) {
9213 0 : return -1;
9214 : }
9215 0 : if (test_var > uint_max) {
9216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9217 : PyLong_Type.tp_name, uint_max, test_var);
9218 0 : return -1;
9219 : }
9220 0 : object->ntver = test_var;
9221 : } else {
9222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9223 : PyLong_Type.tp_name);
9224 0 : return -1;
9225 : }
9226 : }
9227 0 : return 0;
9228 : }
9229 :
9230 0 : static PyObject *py_netlogon_samlogon_response_get_data(PyObject *obj, void *closure)
9231 : {
9232 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(obj);
9233 : PyObject *py_data;
9234 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");
9235 0 : if (py_data == NULL) {
9236 0 : return NULL;
9237 : }
9238 0 : return py_data;
9239 : }
9240 :
9241 0 : static int py_netlogon_samlogon_response_set_data(PyObject *py_obj, PyObject *value, void *closure)
9242 : {
9243 0 : struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(py_obj);
9244 0 : if (value == NULL) {
9245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
9246 0 : return -1;
9247 : }
9248 : {
9249 : union netlogon_samlogon_response_union *data_switch_0;
9250 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");
9251 0 : if (data_switch_0 == NULL) {
9252 0 : return -1;
9253 : }
9254 0 : object->data = *data_switch_0;
9255 : }
9256 0 : return 0;
9257 : }
9258 :
9259 : static PyGetSetDef py_netlogon_samlogon_response_getsetters[] = {
9260 : {
9261 : .name = discard_const_p(char, "ntver"),
9262 : .get = py_netlogon_samlogon_response_get_ntver,
9263 : .set = py_netlogon_samlogon_response_set_ntver,
9264 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9265 : },
9266 : {
9267 : .name = discard_const_p(char, "data"),
9268 : .get = py_netlogon_samlogon_response_get_data,
9269 : .set = py_netlogon_samlogon_response_set_data,
9270 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_samlogon_response_union")
9271 : },
9272 : { .name = NULL }
9273 : };
9274 :
9275 0 : static PyObject *py_netlogon_samlogon_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9276 : {
9277 0 : return pytalloc_new(struct netlogon_samlogon_response, type);
9278 : }
9279 :
9280 :
9281 : static PyTypeObject netlogon_samlogon_response_Type = {
9282 : PyVarObject_HEAD_INIT(NULL, 0)
9283 : .tp_name = "nbt.netlogon_samlogon_response",
9284 : .tp_getset = py_netlogon_samlogon_response_getsetters,
9285 : .tp_methods = NULL,
9286 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9287 : .tp_new = py_netlogon_samlogon_response_new,
9288 : };
9289 :
9290 :
9291 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_computer_name(PyObject *obj, void *closure)
9292 : {
9293 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9294 : PyObject *py_computer_name;
9295 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
9296 0 : return py_computer_name;
9297 : }
9298 :
9299 0 : static int py_nbt_netlogon_query_for_pdc_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
9300 : {
9301 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9302 0 : if (value == NULL) {
9303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
9304 0 : return -1;
9305 : }
9306 : {
9307 : const char *test_str;
9308 : const char *talloc_str;
9309 0 : PyObject *unicode = NULL;
9310 0 : if (PyUnicode_Check(value)) {
9311 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9312 0 : if (unicode == NULL) {
9313 0 : PyErr_NoMemory();
9314 0 : return -1;
9315 : }
9316 0 : test_str = PyBytes_AS_STRING(unicode);
9317 0 : } else if (PyBytes_Check(value)) {
9318 0 : test_str = PyBytes_AS_STRING(value);
9319 : } else {
9320 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9321 0 : return -1;
9322 : }
9323 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9324 0 : if (unicode != NULL) {
9325 0 : Py_DECREF(unicode);
9326 : }
9327 0 : if (talloc_str == NULL) {
9328 0 : PyErr_NoMemory();
9329 0 : return -1;
9330 : }
9331 0 : object->computer_name = talloc_str;
9332 : }
9333 0 : return 0;
9334 : }
9335 :
9336 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_mailslot_name(PyObject *obj, void *closure)
9337 : {
9338 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9339 : PyObject *py_mailslot_name;
9340 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
9341 0 : return py_mailslot_name;
9342 : }
9343 :
9344 0 : static int py_nbt_netlogon_query_for_pdc_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
9345 : {
9346 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9347 0 : if (value == NULL) {
9348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
9349 0 : return -1;
9350 : }
9351 : {
9352 : const char *test_str;
9353 : const char *talloc_str;
9354 0 : PyObject *unicode = NULL;
9355 0 : if (PyUnicode_Check(value)) {
9356 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9357 0 : if (unicode == NULL) {
9358 0 : PyErr_NoMemory();
9359 0 : return -1;
9360 : }
9361 0 : test_str = PyBytes_AS_STRING(unicode);
9362 0 : } else if (PyBytes_Check(value)) {
9363 0 : test_str = PyBytes_AS_STRING(value);
9364 : } else {
9365 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9366 0 : return -1;
9367 : }
9368 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9369 0 : if (unicode != NULL) {
9370 0 : Py_DECREF(unicode);
9371 : }
9372 0 : if (talloc_str == NULL) {
9373 0 : PyErr_NoMemory();
9374 0 : return -1;
9375 : }
9376 0 : object->mailslot_name = talloc_str;
9377 : }
9378 0 : return 0;
9379 : }
9380 :
9381 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get__pad(PyObject *obj, void *closure)
9382 : {
9383 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9384 : PyObject *py__pad;
9385 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9386 0 : return py__pad;
9387 : }
9388 :
9389 0 : static int py_nbt_netlogon_query_for_pdc_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9390 : {
9391 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9392 0 : if (value == NULL) {
9393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
9394 0 : return -1;
9395 : }
9396 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9397 0 : return 0;
9398 : }
9399 :
9400 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_unicode_name(PyObject *obj, void *closure)
9401 : {
9402 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9403 : PyObject *py_unicode_name;
9404 0 : py_unicode_name = PyString_FromStringOrNULL(object->unicode_name);
9405 0 : return py_unicode_name;
9406 : }
9407 :
9408 0 : static int py_nbt_netlogon_query_for_pdc_set_unicode_name(PyObject *py_obj, PyObject *value, void *closure)
9409 : {
9410 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9411 0 : if (value == NULL) {
9412 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_name");
9413 0 : return -1;
9414 : }
9415 : {
9416 : const char *test_str;
9417 : const char *talloc_str;
9418 0 : PyObject *unicode = NULL;
9419 0 : if (PyUnicode_Check(value)) {
9420 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9421 0 : if (unicode == NULL) {
9422 0 : PyErr_NoMemory();
9423 0 : return -1;
9424 : }
9425 0 : test_str = PyBytes_AS_STRING(unicode);
9426 0 : } else if (PyBytes_Check(value)) {
9427 0 : test_str = PyBytes_AS_STRING(value);
9428 : } else {
9429 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9430 0 : return -1;
9431 : }
9432 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9433 0 : if (unicode != NULL) {
9434 0 : Py_DECREF(unicode);
9435 : }
9436 0 : if (talloc_str == NULL) {
9437 0 : PyErr_NoMemory();
9438 0 : return -1;
9439 : }
9440 0 : object->unicode_name = talloc_str;
9441 : }
9442 0 : return 0;
9443 : }
9444 :
9445 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_nt_version(PyObject *obj, void *closure)
9446 : {
9447 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9448 : PyObject *py_nt_version;
9449 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
9450 0 : return py_nt_version;
9451 : }
9452 :
9453 0 : static int py_nbt_netlogon_query_for_pdc_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
9454 : {
9455 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9456 0 : if (value == NULL) {
9457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
9458 0 : return -1;
9459 : }
9460 : {
9461 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
9462 0 : if (PyLong_Check(value)) {
9463 : unsigned long long test_var;
9464 0 : test_var = PyLong_AsUnsignedLongLong(value);
9465 0 : if (PyErr_Occurred() != NULL) {
9466 0 : return -1;
9467 : }
9468 0 : if (test_var > uint_max) {
9469 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9470 : PyLong_Type.tp_name, uint_max, test_var);
9471 0 : return -1;
9472 : }
9473 0 : object->nt_version = test_var;
9474 : } else {
9475 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9476 : PyLong_Type.tp_name);
9477 0 : return -1;
9478 : }
9479 : }
9480 0 : return 0;
9481 : }
9482 :
9483 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_lmnt_token(PyObject *obj, void *closure)
9484 : {
9485 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9486 : PyObject *py_lmnt_token;
9487 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
9488 0 : return py_lmnt_token;
9489 : }
9490 :
9491 0 : static int py_nbt_netlogon_query_for_pdc_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
9492 : {
9493 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9494 0 : if (value == NULL) {
9495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
9496 0 : return -1;
9497 : }
9498 : {
9499 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
9500 0 : if (PyLong_Check(value)) {
9501 : unsigned long long test_var;
9502 0 : test_var = PyLong_AsUnsignedLongLong(value);
9503 0 : if (PyErr_Occurred() != NULL) {
9504 0 : return -1;
9505 : }
9506 0 : if (test_var > uint_max) {
9507 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9508 : PyLong_Type.tp_name, uint_max, test_var);
9509 0 : return -1;
9510 : }
9511 0 : object->lmnt_token = test_var;
9512 : } else {
9513 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9514 : PyLong_Type.tp_name);
9515 0 : return -1;
9516 : }
9517 : }
9518 0 : return 0;
9519 : }
9520 :
9521 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_lm20_token(PyObject *obj, void *closure)
9522 : {
9523 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(obj);
9524 : PyObject *py_lm20_token;
9525 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
9526 0 : return py_lm20_token;
9527 : }
9528 :
9529 0 : static int py_nbt_netlogon_query_for_pdc_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
9530 : {
9531 0 : struct nbt_netlogon_query_for_pdc *object = (struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(py_obj);
9532 0 : if (value == NULL) {
9533 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
9534 0 : return -1;
9535 : }
9536 : {
9537 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
9538 0 : if (PyLong_Check(value)) {
9539 : unsigned long long test_var;
9540 0 : test_var = PyLong_AsUnsignedLongLong(value);
9541 0 : if (PyErr_Occurred() != NULL) {
9542 0 : return -1;
9543 : }
9544 0 : if (test_var > uint_max) {
9545 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9546 : PyLong_Type.tp_name, uint_max, test_var);
9547 0 : return -1;
9548 : }
9549 0 : object->lm20_token = test_var;
9550 : } else {
9551 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9552 : PyLong_Type.tp_name);
9553 0 : return -1;
9554 : }
9555 : }
9556 0 : return 0;
9557 : }
9558 :
9559 : static PyGetSetDef py_nbt_netlogon_query_for_pdc_getsetters[] = {
9560 : {
9561 : .name = discard_const_p(char, "computer_name"),
9562 : .get = py_nbt_netlogon_query_for_pdc_get_computer_name,
9563 : .set = py_nbt_netlogon_query_for_pdc_set_computer_name,
9564 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9565 : },
9566 : {
9567 : .name = discard_const_p(char, "mailslot_name"),
9568 : .get = py_nbt_netlogon_query_for_pdc_get_mailslot_name,
9569 : .set = py_nbt_netlogon_query_for_pdc_set_mailslot_name,
9570 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9571 : },
9572 : {
9573 : .name = discard_const_p(char, "_pad"),
9574 : .get = py_nbt_netlogon_query_for_pdc_get__pad,
9575 : .set = py_nbt_netlogon_query_for_pdc_set__pad,
9576 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9577 : },
9578 : {
9579 : .name = discard_const_p(char, "unicode_name"),
9580 : .get = py_nbt_netlogon_query_for_pdc_get_unicode_name,
9581 : .set = py_nbt_netlogon_query_for_pdc_set_unicode_name,
9582 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9583 : },
9584 : {
9585 : .name = discard_const_p(char, "nt_version"),
9586 : .get = py_nbt_netlogon_query_for_pdc_get_nt_version,
9587 : .set = py_nbt_netlogon_query_for_pdc_set_nt_version,
9588 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
9589 : },
9590 : {
9591 : .name = discard_const_p(char, "lmnt_token"),
9592 : .get = py_nbt_netlogon_query_for_pdc_get_lmnt_token,
9593 : .set = py_nbt_netlogon_query_for_pdc_set_lmnt_token,
9594 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9595 : },
9596 : {
9597 : .name = discard_const_p(char, "lm20_token"),
9598 : .get = py_nbt_netlogon_query_for_pdc_get_lm20_token,
9599 : .set = py_nbt_netlogon_query_for_pdc_set_lm20_token,
9600 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9601 : },
9602 : { .name = NULL }
9603 : };
9604 :
9605 0 : static PyObject *py_nbt_netlogon_query_for_pdc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9606 : {
9607 0 : return pytalloc_new(struct nbt_netlogon_query_for_pdc, type);
9608 : }
9609 :
9610 :
9611 : static PyTypeObject nbt_netlogon_query_for_pdc_Type = {
9612 : PyVarObject_HEAD_INIT(NULL, 0)
9613 : .tp_name = "nbt.netlogon_query_for_pdc",
9614 : .tp_getset = py_nbt_netlogon_query_for_pdc_getsetters,
9615 : .tp_methods = NULL,
9616 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9617 : .tp_new = py_nbt_netlogon_query_for_pdc_new,
9618 : };
9619 :
9620 :
9621 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_command(PyObject *obj, void *closure)
9622 : {
9623 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9624 : PyObject *py_command;
9625 0 : py_command = PyLong_FromLong((uint16_t)object->command);
9626 0 : return py_command;
9627 : }
9628 :
9629 0 : static int py_nbt_netlogon_response_from_pdc_set_command(PyObject *py_obj, PyObject *value, void *closure)
9630 : {
9631 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9632 0 : if (value == NULL) {
9633 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
9634 0 : return -1;
9635 : }
9636 : {
9637 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
9638 0 : if (PyLong_Check(value)) {
9639 : unsigned long long test_var;
9640 0 : test_var = PyLong_AsUnsignedLongLong(value);
9641 0 : if (PyErr_Occurred() != NULL) {
9642 0 : return -1;
9643 : }
9644 0 : if (test_var > uint_max) {
9645 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9646 : PyLong_Type.tp_name, uint_max, test_var);
9647 0 : return -1;
9648 : }
9649 0 : object->command = test_var;
9650 : } else {
9651 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9652 : PyLong_Type.tp_name);
9653 0 : return -1;
9654 : }
9655 : }
9656 0 : return 0;
9657 : }
9658 :
9659 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_pdc_name(PyObject *obj, void *closure)
9660 : {
9661 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9662 : PyObject *py_pdc_name;
9663 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
9664 0 : return py_pdc_name;
9665 : }
9666 :
9667 0 : static int py_nbt_netlogon_response_from_pdc_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
9668 : {
9669 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9670 0 : if (value == NULL) {
9671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
9672 0 : return -1;
9673 : }
9674 : {
9675 : const char *test_str;
9676 : const char *talloc_str;
9677 0 : PyObject *unicode = NULL;
9678 0 : if (PyUnicode_Check(value)) {
9679 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9680 0 : if (unicode == NULL) {
9681 0 : PyErr_NoMemory();
9682 0 : return -1;
9683 : }
9684 0 : test_str = PyBytes_AS_STRING(unicode);
9685 0 : } else if (PyBytes_Check(value)) {
9686 0 : test_str = PyBytes_AS_STRING(value);
9687 : } else {
9688 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9689 0 : return -1;
9690 : }
9691 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9692 0 : if (unicode != NULL) {
9693 0 : Py_DECREF(unicode);
9694 : }
9695 0 : if (talloc_str == NULL) {
9696 0 : PyErr_NoMemory();
9697 0 : return -1;
9698 : }
9699 0 : object->pdc_name = talloc_str;
9700 : }
9701 0 : return 0;
9702 : }
9703 :
9704 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get__pad(PyObject *obj, void *closure)
9705 : {
9706 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9707 : PyObject *py__pad;
9708 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9709 0 : return py__pad;
9710 : }
9711 :
9712 0 : static int py_nbt_netlogon_response_from_pdc_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9713 : {
9714 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9715 0 : if (value == NULL) {
9716 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
9717 0 : return -1;
9718 : }
9719 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9720 0 : return 0;
9721 : }
9722 :
9723 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_unicode_pdc_name(PyObject *obj, void *closure)
9724 : {
9725 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9726 : PyObject *py_unicode_pdc_name;
9727 0 : py_unicode_pdc_name = PyString_FromStringOrNULL(object->unicode_pdc_name);
9728 0 : return py_unicode_pdc_name;
9729 : }
9730 :
9731 0 : static int py_nbt_netlogon_response_from_pdc_set_unicode_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
9732 : {
9733 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9734 0 : if (value == NULL) {
9735 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_pdc_name");
9736 0 : return -1;
9737 : }
9738 : {
9739 : const char *test_str;
9740 : const char *talloc_str;
9741 0 : PyObject *unicode = NULL;
9742 0 : if (PyUnicode_Check(value)) {
9743 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9744 0 : if (unicode == NULL) {
9745 0 : PyErr_NoMemory();
9746 0 : return -1;
9747 : }
9748 0 : test_str = PyBytes_AS_STRING(unicode);
9749 0 : } else if (PyBytes_Check(value)) {
9750 0 : test_str = PyBytes_AS_STRING(value);
9751 : } else {
9752 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9753 0 : return -1;
9754 : }
9755 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9756 0 : if (unicode != NULL) {
9757 0 : Py_DECREF(unicode);
9758 : }
9759 0 : if (talloc_str == NULL) {
9760 0 : PyErr_NoMemory();
9761 0 : return -1;
9762 : }
9763 0 : object->unicode_pdc_name = talloc_str;
9764 : }
9765 0 : return 0;
9766 : }
9767 :
9768 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_domain_name(PyObject *obj, void *closure)
9769 : {
9770 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9771 : PyObject *py_domain_name;
9772 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
9773 0 : return py_domain_name;
9774 : }
9775 :
9776 0 : static int py_nbt_netlogon_response_from_pdc_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
9777 : {
9778 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9779 0 : if (value == NULL) {
9780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
9781 0 : return -1;
9782 : }
9783 : {
9784 : const char *test_str;
9785 : const char *talloc_str;
9786 0 : PyObject *unicode = NULL;
9787 0 : if (PyUnicode_Check(value)) {
9788 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9789 0 : if (unicode == NULL) {
9790 0 : PyErr_NoMemory();
9791 0 : return -1;
9792 : }
9793 0 : test_str = PyBytes_AS_STRING(unicode);
9794 0 : } else if (PyBytes_Check(value)) {
9795 0 : test_str = PyBytes_AS_STRING(value);
9796 : } else {
9797 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9798 0 : return -1;
9799 : }
9800 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9801 0 : if (unicode != NULL) {
9802 0 : Py_DECREF(unicode);
9803 : }
9804 0 : if (talloc_str == NULL) {
9805 0 : PyErr_NoMemory();
9806 0 : return -1;
9807 : }
9808 0 : object->domain_name = talloc_str;
9809 : }
9810 0 : return 0;
9811 : }
9812 :
9813 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_nt_version(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 : PyObject *py_nt_version;
9817 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
9818 0 : return py_nt_version;
9819 : }
9820 :
9821 0 : static int py_nbt_netlogon_response_from_pdc_set_nt_version(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->nt_version");
9826 0 : return -1;
9827 : }
9828 : {
9829 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
9830 0 : if (PyLong_Check(value)) {
9831 : 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->nt_version = 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_lmnt_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 : PyObject *py_lmnt_token;
9855 0 : py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
9856 0 : return py_lmnt_token;
9857 : }
9858 :
9859 0 : static int py_nbt_netlogon_response_from_pdc_set_lmnt_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->lmnt_token");
9864 0 : return -1;
9865 : }
9866 : {
9867 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
9868 0 : if (PyLong_Check(value)) {
9869 : 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->lmnt_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 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_lm20_token(PyObject *obj, void *closure)
9890 : {
9891 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(obj);
9892 : PyObject *py_lm20_token;
9893 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
9894 0 : return py_lm20_token;
9895 : }
9896 :
9897 0 : static int py_nbt_netlogon_response_from_pdc_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
9898 : {
9899 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9900 0 : if (value == NULL) {
9901 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
9902 0 : return -1;
9903 : }
9904 : {
9905 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
9906 0 : if (PyLong_Check(value)) {
9907 : unsigned long long test_var;
9908 0 : test_var = PyLong_AsUnsignedLongLong(value);
9909 0 : if (PyErr_Occurred() != NULL) {
9910 0 : return -1;
9911 : }
9912 0 : if (test_var > uint_max) {
9913 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9914 : PyLong_Type.tp_name, uint_max, test_var);
9915 0 : return -1;
9916 : }
9917 0 : object->lm20_token = test_var;
9918 : } else {
9919 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9920 : PyLong_Type.tp_name);
9921 0 : return -1;
9922 : }
9923 : }
9924 0 : return 0;
9925 : }
9926 :
9927 : static PyGetSetDef py_nbt_netlogon_response_from_pdc_getsetters[] = {
9928 : {
9929 : .name = discard_const_p(char, "command"),
9930 : .get = py_nbt_netlogon_response_from_pdc_get_command,
9931 : .set = py_nbt_netlogon_response_from_pdc_set_command,
9932 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
9933 : },
9934 : {
9935 : .name = discard_const_p(char, "pdc_name"),
9936 : .get = py_nbt_netlogon_response_from_pdc_get_pdc_name,
9937 : .set = py_nbt_netlogon_response_from_pdc_set_pdc_name,
9938 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9939 : },
9940 : {
9941 : .name = discard_const_p(char, "_pad"),
9942 : .get = py_nbt_netlogon_response_from_pdc_get__pad,
9943 : .set = py_nbt_netlogon_response_from_pdc_set__pad,
9944 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9945 : },
9946 : {
9947 : .name = discard_const_p(char, "unicode_pdc_name"),
9948 : .get = py_nbt_netlogon_response_from_pdc_get_unicode_pdc_name,
9949 : .set = py_nbt_netlogon_response_from_pdc_set_unicode_pdc_name,
9950 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9951 : },
9952 : {
9953 : .name = discard_const_p(char, "domain_name"),
9954 : .get = py_nbt_netlogon_response_from_pdc_get_domain_name,
9955 : .set = py_nbt_netlogon_response_from_pdc_set_domain_name,
9956 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9957 : },
9958 : {
9959 : .name = discard_const_p(char, "nt_version"),
9960 : .get = py_nbt_netlogon_response_from_pdc_get_nt_version,
9961 : .set = py_nbt_netlogon_response_from_pdc_set_nt_version,
9962 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
9963 : },
9964 : {
9965 : .name = discard_const_p(char, "lmnt_token"),
9966 : .get = py_nbt_netlogon_response_from_pdc_get_lmnt_token,
9967 : .set = py_nbt_netlogon_response_from_pdc_set_lmnt_token,
9968 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9969 : },
9970 : {
9971 : .name = discard_const_p(char, "lm20_token"),
9972 : .get = py_nbt_netlogon_response_from_pdc_get_lm20_token,
9973 : .set = py_nbt_netlogon_response_from_pdc_set_lm20_token,
9974 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9975 : },
9976 : { .name = NULL }
9977 : };
9978 :
9979 0 : static PyObject *py_nbt_netlogon_response_from_pdc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9980 : {
9981 0 : return pytalloc_new(struct nbt_netlogon_response_from_pdc, type);
9982 : }
9983 :
9984 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9985 : {
9986 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
9987 0 : PyObject *ret = NULL;
9988 : DATA_BLOB blob;
9989 : enum ndr_err_code err;
9990 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9991 0 : if (tmp_ctx == NULL) {
9992 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9993 0 : return NULL;
9994 : }
9995 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response_from_pdc);
9996 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9997 0 : TALLOC_FREE(tmp_ctx);
9998 0 : PyErr_SetNdrError(err);
9999 0 : return NULL;
10000 : }
10001 :
10002 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10003 0 : TALLOC_FREE(tmp_ctx);
10004 0 : return ret;
10005 : }
10006 :
10007 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10008 : {
10009 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
10010 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10011 0 : Py_ssize_t blob_length = 0;
10012 : enum ndr_err_code err;
10013 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10014 0 : PyObject *allow_remaining_obj = NULL;
10015 0 : bool allow_remaining = false;
10016 :
10017 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10018 : discard_const_p(char *, kwnames),
10019 : &blob.data, &blob_length,
10020 : &allow_remaining_obj)) {
10021 0 : return NULL;
10022 : }
10023 0 : blob.length = blob_length;
10024 :
10025 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10026 0 : allow_remaining = true;
10027 : }
10028 :
10029 0 : if (allow_remaining) {
10030 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);
10031 : } else {
10032 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);
10033 : }
10034 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10035 0 : PyErr_SetNdrError(err);
10036 0 : return NULL;
10037 : }
10038 :
10039 0 : Py_RETURN_NONE;
10040 : }
10041 :
10042 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10043 : {
10044 0 : struct nbt_netlogon_response_from_pdc *object = (struct nbt_netlogon_response_from_pdc *)pytalloc_get_ptr(py_obj);
10045 : PyObject *ret;
10046 : char *retstr;
10047 :
10048 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);
10049 0 : ret = PyUnicode_FromString(retstr);
10050 0 : talloc_free(retstr);
10051 :
10052 0 : return ret;
10053 : }
10054 :
10055 : static PyMethodDef py_nbt_netlogon_response_from_pdc_methods[] = {
10056 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_response_from_pdc_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10057 : { "__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" },
10058 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_response_from_pdc_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10059 : { NULL, NULL, 0, NULL }
10060 : };
10061 :
10062 :
10063 : static PyTypeObject nbt_netlogon_response_from_pdc_Type = {
10064 : PyVarObject_HEAD_INIT(NULL, 0)
10065 : .tp_name = "nbt.netlogon_response_from_pdc",
10066 : .tp_getset = py_nbt_netlogon_response_from_pdc_getsetters,
10067 : .tp_methods = py_nbt_netlogon_response_from_pdc_methods,
10068 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10069 : .tp_new = py_nbt_netlogon_response_from_pdc_new,
10070 : };
10071 :
10072 :
10073 0 : static PyObject *py_nbt_netlogon_response2_get_command(PyObject *obj, void *closure)
10074 : {
10075 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(obj);
10076 : PyObject *py_command;
10077 0 : py_command = PyLong_FromLong((uint16_t)object->command);
10078 0 : return py_command;
10079 : }
10080 :
10081 0 : static int py_nbt_netlogon_response2_set_command(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->command");
10086 0 : return -1;
10087 : }
10088 : {
10089 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
10090 0 : if (PyLong_Check(value)) {
10091 : unsigned long long test_var;
10092 0 : test_var = PyLong_AsUnsignedLongLong(value);
10093 0 : if (PyErr_Occurred() != NULL) {
10094 0 : return -1;
10095 : }
10096 0 : if (test_var > uint_max) {
10097 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10098 : PyLong_Type.tp_name, uint_max, test_var);
10099 0 : return -1;
10100 : }
10101 0 : object->command = test_var;
10102 : } else {
10103 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10104 : PyLong_Type.tp_name);
10105 0 : return -1;
10106 : }
10107 : }
10108 0 : return 0;
10109 : }
10110 :
10111 0 : static PyObject *py_nbt_netlogon_response2_get_pdc_name(PyObject *obj, void *closure)
10112 : {
10113 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(obj);
10114 : PyObject *py_pdc_name;
10115 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
10116 0 : return py_pdc_name;
10117 : }
10118 :
10119 0 : static int py_nbt_netlogon_response2_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10120 : {
10121 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10122 0 : if (value == NULL) {
10123 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
10124 0 : return -1;
10125 : }
10126 : {
10127 : const char *test_str;
10128 : const char *talloc_str;
10129 0 : PyObject *unicode = NULL;
10130 0 : if (PyUnicode_Check(value)) {
10131 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10132 0 : if (unicode == NULL) {
10133 0 : PyErr_NoMemory();
10134 0 : return -1;
10135 : }
10136 0 : test_str = PyBytes_AS_STRING(unicode);
10137 0 : } else if (PyBytes_Check(value)) {
10138 0 : test_str = PyBytes_AS_STRING(value);
10139 : } else {
10140 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10141 0 : return -1;
10142 : }
10143 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10144 0 : if (unicode != NULL) {
10145 0 : Py_DECREF(unicode);
10146 : }
10147 0 : if (talloc_str == NULL) {
10148 0 : PyErr_NoMemory();
10149 0 : return -1;
10150 : }
10151 0 : object->pdc_name = talloc_str;
10152 : }
10153 0 : return 0;
10154 : }
10155 :
10156 0 : static PyObject *py_nbt_netlogon_response2_get_lm20_token(PyObject *obj, void *closure)
10157 : {
10158 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(obj);
10159 : PyObject *py_lm20_token;
10160 0 : py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
10161 0 : return py_lm20_token;
10162 : }
10163 :
10164 0 : static int py_nbt_netlogon_response2_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
10165 : {
10166 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10167 0 : if (value == NULL) {
10168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
10169 0 : return -1;
10170 : }
10171 : {
10172 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
10173 0 : if (PyLong_Check(value)) {
10174 : unsigned long long test_var;
10175 0 : test_var = PyLong_AsUnsignedLongLong(value);
10176 0 : if (PyErr_Occurred() != NULL) {
10177 0 : return -1;
10178 : }
10179 0 : if (test_var > uint_max) {
10180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10181 : PyLong_Type.tp_name, uint_max, test_var);
10182 0 : return -1;
10183 : }
10184 0 : object->lm20_token = test_var;
10185 : } else {
10186 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10187 : PyLong_Type.tp_name);
10188 0 : return -1;
10189 : }
10190 : }
10191 0 : return 0;
10192 : }
10193 :
10194 : static PyGetSetDef py_nbt_netlogon_response2_getsetters[] = {
10195 : {
10196 : .name = discard_const_p(char, "command"),
10197 : .get = py_nbt_netlogon_response2_get_command,
10198 : .set = py_nbt_netlogon_response2_set_command,
10199 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
10200 : },
10201 : {
10202 : .name = discard_const_p(char, "pdc_name"),
10203 : .get = py_nbt_netlogon_response2_get_pdc_name,
10204 : .set = py_nbt_netlogon_response2_set_pdc_name,
10205 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
10206 : },
10207 : {
10208 : .name = discard_const_p(char, "lm20_token"),
10209 : .get = py_nbt_netlogon_response2_get_lm20_token,
10210 : .set = py_nbt_netlogon_response2_set_lm20_token,
10211 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10212 : },
10213 : { .name = NULL }
10214 : };
10215 :
10216 0 : static PyObject *py_nbt_netlogon_response2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10217 : {
10218 0 : return pytalloc_new(struct nbt_netlogon_response2, type);
10219 : }
10220 :
10221 0 : static PyObject *py_nbt_netlogon_response2_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10222 : {
10223 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10224 0 : PyObject *ret = NULL;
10225 : DATA_BLOB blob;
10226 : enum ndr_err_code err;
10227 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10228 0 : if (tmp_ctx == NULL) {
10229 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10230 0 : return NULL;
10231 : }
10232 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response2);
10233 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10234 0 : TALLOC_FREE(tmp_ctx);
10235 0 : PyErr_SetNdrError(err);
10236 0 : return NULL;
10237 : }
10238 :
10239 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10240 0 : TALLOC_FREE(tmp_ctx);
10241 0 : return ret;
10242 : }
10243 :
10244 0 : static PyObject *py_nbt_netlogon_response2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10245 : {
10246 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10247 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10248 0 : Py_ssize_t blob_length = 0;
10249 : enum ndr_err_code err;
10250 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10251 0 : PyObject *allow_remaining_obj = NULL;
10252 0 : bool allow_remaining = false;
10253 :
10254 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10255 : discard_const_p(char *, kwnames),
10256 : &blob.data, &blob_length,
10257 : &allow_remaining_obj)) {
10258 0 : return NULL;
10259 : }
10260 0 : blob.length = blob_length;
10261 :
10262 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10263 0 : allow_remaining = true;
10264 : }
10265 :
10266 0 : if (allow_remaining) {
10267 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response2);
10268 : } else {
10269 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);
10270 : }
10271 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10272 0 : PyErr_SetNdrError(err);
10273 0 : return NULL;
10274 : }
10275 :
10276 0 : Py_RETURN_NONE;
10277 : }
10278 :
10279 0 : static PyObject *py_nbt_netlogon_response2_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10280 : {
10281 0 : struct nbt_netlogon_response2 *object = (struct nbt_netlogon_response2 *)pytalloc_get_ptr(py_obj);
10282 : PyObject *ret;
10283 : char *retstr;
10284 :
10285 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);
10286 0 : ret = PyUnicode_FromString(retstr);
10287 0 : talloc_free(retstr);
10288 :
10289 0 : return ret;
10290 : }
10291 :
10292 : static PyMethodDef py_nbt_netlogon_response2_methods[] = {
10293 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_response2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10294 : { "__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" },
10295 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_response2_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10296 : { NULL, NULL, 0, NULL }
10297 : };
10298 :
10299 :
10300 : static PyTypeObject nbt_netlogon_response2_Type = {
10301 : PyVarObject_HEAD_INIT(NULL, 0)
10302 : .tp_name = "nbt.netlogon_response2",
10303 : .tp_getset = py_nbt_netlogon_response2_getsetters,
10304 : .tp_methods = py_nbt_netlogon_response2_methods,
10305 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10306 : .tp_new = py_nbt_netlogon_response2_new,
10307 : };
10308 :
10309 :
10310 0 : static PyObject *py_nbt_db_change_info_get_db_index(PyObject *obj, void *closure)
10311 : {
10312 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(obj);
10313 : PyObject *py_db_index;
10314 0 : py_db_index = PyLong_FromUnsignedLongLong((uint32_t)object->db_index);
10315 0 : return py_db_index;
10316 : }
10317 :
10318 0 : static int py_nbt_db_change_info_set_db_index(PyObject *py_obj, PyObject *value, void *closure)
10319 : {
10320 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(py_obj);
10321 0 : if (value == NULL) {
10322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_index");
10323 0 : return -1;
10324 : }
10325 : {
10326 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_index));
10327 0 : if (PyLong_Check(value)) {
10328 : unsigned long long test_var;
10329 0 : test_var = PyLong_AsUnsignedLongLong(value);
10330 0 : if (PyErr_Occurred() != NULL) {
10331 0 : return -1;
10332 : }
10333 0 : if (test_var > uint_max) {
10334 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10335 : PyLong_Type.tp_name, uint_max, test_var);
10336 0 : return -1;
10337 : }
10338 0 : object->db_index = test_var;
10339 : } else {
10340 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10341 : PyLong_Type.tp_name);
10342 0 : return -1;
10343 : }
10344 : }
10345 0 : return 0;
10346 : }
10347 :
10348 0 : static PyObject *py_nbt_db_change_info_get_serial(PyObject *obj, void *closure)
10349 : {
10350 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(obj);
10351 : PyObject *py_serial;
10352 0 : py_serial = PyLong_FromUnsignedLongLong(object->serial);
10353 0 : return py_serial;
10354 : }
10355 :
10356 0 : static int py_nbt_db_change_info_set_serial(PyObject *py_obj, PyObject *value, void *closure)
10357 : {
10358 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(py_obj);
10359 0 : if (value == NULL) {
10360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial");
10361 0 : return -1;
10362 : }
10363 : {
10364 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial));
10365 0 : if (PyLong_Check(value)) {
10366 : unsigned long long test_var;
10367 0 : test_var = PyLong_AsUnsignedLongLong(value);
10368 0 : if (PyErr_Occurred() != NULL) {
10369 0 : return -1;
10370 : }
10371 0 : if (test_var > uint_max) {
10372 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10373 : PyLong_Type.tp_name, uint_max, test_var);
10374 0 : return -1;
10375 : }
10376 0 : object->serial = test_var;
10377 : } else {
10378 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10379 : PyLong_Type.tp_name);
10380 0 : return -1;
10381 : }
10382 : }
10383 0 : return 0;
10384 : }
10385 :
10386 0 : static PyObject *py_nbt_db_change_info_get_timestamp(PyObject *obj, void *closure)
10387 : {
10388 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(obj);
10389 : PyObject *py_timestamp;
10390 0 : py_timestamp = PyLong_FromUnsignedLongLong(object->timestamp);
10391 0 : return py_timestamp;
10392 : }
10393 :
10394 0 : static int py_nbt_db_change_info_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
10395 : {
10396 0 : struct nbt_db_change_info *object = (struct nbt_db_change_info *)pytalloc_get_ptr(py_obj);
10397 0 : if (value == NULL) {
10398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
10399 0 : return -1;
10400 : }
10401 : {
10402 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timestamp));
10403 0 : if (PyLong_Check(value)) {
10404 : unsigned long long test_var;
10405 0 : test_var = PyLong_AsUnsignedLongLong(value);
10406 0 : if (PyErr_Occurred() != NULL) {
10407 0 : return -1;
10408 : }
10409 0 : if (test_var > uint_max) {
10410 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10411 : PyLong_Type.tp_name, uint_max, test_var);
10412 0 : return -1;
10413 : }
10414 0 : object->timestamp = test_var;
10415 : } else {
10416 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10417 : PyLong_Type.tp_name);
10418 0 : return -1;
10419 : }
10420 : }
10421 0 : return 0;
10422 : }
10423 :
10424 : static PyGetSetDef py_nbt_db_change_info_getsetters[] = {
10425 : {
10426 : .name = discard_const_p(char, "db_index"),
10427 : .get = py_nbt_db_change_info_get_db_index,
10428 : .set = py_nbt_db_change_info_set_db_index,
10429 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID")
10430 : },
10431 : {
10432 : .name = discard_const_p(char, "serial"),
10433 : .get = py_nbt_db_change_info_get_serial,
10434 : .set = py_nbt_db_change_info_set_serial,
10435 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
10436 : },
10437 : {
10438 : .name = discard_const_p(char, "timestamp"),
10439 : .get = py_nbt_db_change_info_get_timestamp,
10440 : .set = py_nbt_db_change_info_set_timestamp,
10441 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
10442 : },
10443 : { .name = NULL }
10444 : };
10445 :
10446 0 : static PyObject *py_nbt_db_change_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10447 : {
10448 0 : return pytalloc_new(struct nbt_db_change_info, type);
10449 : }
10450 :
10451 :
10452 : static PyTypeObject nbt_db_change_info_Type = {
10453 : PyVarObject_HEAD_INIT(NULL, 0)
10454 : .tp_name = "nbt.db_change_info",
10455 : .tp_getset = py_nbt_db_change_info_getsetters,
10456 : .tp_methods = NULL,
10457 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10458 : .tp_new = py_nbt_db_change_info_new,
10459 : };
10460 :
10461 :
10462 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_serial_lo(PyObject *obj, void *closure)
10463 : {
10464 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10465 : PyObject *py_serial_lo;
10466 0 : py_serial_lo = PyLong_FromUnsignedLongLong((uint32_t)object->serial_lo);
10467 0 : return py_serial_lo;
10468 : }
10469 :
10470 0 : static int py_NETLOGON_DB_CHANGE_set_serial_lo(PyObject *py_obj, PyObject *value, void *closure)
10471 : {
10472 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10473 0 : if (value == NULL) {
10474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_lo");
10475 0 : return -1;
10476 : }
10477 : {
10478 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_lo));
10479 0 : if (PyLong_Check(value)) {
10480 : unsigned long long test_var;
10481 0 : test_var = PyLong_AsUnsignedLongLong(value);
10482 0 : if (PyErr_Occurred() != NULL) {
10483 0 : return -1;
10484 : }
10485 0 : if (test_var > uint_max) {
10486 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10487 : PyLong_Type.tp_name, uint_max, test_var);
10488 0 : return -1;
10489 : }
10490 0 : object->serial_lo = 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_timestamp(PyObject *obj, void *closure)
10501 : {
10502 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10503 : PyObject *py_timestamp;
10504 0 : py_timestamp = PyLong_FromLong(object->timestamp);
10505 0 : return py_timestamp;
10506 : }
10507 :
10508 0 : static int py_NETLOGON_DB_CHANGE_set_timestamp(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->timestamp");
10513 0 : return -1;
10514 : }
10515 : {
10516 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp));
10517 0 : const long long int_min = -int_max - 1;
10518 0 : if (PyLong_Check(value)) {
10519 : long long test_var;
10520 0 : test_var = PyLong_AsLongLong(value);
10521 0 : if (PyErr_Occurred() != NULL) {
10522 0 : return -1;
10523 : }
10524 0 : if (test_var < int_min || test_var > int_max) {
10525 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
10526 : PyLong_Type.tp_name, int_min, int_max, test_var);
10527 0 : return -1;
10528 : }
10529 0 : object->timestamp = test_var;
10530 : } else {
10531 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10532 : PyLong_Type.tp_name);
10533 0 : return -1;
10534 : }
10535 : }
10536 0 : return 0;
10537 : }
10538 :
10539 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_pulse(PyObject *obj, void *closure)
10540 : {
10541 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10542 : PyObject *py_pulse;
10543 0 : py_pulse = PyLong_FromUnsignedLongLong((uint32_t)object->pulse);
10544 0 : return py_pulse;
10545 : }
10546 :
10547 0 : static int py_NETLOGON_DB_CHANGE_set_pulse(PyObject *py_obj, PyObject *value, void *closure)
10548 : {
10549 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10550 0 : if (value == NULL) {
10551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pulse");
10552 0 : return -1;
10553 : }
10554 : {
10555 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pulse));
10556 0 : if (PyLong_Check(value)) {
10557 : unsigned long long test_var;
10558 0 : test_var = PyLong_AsUnsignedLongLong(value);
10559 0 : if (PyErr_Occurred() != NULL) {
10560 0 : return -1;
10561 : }
10562 0 : if (test_var > uint_max) {
10563 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10564 : PyLong_Type.tp_name, uint_max, test_var);
10565 0 : return -1;
10566 : }
10567 0 : object->pulse = test_var;
10568 : } else {
10569 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10570 : PyLong_Type.tp_name);
10571 0 : return -1;
10572 : }
10573 : }
10574 0 : return 0;
10575 : }
10576 :
10577 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_random(PyObject *obj, void *closure)
10578 : {
10579 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10580 : PyObject *py_random;
10581 0 : py_random = PyLong_FromUnsignedLongLong((uint32_t)object->random);
10582 0 : return py_random;
10583 : }
10584 :
10585 0 : static int py_NETLOGON_DB_CHANGE_set_random(PyObject *py_obj, PyObject *value, void *closure)
10586 : {
10587 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10588 0 : if (value == NULL) {
10589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->random");
10590 0 : return -1;
10591 : }
10592 : {
10593 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->random));
10594 0 : if (PyLong_Check(value)) {
10595 : unsigned long long test_var;
10596 0 : test_var = PyLong_AsUnsignedLongLong(value);
10597 0 : if (PyErr_Occurred() != NULL) {
10598 0 : return -1;
10599 : }
10600 0 : if (test_var > uint_max) {
10601 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10602 : PyLong_Type.tp_name, uint_max, test_var);
10603 0 : return -1;
10604 : }
10605 0 : object->random = test_var;
10606 : } else {
10607 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10608 : PyLong_Type.tp_name);
10609 0 : return -1;
10610 : }
10611 : }
10612 0 : return 0;
10613 : }
10614 :
10615 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_pdc_name(PyObject *obj, void *closure)
10616 : {
10617 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10618 : PyObject *py_pdc_name;
10619 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
10620 0 : return py_pdc_name;
10621 : }
10622 :
10623 0 : static int py_NETLOGON_DB_CHANGE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10624 : {
10625 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10626 0 : if (value == NULL) {
10627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
10628 0 : return -1;
10629 : }
10630 : {
10631 : const char *test_str;
10632 : const char *talloc_str;
10633 0 : PyObject *unicode = NULL;
10634 0 : if (PyUnicode_Check(value)) {
10635 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10636 0 : if (unicode == NULL) {
10637 0 : PyErr_NoMemory();
10638 0 : return -1;
10639 : }
10640 0 : test_str = PyBytes_AS_STRING(unicode);
10641 0 : } else if (PyBytes_Check(value)) {
10642 0 : test_str = PyBytes_AS_STRING(value);
10643 : } else {
10644 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10645 0 : return -1;
10646 : }
10647 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10648 0 : if (unicode != NULL) {
10649 0 : Py_DECREF(unicode);
10650 : }
10651 0 : if (talloc_str == NULL) {
10652 0 : PyErr_NoMemory();
10653 0 : return -1;
10654 : }
10655 0 : object->pdc_name = talloc_str;
10656 : }
10657 0 : return 0;
10658 : }
10659 :
10660 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_domain(PyObject *obj, void *closure)
10661 : {
10662 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10663 : PyObject *py_domain;
10664 0 : py_domain = PyString_FromStringOrNULL(object->domain);
10665 0 : return py_domain;
10666 : }
10667 :
10668 0 : static int py_NETLOGON_DB_CHANGE_set_domain(PyObject *py_obj, PyObject *value, void *closure)
10669 : {
10670 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10671 0 : if (value == NULL) {
10672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain");
10673 0 : return -1;
10674 : }
10675 : {
10676 : const char *test_str;
10677 : const char *talloc_str;
10678 0 : PyObject *unicode = NULL;
10679 0 : if (PyUnicode_Check(value)) {
10680 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10681 0 : if (unicode == NULL) {
10682 0 : PyErr_NoMemory();
10683 0 : return -1;
10684 : }
10685 0 : test_str = PyBytes_AS_STRING(unicode);
10686 0 : } else if (PyBytes_Check(value)) {
10687 0 : test_str = PyBytes_AS_STRING(value);
10688 : } else {
10689 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10690 0 : return -1;
10691 : }
10692 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10693 0 : if (unicode != NULL) {
10694 0 : Py_DECREF(unicode);
10695 : }
10696 0 : if (talloc_str == NULL) {
10697 0 : PyErr_NoMemory();
10698 0 : return -1;
10699 : }
10700 0 : object->domain = talloc_str;
10701 : }
10702 0 : return 0;
10703 : }
10704 :
10705 0 : static PyObject *py_NETLOGON_DB_CHANGE_get__pad(PyObject *obj, void *closure)
10706 : {
10707 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10708 : PyObject *py__pad;
10709 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
10710 0 : return py__pad;
10711 : }
10712 :
10713 0 : static int py_NETLOGON_DB_CHANGE_set__pad(PyObject *py_obj, PyObject *value, void *closure)
10714 : {
10715 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10716 0 : if (value == NULL) {
10717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
10718 0 : return -1;
10719 : }
10720 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
10721 0 : return 0;
10722 : }
10723 :
10724 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_unicode_pdc_name(PyObject *obj, void *closure)
10725 : {
10726 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10727 : PyObject *py_unicode_pdc_name;
10728 0 : py_unicode_pdc_name = PyString_FromStringOrNULL(object->unicode_pdc_name);
10729 0 : return py_unicode_pdc_name;
10730 : }
10731 :
10732 0 : static int py_NETLOGON_DB_CHANGE_set_unicode_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10733 : {
10734 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10735 0 : if (value == NULL) {
10736 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_pdc_name");
10737 0 : return -1;
10738 : }
10739 : {
10740 : const char *test_str;
10741 : const char *talloc_str;
10742 0 : PyObject *unicode = NULL;
10743 0 : if (PyUnicode_Check(value)) {
10744 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10745 0 : if (unicode == NULL) {
10746 0 : PyErr_NoMemory();
10747 0 : return -1;
10748 : }
10749 0 : test_str = PyBytes_AS_STRING(unicode);
10750 0 : } else if (PyBytes_Check(value)) {
10751 0 : test_str = PyBytes_AS_STRING(value);
10752 : } else {
10753 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10754 0 : return -1;
10755 : }
10756 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10757 0 : if (unicode != NULL) {
10758 0 : Py_DECREF(unicode);
10759 : }
10760 0 : if (talloc_str == NULL) {
10761 0 : PyErr_NoMemory();
10762 0 : return -1;
10763 : }
10764 0 : object->unicode_pdc_name = talloc_str;
10765 : }
10766 0 : return 0;
10767 : }
10768 :
10769 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_unicode_domain(PyObject *obj, void *closure)
10770 : {
10771 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10772 : PyObject *py_unicode_domain;
10773 0 : py_unicode_domain = PyString_FromStringOrNULL(object->unicode_domain);
10774 0 : return py_unicode_domain;
10775 : }
10776 :
10777 0 : static int py_NETLOGON_DB_CHANGE_set_unicode_domain(PyObject *py_obj, PyObject *value, void *closure)
10778 : {
10779 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10780 0 : if (value == NULL) {
10781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unicode_domain");
10782 0 : return -1;
10783 : }
10784 : {
10785 : const char *test_str;
10786 : const char *talloc_str;
10787 0 : PyObject *unicode = NULL;
10788 0 : if (PyUnicode_Check(value)) {
10789 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10790 0 : if (unicode == NULL) {
10791 0 : PyErr_NoMemory();
10792 0 : return -1;
10793 : }
10794 0 : test_str = PyBytes_AS_STRING(unicode);
10795 0 : } else if (PyBytes_Check(value)) {
10796 0 : test_str = PyBytes_AS_STRING(value);
10797 : } else {
10798 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10799 0 : return -1;
10800 : }
10801 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10802 0 : if (unicode != NULL) {
10803 0 : Py_DECREF(unicode);
10804 : }
10805 0 : if (talloc_str == NULL) {
10806 0 : PyErr_NoMemory();
10807 0 : return -1;
10808 : }
10809 0 : object->unicode_domain = talloc_str;
10810 : }
10811 0 : return 0;
10812 : }
10813 :
10814 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_db_count(PyObject *obj, void *closure)
10815 : {
10816 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10817 : PyObject *py_db_count;
10818 0 : py_db_count = PyLong_FromUnsignedLongLong((uint32_t)object->db_count);
10819 0 : return py_db_count;
10820 : }
10821 :
10822 0 : static int py_NETLOGON_DB_CHANGE_set_db_count(PyObject *py_obj, PyObject *value, void *closure)
10823 : {
10824 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10825 0 : if (value == NULL) {
10826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_count");
10827 0 : return -1;
10828 : }
10829 : {
10830 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_count));
10831 0 : if (PyLong_Check(value)) {
10832 : unsigned long long test_var;
10833 0 : test_var = PyLong_AsUnsignedLongLong(value);
10834 0 : if (PyErr_Occurred() != NULL) {
10835 0 : return -1;
10836 : }
10837 0 : if (test_var > uint_max) {
10838 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10839 : PyLong_Type.tp_name, uint_max, test_var);
10840 0 : return -1;
10841 : }
10842 0 : object->db_count = test_var;
10843 : } else {
10844 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10845 : PyLong_Type.tp_name);
10846 0 : return -1;
10847 : }
10848 : }
10849 0 : return 0;
10850 : }
10851 :
10852 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_dbchange(PyObject *obj, void *closure)
10853 : {
10854 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10855 : PyObject *py_dbchange;
10856 0 : py_dbchange = PyList_New(object->db_count);
10857 0 : if (py_dbchange == NULL) {
10858 0 : return NULL;
10859 : }
10860 : {
10861 : int dbchange_cntr_0;
10862 0 : for (dbchange_cntr_0 = 0; dbchange_cntr_0 < (object->db_count); dbchange_cntr_0++) {
10863 : PyObject *py_dbchange_0;
10864 0 : py_dbchange_0 = pytalloc_reference_ex(&nbt_db_change_info_Type, object->dbchange, &object->dbchange[dbchange_cntr_0]);
10865 0 : PyList_SetItem(py_dbchange, dbchange_cntr_0, py_dbchange_0);
10866 : }
10867 : }
10868 0 : return py_dbchange;
10869 : }
10870 :
10871 0 : static int py_NETLOGON_DB_CHANGE_set_dbchange(PyObject *py_obj, PyObject *value, void *closure)
10872 : {
10873 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10874 0 : if (value == NULL) {
10875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dbchange");
10876 0 : return -1;
10877 : }
10878 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10879 : {
10880 : int dbchange_cntr_0;
10881 0 : object->dbchange = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->dbchange, PyList_GET_SIZE(value));
10882 0 : if (!object->dbchange) { return -1;; }
10883 0 : talloc_set_name_const(object->dbchange, "ARRAY: object->dbchange");
10884 0 : for (dbchange_cntr_0 = 0; dbchange_cntr_0 < PyList_GET_SIZE(value); dbchange_cntr_0++) {
10885 0 : if (PyList_GET_ITEM(value, dbchange_cntr_0) == NULL) {
10886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dbchange[dbchange_cntr_0]");
10887 0 : return -1;
10888 : }
10889 0 : PY_CHECK_TYPE(&nbt_db_change_info_Type, PyList_GET_ITEM(value, dbchange_cntr_0), return -1;);
10890 0 : if (talloc_reference(object->dbchange, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, dbchange_cntr_0))) == NULL) {
10891 0 : PyErr_NoMemory();
10892 0 : return -1;
10893 : }
10894 0 : object->dbchange[dbchange_cntr_0] = *(struct nbt_db_change_info *)pytalloc_get_ptr(PyList_GET_ITEM(value, dbchange_cntr_0));
10895 : }
10896 : }
10897 0 : return 0;
10898 : }
10899 :
10900 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_sid_size(PyObject *obj, void *closure)
10901 : {
10902 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10903 : PyObject *py_sid_size;
10904 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)object->sid_size);
10905 0 : return py_sid_size;
10906 : }
10907 :
10908 0 : static int py_NETLOGON_DB_CHANGE_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
10909 : {
10910 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10911 0 : if (value == NULL) {
10912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_size");
10913 0 : return -1;
10914 : }
10915 : {
10916 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
10917 0 : if (PyLong_Check(value)) {
10918 : unsigned long long test_var;
10919 0 : test_var = PyLong_AsUnsignedLongLong(value);
10920 0 : if (PyErr_Occurred() != NULL) {
10921 0 : return -1;
10922 : }
10923 0 : if (test_var > uint_max) {
10924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10925 : PyLong_Type.tp_name, uint_max, test_var);
10926 0 : return -1;
10927 : }
10928 0 : object->sid_size = test_var;
10929 : } else {
10930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10931 : PyLong_Type.tp_name);
10932 0 : return -1;
10933 : }
10934 : }
10935 0 : return 0;
10936 : }
10937 :
10938 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_sid(PyObject *obj, void *closure)
10939 : {
10940 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10941 : PyObject *py_sid;
10942 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
10943 0 : return py_sid;
10944 : }
10945 :
10946 0 : static int py_NETLOGON_DB_CHANGE_set_sid(PyObject *py_obj, PyObject *value, void *closure)
10947 : {
10948 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10949 0 : if (value == NULL) {
10950 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
10951 0 : return -1;
10952 : }
10953 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10954 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10955 0 : PyErr_NoMemory();
10956 0 : return -1;
10957 : }
10958 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
10959 0 : return 0;
10960 : }
10961 :
10962 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_message_format_version(PyObject *obj, void *closure)
10963 : {
10964 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
10965 : PyObject *py_message_format_version;
10966 0 : py_message_format_version = PyLong_FromUnsignedLongLong((uint32_t)object->message_format_version);
10967 0 : return py_message_format_version;
10968 : }
10969 :
10970 0 : static int py_NETLOGON_DB_CHANGE_set_message_format_version(PyObject *py_obj, PyObject *value, void *closure)
10971 : {
10972 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
10973 0 : if (value == NULL) {
10974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_format_version");
10975 0 : return -1;
10976 : }
10977 : {
10978 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_format_version));
10979 0 : if (PyLong_Check(value)) {
10980 : unsigned long long test_var;
10981 0 : test_var = PyLong_AsUnsignedLongLong(value);
10982 0 : if (PyErr_Occurred() != NULL) {
10983 0 : return -1;
10984 : }
10985 0 : if (test_var > uint_max) {
10986 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10987 : PyLong_Type.tp_name, uint_max, test_var);
10988 0 : return -1;
10989 : }
10990 0 : object->message_format_version = test_var;
10991 : } else {
10992 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10993 : PyLong_Type.tp_name);
10994 0 : return -1;
10995 : }
10996 : }
10997 0 : return 0;
10998 : }
10999 :
11000 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_message_token(PyObject *obj, void *closure)
11001 : {
11002 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(obj);
11003 : PyObject *py_message_token;
11004 0 : py_message_token = PyLong_FromUnsignedLongLong((uint32_t)object->message_token);
11005 0 : return py_message_token;
11006 : }
11007 :
11008 0 : static int py_NETLOGON_DB_CHANGE_set_message_token(PyObject *py_obj, PyObject *value, void *closure)
11009 : {
11010 0 : struct NETLOGON_DB_CHANGE *object = (struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(py_obj);
11011 0 : if (value == NULL) {
11012 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_token");
11013 0 : return -1;
11014 : }
11015 : {
11016 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_token));
11017 0 : if (PyLong_Check(value)) {
11018 : unsigned long long test_var;
11019 0 : test_var = PyLong_AsUnsignedLongLong(value);
11020 0 : if (PyErr_Occurred() != NULL) {
11021 0 : return -1;
11022 : }
11023 0 : if (test_var > uint_max) {
11024 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11025 : PyLong_Type.tp_name, uint_max, test_var);
11026 0 : return -1;
11027 : }
11028 0 : object->message_token = test_var;
11029 : } else {
11030 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11031 : PyLong_Type.tp_name);
11032 0 : return -1;
11033 : }
11034 : }
11035 0 : return 0;
11036 : }
11037 :
11038 : static PyGetSetDef py_NETLOGON_DB_CHANGE_getsetters[] = {
11039 : {
11040 : .name = discard_const_p(char, "serial_lo"),
11041 : .get = py_NETLOGON_DB_CHANGE_get_serial_lo,
11042 : .set = py_NETLOGON_DB_CHANGE_set_serial_lo,
11043 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11044 : },
11045 : {
11046 : .name = discard_const_p(char, "timestamp"),
11047 : .get = py_NETLOGON_DB_CHANGE_get_timestamp,
11048 : .set = py_NETLOGON_DB_CHANGE_set_timestamp,
11049 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
11050 : },
11051 : {
11052 : .name = discard_const_p(char, "pulse"),
11053 : .get = py_NETLOGON_DB_CHANGE_get_pulse,
11054 : .set = py_NETLOGON_DB_CHANGE_set_pulse,
11055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11056 : },
11057 : {
11058 : .name = discard_const_p(char, "random"),
11059 : .get = py_NETLOGON_DB_CHANGE_get_random,
11060 : .set = py_NETLOGON_DB_CHANGE_set_random,
11061 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11062 : },
11063 : {
11064 : .name = discard_const_p(char, "pdc_name"),
11065 : .get = py_NETLOGON_DB_CHANGE_get_pdc_name,
11066 : .set = py_NETLOGON_DB_CHANGE_set_pdc_name,
11067 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11068 : },
11069 : {
11070 : .name = discard_const_p(char, "domain"),
11071 : .get = py_NETLOGON_DB_CHANGE_get_domain,
11072 : .set = py_NETLOGON_DB_CHANGE_set_domain,
11073 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11074 : },
11075 : {
11076 : .name = discard_const_p(char, "_pad"),
11077 : .get = py_NETLOGON_DB_CHANGE_get__pad,
11078 : .set = py_NETLOGON_DB_CHANGE_set__pad,
11079 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
11080 : },
11081 : {
11082 : .name = discard_const_p(char, "unicode_pdc_name"),
11083 : .get = py_NETLOGON_DB_CHANGE_get_unicode_pdc_name,
11084 : .set = py_NETLOGON_DB_CHANGE_set_unicode_pdc_name,
11085 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11086 : },
11087 : {
11088 : .name = discard_const_p(char, "unicode_domain"),
11089 : .get = py_NETLOGON_DB_CHANGE_get_unicode_domain,
11090 : .set = py_NETLOGON_DB_CHANGE_set_unicode_domain,
11091 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11092 : },
11093 : {
11094 : .name = discard_const_p(char, "db_count"),
11095 : .get = py_NETLOGON_DB_CHANGE_get_db_count,
11096 : .set = py_NETLOGON_DB_CHANGE_set_db_count,
11097 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11098 : },
11099 : {
11100 : .name = discard_const_p(char, "dbchange"),
11101 : .get = py_NETLOGON_DB_CHANGE_get_dbchange,
11102 : .set = py_NETLOGON_DB_CHANGE_set_dbchange,
11103 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_db_change_info")
11104 : },
11105 : {
11106 : .name = discard_const_p(char, "sid_size"),
11107 : .get = py_NETLOGON_DB_CHANGE_get_sid_size,
11108 : .set = py_NETLOGON_DB_CHANGE_set_sid_size,
11109 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11110 : },
11111 : {
11112 : .name = discard_const_p(char, "sid"),
11113 : .get = py_NETLOGON_DB_CHANGE_get_sid,
11114 : .set = py_NETLOGON_DB_CHANGE_set_sid,
11115 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
11116 : },
11117 : {
11118 : .name = discard_const_p(char, "message_format_version"),
11119 : .get = py_NETLOGON_DB_CHANGE_get_message_format_version,
11120 : .set = py_NETLOGON_DB_CHANGE_set_message_format_version,
11121 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11122 : },
11123 : {
11124 : .name = discard_const_p(char, "message_token"),
11125 : .get = py_NETLOGON_DB_CHANGE_get_message_token,
11126 : .set = py_NETLOGON_DB_CHANGE_set_message_token,
11127 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11128 : },
11129 : { .name = NULL }
11130 : };
11131 :
11132 0 : static PyObject *py_NETLOGON_DB_CHANGE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11133 : {
11134 0 : return pytalloc_new(struct NETLOGON_DB_CHANGE, type);
11135 : }
11136 :
11137 :
11138 : static PyTypeObject NETLOGON_DB_CHANGE_Type = {
11139 : PyVarObject_HEAD_INIT(NULL, 0)
11140 : .tp_name = "nbt.NETLOGON_DB_CHANGE",
11141 : .tp_getset = py_NETLOGON_DB_CHANGE_getsetters,
11142 : .tp_methods = NULL,
11143 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11144 : .tp_new = py_NETLOGON_DB_CHANGE_new,
11145 : };
11146 :
11147 0 : static PyObject *py_import_nbt_netlogon_request(TALLOC_CTX *mem_ctx, int level, union nbt_netlogon_request *in)
11148 : {
11149 : PyObject *ret;
11150 :
11151 0 : switch (level) {
11152 0 : case LOGON_REQUEST:
11153 0 : ret = pytalloc_reference_ex(&NETLOGON_LOGON_REQUEST_Type, mem_ctx, &in->logon0);
11154 0 : return ret;
11155 :
11156 0 : case LOGON_SAM_LOGON_REQUEST:
11157 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_REQUEST_Type, mem_ctx, &in->logon);
11158 0 : return ret;
11159 :
11160 0 : case LOGON_PRIMARY_QUERY:
11161 0 : ret = pytalloc_reference_ex(&nbt_netlogon_query_for_pdc_Type, mem_ctx, &in->pdc);
11162 0 : return ret;
11163 :
11164 0 : case NETLOGON_ANNOUNCE_UAS:
11165 0 : ret = pytalloc_reference_ex(&NETLOGON_DB_CHANGE_Type, mem_ctx, &in->uas);
11166 0 : return ret;
11167 :
11168 : }
11169 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11170 0 : return NULL;
11171 : }
11172 :
11173 0 : static union nbt_netlogon_request *py_export_nbt_netlogon_request(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11174 : {
11175 0 : union nbt_netlogon_request *ret = talloc_zero(mem_ctx, union nbt_netlogon_request);
11176 0 : switch (level) {
11177 0 : case LOGON_REQUEST:
11178 0 : if (in == NULL) {
11179 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon0");
11180 0 : talloc_free(ret); return NULL;
11181 : }
11182 0 : PY_CHECK_TYPE(&NETLOGON_LOGON_REQUEST_Type, in, talloc_free(ret); return NULL;);
11183 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11184 0 : PyErr_NoMemory();
11185 0 : talloc_free(ret); return NULL;
11186 : }
11187 0 : ret->logon0 = *(struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(in);
11188 0 : break;
11189 :
11190 0 : case LOGON_SAM_LOGON_REQUEST:
11191 0 : if (in == NULL) {
11192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon");
11193 0 : talloc_free(ret); return NULL;
11194 : }
11195 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_REQUEST_Type, in, talloc_free(ret); return NULL;);
11196 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11197 0 : PyErr_NoMemory();
11198 0 : talloc_free(ret); return NULL;
11199 : }
11200 0 : ret->logon = *(struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(in);
11201 0 : break;
11202 :
11203 0 : case LOGON_PRIMARY_QUERY:
11204 0 : if (in == NULL) {
11205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pdc");
11206 0 : talloc_free(ret); return NULL;
11207 : }
11208 0 : PY_CHECK_TYPE(&nbt_netlogon_query_for_pdc_Type, in, talloc_free(ret); return NULL;);
11209 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11210 0 : PyErr_NoMemory();
11211 0 : talloc_free(ret); return NULL;
11212 : }
11213 0 : ret->pdc = *(struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(in);
11214 0 : break;
11215 :
11216 0 : case NETLOGON_ANNOUNCE_UAS:
11217 0 : if (in == NULL) {
11218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uas");
11219 0 : talloc_free(ret); return NULL;
11220 : }
11221 0 : PY_CHECK_TYPE(&NETLOGON_DB_CHANGE_Type, in, talloc_free(ret); return NULL;);
11222 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11223 0 : PyErr_NoMemory();
11224 0 : talloc_free(ret); return NULL;
11225 : }
11226 0 : ret->uas = *(struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(in);
11227 0 : break;
11228 :
11229 0 : default:
11230 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
11231 0 : talloc_free(ret);
11232 0 : ret = NULL;
11233 : }
11234 :
11235 0 : return ret;
11236 : }
11237 :
11238 0 : static PyObject *py_nbt_netlogon_request_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11239 : {
11240 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11241 0 : PyObject *mem_ctx_obj = NULL;
11242 0 : TALLOC_CTX *mem_ctx = NULL;
11243 0 : int level = 0;
11244 0 : PyObject *in_obj = NULL;
11245 0 : union nbt_netlogon_request *in = NULL;
11246 :
11247 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11248 : discard_const_p(char *, kwnames),
11249 : &mem_ctx_obj,
11250 : &level,
11251 : &in_obj)) {
11252 0 : return NULL;
11253 : }
11254 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11255 0 : if (mem_ctx == NULL) {
11256 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11257 0 : return NULL;
11258 : }
11259 0 : in = (union nbt_netlogon_request *)pytalloc_get_ptr(in_obj);
11260 0 : if (in == NULL) {
11261 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_netlogon_request!");
11262 0 : return NULL;
11263 : }
11264 :
11265 0 : return py_import_nbt_netlogon_request(mem_ctx, level, in);
11266 : }
11267 :
11268 0 : static PyObject *py_nbt_netlogon_request_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11269 : {
11270 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11271 0 : PyObject *mem_ctx_obj = NULL;
11272 0 : TALLOC_CTX *mem_ctx = NULL;
11273 0 : int level = 0;
11274 0 : PyObject *in = NULL;
11275 0 : union nbt_netlogon_request *out = NULL;
11276 :
11277 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11278 : discard_const_p(char *, kwnames),
11279 : &mem_ctx_obj,
11280 : &level,
11281 : &in)) {
11282 0 : return NULL;
11283 : }
11284 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11285 0 : if (mem_ctx == NULL) {
11286 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11287 0 : return NULL;
11288 : }
11289 :
11290 0 : out = py_export_nbt_netlogon_request(mem_ctx, level, in);
11291 0 : if (out == NULL) {
11292 0 : return NULL;
11293 : }
11294 :
11295 0 : return pytalloc_GenericObject_reference(out);
11296 : }
11297 :
11298 : static PyMethodDef py_nbt_netlogon_request_methods[] = {
11299 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_request_import),
11300 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11301 : "T.__import__(mem_ctx, level, in) => ret." },
11302 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_request_export),
11303 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11304 : "T.__export__(mem_ctx, level, in) => ret." },
11305 : { NULL, NULL, 0, NULL }
11306 : };
11307 :
11308 0 : static PyObject *py_nbt_netlogon_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11309 : {
11310 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
11311 0 : return NULL;
11312 : }
11313 :
11314 :
11315 : static PyTypeObject nbt_netlogon_request_Type = {
11316 : PyVarObject_HEAD_INIT(NULL, 0)
11317 : .tp_name = "nbt.netlogon_request",
11318 : .tp_getset = NULL,
11319 : .tp_methods = py_nbt_netlogon_request_methods,
11320 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11321 : .tp_new = py_nbt_netlogon_request_new,
11322 : };
11323 :
11324 :
11325 0 : static PyObject *py_nbt_netlogon_packet_get_command(PyObject *obj, void *closure)
11326 : {
11327 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(obj);
11328 : PyObject *py_command;
11329 0 : py_command = PyLong_FromLong((uint16_t)object->command);
11330 0 : return py_command;
11331 : }
11332 :
11333 0 : static int py_nbt_netlogon_packet_set_command(PyObject *py_obj, PyObject *value, void *closure)
11334 : {
11335 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11336 0 : if (value == NULL) {
11337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
11338 0 : return -1;
11339 : }
11340 : {
11341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
11342 0 : if (PyLong_Check(value)) {
11343 : unsigned long long test_var;
11344 0 : test_var = PyLong_AsUnsignedLongLong(value);
11345 0 : if (PyErr_Occurred() != NULL) {
11346 0 : return -1;
11347 : }
11348 0 : if (test_var > uint_max) {
11349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11350 : PyLong_Type.tp_name, uint_max, test_var);
11351 0 : return -1;
11352 : }
11353 0 : object->command = test_var;
11354 : } else {
11355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11356 : PyLong_Type.tp_name);
11357 0 : return -1;
11358 : }
11359 : }
11360 0 : return 0;
11361 : }
11362 :
11363 0 : static PyObject *py_nbt_netlogon_packet_get_req(PyObject *obj, void *closure)
11364 : {
11365 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(obj);
11366 : PyObject *py_req;
11367 0 : py_req = pyrpc_import_union(&nbt_netlogon_request_Type, pytalloc_get_mem_ctx(obj), object->command, &object->req, "union nbt_netlogon_request");
11368 0 : if (py_req == NULL) {
11369 0 : return NULL;
11370 : }
11371 0 : return py_req;
11372 : }
11373 :
11374 0 : static int py_nbt_netlogon_packet_set_req(PyObject *py_obj, PyObject *value, void *closure)
11375 : {
11376 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11377 0 : if (value == NULL) {
11378 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->req");
11379 0 : return -1;
11380 : }
11381 : {
11382 : union nbt_netlogon_request *req_switch_0;
11383 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");
11384 0 : if (req_switch_0 == NULL) {
11385 0 : return -1;
11386 : }
11387 0 : object->req = *req_switch_0;
11388 : }
11389 0 : return 0;
11390 : }
11391 :
11392 : static PyGetSetDef py_nbt_netlogon_packet_getsetters[] = {
11393 : {
11394 : .name = discard_const_p(char, "command"),
11395 : .get = py_nbt_netlogon_packet_get_command,
11396 : .set = py_nbt_netlogon_packet_set_command,
11397 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
11398 : },
11399 : {
11400 : .name = discard_const_p(char, "req"),
11401 : .get = py_nbt_netlogon_packet_get_req,
11402 : .set = py_nbt_netlogon_packet_set_req,
11403 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_netlogon_request")
11404 : },
11405 : { .name = NULL }
11406 : };
11407 :
11408 0 : static PyObject *py_nbt_netlogon_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11409 : {
11410 0 : return pytalloc_new(struct nbt_netlogon_packet, type);
11411 : }
11412 :
11413 0 : static PyObject *py_nbt_netlogon_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11414 : {
11415 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11416 0 : PyObject *ret = NULL;
11417 : DATA_BLOB blob;
11418 : enum ndr_err_code err;
11419 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11420 0 : if (tmp_ctx == NULL) {
11421 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11422 0 : return NULL;
11423 : }
11424 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet);
11425 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11426 0 : TALLOC_FREE(tmp_ctx);
11427 0 : PyErr_SetNdrError(err);
11428 0 : return NULL;
11429 : }
11430 :
11431 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11432 0 : TALLOC_FREE(tmp_ctx);
11433 0 : return ret;
11434 : }
11435 :
11436 0 : static PyObject *py_nbt_netlogon_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11437 : {
11438 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11439 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11440 0 : Py_ssize_t blob_length = 0;
11441 : enum ndr_err_code err;
11442 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11443 0 : PyObject *allow_remaining_obj = NULL;
11444 0 : bool allow_remaining = false;
11445 :
11446 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11447 : discard_const_p(char *, kwnames),
11448 : &blob.data, &blob_length,
11449 : &allow_remaining_obj)) {
11450 0 : return NULL;
11451 : }
11452 0 : blob.length = blob_length;
11453 :
11454 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11455 0 : allow_remaining = true;
11456 : }
11457 :
11458 0 : if (allow_remaining) {
11459 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
11460 : } else {
11461 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);
11462 : }
11463 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11464 0 : PyErr_SetNdrError(err);
11465 0 : return NULL;
11466 : }
11467 :
11468 0 : Py_RETURN_NONE;
11469 : }
11470 :
11471 0 : static PyObject *py_nbt_netlogon_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11472 : {
11473 0 : struct nbt_netlogon_packet *object = (struct nbt_netlogon_packet *)pytalloc_get_ptr(py_obj);
11474 : PyObject *ret;
11475 : char *retstr;
11476 :
11477 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);
11478 0 : ret = PyUnicode_FromString(retstr);
11479 0 : talloc_free(retstr);
11480 :
11481 0 : return ret;
11482 : }
11483 :
11484 : static PyMethodDef py_nbt_netlogon_packet_methods[] = {
11485 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11486 : { "__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" },
11487 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11488 : { NULL, NULL, 0, NULL }
11489 : };
11490 :
11491 :
11492 : static PyTypeObject nbt_netlogon_packet_Type = {
11493 : PyVarObject_HEAD_INIT(NULL, 0)
11494 : .tp_name = "nbt.netlogon_packet",
11495 : .tp_getset = py_nbt_netlogon_packet_getsetters,
11496 : .tp_methods = py_nbt_netlogon_packet_methods,
11497 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11498 : .tp_new = py_nbt_netlogon_packet_new,
11499 : };
11500 :
11501 :
11502 0 : static PyObject *py_nbt_browse_host_announcement_get_UpdateCount(PyObject *obj, void *closure)
11503 : {
11504 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11505 : PyObject *py_UpdateCount;
11506 0 : py_UpdateCount = PyLong_FromLong((uint16_t)object->UpdateCount);
11507 0 : return py_UpdateCount;
11508 : }
11509 :
11510 0 : static int py_nbt_browse_host_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
11511 : {
11512 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11513 0 : if (value == NULL) {
11514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpdateCount");
11515 0 : return -1;
11516 : }
11517 : {
11518 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
11519 0 : if (PyLong_Check(value)) {
11520 : unsigned long long test_var;
11521 0 : test_var = PyLong_AsUnsignedLongLong(value);
11522 0 : if (PyErr_Occurred() != NULL) {
11523 0 : return -1;
11524 : }
11525 0 : if (test_var > uint_max) {
11526 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11527 : PyLong_Type.tp_name, uint_max, test_var);
11528 0 : return -1;
11529 : }
11530 0 : object->UpdateCount = test_var;
11531 : } else {
11532 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11533 : PyLong_Type.tp_name);
11534 0 : return -1;
11535 : }
11536 : }
11537 0 : return 0;
11538 : }
11539 :
11540 0 : static PyObject *py_nbt_browse_host_announcement_get_Periodicity(PyObject *obj, void *closure)
11541 : {
11542 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11543 : PyObject *py_Periodicity;
11544 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)object->Periodicity);
11545 0 : return py_Periodicity;
11546 : }
11547 :
11548 0 : static int py_nbt_browse_host_announcement_set_Periodicity(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->Periodicity");
11553 0 : return -1;
11554 : }
11555 : {
11556 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
11557 0 : if (PyLong_Check(value)) {
11558 : unsigned long long test_var;
11559 0 : test_var = PyLong_AsUnsignedLongLong(value);
11560 0 : if (PyErr_Occurred() != NULL) {
11561 0 : return -1;
11562 : }
11563 0 : if (test_var > uint_max) {
11564 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11565 : PyLong_Type.tp_name, uint_max, test_var);
11566 0 : return -1;
11567 : }
11568 0 : object->Periodicity = test_var;
11569 : } else {
11570 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11571 : PyLong_Type.tp_name);
11572 0 : return -1;
11573 : }
11574 : }
11575 0 : return 0;
11576 : }
11577 :
11578 0 : static PyObject *py_nbt_browse_host_announcement_get_ServerName(PyObject *obj, void *closure)
11579 : {
11580 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11581 : PyObject *py_ServerName;
11582 0 : if (object->ServerName == NULL) {
11583 0 : py_ServerName = Py_None;
11584 0 : Py_INCREF(py_ServerName);
11585 : } else {
11586 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
11587 : }
11588 0 : return py_ServerName;
11589 : }
11590 :
11591 0 : static int py_nbt_browse_host_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
11592 : {
11593 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11594 0 : if (value == NULL) {
11595 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
11596 0 : return -1;
11597 : }
11598 : {
11599 : const char *test_str;
11600 : const char *talloc_str;
11601 0 : PyObject *unicode = NULL;
11602 0 : if (PyUnicode_Check(value)) {
11603 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11604 0 : if (unicode == NULL) {
11605 0 : PyErr_NoMemory();
11606 0 : return -1;
11607 : }
11608 0 : test_str = PyBytes_AS_STRING(unicode);
11609 0 : } else if (PyBytes_Check(value)) {
11610 0 : test_str = PyBytes_AS_STRING(value);
11611 : } else {
11612 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11613 0 : return -1;
11614 : }
11615 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11616 0 : if (unicode != NULL) {
11617 0 : Py_DECREF(unicode);
11618 : }
11619 0 : if (talloc_str == NULL) {
11620 0 : PyErr_NoMemory();
11621 0 : return -1;
11622 : }
11623 0 : object->ServerName = talloc_str;
11624 : }
11625 0 : return 0;
11626 : }
11627 :
11628 0 : static PyObject *py_nbt_browse_host_announcement_get_OSMajor(PyObject *obj, void *closure)
11629 : {
11630 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11631 : PyObject *py_OSMajor;
11632 0 : py_OSMajor = PyLong_FromLong((uint16_t)object->OSMajor);
11633 0 : return py_OSMajor;
11634 : }
11635 :
11636 0 : static int py_nbt_browse_host_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
11637 : {
11638 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11639 0 : if (value == NULL) {
11640 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMajor");
11641 0 : return -1;
11642 : }
11643 : {
11644 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
11645 0 : if (PyLong_Check(value)) {
11646 : unsigned long long test_var;
11647 0 : test_var = PyLong_AsUnsignedLongLong(value);
11648 0 : if (PyErr_Occurred() != NULL) {
11649 0 : return -1;
11650 : }
11651 0 : if (test_var > uint_max) {
11652 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11653 : PyLong_Type.tp_name, uint_max, test_var);
11654 0 : return -1;
11655 : }
11656 0 : object->OSMajor = test_var;
11657 : } else {
11658 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11659 : PyLong_Type.tp_name);
11660 0 : return -1;
11661 : }
11662 : }
11663 0 : return 0;
11664 : }
11665 :
11666 0 : static PyObject *py_nbt_browse_host_announcement_get_OSMinor(PyObject *obj, void *closure)
11667 : {
11668 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11669 : PyObject *py_OSMinor;
11670 0 : py_OSMinor = PyLong_FromLong((uint16_t)object->OSMinor);
11671 0 : return py_OSMinor;
11672 : }
11673 :
11674 0 : static int py_nbt_browse_host_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
11675 : {
11676 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11677 0 : if (value == NULL) {
11678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMinor");
11679 0 : return -1;
11680 : }
11681 : {
11682 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
11683 0 : if (PyLong_Check(value)) {
11684 : unsigned long long test_var;
11685 0 : test_var = PyLong_AsUnsignedLongLong(value);
11686 0 : if (PyErr_Occurred() != NULL) {
11687 0 : return -1;
11688 : }
11689 0 : if (test_var > uint_max) {
11690 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11691 : PyLong_Type.tp_name, uint_max, test_var);
11692 0 : return -1;
11693 : }
11694 0 : object->OSMinor = test_var;
11695 : } else {
11696 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11697 : PyLong_Type.tp_name);
11698 0 : return -1;
11699 : }
11700 : }
11701 0 : return 0;
11702 : }
11703 :
11704 0 : static PyObject *py_nbt_browse_host_announcement_get_ServerType(PyObject *obj, void *closure)
11705 : {
11706 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11707 : PyObject *py_ServerType;
11708 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)object->ServerType);
11709 0 : return py_ServerType;
11710 : }
11711 :
11712 0 : static int py_nbt_browse_host_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
11713 : {
11714 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11715 0 : if (value == NULL) {
11716 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerType");
11717 0 : return -1;
11718 : }
11719 : {
11720 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
11721 0 : if (PyLong_Check(value)) {
11722 : unsigned long long test_var;
11723 0 : test_var = PyLong_AsUnsignedLongLong(value);
11724 0 : if (PyErr_Occurred() != NULL) {
11725 0 : return -1;
11726 : }
11727 0 : if (test_var > uint_max) {
11728 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11729 : PyLong_Type.tp_name, uint_max, test_var);
11730 0 : return -1;
11731 : }
11732 0 : object->ServerType = test_var;
11733 : } else {
11734 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11735 : PyLong_Type.tp_name);
11736 0 : return -1;
11737 : }
11738 : }
11739 0 : return 0;
11740 : }
11741 :
11742 0 : static PyObject *py_nbt_browse_host_announcement_get_BroMajorVer(PyObject *obj, void *closure)
11743 : {
11744 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11745 : PyObject *py_BroMajorVer;
11746 0 : py_BroMajorVer = PyLong_FromLong((uint16_t)object->BroMajorVer);
11747 0 : return py_BroMajorVer;
11748 : }
11749 :
11750 0 : static int py_nbt_browse_host_announcement_set_BroMajorVer(PyObject *py_obj, PyObject *value, void *closure)
11751 : {
11752 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11753 0 : if (value == NULL) {
11754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMajorVer");
11755 0 : return -1;
11756 : }
11757 : {
11758 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMajorVer));
11759 0 : if (PyLong_Check(value)) {
11760 : unsigned long long test_var;
11761 0 : test_var = PyLong_AsUnsignedLongLong(value);
11762 0 : if (PyErr_Occurred() != NULL) {
11763 0 : return -1;
11764 : }
11765 0 : if (test_var > uint_max) {
11766 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11767 : PyLong_Type.tp_name, uint_max, test_var);
11768 0 : return -1;
11769 : }
11770 0 : object->BroMajorVer = test_var;
11771 : } else {
11772 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11773 : PyLong_Type.tp_name);
11774 0 : return -1;
11775 : }
11776 : }
11777 0 : return 0;
11778 : }
11779 :
11780 0 : static PyObject *py_nbt_browse_host_announcement_get_BroMinorVer(PyObject *obj, void *closure)
11781 : {
11782 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11783 : PyObject *py_BroMinorVer;
11784 0 : py_BroMinorVer = PyLong_FromLong((uint16_t)object->BroMinorVer);
11785 0 : return py_BroMinorVer;
11786 : }
11787 :
11788 0 : static int py_nbt_browse_host_announcement_set_BroMinorVer(PyObject *py_obj, PyObject *value, void *closure)
11789 : {
11790 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11791 0 : if (value == NULL) {
11792 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMinorVer");
11793 0 : return -1;
11794 : }
11795 : {
11796 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMinorVer));
11797 0 : if (PyLong_Check(value)) {
11798 : unsigned long long test_var;
11799 0 : test_var = PyLong_AsUnsignedLongLong(value);
11800 0 : if (PyErr_Occurred() != NULL) {
11801 0 : return -1;
11802 : }
11803 0 : if (test_var > uint_max) {
11804 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11805 : PyLong_Type.tp_name, uint_max, test_var);
11806 0 : return -1;
11807 : }
11808 0 : object->BroMinorVer = test_var;
11809 : } else {
11810 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11811 : PyLong_Type.tp_name);
11812 0 : return -1;
11813 : }
11814 : }
11815 0 : return 0;
11816 : }
11817 :
11818 0 : static PyObject *py_nbt_browse_host_announcement_get_Signature(PyObject *obj, void *closure)
11819 : {
11820 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11821 : PyObject *py_Signature;
11822 0 : py_Signature = PyLong_FromLong((uint16_t)object->Signature);
11823 0 : return py_Signature;
11824 : }
11825 :
11826 0 : static int py_nbt_browse_host_announcement_set_Signature(PyObject *py_obj, PyObject *value, void *closure)
11827 : {
11828 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11829 0 : if (value == NULL) {
11830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Signature");
11831 0 : return -1;
11832 : }
11833 : {
11834 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Signature));
11835 0 : if (PyLong_Check(value)) {
11836 : unsigned long long test_var;
11837 0 : test_var = PyLong_AsUnsignedLongLong(value);
11838 0 : if (PyErr_Occurred() != NULL) {
11839 0 : return -1;
11840 : }
11841 0 : if (test_var > uint_max) {
11842 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11843 : PyLong_Type.tp_name, uint_max, test_var);
11844 0 : return -1;
11845 : }
11846 0 : object->Signature = test_var;
11847 : } else {
11848 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11849 : PyLong_Type.tp_name);
11850 0 : return -1;
11851 : }
11852 : }
11853 0 : return 0;
11854 : }
11855 :
11856 0 : static PyObject *py_nbt_browse_host_announcement_get_Comment(PyObject *obj, void *closure)
11857 : {
11858 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(obj);
11859 : PyObject *py_Comment;
11860 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
11861 0 : return py_Comment;
11862 : }
11863 :
11864 0 : static int py_nbt_browse_host_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
11865 : {
11866 0 : struct nbt_browse_host_announcement *object = (struct nbt_browse_host_announcement *)pytalloc_get_ptr(py_obj);
11867 0 : if (value == NULL) {
11868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Comment");
11869 0 : return -1;
11870 : }
11871 : {
11872 : const char *test_str;
11873 : const char *talloc_str;
11874 0 : PyObject *unicode = NULL;
11875 0 : if (PyUnicode_Check(value)) {
11876 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11877 0 : if (unicode == NULL) {
11878 0 : PyErr_NoMemory();
11879 0 : return -1;
11880 : }
11881 0 : test_str = PyBytes_AS_STRING(unicode);
11882 0 : } else if (PyBytes_Check(value)) {
11883 0 : test_str = PyBytes_AS_STRING(value);
11884 : } else {
11885 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11886 0 : return -1;
11887 : }
11888 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11889 0 : if (unicode != NULL) {
11890 0 : Py_DECREF(unicode);
11891 : }
11892 0 : if (talloc_str == NULL) {
11893 0 : PyErr_NoMemory();
11894 0 : return -1;
11895 : }
11896 0 : object->Comment = talloc_str;
11897 : }
11898 0 : return 0;
11899 : }
11900 :
11901 : static PyGetSetDef py_nbt_browse_host_announcement_getsetters[] = {
11902 : {
11903 : .name = discard_const_p(char, "UpdateCount"),
11904 : .get = py_nbt_browse_host_announcement_get_UpdateCount,
11905 : .set = py_nbt_browse_host_announcement_set_UpdateCount,
11906 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11907 : },
11908 : {
11909 : .name = discard_const_p(char, "Periodicity"),
11910 : .get = py_nbt_browse_host_announcement_get_Periodicity,
11911 : .set = py_nbt_browse_host_announcement_set_Periodicity,
11912 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11913 : },
11914 : {
11915 : .name = discard_const_p(char, "ServerName"),
11916 : .get = py_nbt_browse_host_announcement_get_ServerName,
11917 : .set = py_nbt_browse_host_announcement_set_ServerName,
11918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11919 : },
11920 : {
11921 : .name = discard_const_p(char, "OSMajor"),
11922 : .get = py_nbt_browse_host_announcement_get_OSMajor,
11923 : .set = py_nbt_browse_host_announcement_set_OSMajor,
11924 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11925 : },
11926 : {
11927 : .name = discard_const_p(char, "OSMinor"),
11928 : .get = py_nbt_browse_host_announcement_get_OSMinor,
11929 : .set = py_nbt_browse_host_announcement_set_OSMinor,
11930 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11931 : },
11932 : {
11933 : .name = discard_const_p(char, "ServerType"),
11934 : .get = py_nbt_browse_host_announcement_get_ServerType,
11935 : .set = py_nbt_browse_host_announcement_set_ServerType,
11936 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
11937 : },
11938 : {
11939 : .name = discard_const_p(char, "BroMajorVer"),
11940 : .get = py_nbt_browse_host_announcement_get_BroMajorVer,
11941 : .set = py_nbt_browse_host_announcement_set_BroMajorVer,
11942 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11943 : },
11944 : {
11945 : .name = discard_const_p(char, "BroMinorVer"),
11946 : .get = py_nbt_browse_host_announcement_get_BroMinorVer,
11947 : .set = py_nbt_browse_host_announcement_set_BroMinorVer,
11948 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11949 : },
11950 : {
11951 : .name = discard_const_p(char, "Signature"),
11952 : .get = py_nbt_browse_host_announcement_get_Signature,
11953 : .set = py_nbt_browse_host_announcement_set_Signature,
11954 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11955 : },
11956 : {
11957 : .name = discard_const_p(char, "Comment"),
11958 : .get = py_nbt_browse_host_announcement_get_Comment,
11959 : .set = py_nbt_browse_host_announcement_set_Comment,
11960 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11961 : },
11962 : { .name = NULL }
11963 : };
11964 :
11965 0 : static PyObject *py_nbt_browse_host_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11966 : {
11967 0 : return pytalloc_new(struct nbt_browse_host_announcement, type);
11968 : }
11969 :
11970 :
11971 : static PyTypeObject nbt_browse_host_announcement_Type = {
11972 : PyVarObject_HEAD_INIT(NULL, 0)
11973 : .tp_name = "nbt.browse_host_announcement",
11974 : .tp_getset = py_nbt_browse_host_announcement_getsetters,
11975 : .tp_methods = NULL,
11976 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11977 : .tp_new = py_nbt_browse_host_announcement_new,
11978 : };
11979 :
11980 :
11981 0 : static PyObject *py_nbt_browse_announcement_request_get_Unused(PyObject *obj, void *closure)
11982 : {
11983 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(obj);
11984 : PyObject *py_Unused;
11985 0 : py_Unused = PyLong_FromLong((uint16_t)object->Unused);
11986 0 : return py_Unused;
11987 : }
11988 :
11989 0 : static int py_nbt_browse_announcement_request_set_Unused(PyObject *py_obj, PyObject *value, void *closure)
11990 : {
11991 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(py_obj);
11992 0 : if (value == NULL) {
11993 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Unused");
11994 0 : return -1;
11995 : }
11996 : {
11997 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Unused));
11998 0 : if (PyLong_Check(value)) {
11999 : unsigned long long test_var;
12000 0 : test_var = PyLong_AsUnsignedLongLong(value);
12001 0 : if (PyErr_Occurred() != NULL) {
12002 0 : return -1;
12003 : }
12004 0 : if (test_var > uint_max) {
12005 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12006 : PyLong_Type.tp_name, uint_max, test_var);
12007 0 : return -1;
12008 : }
12009 0 : object->Unused = test_var;
12010 : } else {
12011 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12012 : PyLong_Type.tp_name);
12013 0 : return -1;
12014 : }
12015 : }
12016 0 : return 0;
12017 : }
12018 :
12019 0 : static PyObject *py_nbt_browse_announcement_request_get_ResponseName(PyObject *obj, void *closure)
12020 : {
12021 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(obj);
12022 : PyObject *py_ResponseName;
12023 0 : py_ResponseName = PyString_FromStringOrNULL(object->ResponseName);
12024 0 : return py_ResponseName;
12025 : }
12026 :
12027 0 : static int py_nbt_browse_announcement_request_set_ResponseName(PyObject *py_obj, PyObject *value, void *closure)
12028 : {
12029 0 : struct nbt_browse_announcement_request *object = (struct nbt_browse_announcement_request *)pytalloc_get_ptr(py_obj);
12030 0 : if (value == NULL) {
12031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ResponseName");
12032 0 : return -1;
12033 : }
12034 : {
12035 : const char *test_str;
12036 : const char *talloc_str;
12037 0 : PyObject *unicode = NULL;
12038 0 : if (PyUnicode_Check(value)) {
12039 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12040 0 : if (unicode == NULL) {
12041 0 : PyErr_NoMemory();
12042 0 : return -1;
12043 : }
12044 0 : test_str = PyBytes_AS_STRING(unicode);
12045 0 : } else if (PyBytes_Check(value)) {
12046 0 : test_str = PyBytes_AS_STRING(value);
12047 : } else {
12048 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12049 0 : return -1;
12050 : }
12051 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12052 0 : if (unicode != NULL) {
12053 0 : Py_DECREF(unicode);
12054 : }
12055 0 : if (talloc_str == NULL) {
12056 0 : PyErr_NoMemory();
12057 0 : return -1;
12058 : }
12059 0 : object->ResponseName = talloc_str;
12060 : }
12061 0 : return 0;
12062 : }
12063 :
12064 : static PyGetSetDef py_nbt_browse_announcement_request_getsetters[] = {
12065 : {
12066 : .name = discard_const_p(char, "Unused"),
12067 : .get = py_nbt_browse_announcement_request_get_Unused,
12068 : .set = py_nbt_browse_announcement_request_set_Unused,
12069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12070 : },
12071 : {
12072 : .name = discard_const_p(char, "ResponseName"),
12073 : .get = py_nbt_browse_announcement_request_get_ResponseName,
12074 : .set = py_nbt_browse_announcement_request_set_ResponseName,
12075 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12076 : },
12077 : { .name = NULL }
12078 : };
12079 :
12080 0 : static PyObject *py_nbt_browse_announcement_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12081 : {
12082 0 : return pytalloc_new(struct nbt_browse_announcement_request, type);
12083 : }
12084 :
12085 :
12086 : static PyTypeObject nbt_browse_announcement_request_Type = {
12087 : PyVarObject_HEAD_INIT(NULL, 0)
12088 : .tp_name = "nbt.browse_announcement_request",
12089 : .tp_getset = py_nbt_browse_announcement_request_getsetters,
12090 : .tp_methods = NULL,
12091 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12092 : .tp_new = py_nbt_browse_announcement_request_new,
12093 : };
12094 :
12095 :
12096 0 : static PyObject *py_nbt_browse_election_request_get_Version(PyObject *obj, void *closure)
12097 : {
12098 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12099 : PyObject *py_Version;
12100 0 : py_Version = PyLong_FromLong((uint16_t)object->Version);
12101 0 : return py_Version;
12102 : }
12103 :
12104 0 : static int py_nbt_browse_election_request_set_Version(PyObject *py_obj, PyObject *value, void *closure)
12105 : {
12106 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12107 0 : if (value == NULL) {
12108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Version");
12109 0 : return -1;
12110 : }
12111 : {
12112 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
12113 0 : if (PyLong_Check(value)) {
12114 : unsigned long long test_var;
12115 0 : test_var = PyLong_AsUnsignedLongLong(value);
12116 0 : if (PyErr_Occurred() != NULL) {
12117 0 : return -1;
12118 : }
12119 0 : if (test_var > uint_max) {
12120 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12121 : PyLong_Type.tp_name, uint_max, test_var);
12122 0 : return -1;
12123 : }
12124 0 : object->Version = test_var;
12125 : } else {
12126 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12127 : PyLong_Type.tp_name);
12128 0 : return -1;
12129 : }
12130 : }
12131 0 : return 0;
12132 : }
12133 :
12134 0 : static PyObject *py_nbt_browse_election_request_get_Criteria(PyObject *obj, void *closure)
12135 : {
12136 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12137 : PyObject *py_Criteria;
12138 0 : py_Criteria = PyLong_FromUnsignedLongLong((uint32_t)object->Criteria);
12139 0 : return py_Criteria;
12140 : }
12141 :
12142 0 : static int py_nbt_browse_election_request_set_Criteria(PyObject *py_obj, PyObject *value, void *closure)
12143 : {
12144 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12145 0 : if (value == NULL) {
12146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Criteria");
12147 0 : return -1;
12148 : }
12149 : {
12150 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Criteria));
12151 0 : if (PyLong_Check(value)) {
12152 : unsigned long long test_var;
12153 0 : test_var = PyLong_AsUnsignedLongLong(value);
12154 0 : if (PyErr_Occurred() != NULL) {
12155 0 : return -1;
12156 : }
12157 0 : if (test_var > uint_max) {
12158 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12159 : PyLong_Type.tp_name, uint_max, test_var);
12160 0 : return -1;
12161 : }
12162 0 : object->Criteria = test_var;
12163 : } else {
12164 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12165 : PyLong_Type.tp_name);
12166 0 : return -1;
12167 : }
12168 : }
12169 0 : return 0;
12170 : }
12171 :
12172 0 : static PyObject *py_nbt_browse_election_request_get_UpTime(PyObject *obj, void *closure)
12173 : {
12174 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12175 : PyObject *py_UpTime;
12176 0 : py_UpTime = PyLong_FromUnsignedLongLong((uint32_t)object->UpTime);
12177 0 : return py_UpTime;
12178 : }
12179 :
12180 0 : static int py_nbt_browse_election_request_set_UpTime(PyObject *py_obj, PyObject *value, void *closure)
12181 : {
12182 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12183 0 : if (value == NULL) {
12184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpTime");
12185 0 : return -1;
12186 : }
12187 : {
12188 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpTime));
12189 0 : if (PyLong_Check(value)) {
12190 : unsigned long long test_var;
12191 0 : test_var = PyLong_AsUnsignedLongLong(value);
12192 0 : if (PyErr_Occurred() != NULL) {
12193 0 : return -1;
12194 : }
12195 0 : if (test_var > uint_max) {
12196 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12197 : PyLong_Type.tp_name, uint_max, test_var);
12198 0 : return -1;
12199 : }
12200 0 : object->UpTime = test_var;
12201 : } else {
12202 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12203 : PyLong_Type.tp_name);
12204 0 : return -1;
12205 : }
12206 : }
12207 0 : return 0;
12208 : }
12209 :
12210 0 : static PyObject *py_nbt_browse_election_request_get_Reserved(PyObject *obj, void *closure)
12211 : {
12212 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12213 : PyObject *py_Reserved;
12214 0 : py_Reserved = PyLong_FromUnsignedLongLong((uint32_t)object->Reserved);
12215 0 : return py_Reserved;
12216 : }
12217 :
12218 0 : static int py_nbt_browse_election_request_set_Reserved(PyObject *py_obj, PyObject *value, void *closure)
12219 : {
12220 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12221 0 : if (value == NULL) {
12222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Reserved");
12223 0 : return -1;
12224 : }
12225 : {
12226 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved));
12227 0 : if (PyLong_Check(value)) {
12228 : unsigned long long test_var;
12229 0 : test_var = PyLong_AsUnsignedLongLong(value);
12230 0 : if (PyErr_Occurred() != NULL) {
12231 0 : return -1;
12232 : }
12233 0 : if (test_var > uint_max) {
12234 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12235 : PyLong_Type.tp_name, uint_max, test_var);
12236 0 : return -1;
12237 : }
12238 0 : object->Reserved = test_var;
12239 : } else {
12240 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12241 : PyLong_Type.tp_name);
12242 0 : return -1;
12243 : }
12244 : }
12245 0 : return 0;
12246 : }
12247 :
12248 0 : static PyObject *py_nbt_browse_election_request_get_ServerName(PyObject *obj, void *closure)
12249 : {
12250 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(obj);
12251 : PyObject *py_ServerName;
12252 0 : py_ServerName = PyString_FromStringOrNULL(object->ServerName);
12253 0 : return py_ServerName;
12254 : }
12255 :
12256 0 : static int py_nbt_browse_election_request_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
12257 : {
12258 0 : struct nbt_browse_election_request *object = (struct nbt_browse_election_request *)pytalloc_get_ptr(py_obj);
12259 0 : if (value == NULL) {
12260 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
12261 0 : return -1;
12262 : }
12263 : {
12264 : const char *test_str;
12265 : const char *talloc_str;
12266 0 : PyObject *unicode = NULL;
12267 0 : if (PyUnicode_Check(value)) {
12268 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12269 0 : if (unicode == NULL) {
12270 0 : PyErr_NoMemory();
12271 0 : return -1;
12272 : }
12273 0 : test_str = PyBytes_AS_STRING(unicode);
12274 0 : } else if (PyBytes_Check(value)) {
12275 0 : test_str = PyBytes_AS_STRING(value);
12276 : } else {
12277 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12278 0 : return -1;
12279 : }
12280 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12281 0 : if (unicode != NULL) {
12282 0 : Py_DECREF(unicode);
12283 : }
12284 0 : if (talloc_str == NULL) {
12285 0 : PyErr_NoMemory();
12286 0 : return -1;
12287 : }
12288 0 : object->ServerName = talloc_str;
12289 : }
12290 0 : return 0;
12291 : }
12292 :
12293 : static PyGetSetDef py_nbt_browse_election_request_getsetters[] = {
12294 : {
12295 : .name = discard_const_p(char, "Version"),
12296 : .get = py_nbt_browse_election_request_get_Version,
12297 : .set = py_nbt_browse_election_request_set_Version,
12298 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12299 : },
12300 : {
12301 : .name = discard_const_p(char, "Criteria"),
12302 : .get = py_nbt_browse_election_request_get_Criteria,
12303 : .set = py_nbt_browse_election_request_set_Criteria,
12304 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12305 : },
12306 : {
12307 : .name = discard_const_p(char, "UpTime"),
12308 : .get = py_nbt_browse_election_request_get_UpTime,
12309 : .set = py_nbt_browse_election_request_set_UpTime,
12310 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12311 : },
12312 : {
12313 : .name = discard_const_p(char, "Reserved"),
12314 : .get = py_nbt_browse_election_request_get_Reserved,
12315 : .set = py_nbt_browse_election_request_set_Reserved,
12316 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12317 : },
12318 : {
12319 : .name = discard_const_p(char, "ServerName"),
12320 : .get = py_nbt_browse_election_request_get_ServerName,
12321 : .set = py_nbt_browse_election_request_set_ServerName,
12322 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12323 : },
12324 : { .name = NULL }
12325 : };
12326 :
12327 0 : static PyObject *py_nbt_browse_election_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12328 : {
12329 0 : return pytalloc_new(struct nbt_browse_election_request, type);
12330 : }
12331 :
12332 :
12333 : static PyTypeObject nbt_browse_election_request_Type = {
12334 : PyVarObject_HEAD_INIT(NULL, 0)
12335 : .tp_name = "nbt.browse_election_request",
12336 : .tp_getset = py_nbt_browse_election_request_getsetters,
12337 : .tp_methods = NULL,
12338 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12339 : .tp_new = py_nbt_browse_election_request_new,
12340 : };
12341 :
12342 :
12343 0 : static PyObject *py_nbt_browse_backup_list_request_get_ReqCount(PyObject *obj, void *closure)
12344 : {
12345 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(obj);
12346 : PyObject *py_ReqCount;
12347 0 : py_ReqCount = PyLong_FromLong((uint16_t)object->ReqCount);
12348 0 : return py_ReqCount;
12349 : }
12350 :
12351 0 : static int py_nbt_browse_backup_list_request_set_ReqCount(PyObject *py_obj, PyObject *value, void *closure)
12352 : {
12353 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(py_obj);
12354 0 : if (value == NULL) {
12355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ReqCount");
12356 0 : return -1;
12357 : }
12358 : {
12359 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReqCount));
12360 0 : if (PyLong_Check(value)) {
12361 : unsigned long long test_var;
12362 0 : test_var = PyLong_AsUnsignedLongLong(value);
12363 0 : if (PyErr_Occurred() != NULL) {
12364 0 : return -1;
12365 : }
12366 0 : if (test_var > uint_max) {
12367 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12368 : PyLong_Type.tp_name, uint_max, test_var);
12369 0 : return -1;
12370 : }
12371 0 : object->ReqCount = test_var;
12372 : } else {
12373 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12374 : PyLong_Type.tp_name);
12375 0 : return -1;
12376 : }
12377 : }
12378 0 : return 0;
12379 : }
12380 :
12381 0 : static PyObject *py_nbt_browse_backup_list_request_get_Token(PyObject *obj, void *closure)
12382 : {
12383 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(obj);
12384 : PyObject *py_Token;
12385 0 : py_Token = PyLong_FromUnsignedLongLong((uint32_t)object->Token);
12386 0 : return py_Token;
12387 : }
12388 :
12389 0 : static int py_nbt_browse_backup_list_request_set_Token(PyObject *py_obj, PyObject *value, void *closure)
12390 : {
12391 0 : struct nbt_browse_backup_list_request *object = (struct nbt_browse_backup_list_request *)pytalloc_get_ptr(py_obj);
12392 0 : if (value == NULL) {
12393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Token");
12394 0 : return -1;
12395 : }
12396 : {
12397 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Token));
12398 0 : if (PyLong_Check(value)) {
12399 : unsigned long long test_var;
12400 0 : test_var = PyLong_AsUnsignedLongLong(value);
12401 0 : if (PyErr_Occurred() != NULL) {
12402 0 : return -1;
12403 : }
12404 0 : if (test_var > uint_max) {
12405 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12406 : PyLong_Type.tp_name, uint_max, test_var);
12407 0 : return -1;
12408 : }
12409 0 : object->Token = test_var;
12410 : } else {
12411 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12412 : PyLong_Type.tp_name);
12413 0 : return -1;
12414 : }
12415 : }
12416 0 : return 0;
12417 : }
12418 :
12419 : static PyGetSetDef py_nbt_browse_backup_list_request_getsetters[] = {
12420 : {
12421 : .name = discard_const_p(char, "ReqCount"),
12422 : .get = py_nbt_browse_backup_list_request_get_ReqCount,
12423 : .set = py_nbt_browse_backup_list_request_set_ReqCount,
12424 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12425 : },
12426 : {
12427 : .name = discard_const_p(char, "Token"),
12428 : .get = py_nbt_browse_backup_list_request_get_Token,
12429 : .set = py_nbt_browse_backup_list_request_set_Token,
12430 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12431 : },
12432 : { .name = NULL }
12433 : };
12434 :
12435 0 : static PyObject *py_nbt_browse_backup_list_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12436 : {
12437 0 : return pytalloc_new(struct nbt_browse_backup_list_request, type);
12438 : }
12439 :
12440 :
12441 : static PyTypeObject nbt_browse_backup_list_request_Type = {
12442 : PyVarObject_HEAD_INIT(NULL, 0)
12443 : .tp_name = "nbt.browse_backup_list_request",
12444 : .tp_getset = py_nbt_browse_backup_list_request_getsetters,
12445 : .tp_methods = NULL,
12446 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12447 : .tp_new = py_nbt_browse_backup_list_request_new,
12448 : };
12449 :
12450 :
12451 0 : static PyObject *py_nbt_browse_backup_list_response_get_BackupCount(PyObject *obj, void *closure)
12452 : {
12453 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(obj);
12454 : PyObject *py_BackupCount;
12455 0 : py_BackupCount = PyLong_FromLong((uint16_t)object->BackupCount);
12456 0 : return py_BackupCount;
12457 : }
12458 :
12459 0 : static int py_nbt_browse_backup_list_response_set_BackupCount(PyObject *py_obj, PyObject *value, void *closure)
12460 : {
12461 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(py_obj);
12462 0 : if (value == NULL) {
12463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BackupCount");
12464 0 : return -1;
12465 : }
12466 : {
12467 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BackupCount));
12468 0 : if (PyLong_Check(value)) {
12469 : unsigned long long test_var;
12470 0 : test_var = PyLong_AsUnsignedLongLong(value);
12471 0 : if (PyErr_Occurred() != NULL) {
12472 0 : return -1;
12473 : }
12474 0 : if (test_var > uint_max) {
12475 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12476 : PyLong_Type.tp_name, uint_max, test_var);
12477 0 : return -1;
12478 : }
12479 0 : object->BackupCount = test_var;
12480 : } else {
12481 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12482 : PyLong_Type.tp_name);
12483 0 : return -1;
12484 : }
12485 : }
12486 0 : return 0;
12487 : }
12488 :
12489 0 : static PyObject *py_nbt_browse_backup_list_response_get_Token(PyObject *obj, void *closure)
12490 : {
12491 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(obj);
12492 : PyObject *py_Token;
12493 0 : py_Token = PyLong_FromUnsignedLongLong((uint32_t)object->Token);
12494 0 : return py_Token;
12495 : }
12496 :
12497 0 : static int py_nbt_browse_backup_list_response_set_Token(PyObject *py_obj, PyObject *value, void *closure)
12498 : {
12499 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(py_obj);
12500 0 : if (value == NULL) {
12501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Token");
12502 0 : return -1;
12503 : }
12504 : {
12505 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Token));
12506 0 : if (PyLong_Check(value)) {
12507 : unsigned long long test_var;
12508 0 : test_var = PyLong_AsUnsignedLongLong(value);
12509 0 : if (PyErr_Occurred() != NULL) {
12510 0 : return -1;
12511 : }
12512 0 : if (test_var > uint_max) {
12513 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12514 : PyLong_Type.tp_name, uint_max, test_var);
12515 0 : return -1;
12516 : }
12517 0 : object->Token = test_var;
12518 : } else {
12519 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12520 : PyLong_Type.tp_name);
12521 0 : return -1;
12522 : }
12523 : }
12524 0 : return 0;
12525 : }
12526 :
12527 0 : static PyObject *py_nbt_browse_backup_list_response_get_BackupServerList(PyObject *obj, void *closure)
12528 : {
12529 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(obj);
12530 : PyObject *py_BackupServerList;
12531 0 : py_BackupServerList = PyList_New(object->BackupCount);
12532 0 : if (py_BackupServerList == NULL) {
12533 0 : return NULL;
12534 : }
12535 : {
12536 : int BackupServerList_cntr_0;
12537 0 : for (BackupServerList_cntr_0 = 0; BackupServerList_cntr_0 < (object->BackupCount); BackupServerList_cntr_0++) {
12538 : PyObject *py_BackupServerList_0;
12539 0 : py_BackupServerList_0 = pytalloc_reference_ex(&nbt_name_Type, object->BackupServerList, &object->BackupServerList[BackupServerList_cntr_0]);
12540 0 : PyList_SetItem(py_BackupServerList, BackupServerList_cntr_0, py_BackupServerList_0);
12541 : }
12542 : }
12543 0 : return py_BackupServerList;
12544 : }
12545 :
12546 0 : static int py_nbt_browse_backup_list_response_set_BackupServerList(PyObject *py_obj, PyObject *value, void *closure)
12547 : {
12548 0 : struct nbt_browse_backup_list_response *object = (struct nbt_browse_backup_list_response *)pytalloc_get_ptr(py_obj);
12549 0 : if (value == NULL) {
12550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BackupServerList");
12551 0 : return -1;
12552 : }
12553 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12554 : {
12555 : int BackupServerList_cntr_0;
12556 0 : object->BackupServerList = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->BackupServerList, PyList_GET_SIZE(value));
12557 0 : if (!object->BackupServerList) { return -1;; }
12558 0 : talloc_set_name_const(object->BackupServerList, "ARRAY: object->BackupServerList");
12559 0 : for (BackupServerList_cntr_0 = 0; BackupServerList_cntr_0 < PyList_GET_SIZE(value); BackupServerList_cntr_0++) {
12560 0 : if (PyList_GET_ITEM(value, BackupServerList_cntr_0) == NULL) {
12561 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BackupServerList[BackupServerList_cntr_0]");
12562 0 : return -1;
12563 : }
12564 0 : PY_CHECK_TYPE(&nbt_name_Type, PyList_GET_ITEM(value, BackupServerList_cntr_0), return -1;);
12565 0 : if (talloc_reference(object->BackupServerList, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, BackupServerList_cntr_0))) == NULL) {
12566 0 : PyErr_NoMemory();
12567 0 : return -1;
12568 : }
12569 0 : object->BackupServerList[BackupServerList_cntr_0] = *(struct nbt_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, BackupServerList_cntr_0));
12570 : }
12571 : }
12572 0 : return 0;
12573 : }
12574 :
12575 : static PyGetSetDef py_nbt_browse_backup_list_response_getsetters[] = {
12576 : {
12577 : .name = discard_const_p(char, "BackupCount"),
12578 : .get = py_nbt_browse_backup_list_response_get_BackupCount,
12579 : .set = py_nbt_browse_backup_list_response_set_BackupCount,
12580 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12581 : },
12582 : {
12583 : .name = discard_const_p(char, "Token"),
12584 : .get = py_nbt_browse_backup_list_response_get_Token,
12585 : .set = py_nbt_browse_backup_list_response_set_Token,
12586 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12587 : },
12588 : {
12589 : .name = discard_const_p(char, "BackupServerList"),
12590 : .get = py_nbt_browse_backup_list_response_get_BackupServerList,
12591 : .set = py_nbt_browse_backup_list_response_set_BackupServerList,
12592 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
12593 : },
12594 : { .name = NULL }
12595 : };
12596 :
12597 0 : static PyObject *py_nbt_browse_backup_list_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12598 : {
12599 0 : return pytalloc_new(struct nbt_browse_backup_list_response, type);
12600 : }
12601 :
12602 :
12603 : static PyTypeObject nbt_browse_backup_list_response_Type = {
12604 : PyVarObject_HEAD_INIT(NULL, 0)
12605 : .tp_name = "nbt.browse_backup_list_response",
12606 : .tp_getset = py_nbt_browse_backup_list_response_getsetters,
12607 : .tp_methods = NULL,
12608 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12609 : .tp_new = py_nbt_browse_backup_list_response_new,
12610 : };
12611 :
12612 :
12613 0 : static PyObject *py_nbt_browse_become_backup_get_BrowserName(PyObject *obj, void *closure)
12614 : {
12615 0 : struct nbt_browse_become_backup *object = (struct nbt_browse_become_backup *)pytalloc_get_ptr(obj);
12616 : PyObject *py_BrowserName;
12617 0 : py_BrowserName = PyString_FromStringOrNULL(object->BrowserName);
12618 0 : return py_BrowserName;
12619 : }
12620 :
12621 0 : static int py_nbt_browse_become_backup_set_BrowserName(PyObject *py_obj, PyObject *value, void *closure)
12622 : {
12623 0 : struct nbt_browse_become_backup *object = (struct nbt_browse_become_backup *)pytalloc_get_ptr(py_obj);
12624 0 : if (value == NULL) {
12625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BrowserName");
12626 0 : return -1;
12627 : }
12628 : {
12629 : const char *test_str;
12630 : const char *talloc_str;
12631 0 : PyObject *unicode = NULL;
12632 0 : if (PyUnicode_Check(value)) {
12633 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12634 0 : if (unicode == NULL) {
12635 0 : PyErr_NoMemory();
12636 0 : return -1;
12637 : }
12638 0 : test_str = PyBytes_AS_STRING(unicode);
12639 0 : } else if (PyBytes_Check(value)) {
12640 0 : test_str = PyBytes_AS_STRING(value);
12641 : } else {
12642 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12643 0 : return -1;
12644 : }
12645 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12646 0 : if (unicode != NULL) {
12647 0 : Py_DECREF(unicode);
12648 : }
12649 0 : if (talloc_str == NULL) {
12650 0 : PyErr_NoMemory();
12651 0 : return -1;
12652 : }
12653 0 : object->BrowserName = talloc_str;
12654 : }
12655 0 : return 0;
12656 : }
12657 :
12658 : static PyGetSetDef py_nbt_browse_become_backup_getsetters[] = {
12659 : {
12660 : .name = discard_const_p(char, "BrowserName"),
12661 : .get = py_nbt_browse_become_backup_get_BrowserName,
12662 : .set = py_nbt_browse_become_backup_set_BrowserName,
12663 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12664 : },
12665 : { .name = NULL }
12666 : };
12667 :
12668 0 : static PyObject *py_nbt_browse_become_backup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12669 : {
12670 0 : return pytalloc_new(struct nbt_browse_become_backup, type);
12671 : }
12672 :
12673 :
12674 : static PyTypeObject nbt_browse_become_backup_Type = {
12675 : PyVarObject_HEAD_INIT(NULL, 0)
12676 : .tp_name = "nbt.browse_become_backup",
12677 : .tp_getset = py_nbt_browse_become_backup_getsetters,
12678 : .tp_methods = NULL,
12679 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12680 : .tp_new = py_nbt_browse_become_backup_new,
12681 : };
12682 :
12683 :
12684 0 : static PyObject *py_nbt_browse_domain_announcement_get_UpdateCount(PyObject *obj, void *closure)
12685 : {
12686 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12687 : PyObject *py_UpdateCount;
12688 0 : py_UpdateCount = PyLong_FromLong((uint16_t)object->UpdateCount);
12689 0 : return py_UpdateCount;
12690 : }
12691 :
12692 0 : static int py_nbt_browse_domain_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
12693 : {
12694 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12695 0 : if (value == NULL) {
12696 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpdateCount");
12697 0 : return -1;
12698 : }
12699 : {
12700 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
12701 0 : if (PyLong_Check(value)) {
12702 : unsigned long long test_var;
12703 0 : test_var = PyLong_AsUnsignedLongLong(value);
12704 0 : if (PyErr_Occurred() != NULL) {
12705 0 : return -1;
12706 : }
12707 0 : if (test_var > uint_max) {
12708 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12709 : PyLong_Type.tp_name, uint_max, test_var);
12710 0 : return -1;
12711 : }
12712 0 : object->UpdateCount = test_var;
12713 : } else {
12714 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12715 : PyLong_Type.tp_name);
12716 0 : return -1;
12717 : }
12718 : }
12719 0 : return 0;
12720 : }
12721 :
12722 0 : static PyObject *py_nbt_browse_domain_announcement_get_Periodicity(PyObject *obj, void *closure)
12723 : {
12724 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12725 : PyObject *py_Periodicity;
12726 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)object->Periodicity);
12727 0 : return py_Periodicity;
12728 : }
12729 :
12730 0 : static int py_nbt_browse_domain_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
12731 : {
12732 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12733 0 : if (value == NULL) {
12734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Periodicity");
12735 0 : return -1;
12736 : }
12737 : {
12738 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
12739 0 : if (PyLong_Check(value)) {
12740 : unsigned long long test_var;
12741 0 : test_var = PyLong_AsUnsignedLongLong(value);
12742 0 : if (PyErr_Occurred() != NULL) {
12743 0 : return -1;
12744 : }
12745 0 : if (test_var > uint_max) {
12746 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12747 : PyLong_Type.tp_name, uint_max, test_var);
12748 0 : return -1;
12749 : }
12750 0 : object->Periodicity = test_var;
12751 : } else {
12752 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12753 : PyLong_Type.tp_name);
12754 0 : return -1;
12755 : }
12756 : }
12757 0 : return 0;
12758 : }
12759 :
12760 0 : static PyObject *py_nbt_browse_domain_announcement_get_ServerName(PyObject *obj, void *closure)
12761 : {
12762 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12763 : PyObject *py_ServerName;
12764 0 : if (object->ServerName == NULL) {
12765 0 : py_ServerName = Py_None;
12766 0 : Py_INCREF(py_ServerName);
12767 : } else {
12768 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
12769 : }
12770 0 : return py_ServerName;
12771 : }
12772 :
12773 0 : static int py_nbt_browse_domain_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
12774 : {
12775 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12776 0 : if (value == NULL) {
12777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
12778 0 : return -1;
12779 : }
12780 : {
12781 : const char *test_str;
12782 : const char *talloc_str;
12783 0 : PyObject *unicode = NULL;
12784 0 : if (PyUnicode_Check(value)) {
12785 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12786 0 : if (unicode == NULL) {
12787 0 : PyErr_NoMemory();
12788 0 : return -1;
12789 : }
12790 0 : test_str = PyBytes_AS_STRING(unicode);
12791 0 : } else if (PyBytes_Check(value)) {
12792 0 : test_str = PyBytes_AS_STRING(value);
12793 : } else {
12794 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12795 0 : return -1;
12796 : }
12797 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12798 0 : if (unicode != NULL) {
12799 0 : Py_DECREF(unicode);
12800 : }
12801 0 : if (talloc_str == NULL) {
12802 0 : PyErr_NoMemory();
12803 0 : return -1;
12804 : }
12805 0 : object->ServerName = talloc_str;
12806 : }
12807 0 : return 0;
12808 : }
12809 :
12810 0 : static PyObject *py_nbt_browse_domain_announcement_get_OSMajor(PyObject *obj, void *closure)
12811 : {
12812 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12813 : PyObject *py_OSMajor;
12814 0 : py_OSMajor = PyLong_FromLong((uint16_t)object->OSMajor);
12815 0 : return py_OSMajor;
12816 : }
12817 :
12818 0 : static int py_nbt_browse_domain_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
12819 : {
12820 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12821 0 : if (value == NULL) {
12822 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMajor");
12823 0 : return -1;
12824 : }
12825 : {
12826 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
12827 0 : if (PyLong_Check(value)) {
12828 : unsigned long long test_var;
12829 0 : test_var = PyLong_AsUnsignedLongLong(value);
12830 0 : if (PyErr_Occurred() != NULL) {
12831 0 : return -1;
12832 : }
12833 0 : if (test_var > uint_max) {
12834 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12835 : PyLong_Type.tp_name, uint_max, test_var);
12836 0 : return -1;
12837 : }
12838 0 : object->OSMajor = test_var;
12839 : } else {
12840 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12841 : PyLong_Type.tp_name);
12842 0 : return -1;
12843 : }
12844 : }
12845 0 : return 0;
12846 : }
12847 :
12848 0 : static PyObject *py_nbt_browse_domain_announcement_get_OSMinor(PyObject *obj, void *closure)
12849 : {
12850 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12851 : PyObject *py_OSMinor;
12852 0 : py_OSMinor = PyLong_FromLong((uint16_t)object->OSMinor);
12853 0 : return py_OSMinor;
12854 : }
12855 :
12856 0 : static int py_nbt_browse_domain_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
12857 : {
12858 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12859 0 : if (value == NULL) {
12860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMinor");
12861 0 : return -1;
12862 : }
12863 : {
12864 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
12865 0 : if (PyLong_Check(value)) {
12866 : unsigned long long test_var;
12867 0 : test_var = PyLong_AsUnsignedLongLong(value);
12868 0 : if (PyErr_Occurred() != NULL) {
12869 0 : return -1;
12870 : }
12871 0 : if (test_var > uint_max) {
12872 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12873 : PyLong_Type.tp_name, uint_max, test_var);
12874 0 : return -1;
12875 : }
12876 0 : object->OSMinor = test_var;
12877 : } else {
12878 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12879 : PyLong_Type.tp_name);
12880 0 : return -1;
12881 : }
12882 : }
12883 0 : return 0;
12884 : }
12885 :
12886 0 : static PyObject *py_nbt_browse_domain_announcement_get_ServerType(PyObject *obj, void *closure)
12887 : {
12888 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12889 : PyObject *py_ServerType;
12890 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)object->ServerType);
12891 0 : return py_ServerType;
12892 : }
12893 :
12894 0 : static int py_nbt_browse_domain_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
12895 : {
12896 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12897 0 : if (value == NULL) {
12898 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerType");
12899 0 : return -1;
12900 : }
12901 : {
12902 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
12903 0 : if (PyLong_Check(value)) {
12904 : unsigned long long test_var;
12905 0 : test_var = PyLong_AsUnsignedLongLong(value);
12906 0 : if (PyErr_Occurred() != NULL) {
12907 0 : return -1;
12908 : }
12909 0 : if (test_var > uint_max) {
12910 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12911 : PyLong_Type.tp_name, uint_max, test_var);
12912 0 : return -1;
12913 : }
12914 0 : object->ServerType = test_var;
12915 : } else {
12916 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12917 : PyLong_Type.tp_name);
12918 0 : return -1;
12919 : }
12920 : }
12921 0 : return 0;
12922 : }
12923 :
12924 0 : static PyObject *py_nbt_browse_domain_announcement_get_MysteriousField(PyObject *obj, void *closure)
12925 : {
12926 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12927 : PyObject *py_MysteriousField;
12928 0 : py_MysteriousField = PyLong_FromUnsignedLongLong((uint32_t)object->MysteriousField);
12929 0 : return py_MysteriousField;
12930 : }
12931 :
12932 0 : static int py_nbt_browse_domain_announcement_set_MysteriousField(PyObject *py_obj, PyObject *value, void *closure)
12933 : {
12934 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12935 0 : if (value == NULL) {
12936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MysteriousField");
12937 0 : return -1;
12938 : }
12939 : {
12940 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MysteriousField));
12941 0 : if (PyLong_Check(value)) {
12942 : unsigned long long test_var;
12943 0 : test_var = PyLong_AsUnsignedLongLong(value);
12944 0 : if (PyErr_Occurred() != NULL) {
12945 0 : return -1;
12946 : }
12947 0 : if (test_var > uint_max) {
12948 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12949 : PyLong_Type.tp_name, uint_max, test_var);
12950 0 : return -1;
12951 : }
12952 0 : object->MysteriousField = test_var;
12953 : } else {
12954 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12955 : PyLong_Type.tp_name);
12956 0 : return -1;
12957 : }
12958 : }
12959 0 : return 0;
12960 : }
12961 :
12962 0 : static PyObject *py_nbt_browse_domain_announcement_get_Comment(PyObject *obj, void *closure)
12963 : {
12964 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(obj);
12965 : PyObject *py_Comment;
12966 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
12967 0 : return py_Comment;
12968 : }
12969 :
12970 0 : static int py_nbt_browse_domain_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
12971 : {
12972 0 : struct nbt_browse_domain_announcement *object = (struct nbt_browse_domain_announcement *)pytalloc_get_ptr(py_obj);
12973 0 : if (value == NULL) {
12974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Comment");
12975 0 : return -1;
12976 : }
12977 : {
12978 : const char *test_str;
12979 : const char *talloc_str;
12980 0 : PyObject *unicode = NULL;
12981 0 : if (PyUnicode_Check(value)) {
12982 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12983 0 : if (unicode == NULL) {
12984 0 : PyErr_NoMemory();
12985 0 : return -1;
12986 : }
12987 0 : test_str = PyBytes_AS_STRING(unicode);
12988 0 : } else if (PyBytes_Check(value)) {
12989 0 : test_str = PyBytes_AS_STRING(value);
12990 : } else {
12991 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12992 0 : return -1;
12993 : }
12994 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12995 0 : if (unicode != NULL) {
12996 0 : Py_DECREF(unicode);
12997 : }
12998 0 : if (talloc_str == NULL) {
12999 0 : PyErr_NoMemory();
13000 0 : return -1;
13001 : }
13002 0 : object->Comment = talloc_str;
13003 : }
13004 0 : return 0;
13005 : }
13006 :
13007 : static PyGetSetDef py_nbt_browse_domain_announcement_getsetters[] = {
13008 : {
13009 : .name = discard_const_p(char, "UpdateCount"),
13010 : .get = py_nbt_browse_domain_announcement_get_UpdateCount,
13011 : .set = py_nbt_browse_domain_announcement_set_UpdateCount,
13012 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13013 : },
13014 : {
13015 : .name = discard_const_p(char, "Periodicity"),
13016 : .get = py_nbt_browse_domain_announcement_get_Periodicity,
13017 : .set = py_nbt_browse_domain_announcement_set_Periodicity,
13018 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13019 : },
13020 : {
13021 : .name = discard_const_p(char, "ServerName"),
13022 : .get = py_nbt_browse_domain_announcement_get_ServerName,
13023 : .set = py_nbt_browse_domain_announcement_set_ServerName,
13024 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13025 : },
13026 : {
13027 : .name = discard_const_p(char, "OSMajor"),
13028 : .get = py_nbt_browse_domain_announcement_get_OSMajor,
13029 : .set = py_nbt_browse_domain_announcement_set_OSMajor,
13030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13031 : },
13032 : {
13033 : .name = discard_const_p(char, "OSMinor"),
13034 : .get = py_nbt_browse_domain_announcement_get_OSMinor,
13035 : .set = py_nbt_browse_domain_announcement_set_OSMinor,
13036 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13037 : },
13038 : {
13039 : .name = discard_const_p(char, "ServerType"),
13040 : .get = py_nbt_browse_domain_announcement_get_ServerType,
13041 : .set = py_nbt_browse_domain_announcement_set_ServerType,
13042 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
13043 : },
13044 : {
13045 : .name = discard_const_p(char, "MysteriousField"),
13046 : .get = py_nbt_browse_domain_announcement_get_MysteriousField,
13047 : .set = py_nbt_browse_domain_announcement_set_MysteriousField,
13048 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13049 : },
13050 : {
13051 : .name = discard_const_p(char, "Comment"),
13052 : .get = py_nbt_browse_domain_announcement_get_Comment,
13053 : .set = py_nbt_browse_domain_announcement_set_Comment,
13054 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13055 : },
13056 : { .name = NULL }
13057 : };
13058 :
13059 0 : static PyObject *py_nbt_browse_domain_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13060 : {
13061 0 : return pytalloc_new(struct nbt_browse_domain_announcement, type);
13062 : }
13063 :
13064 :
13065 : static PyTypeObject nbt_browse_domain_announcement_Type = {
13066 : PyVarObject_HEAD_INIT(NULL, 0)
13067 : .tp_name = "nbt.browse_domain_announcement",
13068 : .tp_getset = py_nbt_browse_domain_announcement_getsetters,
13069 : .tp_methods = NULL,
13070 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13071 : .tp_new = py_nbt_browse_domain_announcement_new,
13072 : };
13073 :
13074 :
13075 0 : static PyObject *py_nbt_browse_master_announcement_get_ServerName(PyObject *obj, void *closure)
13076 : {
13077 0 : struct nbt_browse_master_announcement *object = (struct nbt_browse_master_announcement *)pytalloc_get_ptr(obj);
13078 : PyObject *py_ServerName;
13079 0 : py_ServerName = PyString_FromStringOrNULL(object->ServerName);
13080 0 : return py_ServerName;
13081 : }
13082 :
13083 0 : static int py_nbt_browse_master_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
13084 : {
13085 0 : struct nbt_browse_master_announcement *object = (struct nbt_browse_master_announcement *)pytalloc_get_ptr(py_obj);
13086 0 : if (value == NULL) {
13087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
13088 0 : return -1;
13089 : }
13090 : {
13091 : const char *test_str;
13092 : const char *talloc_str;
13093 0 : PyObject *unicode = NULL;
13094 0 : if (PyUnicode_Check(value)) {
13095 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13096 0 : if (unicode == NULL) {
13097 0 : PyErr_NoMemory();
13098 0 : return -1;
13099 : }
13100 0 : test_str = PyBytes_AS_STRING(unicode);
13101 0 : } else if (PyBytes_Check(value)) {
13102 0 : test_str = PyBytes_AS_STRING(value);
13103 : } else {
13104 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13105 0 : return -1;
13106 : }
13107 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13108 0 : if (unicode != NULL) {
13109 0 : Py_DECREF(unicode);
13110 : }
13111 0 : if (talloc_str == NULL) {
13112 0 : PyErr_NoMemory();
13113 0 : return -1;
13114 : }
13115 0 : object->ServerName = talloc_str;
13116 : }
13117 0 : return 0;
13118 : }
13119 :
13120 : static PyGetSetDef py_nbt_browse_master_announcement_getsetters[] = {
13121 : {
13122 : .name = discard_const_p(char, "ServerName"),
13123 : .get = py_nbt_browse_master_announcement_get_ServerName,
13124 : .set = py_nbt_browse_master_announcement_set_ServerName,
13125 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13126 : },
13127 : { .name = NULL }
13128 : };
13129 :
13130 0 : static PyObject *py_nbt_browse_master_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13131 : {
13132 0 : return pytalloc_new(struct nbt_browse_master_announcement, type);
13133 : }
13134 :
13135 :
13136 : static PyTypeObject nbt_browse_master_announcement_Type = {
13137 : PyVarObject_HEAD_INIT(NULL, 0)
13138 : .tp_name = "nbt.browse_master_announcement",
13139 : .tp_getset = py_nbt_browse_master_announcement_getsetters,
13140 : .tp_methods = NULL,
13141 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13142 : .tp_new = py_nbt_browse_master_announcement_new,
13143 : };
13144 :
13145 :
13146 0 : static PyObject *py_nbt_browse_reset_state_get_Command(PyObject *obj, void *closure)
13147 : {
13148 0 : struct nbt_browse_reset_state *object = (struct nbt_browse_reset_state *)pytalloc_get_ptr(obj);
13149 : PyObject *py_Command;
13150 0 : py_Command = PyLong_FromLong((uint16_t)object->Command);
13151 0 : return py_Command;
13152 : }
13153 :
13154 0 : static int py_nbt_browse_reset_state_set_Command(PyObject *py_obj, PyObject *value, void *closure)
13155 : {
13156 0 : struct nbt_browse_reset_state *object = (struct nbt_browse_reset_state *)pytalloc_get_ptr(py_obj);
13157 0 : if (value == NULL) {
13158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Command");
13159 0 : return -1;
13160 : }
13161 : {
13162 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Command));
13163 0 : if (PyLong_Check(value)) {
13164 : unsigned long long test_var;
13165 0 : test_var = PyLong_AsUnsignedLongLong(value);
13166 0 : if (PyErr_Occurred() != NULL) {
13167 0 : return -1;
13168 : }
13169 0 : if (test_var > uint_max) {
13170 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13171 : PyLong_Type.tp_name, uint_max, test_var);
13172 0 : return -1;
13173 : }
13174 0 : object->Command = test_var;
13175 : } else {
13176 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13177 : PyLong_Type.tp_name);
13178 0 : return -1;
13179 : }
13180 : }
13181 0 : return 0;
13182 : }
13183 :
13184 : static PyGetSetDef py_nbt_browse_reset_state_getsetters[] = {
13185 : {
13186 : .name = discard_const_p(char, "Command"),
13187 : .get = py_nbt_browse_reset_state_get_Command,
13188 : .set = py_nbt_browse_reset_state_set_Command,
13189 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13190 : },
13191 : { .name = NULL }
13192 : };
13193 :
13194 0 : static PyObject *py_nbt_browse_reset_state_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13195 : {
13196 0 : return pytalloc_new(struct nbt_browse_reset_state, type);
13197 : }
13198 :
13199 :
13200 : static PyTypeObject nbt_browse_reset_state_Type = {
13201 : PyVarObject_HEAD_INIT(NULL, 0)
13202 : .tp_name = "nbt.browse_reset_state",
13203 : .tp_getset = py_nbt_browse_reset_state_getsetters,
13204 : .tp_methods = NULL,
13205 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13206 : .tp_new = py_nbt_browse_reset_state_new,
13207 : };
13208 :
13209 :
13210 0 : static PyObject *py_nbt_browse_local_master_announcement_get_UpdateCount(PyObject *obj, void *closure)
13211 : {
13212 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13213 : PyObject *py_UpdateCount;
13214 0 : py_UpdateCount = PyLong_FromLong((uint16_t)object->UpdateCount);
13215 0 : return py_UpdateCount;
13216 : }
13217 :
13218 0 : static int py_nbt_browse_local_master_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
13219 : {
13220 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13221 0 : if (value == NULL) {
13222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->UpdateCount");
13223 0 : return -1;
13224 : }
13225 : {
13226 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
13227 0 : if (PyLong_Check(value)) {
13228 : unsigned long long test_var;
13229 0 : test_var = PyLong_AsUnsignedLongLong(value);
13230 0 : if (PyErr_Occurred() != NULL) {
13231 0 : return -1;
13232 : }
13233 0 : if (test_var > uint_max) {
13234 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13235 : PyLong_Type.tp_name, uint_max, test_var);
13236 0 : return -1;
13237 : }
13238 0 : object->UpdateCount = test_var;
13239 : } else {
13240 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13241 : PyLong_Type.tp_name);
13242 0 : return -1;
13243 : }
13244 : }
13245 0 : return 0;
13246 : }
13247 :
13248 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Periodicity(PyObject *obj, void *closure)
13249 : {
13250 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13251 : PyObject *py_Periodicity;
13252 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)object->Periodicity);
13253 0 : return py_Periodicity;
13254 : }
13255 :
13256 0 : static int py_nbt_browse_local_master_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
13257 : {
13258 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13259 0 : if (value == NULL) {
13260 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Periodicity");
13261 0 : return -1;
13262 : }
13263 : {
13264 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
13265 0 : if (PyLong_Check(value)) {
13266 : unsigned long long test_var;
13267 0 : test_var = PyLong_AsUnsignedLongLong(value);
13268 0 : if (PyErr_Occurred() != NULL) {
13269 0 : return -1;
13270 : }
13271 0 : if (test_var > uint_max) {
13272 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13273 : PyLong_Type.tp_name, uint_max, test_var);
13274 0 : return -1;
13275 : }
13276 0 : object->Periodicity = test_var;
13277 : } else {
13278 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13279 : PyLong_Type.tp_name);
13280 0 : return -1;
13281 : }
13282 : }
13283 0 : return 0;
13284 : }
13285 :
13286 0 : static PyObject *py_nbt_browse_local_master_announcement_get_ServerName(PyObject *obj, void *closure)
13287 : {
13288 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13289 : PyObject *py_ServerName;
13290 0 : if (object->ServerName == NULL) {
13291 0 : py_ServerName = Py_None;
13292 0 : Py_INCREF(py_ServerName);
13293 : } else {
13294 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
13295 : }
13296 0 : return py_ServerName;
13297 : }
13298 :
13299 0 : static int py_nbt_browse_local_master_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
13300 : {
13301 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13302 0 : if (value == NULL) {
13303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerName");
13304 0 : return -1;
13305 : }
13306 : {
13307 : const char *test_str;
13308 : const char *talloc_str;
13309 0 : PyObject *unicode = NULL;
13310 0 : if (PyUnicode_Check(value)) {
13311 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13312 0 : if (unicode == NULL) {
13313 0 : PyErr_NoMemory();
13314 0 : return -1;
13315 : }
13316 0 : test_str = PyBytes_AS_STRING(unicode);
13317 0 : } else if (PyBytes_Check(value)) {
13318 0 : test_str = PyBytes_AS_STRING(value);
13319 : } else {
13320 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13321 0 : return -1;
13322 : }
13323 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13324 0 : if (unicode != NULL) {
13325 0 : Py_DECREF(unicode);
13326 : }
13327 0 : if (talloc_str == NULL) {
13328 0 : PyErr_NoMemory();
13329 0 : return -1;
13330 : }
13331 0 : object->ServerName = talloc_str;
13332 : }
13333 0 : return 0;
13334 : }
13335 :
13336 0 : static PyObject *py_nbt_browse_local_master_announcement_get_OSMajor(PyObject *obj, void *closure)
13337 : {
13338 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13339 : PyObject *py_OSMajor;
13340 0 : py_OSMajor = PyLong_FromLong((uint16_t)object->OSMajor);
13341 0 : return py_OSMajor;
13342 : }
13343 :
13344 0 : static int py_nbt_browse_local_master_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
13345 : {
13346 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13347 0 : if (value == NULL) {
13348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMajor");
13349 0 : return -1;
13350 : }
13351 : {
13352 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
13353 0 : if (PyLong_Check(value)) {
13354 : unsigned long long test_var;
13355 0 : test_var = PyLong_AsUnsignedLongLong(value);
13356 0 : if (PyErr_Occurred() != NULL) {
13357 0 : return -1;
13358 : }
13359 0 : if (test_var > uint_max) {
13360 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13361 : PyLong_Type.tp_name, uint_max, test_var);
13362 0 : return -1;
13363 : }
13364 0 : object->OSMajor = test_var;
13365 : } else {
13366 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13367 : PyLong_Type.tp_name);
13368 0 : return -1;
13369 : }
13370 : }
13371 0 : return 0;
13372 : }
13373 :
13374 0 : static PyObject *py_nbt_browse_local_master_announcement_get_OSMinor(PyObject *obj, void *closure)
13375 : {
13376 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13377 : PyObject *py_OSMinor;
13378 0 : py_OSMinor = PyLong_FromLong((uint16_t)object->OSMinor);
13379 0 : return py_OSMinor;
13380 : }
13381 :
13382 0 : static int py_nbt_browse_local_master_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
13383 : {
13384 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13385 0 : if (value == NULL) {
13386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSMinor");
13387 0 : return -1;
13388 : }
13389 : {
13390 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
13391 0 : if (PyLong_Check(value)) {
13392 : unsigned long long test_var;
13393 0 : test_var = PyLong_AsUnsignedLongLong(value);
13394 0 : if (PyErr_Occurred() != NULL) {
13395 0 : return -1;
13396 : }
13397 0 : if (test_var > uint_max) {
13398 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13399 : PyLong_Type.tp_name, uint_max, test_var);
13400 0 : return -1;
13401 : }
13402 0 : object->OSMinor = test_var;
13403 : } else {
13404 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13405 : PyLong_Type.tp_name);
13406 0 : return -1;
13407 : }
13408 : }
13409 0 : return 0;
13410 : }
13411 :
13412 0 : static PyObject *py_nbt_browse_local_master_announcement_get_ServerType(PyObject *obj, void *closure)
13413 : {
13414 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13415 : PyObject *py_ServerType;
13416 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)object->ServerType);
13417 0 : return py_ServerType;
13418 : }
13419 :
13420 0 : static int py_nbt_browse_local_master_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
13421 : {
13422 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13423 0 : if (value == NULL) {
13424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServerType");
13425 0 : return -1;
13426 : }
13427 : {
13428 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
13429 0 : if (PyLong_Check(value)) {
13430 : unsigned long long test_var;
13431 0 : test_var = PyLong_AsUnsignedLongLong(value);
13432 0 : if (PyErr_Occurred() != NULL) {
13433 0 : return -1;
13434 : }
13435 0 : if (test_var > uint_max) {
13436 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13437 : PyLong_Type.tp_name, uint_max, test_var);
13438 0 : return -1;
13439 : }
13440 0 : object->ServerType = test_var;
13441 : } else {
13442 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13443 : PyLong_Type.tp_name);
13444 0 : return -1;
13445 : }
13446 : }
13447 0 : return 0;
13448 : }
13449 :
13450 0 : static PyObject *py_nbt_browse_local_master_announcement_get_BroMajorVer(PyObject *obj, void *closure)
13451 : {
13452 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13453 : PyObject *py_BroMajorVer;
13454 0 : py_BroMajorVer = PyLong_FromLong((uint16_t)object->BroMajorVer);
13455 0 : return py_BroMajorVer;
13456 : }
13457 :
13458 0 : static int py_nbt_browse_local_master_announcement_set_BroMajorVer(PyObject *py_obj, PyObject *value, void *closure)
13459 : {
13460 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13461 0 : if (value == NULL) {
13462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMajorVer");
13463 0 : return -1;
13464 : }
13465 : {
13466 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMajorVer));
13467 0 : if (PyLong_Check(value)) {
13468 : unsigned long long test_var;
13469 0 : test_var = PyLong_AsUnsignedLongLong(value);
13470 0 : if (PyErr_Occurred() != NULL) {
13471 0 : return -1;
13472 : }
13473 0 : if (test_var > uint_max) {
13474 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13475 : PyLong_Type.tp_name, uint_max, test_var);
13476 0 : return -1;
13477 : }
13478 0 : object->BroMajorVer = test_var;
13479 : } else {
13480 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13481 : PyLong_Type.tp_name);
13482 0 : return -1;
13483 : }
13484 : }
13485 0 : return 0;
13486 : }
13487 :
13488 0 : static PyObject *py_nbt_browse_local_master_announcement_get_BroMinorVer(PyObject *obj, void *closure)
13489 : {
13490 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13491 : PyObject *py_BroMinorVer;
13492 0 : py_BroMinorVer = PyLong_FromLong((uint16_t)object->BroMinorVer);
13493 0 : return py_BroMinorVer;
13494 : }
13495 :
13496 0 : static int py_nbt_browse_local_master_announcement_set_BroMinorVer(PyObject *py_obj, PyObject *value, void *closure)
13497 : {
13498 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13499 0 : if (value == NULL) {
13500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BroMinorVer");
13501 0 : return -1;
13502 : }
13503 : {
13504 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMinorVer));
13505 0 : if (PyLong_Check(value)) {
13506 : unsigned long long test_var;
13507 0 : test_var = PyLong_AsUnsignedLongLong(value);
13508 0 : if (PyErr_Occurred() != NULL) {
13509 0 : return -1;
13510 : }
13511 0 : if (test_var > uint_max) {
13512 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13513 : PyLong_Type.tp_name, uint_max, test_var);
13514 0 : return -1;
13515 : }
13516 0 : object->BroMinorVer = test_var;
13517 : } else {
13518 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13519 : PyLong_Type.tp_name);
13520 0 : return -1;
13521 : }
13522 : }
13523 0 : return 0;
13524 : }
13525 :
13526 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Signature(PyObject *obj, void *closure)
13527 : {
13528 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13529 : PyObject *py_Signature;
13530 0 : py_Signature = PyLong_FromLong((uint16_t)object->Signature);
13531 0 : return py_Signature;
13532 : }
13533 :
13534 0 : static int py_nbt_browse_local_master_announcement_set_Signature(PyObject *py_obj, PyObject *value, void *closure)
13535 : {
13536 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13537 0 : if (value == NULL) {
13538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Signature");
13539 0 : return -1;
13540 : }
13541 : {
13542 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Signature));
13543 0 : if (PyLong_Check(value)) {
13544 : unsigned long long test_var;
13545 0 : test_var = PyLong_AsUnsignedLongLong(value);
13546 0 : if (PyErr_Occurred() != NULL) {
13547 0 : return -1;
13548 : }
13549 0 : if (test_var > uint_max) {
13550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13551 : PyLong_Type.tp_name, uint_max, test_var);
13552 0 : return -1;
13553 : }
13554 0 : object->Signature = test_var;
13555 : } else {
13556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13557 : PyLong_Type.tp_name);
13558 0 : return -1;
13559 : }
13560 : }
13561 0 : return 0;
13562 : }
13563 :
13564 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Comment(PyObject *obj, void *closure)
13565 : {
13566 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(obj);
13567 : PyObject *py_Comment;
13568 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
13569 0 : return py_Comment;
13570 : }
13571 :
13572 0 : static int py_nbt_browse_local_master_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
13573 : {
13574 0 : struct nbt_browse_local_master_announcement *object = (struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(py_obj);
13575 0 : if (value == NULL) {
13576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Comment");
13577 0 : return -1;
13578 : }
13579 : {
13580 : const char *test_str;
13581 : const char *talloc_str;
13582 0 : PyObject *unicode = NULL;
13583 0 : if (PyUnicode_Check(value)) {
13584 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13585 0 : if (unicode == NULL) {
13586 0 : PyErr_NoMemory();
13587 0 : return -1;
13588 : }
13589 0 : test_str = PyBytes_AS_STRING(unicode);
13590 0 : } else if (PyBytes_Check(value)) {
13591 0 : test_str = PyBytes_AS_STRING(value);
13592 : } else {
13593 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13594 0 : return -1;
13595 : }
13596 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13597 0 : if (unicode != NULL) {
13598 0 : Py_DECREF(unicode);
13599 : }
13600 0 : if (talloc_str == NULL) {
13601 0 : PyErr_NoMemory();
13602 0 : return -1;
13603 : }
13604 0 : object->Comment = talloc_str;
13605 : }
13606 0 : return 0;
13607 : }
13608 :
13609 : static PyGetSetDef py_nbt_browse_local_master_announcement_getsetters[] = {
13610 : {
13611 : .name = discard_const_p(char, "UpdateCount"),
13612 : .get = py_nbt_browse_local_master_announcement_get_UpdateCount,
13613 : .set = py_nbt_browse_local_master_announcement_set_UpdateCount,
13614 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13615 : },
13616 : {
13617 : .name = discard_const_p(char, "Periodicity"),
13618 : .get = py_nbt_browse_local_master_announcement_get_Periodicity,
13619 : .set = py_nbt_browse_local_master_announcement_set_Periodicity,
13620 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13621 : },
13622 : {
13623 : .name = discard_const_p(char, "ServerName"),
13624 : .get = py_nbt_browse_local_master_announcement_get_ServerName,
13625 : .set = py_nbt_browse_local_master_announcement_set_ServerName,
13626 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13627 : },
13628 : {
13629 : .name = discard_const_p(char, "OSMajor"),
13630 : .get = py_nbt_browse_local_master_announcement_get_OSMajor,
13631 : .set = py_nbt_browse_local_master_announcement_set_OSMajor,
13632 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13633 : },
13634 : {
13635 : .name = discard_const_p(char, "OSMinor"),
13636 : .get = py_nbt_browse_local_master_announcement_get_OSMinor,
13637 : .set = py_nbt_browse_local_master_announcement_set_OSMinor,
13638 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13639 : },
13640 : {
13641 : .name = discard_const_p(char, "ServerType"),
13642 : .get = py_nbt_browse_local_master_announcement_get_ServerType,
13643 : .set = py_nbt_browse_local_master_announcement_set_ServerType,
13644 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
13645 : },
13646 : {
13647 : .name = discard_const_p(char, "BroMajorVer"),
13648 : .get = py_nbt_browse_local_master_announcement_get_BroMajorVer,
13649 : .set = py_nbt_browse_local_master_announcement_set_BroMajorVer,
13650 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13651 : },
13652 : {
13653 : .name = discard_const_p(char, "BroMinorVer"),
13654 : .get = py_nbt_browse_local_master_announcement_get_BroMinorVer,
13655 : .set = py_nbt_browse_local_master_announcement_set_BroMinorVer,
13656 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13657 : },
13658 : {
13659 : .name = discard_const_p(char, "Signature"),
13660 : .get = py_nbt_browse_local_master_announcement_get_Signature,
13661 : .set = py_nbt_browse_local_master_announcement_set_Signature,
13662 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13663 : },
13664 : {
13665 : .name = discard_const_p(char, "Comment"),
13666 : .get = py_nbt_browse_local_master_announcement_get_Comment,
13667 : .set = py_nbt_browse_local_master_announcement_set_Comment,
13668 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13669 : },
13670 : { .name = NULL }
13671 : };
13672 :
13673 0 : static PyObject *py_nbt_browse_local_master_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13674 : {
13675 0 : return pytalloc_new(struct nbt_browse_local_master_announcement, type);
13676 : }
13677 :
13678 :
13679 : static PyTypeObject nbt_browse_local_master_announcement_Type = {
13680 : PyVarObject_HEAD_INIT(NULL, 0)
13681 : .tp_name = "nbt.browse_local_master_announcement",
13682 : .tp_getset = py_nbt_browse_local_master_announcement_getsetters,
13683 : .tp_methods = NULL,
13684 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13685 : .tp_new = py_nbt_browse_local_master_announcement_new,
13686 : };
13687 :
13688 0 : static PyObject *py_import_nbt_browse_payload(TALLOC_CTX *mem_ctx, int level, union nbt_browse_payload *in)
13689 : {
13690 : PyObject *ret;
13691 :
13692 0 : switch (level) {
13693 0 : case HostAnnouncement:
13694 0 : ret = pytalloc_reference_ex(&nbt_browse_host_announcement_Type, mem_ctx, &in->host_annoucement);
13695 0 : return ret;
13696 :
13697 0 : case AnnouncementRequest:
13698 0 : ret = pytalloc_reference_ex(&nbt_browse_announcement_request_Type, mem_ctx, &in->announcement_request);
13699 0 : return ret;
13700 :
13701 0 : case Election:
13702 0 : ret = pytalloc_reference_ex(&nbt_browse_election_request_Type, mem_ctx, &in->election_request);
13703 0 : return ret;
13704 :
13705 0 : case GetBackupListReq:
13706 0 : ret = pytalloc_reference_ex(&nbt_browse_backup_list_request_Type, mem_ctx, &in->backup_list_request);
13707 0 : return ret;
13708 :
13709 0 : case GetBackupListResp:
13710 0 : ret = pytalloc_reference_ex(&nbt_browse_backup_list_response_Type, mem_ctx, &in->backup_list_response);
13711 0 : return ret;
13712 :
13713 0 : case BecomeBackup:
13714 0 : ret = pytalloc_reference_ex(&nbt_browse_become_backup_Type, mem_ctx, &in->become_backup);
13715 0 : return ret;
13716 :
13717 0 : case DomainAnnouncement:
13718 0 : ret = pytalloc_reference_ex(&nbt_browse_domain_announcement_Type, mem_ctx, &in->domain_announcement);
13719 0 : return ret;
13720 :
13721 0 : case MasterAnnouncement:
13722 0 : ret = pytalloc_reference_ex(&nbt_browse_master_announcement_Type, mem_ctx, &in->master_announcement);
13723 0 : return ret;
13724 :
13725 0 : case ResetBrowserState:
13726 0 : ret = pytalloc_reference_ex(&nbt_browse_reset_state_Type, mem_ctx, &in->reset_browser_state);
13727 0 : return ret;
13728 :
13729 0 : case LocalMasterAnnouncement:
13730 0 : ret = pytalloc_reference_ex(&nbt_browse_local_master_announcement_Type, mem_ctx, &in->local_master_announcement);
13731 0 : return ret;
13732 :
13733 : }
13734 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
13735 0 : return NULL;
13736 : }
13737 :
13738 0 : static union nbt_browse_payload *py_export_nbt_browse_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in)
13739 : {
13740 0 : union nbt_browse_payload *ret = talloc_zero(mem_ctx, union nbt_browse_payload);
13741 0 : switch (level) {
13742 0 : case HostAnnouncement:
13743 0 : if (in == NULL) {
13744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->host_annoucement");
13745 0 : talloc_free(ret); return NULL;
13746 : }
13747 0 : PY_CHECK_TYPE(&nbt_browse_host_announcement_Type, in, talloc_free(ret); return NULL;);
13748 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13749 0 : PyErr_NoMemory();
13750 0 : talloc_free(ret); return NULL;
13751 : }
13752 0 : ret->host_annoucement = *(struct nbt_browse_host_announcement *)pytalloc_get_ptr(in);
13753 0 : break;
13754 :
13755 0 : case AnnouncementRequest:
13756 0 : if (in == NULL) {
13757 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->announcement_request");
13758 0 : talloc_free(ret); return NULL;
13759 : }
13760 0 : PY_CHECK_TYPE(&nbt_browse_announcement_request_Type, in, talloc_free(ret); return NULL;);
13761 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13762 0 : PyErr_NoMemory();
13763 0 : talloc_free(ret); return NULL;
13764 : }
13765 0 : ret->announcement_request = *(struct nbt_browse_announcement_request *)pytalloc_get_ptr(in);
13766 0 : break;
13767 :
13768 0 : case Election:
13769 0 : if (in == NULL) {
13770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->election_request");
13771 0 : talloc_free(ret); return NULL;
13772 : }
13773 0 : PY_CHECK_TYPE(&nbt_browse_election_request_Type, in, talloc_free(ret); return NULL;);
13774 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13775 0 : PyErr_NoMemory();
13776 0 : talloc_free(ret); return NULL;
13777 : }
13778 0 : ret->election_request = *(struct nbt_browse_election_request *)pytalloc_get_ptr(in);
13779 0 : break;
13780 :
13781 0 : case GetBackupListReq:
13782 0 : if (in == NULL) {
13783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->backup_list_request");
13784 0 : talloc_free(ret); return NULL;
13785 : }
13786 0 : PY_CHECK_TYPE(&nbt_browse_backup_list_request_Type, in, talloc_free(ret); return NULL;);
13787 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13788 0 : PyErr_NoMemory();
13789 0 : talloc_free(ret); return NULL;
13790 : }
13791 0 : ret->backup_list_request = *(struct nbt_browse_backup_list_request *)pytalloc_get_ptr(in);
13792 0 : break;
13793 :
13794 0 : case GetBackupListResp:
13795 0 : if (in == NULL) {
13796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->backup_list_response");
13797 0 : talloc_free(ret); return NULL;
13798 : }
13799 0 : PY_CHECK_TYPE(&nbt_browse_backup_list_response_Type, in, talloc_free(ret); return NULL;);
13800 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13801 0 : PyErr_NoMemory();
13802 0 : talloc_free(ret); return NULL;
13803 : }
13804 0 : ret->backup_list_response = *(struct nbt_browse_backup_list_response *)pytalloc_get_ptr(in);
13805 0 : break;
13806 :
13807 0 : case BecomeBackup:
13808 0 : if (in == NULL) {
13809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->become_backup");
13810 0 : talloc_free(ret); return NULL;
13811 : }
13812 0 : PY_CHECK_TYPE(&nbt_browse_become_backup_Type, in, talloc_free(ret); return NULL;);
13813 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13814 0 : PyErr_NoMemory();
13815 0 : talloc_free(ret); return NULL;
13816 : }
13817 0 : ret->become_backup = *(struct nbt_browse_become_backup *)pytalloc_get_ptr(in);
13818 0 : break;
13819 :
13820 0 : case DomainAnnouncement:
13821 0 : if (in == NULL) {
13822 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain_announcement");
13823 0 : talloc_free(ret); return NULL;
13824 : }
13825 0 : PY_CHECK_TYPE(&nbt_browse_domain_announcement_Type, in, talloc_free(ret); return NULL;);
13826 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13827 0 : PyErr_NoMemory();
13828 0 : talloc_free(ret); return NULL;
13829 : }
13830 0 : ret->domain_announcement = *(struct nbt_browse_domain_announcement *)pytalloc_get_ptr(in);
13831 0 : break;
13832 :
13833 0 : case MasterAnnouncement:
13834 0 : if (in == NULL) {
13835 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->master_announcement");
13836 0 : talloc_free(ret); return NULL;
13837 : }
13838 0 : PY_CHECK_TYPE(&nbt_browse_master_announcement_Type, in, talloc_free(ret); return NULL;);
13839 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13840 0 : PyErr_NoMemory();
13841 0 : talloc_free(ret); return NULL;
13842 : }
13843 0 : ret->master_announcement = *(struct nbt_browse_master_announcement *)pytalloc_get_ptr(in);
13844 0 : break;
13845 :
13846 0 : case ResetBrowserState:
13847 0 : if (in == NULL) {
13848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->reset_browser_state");
13849 0 : talloc_free(ret); return NULL;
13850 : }
13851 0 : PY_CHECK_TYPE(&nbt_browse_reset_state_Type, in, talloc_free(ret); return NULL;);
13852 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13853 0 : PyErr_NoMemory();
13854 0 : talloc_free(ret); return NULL;
13855 : }
13856 0 : ret->reset_browser_state = *(struct nbt_browse_reset_state *)pytalloc_get_ptr(in);
13857 0 : break;
13858 :
13859 0 : case LocalMasterAnnouncement:
13860 0 : if (in == NULL) {
13861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->local_master_announcement");
13862 0 : talloc_free(ret); return NULL;
13863 : }
13864 0 : PY_CHECK_TYPE(&nbt_browse_local_master_announcement_Type, in, talloc_free(ret); return NULL;);
13865 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13866 0 : PyErr_NoMemory();
13867 0 : talloc_free(ret); return NULL;
13868 : }
13869 0 : ret->local_master_announcement = *(struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(in);
13870 0 : break;
13871 :
13872 0 : default:
13873 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
13874 0 : talloc_free(ret);
13875 0 : ret = NULL;
13876 : }
13877 :
13878 0 : return ret;
13879 : }
13880 :
13881 0 : static PyObject *py_nbt_browse_payload_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13882 : {
13883 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13884 0 : PyObject *mem_ctx_obj = NULL;
13885 0 : TALLOC_CTX *mem_ctx = NULL;
13886 0 : int level = 0;
13887 0 : PyObject *in_obj = NULL;
13888 0 : union nbt_browse_payload *in = NULL;
13889 :
13890 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
13891 : discard_const_p(char *, kwnames),
13892 : &mem_ctx_obj,
13893 : &level,
13894 : &in_obj)) {
13895 0 : return NULL;
13896 : }
13897 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13898 0 : if (mem_ctx == NULL) {
13899 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13900 0 : return NULL;
13901 : }
13902 0 : in = (union nbt_browse_payload *)pytalloc_get_ptr(in_obj);
13903 0 : if (in == NULL) {
13904 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_browse_payload!");
13905 0 : return NULL;
13906 : }
13907 :
13908 0 : return py_import_nbt_browse_payload(mem_ctx, level, in);
13909 : }
13910 :
13911 0 : static PyObject *py_nbt_browse_payload_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13912 : {
13913 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13914 0 : PyObject *mem_ctx_obj = NULL;
13915 0 : TALLOC_CTX *mem_ctx = NULL;
13916 0 : int level = 0;
13917 0 : PyObject *in = NULL;
13918 0 : union nbt_browse_payload *out = NULL;
13919 :
13920 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
13921 : discard_const_p(char *, kwnames),
13922 : &mem_ctx_obj,
13923 : &level,
13924 : &in)) {
13925 0 : return NULL;
13926 : }
13927 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13928 0 : if (mem_ctx == NULL) {
13929 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13930 0 : return NULL;
13931 : }
13932 :
13933 0 : out = py_export_nbt_browse_payload(mem_ctx, level, in);
13934 0 : if (out == NULL) {
13935 0 : return NULL;
13936 : }
13937 :
13938 0 : return pytalloc_GenericObject_reference(out);
13939 : }
13940 :
13941 : static PyMethodDef py_nbt_browse_payload_methods[] = {
13942 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_payload_import),
13943 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13944 : "T.__import__(mem_ctx, level, in) => ret." },
13945 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_payload_export),
13946 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13947 : "T.__export__(mem_ctx, level, in) => ret." },
13948 : { NULL, NULL, 0, NULL }
13949 : };
13950 :
13951 0 : static PyObject *py_nbt_browse_payload_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13952 : {
13953 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
13954 0 : return NULL;
13955 : }
13956 :
13957 :
13958 : static PyTypeObject nbt_browse_payload_Type = {
13959 : PyVarObject_HEAD_INIT(NULL, 0)
13960 : .tp_name = "nbt.browse_payload",
13961 : .tp_getset = NULL,
13962 : .tp_methods = py_nbt_browse_payload_methods,
13963 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13964 : .tp_new = py_nbt_browse_payload_new,
13965 : };
13966 :
13967 :
13968 0 : static PyObject *py_nbt_browse_packet_get_opcode(PyObject *obj, void *closure)
13969 : {
13970 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(obj);
13971 : PyObject *py_opcode;
13972 0 : py_opcode = PyLong_FromLong((uint16_t)object->opcode);
13973 0 : return py_opcode;
13974 : }
13975 :
13976 0 : static int py_nbt_browse_packet_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
13977 : {
13978 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
13979 0 : if (value == NULL) {
13980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->opcode");
13981 0 : return -1;
13982 : }
13983 : {
13984 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
13985 0 : if (PyLong_Check(value)) {
13986 : unsigned long long test_var;
13987 0 : test_var = PyLong_AsUnsignedLongLong(value);
13988 0 : if (PyErr_Occurred() != NULL) {
13989 0 : return -1;
13990 : }
13991 0 : if (test_var > uint_max) {
13992 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13993 : PyLong_Type.tp_name, uint_max, test_var);
13994 0 : return -1;
13995 : }
13996 0 : object->opcode = test_var;
13997 : } else {
13998 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13999 : PyLong_Type.tp_name);
14000 0 : return -1;
14001 : }
14002 : }
14003 0 : return 0;
14004 : }
14005 :
14006 0 : static PyObject *py_nbt_browse_packet_get_payload(PyObject *obj, void *closure)
14007 : {
14008 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(obj);
14009 : PyObject *py_payload;
14010 0 : py_payload = pyrpc_import_union(&nbt_browse_payload_Type, pytalloc_get_mem_ctx(obj), object->opcode, &object->payload, "union nbt_browse_payload");
14011 0 : if (py_payload == NULL) {
14012 0 : return NULL;
14013 : }
14014 0 : return py_payload;
14015 : }
14016 :
14017 0 : static int py_nbt_browse_packet_set_payload(PyObject *py_obj, PyObject *value, void *closure)
14018 : {
14019 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14020 0 : if (value == NULL) {
14021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->payload");
14022 0 : return -1;
14023 : }
14024 : {
14025 : union nbt_browse_payload *payload_switch_0;
14026 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");
14027 0 : if (payload_switch_0 == NULL) {
14028 0 : return -1;
14029 : }
14030 0 : object->payload = *payload_switch_0;
14031 : }
14032 0 : return 0;
14033 : }
14034 :
14035 : static PyGetSetDef py_nbt_browse_packet_getsetters[] = {
14036 : {
14037 : .name = discard_const_p(char, "opcode"),
14038 : .get = py_nbt_browse_packet_get_opcode,
14039 : .set = py_nbt_browse_packet_set_opcode,
14040 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_browse_opcode")
14041 : },
14042 : {
14043 : .name = discard_const_p(char, "payload"),
14044 : .get = py_nbt_browse_packet_get_payload,
14045 : .set = py_nbt_browse_packet_set_payload,
14046 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_browse_payload")
14047 : },
14048 : { .name = NULL }
14049 : };
14050 :
14051 0 : static PyObject *py_nbt_browse_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14052 : {
14053 0 : return pytalloc_new(struct nbt_browse_packet, type);
14054 : }
14055 :
14056 0 : static PyObject *py_nbt_browse_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14057 : {
14058 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14059 0 : PyObject *ret = NULL;
14060 : DATA_BLOB blob;
14061 : enum ndr_err_code err;
14062 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
14063 0 : if (tmp_ctx == NULL) {
14064 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14065 0 : return NULL;
14066 : }
14067 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_browse_packet);
14068 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14069 0 : TALLOC_FREE(tmp_ctx);
14070 0 : PyErr_SetNdrError(err);
14071 0 : return NULL;
14072 : }
14073 :
14074 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14075 0 : TALLOC_FREE(tmp_ctx);
14076 0 : return ret;
14077 : }
14078 :
14079 0 : static PyObject *py_nbt_browse_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14080 : {
14081 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14082 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
14083 0 : Py_ssize_t blob_length = 0;
14084 : enum ndr_err_code err;
14085 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
14086 0 : PyObject *allow_remaining_obj = NULL;
14087 0 : bool allow_remaining = false;
14088 :
14089 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
14090 : discard_const_p(char *, kwnames),
14091 : &blob.data, &blob_length,
14092 : &allow_remaining_obj)) {
14093 0 : return NULL;
14094 : }
14095 0 : blob.length = blob_length;
14096 :
14097 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14098 0 : allow_remaining = true;
14099 : }
14100 :
14101 0 : if (allow_remaining) {
14102 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_browse_packet);
14103 : } else {
14104 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);
14105 : }
14106 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14107 0 : PyErr_SetNdrError(err);
14108 0 : return NULL;
14109 : }
14110 :
14111 0 : Py_RETURN_NONE;
14112 : }
14113 :
14114 0 : static PyObject *py_nbt_browse_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14115 : {
14116 0 : struct nbt_browse_packet *object = (struct nbt_browse_packet *)pytalloc_get_ptr(py_obj);
14117 : PyObject *ret;
14118 : char *retstr;
14119 :
14120 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);
14121 0 : ret = PyUnicode_FromString(retstr);
14122 0 : talloc_free(retstr);
14123 :
14124 0 : return ret;
14125 : }
14126 :
14127 : static PyMethodDef py_nbt_browse_packet_methods[] = {
14128 : { "__ndr_pack__", (PyCFunction)py_nbt_browse_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
14129 : { "__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" },
14130 : { "__ndr_print__", (PyCFunction)py_nbt_browse_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
14131 : { NULL, NULL, 0, NULL }
14132 : };
14133 :
14134 :
14135 : static PyTypeObject nbt_browse_packet_Type = {
14136 : PyVarObject_HEAD_INIT(NULL, 0)
14137 : .tp_name = "nbt.browse_packet",
14138 : .tp_getset = py_nbt_browse_packet_getsetters,
14139 : .tp_methods = py_nbt_browse_packet_methods,
14140 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14141 : .tp_new = py_nbt_browse_packet_new,
14142 : };
14143 :
14144 :
14145 : const struct PyNdrRpcMethodDef py_ndr_nbt_methods[] = {
14146 : {0}
14147 : };
14148 :
14149 0 : static PyObject *interface_nbt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14150 : {
14151 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_nbt);
14152 : }
14153 :
14154 : #define PY_DOC_NBT "NBT messages"
14155 : static PyTypeObject nbt_InterfaceType = {
14156 : PyVarObject_HEAD_INIT(NULL, 0)
14157 : .tp_name = "nbt.nbt",
14158 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
14159 : .tp_doc = "nbt(binding, lp_ctx=None, credentials=None) -> connection\n"
14160 : "\n"
14161 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
14162 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
14163 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_NBT,
14164 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14165 : .tp_new = interface_nbt_new,
14166 : };
14167 :
14168 0 : static PyObject *syntax_nbt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14169 : {
14170 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_nbt.syntax_id);
14171 : }
14172 :
14173 : #define PY_DOC_NBT_SYNTAX "NBT messages"
14174 : static PyTypeObject nbt_SyntaxType = {
14175 : PyVarObject_HEAD_INIT(NULL, 0)
14176 : .tp_name = "nbt.nbt_abstract_syntax",
14177 : .tp_doc = "nbt_abstract_syntax()\n"PY_DOC_NBT_SYNTAX,
14178 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14179 : .tp_new = syntax_nbt_new,
14180 : };
14181 :
14182 : static PyMethodDef nbt_methods[] = {
14183 : { NULL, NULL, 0, NULL }
14184 : };
14185 :
14186 : static struct PyModuleDef moduledef = {
14187 : PyModuleDef_HEAD_INIT,
14188 : .m_name = "nbt",
14189 : .m_doc = "nbt DCE/RPC",
14190 : .m_size = -1,
14191 : .m_methods = nbt_methods,
14192 : };
14193 2460 : MODULE_INIT_FUNC(nbt)
14194 : {
14195 2460 : PyObject *m = NULL;
14196 2460 : PyObject *dep_samba_dcerpc_misc = NULL;
14197 2460 : PyObject *dep_samba_dcerpc_security = NULL;
14198 2460 : PyObject *dep_talloc = NULL;
14199 2460 : PyObject *dep_samba_dcerpc_base = NULL;
14200 :
14201 2460 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
14202 2460 : if (dep_samba_dcerpc_misc == NULL)
14203 0 : goto out;
14204 :
14205 2460 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
14206 2460 : if (dep_samba_dcerpc_security == NULL)
14207 0 : goto out;
14208 :
14209 2460 : dep_talloc = PyImport_ImportModule("talloc");
14210 2460 : if (dep_talloc == NULL)
14211 0 : goto out;
14212 :
14213 2460 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
14214 2460 : if (dep_samba_dcerpc_base == NULL)
14215 0 : goto out;
14216 :
14217 2460 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
14218 2460 : if (BaseObject_Type == NULL)
14219 0 : goto out;
14220 :
14221 2460 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
14222 2460 : if (dom_sid_Type == NULL)
14223 0 : goto out;
14224 :
14225 2460 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
14226 2460 : if (GUID_Type == NULL)
14227 0 : goto out;
14228 :
14229 2460 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
14230 2460 : if (ClientConnection_Type == NULL)
14231 0 : goto out;
14232 :
14233 2460 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
14234 2460 : if (ndr_syntax_id_Type == NULL)
14235 0 : goto out;
14236 :
14237 2460 : nbt_name_Type.tp_base = BaseObject_Type;
14238 2460 : nbt_name_Type.tp_basicsize = pytalloc_BaseObject_size();
14239 :
14240 2460 : nbt_name_question_Type.tp_base = BaseObject_Type;
14241 2460 : nbt_name_question_Type.tp_basicsize = pytalloc_BaseObject_size();
14242 :
14243 2460 : nbt_rdata_address_Type.tp_base = BaseObject_Type;
14244 2460 : nbt_rdata_address_Type.tp_basicsize = pytalloc_BaseObject_size();
14245 :
14246 2460 : nbt_rdata_netbios_Type.tp_base = BaseObject_Type;
14247 2460 : nbt_rdata_netbios_Type.tp_basicsize = pytalloc_BaseObject_size();
14248 :
14249 2460 : nbt_statistics_Type.tp_base = BaseObject_Type;
14250 2460 : nbt_statistics_Type.tp_basicsize = pytalloc_BaseObject_size();
14251 :
14252 2460 : nbt_status_name_Type.tp_base = BaseObject_Type;
14253 2460 : nbt_status_name_Type.tp_basicsize = pytalloc_BaseObject_size();
14254 :
14255 2460 : nbt_rdata_status_Type.tp_base = BaseObject_Type;
14256 2460 : nbt_rdata_status_Type.tp_basicsize = pytalloc_BaseObject_size();
14257 :
14258 2460 : nbt_rdata_data_Type.tp_base = BaseObject_Type;
14259 2460 : nbt_rdata_data_Type.tp_basicsize = pytalloc_BaseObject_size();
14260 :
14261 2460 : nbt_rdata_Type.tp_base = BaseObject_Type;
14262 2460 : nbt_rdata_Type.tp_basicsize = pytalloc_BaseObject_size();
14263 :
14264 2460 : nbt_res_rec_Type.tp_base = BaseObject_Type;
14265 2460 : nbt_res_rec_Type.tp_basicsize = pytalloc_BaseObject_size();
14266 :
14267 2460 : nbt_name_packet_Type.tp_base = BaseObject_Type;
14268 2460 : nbt_name_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14269 :
14270 2460 : smb_trans_body_Type.tp_base = BaseObject_Type;
14271 2460 : smb_trans_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14272 :
14273 2460 : smb_body_Type.tp_base = BaseObject_Type;
14274 2460 : smb_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14275 :
14276 2460 : dgram_smb_packet_Type.tp_base = BaseObject_Type;
14277 2460 : dgram_smb_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14278 :
14279 2460 : dgram_message_body_Type.tp_base = BaseObject_Type;
14280 2460 : dgram_message_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14281 :
14282 2460 : dgram_message_Type.tp_base = BaseObject_Type;
14283 2460 : dgram_message_Type.tp_basicsize = pytalloc_BaseObject_size();
14284 :
14285 2460 : dgram_data_Type.tp_base = BaseObject_Type;
14286 2460 : dgram_data_Type.tp_basicsize = pytalloc_BaseObject_size();
14287 :
14288 2460 : nbt_dgram_packet_Type.tp_base = BaseObject_Type;
14289 2460 : nbt_dgram_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14290 :
14291 2460 : nbt_sockaddr_Type.tp_base = BaseObject_Type;
14292 2460 : nbt_sockaddr_Type.tp_basicsize = pytalloc_BaseObject_size();
14293 :
14294 2460 : NETLOGON_SAM_LOGON_REQUEST_Type.tp_base = BaseObject_Type;
14295 2460 : NETLOGON_SAM_LOGON_REQUEST_Type.tp_basicsize = pytalloc_BaseObject_size();
14296 :
14297 2460 : NETLOGON_LOGON_REQUEST_Type.tp_base = BaseObject_Type;
14298 2460 : NETLOGON_LOGON_REQUEST_Type.tp_basicsize = pytalloc_BaseObject_size();
14299 :
14300 2460 : NETLOGON_SAM_LOGON_RESPONSE_NT40_Type.tp_base = BaseObject_Type;
14301 2460 : NETLOGON_SAM_LOGON_RESPONSE_NT40_Type.tp_basicsize = pytalloc_BaseObject_size();
14302 :
14303 2460 : NETLOGON_SAM_LOGON_RESPONSE_Type.tp_base = BaseObject_Type;
14304 2460 : NETLOGON_SAM_LOGON_RESPONSE_Type.tp_basicsize = pytalloc_BaseObject_size();
14305 :
14306 2460 : NETLOGON_SAM_LOGON_RESPONSE_EX_Type.tp_base = BaseObject_Type;
14307 2460 : NETLOGON_SAM_LOGON_RESPONSE_EX_Type.tp_basicsize = pytalloc_BaseObject_size();
14308 :
14309 2460 : netlogon_samlogon_response_union_Type.tp_base = BaseObject_Type;
14310 2460 : netlogon_samlogon_response_union_Type.tp_basicsize = pytalloc_BaseObject_size();
14311 :
14312 2460 : netlogon_samlogon_response_Type.tp_base = BaseObject_Type;
14313 2460 : netlogon_samlogon_response_Type.tp_basicsize = pytalloc_BaseObject_size();
14314 :
14315 2460 : nbt_netlogon_query_for_pdc_Type.tp_base = BaseObject_Type;
14316 2460 : nbt_netlogon_query_for_pdc_Type.tp_basicsize = pytalloc_BaseObject_size();
14317 :
14318 2460 : nbt_netlogon_response_from_pdc_Type.tp_base = BaseObject_Type;
14319 2460 : nbt_netlogon_response_from_pdc_Type.tp_basicsize = pytalloc_BaseObject_size();
14320 :
14321 2460 : nbt_netlogon_response2_Type.tp_base = BaseObject_Type;
14322 2460 : nbt_netlogon_response2_Type.tp_basicsize = pytalloc_BaseObject_size();
14323 :
14324 2460 : nbt_db_change_info_Type.tp_base = BaseObject_Type;
14325 2460 : nbt_db_change_info_Type.tp_basicsize = pytalloc_BaseObject_size();
14326 :
14327 2460 : NETLOGON_DB_CHANGE_Type.tp_base = BaseObject_Type;
14328 2460 : NETLOGON_DB_CHANGE_Type.tp_basicsize = pytalloc_BaseObject_size();
14329 :
14330 2460 : nbt_netlogon_request_Type.tp_base = BaseObject_Type;
14331 2460 : nbt_netlogon_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14332 :
14333 2460 : nbt_netlogon_packet_Type.tp_base = BaseObject_Type;
14334 2460 : nbt_netlogon_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14335 :
14336 2460 : nbt_browse_host_announcement_Type.tp_base = BaseObject_Type;
14337 2460 : nbt_browse_host_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14338 :
14339 2460 : nbt_browse_announcement_request_Type.tp_base = BaseObject_Type;
14340 2460 : nbt_browse_announcement_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14341 :
14342 2460 : nbt_browse_election_request_Type.tp_base = BaseObject_Type;
14343 2460 : nbt_browse_election_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14344 :
14345 2460 : nbt_browse_backup_list_request_Type.tp_base = BaseObject_Type;
14346 2460 : nbt_browse_backup_list_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14347 :
14348 2460 : nbt_browse_backup_list_response_Type.tp_base = BaseObject_Type;
14349 2460 : nbt_browse_backup_list_response_Type.tp_basicsize = pytalloc_BaseObject_size();
14350 :
14351 2460 : nbt_browse_become_backup_Type.tp_base = BaseObject_Type;
14352 2460 : nbt_browse_become_backup_Type.tp_basicsize = pytalloc_BaseObject_size();
14353 :
14354 2460 : nbt_browse_domain_announcement_Type.tp_base = BaseObject_Type;
14355 2460 : nbt_browse_domain_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14356 :
14357 2460 : nbt_browse_master_announcement_Type.tp_base = BaseObject_Type;
14358 2460 : nbt_browse_master_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14359 :
14360 2460 : nbt_browse_reset_state_Type.tp_base = BaseObject_Type;
14361 2460 : nbt_browse_reset_state_Type.tp_basicsize = pytalloc_BaseObject_size();
14362 :
14363 2460 : nbt_browse_local_master_announcement_Type.tp_base = BaseObject_Type;
14364 2460 : nbt_browse_local_master_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14365 :
14366 2460 : nbt_browse_payload_Type.tp_base = BaseObject_Type;
14367 2460 : nbt_browse_payload_Type.tp_basicsize = pytalloc_BaseObject_size();
14368 :
14369 2460 : nbt_browse_packet_Type.tp_base = BaseObject_Type;
14370 2460 : nbt_browse_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14371 :
14372 2460 : nbt_InterfaceType.tp_base = ClientConnection_Type;
14373 :
14374 2460 : nbt_SyntaxType.tp_base = ndr_syntax_id_Type;
14375 2460 : nbt_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
14376 :
14377 2460 : if (PyType_Ready(&nbt_name_Type) < 0)
14378 0 : goto out;
14379 2460 : if (PyType_Ready(&nbt_name_question_Type) < 0)
14380 0 : goto out;
14381 2460 : if (PyType_Ready(&nbt_rdata_address_Type) < 0)
14382 0 : goto out;
14383 2460 : if (PyType_Ready(&nbt_rdata_netbios_Type) < 0)
14384 0 : goto out;
14385 2460 : if (PyType_Ready(&nbt_statistics_Type) < 0)
14386 0 : goto out;
14387 2460 : if (PyType_Ready(&nbt_status_name_Type) < 0)
14388 0 : goto out;
14389 2460 : if (PyType_Ready(&nbt_rdata_status_Type) < 0)
14390 0 : goto out;
14391 2460 : if (PyType_Ready(&nbt_rdata_data_Type) < 0)
14392 0 : goto out;
14393 2460 : if (PyType_Ready(&nbt_rdata_Type) < 0)
14394 0 : goto out;
14395 2460 : if (PyType_Ready(&nbt_res_rec_Type) < 0)
14396 0 : goto out;
14397 2460 : if (PyType_Ready(&nbt_name_packet_Type) < 0)
14398 0 : goto out;
14399 2460 : if (PyType_Ready(&smb_trans_body_Type) < 0)
14400 0 : goto out;
14401 2460 : if (PyType_Ready(&smb_body_Type) < 0)
14402 0 : goto out;
14403 2460 : if (PyType_Ready(&dgram_smb_packet_Type) < 0)
14404 0 : goto out;
14405 2460 : if (PyType_Ready(&dgram_message_body_Type) < 0)
14406 0 : goto out;
14407 2460 : if (PyType_Ready(&dgram_message_Type) < 0)
14408 0 : goto out;
14409 2460 : if (PyType_Ready(&dgram_data_Type) < 0)
14410 0 : goto out;
14411 2460 : if (PyType_Ready(&nbt_dgram_packet_Type) < 0)
14412 0 : goto out;
14413 2460 : if (PyType_Ready(&nbt_sockaddr_Type) < 0)
14414 0 : goto out;
14415 2460 : if (PyType_Ready(&NETLOGON_SAM_LOGON_REQUEST_Type) < 0)
14416 0 : goto out;
14417 2460 : if (PyType_Ready(&NETLOGON_LOGON_REQUEST_Type) < 0)
14418 0 : goto out;
14419 2460 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type) < 0)
14420 0 : goto out;
14421 2460 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_Type) < 0)
14422 0 : goto out;
14423 2460 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type) < 0)
14424 0 : goto out;
14425 2460 : if (PyType_Ready(&netlogon_samlogon_response_union_Type) < 0)
14426 0 : goto out;
14427 2460 : if (PyType_Ready(&netlogon_samlogon_response_Type) < 0)
14428 0 : goto out;
14429 2460 : if (PyType_Ready(&nbt_netlogon_query_for_pdc_Type) < 0)
14430 0 : goto out;
14431 2460 : if (PyType_Ready(&nbt_netlogon_response_from_pdc_Type) < 0)
14432 0 : goto out;
14433 2460 : if (PyType_Ready(&nbt_netlogon_response2_Type) < 0)
14434 0 : goto out;
14435 2460 : if (PyType_Ready(&nbt_db_change_info_Type) < 0)
14436 0 : goto out;
14437 2460 : if (PyType_Ready(&NETLOGON_DB_CHANGE_Type) < 0)
14438 0 : goto out;
14439 2460 : if (PyType_Ready(&nbt_netlogon_request_Type) < 0)
14440 0 : goto out;
14441 2460 : if (PyType_Ready(&nbt_netlogon_packet_Type) < 0)
14442 0 : goto out;
14443 2460 : if (PyType_Ready(&nbt_browse_host_announcement_Type) < 0)
14444 0 : goto out;
14445 2460 : if (PyType_Ready(&nbt_browse_announcement_request_Type) < 0)
14446 0 : goto out;
14447 2460 : if (PyType_Ready(&nbt_browse_election_request_Type) < 0)
14448 0 : goto out;
14449 2460 : if (PyType_Ready(&nbt_browse_backup_list_request_Type) < 0)
14450 0 : goto out;
14451 2460 : if (PyType_Ready(&nbt_browse_backup_list_response_Type) < 0)
14452 0 : goto out;
14453 2460 : if (PyType_Ready(&nbt_browse_become_backup_Type) < 0)
14454 0 : goto out;
14455 2460 : if (PyType_Ready(&nbt_browse_domain_announcement_Type) < 0)
14456 0 : goto out;
14457 2460 : if (PyType_Ready(&nbt_browse_master_announcement_Type) < 0)
14458 0 : goto out;
14459 2460 : if (PyType_Ready(&nbt_browse_reset_state_Type) < 0)
14460 0 : goto out;
14461 2460 : if (PyType_Ready(&nbt_browse_local_master_announcement_Type) < 0)
14462 0 : goto out;
14463 2460 : if (PyType_Ready(&nbt_browse_payload_Type) < 0)
14464 0 : goto out;
14465 2460 : if (PyType_Ready(&nbt_browse_packet_Type) < 0)
14466 0 : goto out;
14467 2460 : if (PyType_Ready(&nbt_InterfaceType) < 0)
14468 0 : goto out;
14469 2460 : if (PyType_Ready(&nbt_SyntaxType) < 0)
14470 0 : goto out;
14471 2460 : if (!PyInterface_AddNdrRpcMethods(&nbt_InterfaceType, py_ndr_nbt_methods))
14472 0 : return NULL;
14473 :
14474 : #ifdef PY_NAME_PATCH
14475 : PY_NAME_PATCH(&nbt_name_Type);
14476 : #endif
14477 : #ifdef PY_NAME_QUESTION_PATCH
14478 : PY_NAME_QUESTION_PATCH(&nbt_name_question_Type);
14479 : #endif
14480 : #ifdef PY_RDATA_ADDRESS_PATCH
14481 : PY_RDATA_ADDRESS_PATCH(&nbt_rdata_address_Type);
14482 : #endif
14483 : #ifdef PY_RDATA_NETBIOS_PATCH
14484 : PY_RDATA_NETBIOS_PATCH(&nbt_rdata_netbios_Type);
14485 : #endif
14486 : #ifdef PY_STATISTICS_PATCH
14487 : PY_STATISTICS_PATCH(&nbt_statistics_Type);
14488 : #endif
14489 : #ifdef PY_STATUS_NAME_PATCH
14490 : PY_STATUS_NAME_PATCH(&nbt_status_name_Type);
14491 : #endif
14492 : #ifdef PY_RDATA_STATUS_PATCH
14493 : PY_RDATA_STATUS_PATCH(&nbt_rdata_status_Type);
14494 : #endif
14495 : #ifdef PY_RDATA_DATA_PATCH
14496 : PY_RDATA_DATA_PATCH(&nbt_rdata_data_Type);
14497 : #endif
14498 : #ifdef PY_RDATA_PATCH
14499 : PY_RDATA_PATCH(&nbt_rdata_Type);
14500 : #endif
14501 : #ifdef PY_RES_REC_PATCH
14502 : PY_RES_REC_PATCH(&nbt_res_rec_Type);
14503 : #endif
14504 : #ifdef PY_NAME_PACKET_PATCH
14505 : PY_NAME_PACKET_PATCH(&nbt_name_packet_Type);
14506 : #endif
14507 : #ifdef PY_SMB_TRANS_BODY_PATCH
14508 : PY_SMB_TRANS_BODY_PATCH(&smb_trans_body_Type);
14509 : #endif
14510 : #ifdef PY_SMB_BODY_PATCH
14511 : PY_SMB_BODY_PATCH(&smb_body_Type);
14512 : #endif
14513 : #ifdef PY_DGRAM_SMB_PACKET_PATCH
14514 : PY_DGRAM_SMB_PACKET_PATCH(&dgram_smb_packet_Type);
14515 : #endif
14516 : #ifdef PY_DGRAM_MESSAGE_BODY_PATCH
14517 : PY_DGRAM_MESSAGE_BODY_PATCH(&dgram_message_body_Type);
14518 : #endif
14519 : #ifdef PY_DGRAM_MESSAGE_PATCH
14520 : PY_DGRAM_MESSAGE_PATCH(&dgram_message_Type);
14521 : #endif
14522 : #ifdef PY_DGRAM_DATA_PATCH
14523 : PY_DGRAM_DATA_PATCH(&dgram_data_Type);
14524 : #endif
14525 : #ifdef PY_DGRAM_PACKET_PATCH
14526 : PY_DGRAM_PACKET_PATCH(&nbt_dgram_packet_Type);
14527 : #endif
14528 : #ifdef PY_SOCKADDR_PATCH
14529 : PY_SOCKADDR_PATCH(&nbt_sockaddr_Type);
14530 : #endif
14531 : #ifdef PY_NETLOGON_SAM_LOGON_REQUEST_PATCH
14532 : PY_NETLOGON_SAM_LOGON_REQUEST_PATCH(&NETLOGON_SAM_LOGON_REQUEST_Type);
14533 : #endif
14534 : #ifdef PY_NETLOGON_LOGON_REQUEST_PATCH
14535 : PY_NETLOGON_LOGON_REQUEST_PATCH(&NETLOGON_LOGON_REQUEST_Type);
14536 : #endif
14537 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_NT40_PATCH
14538 : PY_NETLOGON_SAM_LOGON_RESPONSE_NT40_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14539 : #endif
14540 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_PATCH
14541 : PY_NETLOGON_SAM_LOGON_RESPONSE_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_Type);
14542 : #endif
14543 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_EX_PATCH
14544 : PY_NETLOGON_SAM_LOGON_RESPONSE_EX_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14545 : #endif
14546 : #ifdef PY_NETLOGON_SAMLOGON_RESPONSE_UNION_PATCH
14547 : PY_NETLOGON_SAMLOGON_RESPONSE_UNION_PATCH(&netlogon_samlogon_response_union_Type);
14548 : #endif
14549 : #ifdef PY_NETLOGON_SAMLOGON_RESPONSE_PATCH
14550 : PY_NETLOGON_SAMLOGON_RESPONSE_PATCH(&netlogon_samlogon_response_Type);
14551 : #endif
14552 : #ifdef PY_NETLOGON_QUERY_FOR_PDC_PATCH
14553 : PY_NETLOGON_QUERY_FOR_PDC_PATCH(&nbt_netlogon_query_for_pdc_Type);
14554 : #endif
14555 : #ifdef PY_NETLOGON_RESPONSE_FROM_PDC_PATCH
14556 : PY_NETLOGON_RESPONSE_FROM_PDC_PATCH(&nbt_netlogon_response_from_pdc_Type);
14557 : #endif
14558 : #ifdef PY_NETLOGON_RESPONSE2_PATCH
14559 : PY_NETLOGON_RESPONSE2_PATCH(&nbt_netlogon_response2_Type);
14560 : #endif
14561 : #ifdef PY_DB_CHANGE_INFO_PATCH
14562 : PY_DB_CHANGE_INFO_PATCH(&nbt_db_change_info_Type);
14563 : #endif
14564 : #ifdef PY_NETLOGON_DB_CHANGE_PATCH
14565 : PY_NETLOGON_DB_CHANGE_PATCH(&NETLOGON_DB_CHANGE_Type);
14566 : #endif
14567 : #ifdef PY_NETLOGON_REQUEST_PATCH
14568 : PY_NETLOGON_REQUEST_PATCH(&nbt_netlogon_request_Type);
14569 : #endif
14570 : #ifdef PY_NETLOGON_PACKET_PATCH
14571 : PY_NETLOGON_PACKET_PATCH(&nbt_netlogon_packet_Type);
14572 : #endif
14573 : #ifdef PY_BROWSE_HOST_ANNOUNCEMENT_PATCH
14574 : PY_BROWSE_HOST_ANNOUNCEMENT_PATCH(&nbt_browse_host_announcement_Type);
14575 : #endif
14576 : #ifdef PY_BROWSE_ANNOUNCEMENT_REQUEST_PATCH
14577 : PY_BROWSE_ANNOUNCEMENT_REQUEST_PATCH(&nbt_browse_announcement_request_Type);
14578 : #endif
14579 : #ifdef PY_BROWSE_ELECTION_REQUEST_PATCH
14580 : PY_BROWSE_ELECTION_REQUEST_PATCH(&nbt_browse_election_request_Type);
14581 : #endif
14582 : #ifdef PY_BROWSE_BACKUP_LIST_REQUEST_PATCH
14583 : PY_BROWSE_BACKUP_LIST_REQUEST_PATCH(&nbt_browse_backup_list_request_Type);
14584 : #endif
14585 : #ifdef PY_BROWSE_BACKUP_LIST_RESPONSE_PATCH
14586 : PY_BROWSE_BACKUP_LIST_RESPONSE_PATCH(&nbt_browse_backup_list_response_Type);
14587 : #endif
14588 : #ifdef PY_BROWSE_BECOME_BACKUP_PATCH
14589 : PY_BROWSE_BECOME_BACKUP_PATCH(&nbt_browse_become_backup_Type);
14590 : #endif
14591 : #ifdef PY_BROWSE_DOMAIN_ANNOUNCEMENT_PATCH
14592 : PY_BROWSE_DOMAIN_ANNOUNCEMENT_PATCH(&nbt_browse_domain_announcement_Type);
14593 : #endif
14594 : #ifdef PY_BROWSE_MASTER_ANNOUNCEMENT_PATCH
14595 : PY_BROWSE_MASTER_ANNOUNCEMENT_PATCH(&nbt_browse_master_announcement_Type);
14596 : #endif
14597 : #ifdef PY_BROWSE_RESET_STATE_PATCH
14598 : PY_BROWSE_RESET_STATE_PATCH(&nbt_browse_reset_state_Type);
14599 : #endif
14600 : #ifdef PY_BROWSE_LOCAL_MASTER_ANNOUNCEMENT_PATCH
14601 : PY_BROWSE_LOCAL_MASTER_ANNOUNCEMENT_PATCH(&nbt_browse_local_master_announcement_Type);
14602 : #endif
14603 : #ifdef PY_BROWSE_PAYLOAD_PATCH
14604 : PY_BROWSE_PAYLOAD_PATCH(&nbt_browse_payload_Type);
14605 : #endif
14606 : #ifdef PY_BROWSE_PACKET_PATCH
14607 : PY_BROWSE_PACKET_PATCH(&nbt_browse_packet_Type);
14608 : #endif
14609 : #ifdef PY_NBT_PATCH
14610 : PY_NBT_PATCH(&nbt_InterfaceType);
14611 : #endif
14612 : #ifdef PY_NBT_ABSTRACT_SYNTAX_PATCH
14613 : PY_NBT_ABSTRACT_SYNTAX_PATCH(&nbt_SyntaxType);
14614 : #endif
14615 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
14616 : PY_ABSTRACT_SYNTAX_PATCH(&nbt_SyntaxType);
14617 : #endif
14618 :
14619 2460 : m = PyModule_Create(&moduledef);
14620 2460 : if (m == NULL)
14621 0 : goto out;
14622 :
14623 2460 : PyModule_AddObject(m, "NBT_NAME_SERVICE_PORT", PyLong_FromUnsignedLongLong(137));
14624 2460 : PyModule_AddObject(m, "NBT_DGRAM_SERVICE_PORT", PyLong_FromUnsignedLongLong(138));
14625 2460 : PyModule_AddObject(m, "NBT_MAILSLOT_NETLOGON", PyUnicode_FromString("\\MAILSLOT\\NET\\NETLOGON"));
14626 2460 : PyModule_AddObject(m, "NBT_MAILSLOT_NTLOGON", PyUnicode_FromString("\\MAILSLOT\\NET\\NTLOGON"));
14627 2460 : PyModule_AddObject(m, "NBT_MAILSLOT_GETDC", PyUnicode_FromString("\\MAILSLOT\\NET\\GETDC"));
14628 2460 : PyModule_AddObject(m, "NBT_MAILSLOT_BROWSE", PyUnicode_FromString("\\MAILSLOT\\BROWSE"));
14629 2460 : PyModule_AddObject(m, "DGRAM_SMB", PyLong_FromUnsignedLongLong(0xff534d42));
14630 2460 : PyModule_AddObject(m, "NBT_RCODE", PyLong_FromLong((uint16_t)NBT_RCODE));
14631 2460 : PyModule_AddObject(m, "NBT_FLAG_BROADCAST", PyLong_FromLong((uint16_t)NBT_FLAG_BROADCAST));
14632 2460 : PyModule_AddObject(m, "NBT_FLAG_RECURSION_AVAIL", PyLong_FromLong((uint16_t)NBT_FLAG_RECURSION_AVAIL));
14633 2460 : PyModule_AddObject(m, "NBT_FLAG_RECURSION_DESIRED", PyLong_FromLong((uint16_t)NBT_FLAG_RECURSION_DESIRED));
14634 2460 : PyModule_AddObject(m, "NBT_FLAG_TRUNCATION", PyLong_FromLong((uint16_t)NBT_FLAG_TRUNCATION));
14635 2460 : PyModule_AddObject(m, "NBT_FLAG_AUTHORITATIVE", PyLong_FromLong((uint16_t)NBT_FLAG_AUTHORITATIVE));
14636 2460 : PyModule_AddObject(m, "NBT_OPCODE", PyLong_FromLong((uint16_t)NBT_OPCODE));
14637 2460 : PyModule_AddObject(m, "NBT_FLAG_REPLY", PyLong_FromLong((uint16_t)NBT_FLAG_REPLY));
14638 2460 : PyModule_AddObject(m, "NBT_OPCODE_QUERY", PyLong_FromLong((uint16_t)NBT_OPCODE_QUERY));
14639 2460 : PyModule_AddObject(m, "NBT_OPCODE_REGISTER", PyLong_FromLong((uint16_t)NBT_OPCODE_REGISTER));
14640 2460 : PyModule_AddObject(m, "NBT_OPCODE_RELEASE", PyLong_FromLong((uint16_t)NBT_OPCODE_RELEASE));
14641 2460 : PyModule_AddObject(m, "NBT_OPCODE_WACK", PyLong_FromLong((uint16_t)NBT_OPCODE_WACK));
14642 2460 : PyModule_AddObject(m, "NBT_OPCODE_REFRESH", PyLong_FromLong((uint16_t)NBT_OPCODE_REFRESH));
14643 2460 : PyModule_AddObject(m, "NBT_OPCODE_REFRESH2", PyLong_FromLong((uint16_t)NBT_OPCODE_REFRESH2));
14644 2460 : PyModule_AddObject(m, "NBT_OPCODE_MULTI_HOME_REG", PyLong_FromLong((uint16_t)NBT_OPCODE_MULTI_HOME_REG));
14645 2460 : PyModule_AddObject(m, "NBT_RCODE_OK", PyLong_FromLong((uint16_t)NBT_RCODE_OK));
14646 2460 : PyModule_AddObject(m, "NBT_RCODE_FMT", PyLong_FromLong((uint16_t)NBT_RCODE_FMT));
14647 2460 : PyModule_AddObject(m, "NBT_RCODE_SVR", PyLong_FromLong((uint16_t)NBT_RCODE_SVR));
14648 2460 : PyModule_AddObject(m, "NBT_RCODE_NAM", PyLong_FromLong((uint16_t)NBT_RCODE_NAM));
14649 2460 : PyModule_AddObject(m, "NBT_RCODE_IMP", PyLong_FromLong((uint16_t)NBT_RCODE_IMP));
14650 2460 : PyModule_AddObject(m, "NBT_RCODE_RFS", PyLong_FromLong((uint16_t)NBT_RCODE_RFS));
14651 2460 : PyModule_AddObject(m, "NBT_RCODE_ACT", PyLong_FromLong((uint16_t)NBT_RCODE_ACT));
14652 2460 : PyModule_AddObject(m, "NBT_RCODE_CFT", PyLong_FromLong((uint16_t)NBT_RCODE_CFT));
14653 2460 : PyModule_AddObject(m, "NBT_NAME_CLIENT", PyLong_FromLong((uint16_t)NBT_NAME_CLIENT));
14654 2460 : PyModule_AddObject(m, "NBT_NAME_MS", PyLong_FromLong((uint16_t)NBT_NAME_MS));
14655 2460 : PyModule_AddObject(m, "NBT_NAME_USER", PyLong_FromLong((uint16_t)NBT_NAME_USER));
14656 2460 : PyModule_AddObject(m, "NBT_NAME_SERVER", PyLong_FromLong((uint16_t)NBT_NAME_SERVER));
14657 2460 : PyModule_AddObject(m, "NBT_NAME_PDC", PyLong_FromLong((uint16_t)NBT_NAME_PDC));
14658 2460 : PyModule_AddObject(m, "NBT_NAME_LOGON", PyLong_FromLong((uint16_t)NBT_NAME_LOGON));
14659 2460 : PyModule_AddObject(m, "NBT_NAME_MASTER", PyLong_FromLong((uint16_t)NBT_NAME_MASTER));
14660 2460 : PyModule_AddObject(m, "NBT_NAME_BROWSER", PyLong_FromLong((uint16_t)NBT_NAME_BROWSER));
14661 2460 : PyModule_AddObject(m, "NBT_QCLASS_IP", PyLong_FromLong((uint16_t)NBT_QCLASS_IP));
14662 2460 : PyModule_AddObject(m, "NBT_QTYPE_ADDRESS", PyLong_FromLong((uint16_t)NBT_QTYPE_ADDRESS));
14663 2460 : PyModule_AddObject(m, "NBT_QTYPE_NAMESERVICE", PyLong_FromLong((uint16_t)NBT_QTYPE_NAMESERVICE));
14664 2460 : PyModule_AddObject(m, "NBT_QTYPE_NULL", PyLong_FromLong((uint16_t)NBT_QTYPE_NULL));
14665 2460 : PyModule_AddObject(m, "NBT_QTYPE_NETBIOS", PyLong_FromLong((uint16_t)NBT_QTYPE_NETBIOS));
14666 2460 : PyModule_AddObject(m, "NBT_QTYPE_STATUS", PyLong_FromLong((uint16_t)NBT_QTYPE_STATUS));
14667 2460 : PyModule_AddObject(m, "NBT_NODE_B", PyLong_FromLong((uint16_t)NBT_NODE_B));
14668 2460 : PyModule_AddObject(m, "NBT_NODE_P", PyLong_FromLong((uint16_t)NBT_NODE_P));
14669 2460 : PyModule_AddObject(m, "NBT_NODE_M", PyLong_FromLong((uint16_t)NBT_NODE_M));
14670 2460 : PyModule_AddObject(m, "NBT_NODE_H", PyLong_FromLong((uint16_t)NBT_NODE_H));
14671 2460 : PyModule_AddObject(m, "NBT_NM_PERMANENT", PyLong_FromLong((uint16_t)NBT_NM_PERMANENT));
14672 2460 : PyModule_AddObject(m, "NBT_NM_ACTIVE", PyLong_FromLong((uint16_t)NBT_NM_ACTIVE));
14673 2460 : PyModule_AddObject(m, "NBT_NM_CONFLICT", PyLong_FromLong((uint16_t)NBT_NM_CONFLICT));
14674 2460 : PyModule_AddObject(m, "NBT_NM_DEREGISTER", PyLong_FromLong((uint16_t)NBT_NM_DEREGISTER));
14675 2460 : PyModule_AddObject(m, "NBT_NM_OWNER_TYPE", PyLong_FromLong((uint16_t)NBT_NM_OWNER_TYPE));
14676 2460 : PyModule_AddObject(m, "NBT_NM_GROUP", PyLong_FromLong((uint16_t)NBT_NM_GROUP));
14677 2460 : PyModule_AddObject(m, "DGRAM_DIRECT_UNIQUE", PyLong_FromLong((uint16_t)DGRAM_DIRECT_UNIQUE));
14678 2460 : PyModule_AddObject(m, "DGRAM_DIRECT_GROUP", PyLong_FromLong((uint16_t)DGRAM_DIRECT_GROUP));
14679 2460 : PyModule_AddObject(m, "DGRAM_BCAST", PyLong_FromLong((uint16_t)DGRAM_BCAST));
14680 2460 : PyModule_AddObject(m, "DGRAM_ERROR", PyLong_FromLong((uint16_t)DGRAM_ERROR));
14681 2460 : PyModule_AddObject(m, "DGRAM_QUERY", PyLong_FromLong((uint16_t)DGRAM_QUERY));
14682 2460 : PyModule_AddObject(m, "DGRAM_QUERY_POSITIVE", PyLong_FromLong((uint16_t)DGRAM_QUERY_POSITIVE));
14683 2460 : PyModule_AddObject(m, "DGRAM_QUERY_NEGATIVE", PyLong_FromLong((uint16_t)DGRAM_QUERY_NEGATIVE));
14684 2460 : PyModule_AddObject(m, "DGRAM_FLAG_MORE", PyLong_FromLong((uint16_t)DGRAM_FLAG_MORE));
14685 2460 : PyModule_AddObject(m, "DGRAM_FLAG_FIRST", PyLong_FromLong((uint16_t)DGRAM_FLAG_FIRST));
14686 2460 : PyModule_AddObject(m, "DGRAM_FLAG_NODE_TYPE", PyLong_FromLong((uint16_t)DGRAM_FLAG_NODE_TYPE));
14687 2460 : PyModule_AddObject(m, "DGRAM_NODE_B", PyLong_FromLong((uint16_t)DGRAM_NODE_B));
14688 2460 : PyModule_AddObject(m, "DGRAM_NODE_P", PyLong_FromLong((uint16_t)DGRAM_NODE_P));
14689 2460 : PyModule_AddObject(m, "DGRAM_NODE_M", PyLong_FromLong((uint16_t)DGRAM_NODE_M));
14690 2460 : PyModule_AddObject(m, "DGRAM_NODE_NBDD", PyLong_FromLong((uint16_t)DGRAM_NODE_NBDD));
14691 2460 : PyModule_AddObject(m, "SMB_TRANSACTION", PyLong_FromLong((uint16_t)SMB_TRANSACTION));
14692 2460 : PyModule_AddObject(m, "DGRAM_ERROR_NAME_NOT_PRESENT", PyLong_FromLong((uint16_t)DGRAM_ERROR_NAME_NOT_PRESENT));
14693 2460 : PyModule_AddObject(m, "DGRAM_ERROR_INVALID_SOURCE", PyLong_FromLong((uint16_t)DGRAM_ERROR_INVALID_SOURCE));
14694 2460 : PyModule_AddObject(m, "DGRAM_ERROR_INVALID_DEST", PyLong_FromLong((uint16_t)DGRAM_ERROR_INVALID_DEST));
14695 2460 : PyModule_AddObject(m, "NBT_SERVER_PDC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_PDC));
14696 2460 : PyModule_AddObject(m, "NBT_SERVER_GC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_GC));
14697 2460 : PyModule_AddObject(m, "NBT_SERVER_LDAP", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_LDAP));
14698 2460 : PyModule_AddObject(m, "NBT_SERVER_DS", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_DS));
14699 2460 : PyModule_AddObject(m, "NBT_SERVER_KDC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_KDC));
14700 2460 : PyModule_AddObject(m, "NBT_SERVER_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_TIMESERV));
14701 2460 : PyModule_AddObject(m, "NBT_SERVER_CLOSEST", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_CLOSEST));
14702 2460 : PyModule_AddObject(m, "NBT_SERVER_WRITABLE", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_WRITABLE));
14703 2460 : PyModule_AddObject(m, "NBT_SERVER_GOOD_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_GOOD_TIMESERV));
14704 2460 : PyModule_AddObject(m, "NBT_SERVER_NDNC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_NDNC));
14705 2460 : PyModule_AddObject(m, "NBT_SERVER_SELECT_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_SELECT_SECRET_DOMAIN_6));
14706 2460 : PyModule_AddObject(m, "NBT_SERVER_FULL_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_FULL_SECRET_DOMAIN_6));
14707 2460 : PyModule_AddObject(m, "NBT_SERVER_ADS_WEB_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_ADS_WEB_SERVICE));
14708 2460 : PyModule_AddObject(m, "NBT_SERVER_DS_8", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_DS_8));
14709 2460 : PyModule_AddObject(m, "NBT_SERVER_HAS_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_HAS_DNS_NAME));
14710 2460 : PyModule_AddObject(m, "NBT_SERVER_IS_DEFAULT_NC", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_IS_DEFAULT_NC));
14711 2460 : PyModule_AddObject(m, "NBT_SERVER_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)NBT_SERVER_FOREST_ROOT));
14712 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_1", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_1));
14713 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_5));
14714 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5EX", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_5EX));
14715 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5EX_WITH_IP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_5EX_WITH_IP));
14716 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_WITH_CLOSEST_SITE));
14717 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_AVOID_NT4EMUL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_AVOID_NT4EMUL));
14718 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_PDC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_PDC));
14719 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_IP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_IP));
14720 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_LOCAL));
14721 2460 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_GC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NT_VERSION_GC));
14722 2460 : PyModule_AddObject(m, "LOGON_REQUEST", PyLong_FromLong((uint16_t)LOGON_REQUEST));
14723 2460 : PyModule_AddObject(m, "LOGON_RESPONSE2", PyLong_FromLong((uint16_t)LOGON_RESPONSE2));
14724 2460 : PyModule_AddObject(m, "LOGON_PRIMARY_QUERY", PyLong_FromLong((uint16_t)LOGON_PRIMARY_QUERY));
14725 2460 : PyModule_AddObject(m, "NETLOGON_ANNOUNCE_UAS", PyLong_FromLong((uint16_t)NETLOGON_ANNOUNCE_UAS));
14726 2460 : PyModule_AddObject(m, "NETLOGON_RESPONSE_FROM_PDC", PyLong_FromLong((uint16_t)NETLOGON_RESPONSE_FROM_PDC));
14727 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_REQUEST", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_REQUEST));
14728 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_RESPONSE", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_RESPONSE));
14729 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_PAUSE_RESPONSE", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_PAUSE_RESPONSE));
14730 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_USER_UNKNOWN", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_USER_UNKNOWN));
14731 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_RESPONSE_EX", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_RESPONSE_EX));
14732 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_PAUSE_RESPONSE_EX));
14733 2460 : PyModule_AddObject(m, "LOGON_SAM_LOGON_USER_UNKNOWN_EX", PyLong_FromLong((uint16_t)LOGON_SAM_LOGON_USER_UNKNOWN_EX));
14734 2460 : PyModule_AddObject(m, "HostAnnouncement", PyLong_FromLong((uint16_t)HostAnnouncement));
14735 2460 : PyModule_AddObject(m, "AnnouncementRequest", PyLong_FromLong((uint16_t)AnnouncementRequest));
14736 2460 : PyModule_AddObject(m, "Election", PyLong_FromLong((uint16_t)Election));
14737 2460 : PyModule_AddObject(m, "GetBackupListReq", PyLong_FromLong((uint16_t)GetBackupListReq));
14738 2460 : PyModule_AddObject(m, "GetBackupListResp", PyLong_FromLong((uint16_t)GetBackupListResp));
14739 2460 : PyModule_AddObject(m, "BecomeBackup", PyLong_FromLong((uint16_t)BecomeBackup));
14740 2460 : PyModule_AddObject(m, "DomainAnnouncement", PyLong_FromLong((uint16_t)DomainAnnouncement));
14741 2460 : PyModule_AddObject(m, "MasterAnnouncement", PyLong_FromLong((uint16_t)MasterAnnouncement));
14742 2460 : PyModule_AddObject(m, "ResetBrowserState", PyLong_FromLong((uint16_t)ResetBrowserState));
14743 2460 : PyModule_AddObject(m, "LocalMasterAnnouncement", PyLong_FromLong((uint16_t)LocalMasterAnnouncement));
14744 2460 : Py_INCREF((PyObject *)(void *)&nbt_name_Type);
14745 2460 : PyModule_AddObject(m, "name", (PyObject *)(void *)&nbt_name_Type);
14746 2460 : Py_INCREF((PyObject *)(void *)&nbt_name_question_Type);
14747 2460 : PyModule_AddObject(m, "name_question", (PyObject *)(void *)&nbt_name_question_Type);
14748 2460 : Py_INCREF((PyObject *)(void *)&nbt_rdata_address_Type);
14749 2460 : PyModule_AddObject(m, "rdata_address", (PyObject *)(void *)&nbt_rdata_address_Type);
14750 2460 : Py_INCREF((PyObject *)(void *)&nbt_rdata_netbios_Type);
14751 2460 : PyModule_AddObject(m, "rdata_netbios", (PyObject *)(void *)&nbt_rdata_netbios_Type);
14752 2460 : Py_INCREF((PyObject *)(void *)&nbt_statistics_Type);
14753 2460 : PyModule_AddObject(m, "statistics", (PyObject *)(void *)&nbt_statistics_Type);
14754 2460 : Py_INCREF((PyObject *)(void *)&nbt_status_name_Type);
14755 2460 : PyModule_AddObject(m, "status_name", (PyObject *)(void *)&nbt_status_name_Type);
14756 2460 : Py_INCREF((PyObject *)(void *)&nbt_rdata_status_Type);
14757 2460 : PyModule_AddObject(m, "rdata_status", (PyObject *)(void *)&nbt_rdata_status_Type);
14758 2460 : Py_INCREF((PyObject *)(void *)&nbt_rdata_data_Type);
14759 2460 : PyModule_AddObject(m, "rdata_data", (PyObject *)(void *)&nbt_rdata_data_Type);
14760 2460 : Py_INCREF((PyObject *)(void *)&nbt_rdata_Type);
14761 2460 : PyModule_AddObject(m, "rdata", (PyObject *)(void *)&nbt_rdata_Type);
14762 2460 : Py_INCREF((PyObject *)(void *)&nbt_res_rec_Type);
14763 2460 : PyModule_AddObject(m, "res_rec", (PyObject *)(void *)&nbt_res_rec_Type);
14764 2460 : Py_INCREF((PyObject *)(void *)&nbt_name_packet_Type);
14765 2460 : PyModule_AddObject(m, "name_packet", (PyObject *)(void *)&nbt_name_packet_Type);
14766 2460 : Py_INCREF((PyObject *)(void *)&smb_trans_body_Type);
14767 2460 : PyModule_AddObject(m, "smb_trans_body", (PyObject *)(void *)&smb_trans_body_Type);
14768 2460 : Py_INCREF((PyObject *)(void *)&smb_body_Type);
14769 2460 : PyModule_AddObject(m, "smb_body", (PyObject *)(void *)&smb_body_Type);
14770 2460 : Py_INCREF((PyObject *)(void *)&dgram_smb_packet_Type);
14771 2460 : PyModule_AddObject(m, "dgram_smb_packet", (PyObject *)(void *)&dgram_smb_packet_Type);
14772 2460 : Py_INCREF((PyObject *)(void *)&dgram_message_body_Type);
14773 2460 : PyModule_AddObject(m, "dgram_message_body", (PyObject *)(void *)&dgram_message_body_Type);
14774 2460 : Py_INCREF((PyObject *)(void *)&dgram_message_Type);
14775 2460 : PyModule_AddObject(m, "dgram_message", (PyObject *)(void *)&dgram_message_Type);
14776 2460 : Py_INCREF((PyObject *)(void *)&dgram_data_Type);
14777 2460 : PyModule_AddObject(m, "dgram_data", (PyObject *)(void *)&dgram_data_Type);
14778 2460 : Py_INCREF((PyObject *)(void *)&nbt_dgram_packet_Type);
14779 2460 : PyModule_AddObject(m, "dgram_packet", (PyObject *)(void *)&nbt_dgram_packet_Type);
14780 2460 : Py_INCREF((PyObject *)(void *)&nbt_sockaddr_Type);
14781 2460 : PyModule_AddObject(m, "sockaddr", (PyObject *)(void *)&nbt_sockaddr_Type);
14782 2460 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_REQUEST_Type);
14783 2460 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_REQUEST", (PyObject *)(void *)&NETLOGON_SAM_LOGON_REQUEST_Type);
14784 2460 : Py_INCREF((PyObject *)(void *)&NETLOGON_LOGON_REQUEST_Type);
14785 2460 : PyModule_AddObject(m, "NETLOGON_LOGON_REQUEST", (PyObject *)(void *)&NETLOGON_LOGON_REQUEST_Type);
14786 2460 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14787 2460 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE_NT40", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14788 2460 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_Type);
14789 2460 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_Type);
14790 2460 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14791 2460 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE_EX", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14792 2460 : Py_INCREF((PyObject *)(void *)&netlogon_samlogon_response_union_Type);
14793 2460 : PyModule_AddObject(m, "netlogon_samlogon_response_union", (PyObject *)(void *)&netlogon_samlogon_response_union_Type);
14794 2460 : Py_INCREF((PyObject *)(void *)&netlogon_samlogon_response_Type);
14795 2460 : PyModule_AddObject(m, "netlogon_samlogon_response", (PyObject *)(void *)&netlogon_samlogon_response_Type);
14796 2460 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_query_for_pdc_Type);
14797 2460 : PyModule_AddObject(m, "netlogon_query_for_pdc", (PyObject *)(void *)&nbt_netlogon_query_for_pdc_Type);
14798 2460 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_response_from_pdc_Type);
14799 2460 : PyModule_AddObject(m, "netlogon_response_from_pdc", (PyObject *)(void *)&nbt_netlogon_response_from_pdc_Type);
14800 2460 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_response2_Type);
14801 2460 : PyModule_AddObject(m, "netlogon_response2", (PyObject *)(void *)&nbt_netlogon_response2_Type);
14802 2460 : Py_INCREF((PyObject *)(void *)&nbt_db_change_info_Type);
14803 2460 : PyModule_AddObject(m, "db_change_info", (PyObject *)(void *)&nbt_db_change_info_Type);
14804 2460 : Py_INCREF((PyObject *)(void *)&NETLOGON_DB_CHANGE_Type);
14805 2460 : PyModule_AddObject(m, "NETLOGON_DB_CHANGE", (PyObject *)(void *)&NETLOGON_DB_CHANGE_Type);
14806 2460 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_request_Type);
14807 2460 : PyModule_AddObject(m, "netlogon_request", (PyObject *)(void *)&nbt_netlogon_request_Type);
14808 2460 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_packet_Type);
14809 2460 : PyModule_AddObject(m, "netlogon_packet", (PyObject *)(void *)&nbt_netlogon_packet_Type);
14810 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_host_announcement_Type);
14811 2460 : PyModule_AddObject(m, "browse_host_announcement", (PyObject *)(void *)&nbt_browse_host_announcement_Type);
14812 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_announcement_request_Type);
14813 2460 : PyModule_AddObject(m, "browse_announcement_request", (PyObject *)(void *)&nbt_browse_announcement_request_Type);
14814 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_election_request_Type);
14815 2460 : PyModule_AddObject(m, "browse_election_request", (PyObject *)(void *)&nbt_browse_election_request_Type);
14816 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_backup_list_request_Type);
14817 2460 : PyModule_AddObject(m, "browse_backup_list_request", (PyObject *)(void *)&nbt_browse_backup_list_request_Type);
14818 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_backup_list_response_Type);
14819 2460 : PyModule_AddObject(m, "browse_backup_list_response", (PyObject *)(void *)&nbt_browse_backup_list_response_Type);
14820 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_become_backup_Type);
14821 2460 : PyModule_AddObject(m, "browse_become_backup", (PyObject *)(void *)&nbt_browse_become_backup_Type);
14822 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_domain_announcement_Type);
14823 2460 : PyModule_AddObject(m, "browse_domain_announcement", (PyObject *)(void *)&nbt_browse_domain_announcement_Type);
14824 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_master_announcement_Type);
14825 2460 : PyModule_AddObject(m, "browse_master_announcement", (PyObject *)(void *)&nbt_browse_master_announcement_Type);
14826 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_reset_state_Type);
14827 2460 : PyModule_AddObject(m, "browse_reset_state", (PyObject *)(void *)&nbt_browse_reset_state_Type);
14828 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_local_master_announcement_Type);
14829 2460 : PyModule_AddObject(m, "browse_local_master_announcement", (PyObject *)(void *)&nbt_browse_local_master_announcement_Type);
14830 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_payload_Type);
14831 2460 : PyModule_AddObject(m, "browse_payload", (PyObject *)(void *)&nbt_browse_payload_Type);
14832 2460 : Py_INCREF((PyObject *)(void *)&nbt_browse_packet_Type);
14833 2460 : PyModule_AddObject(m, "browse_packet", (PyObject *)(void *)&nbt_browse_packet_Type);
14834 2460 : Py_INCREF((PyObject *)(void *)&nbt_InterfaceType);
14835 2460 : PyModule_AddObject(m, "nbt", (PyObject *)(void *)&nbt_InterfaceType);
14836 2460 : Py_INCREF((PyObject *)(void *)&nbt_SyntaxType);
14837 2460 : PyModule_AddObject(m, "nbt_abstract_syntax", (PyObject *)(void *)&nbt_SyntaxType);
14838 2460 : Py_INCREF((PyObject *)(void *)&nbt_SyntaxType);
14839 2460 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&nbt_SyntaxType);
14840 : #ifdef PY_MOD_NBT_PATCH
14841 : PY_MOD_NBT_PATCH(m);
14842 : #endif
14843 2460 : out:
14844 2460 : Py_XDECREF(dep_samba_dcerpc_misc);
14845 2460 : Py_XDECREF(dep_samba_dcerpc_security);
14846 2460 : Py_XDECREF(dep_talloc);
14847 2460 : Py_XDECREF(dep_samba_dcerpc_base);
14848 2460 : return m;
14849 :
14850 : }
|