Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_nbt.h"
12 :
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 150 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 150 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 150 : case 4:
38 150 : 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 = pytalloc_get_ptr(obj);
122 0 : PyObject *py_name;
123 0 : py_name = PyString_FromStringOrNULL(object->name);
124 0 : return py_name;
125 : }
126 :
127 0 : static int py_nbt_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
128 : {
129 0 : struct nbt_name *object = pytalloc_get_ptr(py_obj);
130 0 : if (value == NULL) {
131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
132 0 : return -1;
133 : }
134 : {
135 0 : const char *test_str;
136 0 : const char *talloc_str;
137 0 : PyObject *unicode = NULL;
138 0 : if (PyUnicode_Check(value)) {
139 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
140 0 : if (unicode == NULL) {
141 0 : return -1;
142 : }
143 0 : test_str = PyBytes_AS_STRING(unicode);
144 0 : } else if (PyBytes_Check(value)) {
145 0 : test_str = PyBytes_AS_STRING(value);
146 : } else {
147 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
148 0 : return -1;
149 : }
150 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
151 0 : if (unicode != NULL) {
152 0 : Py_DECREF(unicode);
153 : }
154 0 : if (talloc_str == NULL) {
155 0 : PyErr_NoMemory();
156 0 : return -1;
157 : }
158 0 : object->name = talloc_str;
159 : }
160 0 : return 0;
161 : }
162 :
163 0 : static PyObject *py_nbt_name_get_scope(PyObject *obj, void *closure)
164 : {
165 0 : struct nbt_name *object = pytalloc_get_ptr(obj);
166 0 : PyObject *py_scope;
167 0 : py_scope = PyString_FromStringOrNULL(object->scope);
168 0 : return py_scope;
169 : }
170 :
171 0 : static int py_nbt_name_set_scope(PyObject *py_obj, PyObject *value, void *closure)
172 : {
173 0 : struct nbt_name *object = pytalloc_get_ptr(py_obj);
174 0 : if (value == NULL) {
175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->scope");
176 0 : return -1;
177 : }
178 : {
179 0 : const char *test_str;
180 0 : const char *talloc_str;
181 0 : PyObject *unicode = NULL;
182 0 : if (PyUnicode_Check(value)) {
183 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
184 0 : if (unicode == NULL) {
185 0 : return -1;
186 : }
187 0 : test_str = PyBytes_AS_STRING(unicode);
188 0 : } else if (PyBytes_Check(value)) {
189 0 : test_str = PyBytes_AS_STRING(value);
190 : } else {
191 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
192 0 : return -1;
193 : }
194 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
195 0 : if (unicode != NULL) {
196 0 : Py_DECREF(unicode);
197 : }
198 0 : if (talloc_str == NULL) {
199 0 : PyErr_NoMemory();
200 0 : return -1;
201 : }
202 0 : object->scope = talloc_str;
203 : }
204 0 : return 0;
205 : }
206 :
207 0 : static PyObject *py_nbt_name_get_type(PyObject *obj, void *closure)
208 : {
209 0 : struct nbt_name *object = pytalloc_get_ptr(obj);
210 0 : PyObject *py_type;
211 0 : py_type = PyLong_FromLong((uint16_t)(object->type));
212 0 : return py_type;
213 : }
214 :
215 0 : static int py_nbt_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
216 : {
217 0 : struct nbt_name *object = pytalloc_get_ptr(py_obj);
218 0 : if (value == NULL) {
219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
220 0 : return -1;
221 : }
222 : {
223 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
224 0 : if (PyLong_Check(value)) {
225 0 : unsigned long long test_var;
226 0 : test_var = PyLong_AsUnsignedLongLong(value);
227 0 : if (PyErr_Occurred() != NULL) {
228 0 : return -1;
229 : }
230 0 : if (test_var > uint_max) {
231 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
232 : PyLong_Type.tp_name, uint_max, test_var);
233 0 : return -1;
234 : }
235 0 : object->type = test_var;
236 : } else {
237 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
238 : PyLong_Type.tp_name);
239 0 : return -1;
240 : }
241 : }
242 0 : return 0;
243 : }
244 :
245 : static PyGetSetDef py_nbt_name_getsetters[] = {
246 : {
247 : .name = discard_const_p(char, "name"),
248 : .get = py_nbt_name_get_name,
249 : .set = py_nbt_name_set_name,
250 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
251 : },
252 : {
253 : .name = discard_const_p(char, "scope"),
254 : .get = py_nbt_name_get_scope,
255 : .set = py_nbt_name_set_scope,
256 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
257 : },
258 : {
259 : .name = discard_const_p(char, "type"),
260 : .get = py_nbt_name_get_type,
261 : .set = py_nbt_name_set_type,
262 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
263 : },
264 : { .name = NULL }
265 : };
266 :
267 0 : static PyObject *py_nbt_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
268 : {
269 0 : return pytalloc_new(struct nbt_name, type);
270 : }
271 :
272 0 : static PyObject *py_nbt_name_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
273 : {
274 0 : struct nbt_name *object = pytalloc_get_ptr(py_obj);
275 0 : PyObject *ret = NULL;
276 0 : DATA_BLOB blob;
277 0 : enum ndr_err_code err;
278 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
279 0 : if (tmp_ctx == NULL) {
280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
281 0 : return NULL;
282 : }
283 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name);
284 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
285 0 : TALLOC_FREE(tmp_ctx);
286 0 : PyErr_SetNdrError(err);
287 0 : return NULL;
288 : }
289 :
290 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
291 0 : TALLOC_FREE(tmp_ctx);
292 0 : return ret;
293 : }
294 :
295 0 : static PyObject *py_nbt_name_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
296 : {
297 0 : struct nbt_name *object = pytalloc_get_ptr(py_obj);
298 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
299 0 : Py_ssize_t blob_length = 0;
300 0 : enum ndr_err_code err;
301 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
302 0 : PyObject *allow_remaining_obj = NULL;
303 0 : bool allow_remaining = false;
304 :
305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
306 : discard_const_p(char *, kwnames),
307 : &blob.data, &blob_length,
308 : &allow_remaining_obj)) {
309 0 : return NULL;
310 : }
311 0 : blob.length = blob_length;
312 :
313 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
314 0 : allow_remaining = true;
315 : }
316 :
317 0 : if (allow_remaining) {
318 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
319 : } else {
320 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
321 : }
322 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
323 0 : PyErr_SetNdrError(err);
324 0 : return NULL;
325 : }
326 :
327 0 : Py_RETURN_NONE;
328 : }
329 :
330 0 : static PyObject *py_nbt_name_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
331 : {
332 0 : struct nbt_name *object = pytalloc_get_ptr(py_obj);
333 0 : PyObject *ret;
334 0 : char *retstr;
335 :
336 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name, "nbt_name", object);
337 0 : ret = PyUnicode_FromString(retstr);
338 0 : talloc_free(retstr);
339 :
340 0 : return ret;
341 : }
342 :
343 : static PyMethodDef py_nbt_name_methods[] = {
344 : { "__ndr_pack__", (PyCFunction)py_nbt_name_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
345 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_name_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
346 : { "__ndr_print__", (PyCFunction)py_nbt_name_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
347 : { NULL, NULL, 0, NULL }
348 : };
349 :
350 :
351 : static PyTypeObject nbt_name_Type = {
352 : PyVarObject_HEAD_INIT(NULL, 0)
353 : .tp_name = "nbt.name",
354 : .tp_getset = py_nbt_name_getsetters,
355 : .tp_methods = py_nbt_name_methods,
356 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
357 : .tp_new = py_nbt_name_new,
358 : };
359 :
360 :
361 0 : static PyObject *py_nbt_name_question_get_name(PyObject *obj, void *closure)
362 : {
363 0 : struct nbt_name_question *object = pytalloc_get_ptr(obj);
364 0 : PyObject *py_name;
365 0 : py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
366 0 : return py_name;
367 : }
368 :
369 0 : static int py_nbt_name_question_set_name(PyObject *py_obj, PyObject *value, void *closure)
370 : {
371 0 : struct nbt_name_question *object = pytalloc_get_ptr(py_obj);
372 0 : if (value == NULL) {
373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
374 0 : return -1;
375 : }
376 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
377 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
378 0 : PyErr_NoMemory();
379 0 : return -1;
380 : }
381 0 : object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
382 0 : return 0;
383 : }
384 :
385 0 : static PyObject *py_nbt_name_question_get_question_type(PyObject *obj, void *closure)
386 : {
387 0 : struct nbt_name_question *object = pytalloc_get_ptr(obj);
388 0 : PyObject *py_question_type;
389 0 : py_question_type = PyLong_FromLong((uint16_t)(object->question_type));
390 0 : return py_question_type;
391 : }
392 :
393 0 : static int py_nbt_name_question_set_question_type(PyObject *py_obj, PyObject *value, void *closure)
394 : {
395 0 : struct nbt_name_question *object = pytalloc_get_ptr(py_obj);
396 0 : if (value == NULL) {
397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->question_type");
398 0 : return -1;
399 : }
400 : {
401 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_type));
402 0 : if (PyLong_Check(value)) {
403 0 : unsigned long long test_var;
404 0 : test_var = PyLong_AsUnsignedLongLong(value);
405 0 : if (PyErr_Occurred() != NULL) {
406 0 : return -1;
407 : }
408 0 : if (test_var > uint_max) {
409 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
410 : PyLong_Type.tp_name, uint_max, test_var);
411 0 : return -1;
412 : }
413 0 : object->question_type = test_var;
414 : } else {
415 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
416 : PyLong_Type.tp_name);
417 0 : return -1;
418 : }
419 : }
420 0 : return 0;
421 : }
422 :
423 0 : static PyObject *py_nbt_name_question_get_question_class(PyObject *obj, void *closure)
424 : {
425 0 : struct nbt_name_question *object = pytalloc_get_ptr(obj);
426 0 : PyObject *py_question_class;
427 0 : py_question_class = PyLong_FromLong((uint16_t)(object->question_class));
428 0 : return py_question_class;
429 : }
430 :
431 0 : static int py_nbt_name_question_set_question_class(PyObject *py_obj, PyObject *value, void *closure)
432 : {
433 0 : struct nbt_name_question *object = pytalloc_get_ptr(py_obj);
434 0 : if (value == NULL) {
435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->question_class");
436 0 : return -1;
437 : }
438 : {
439 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_class));
440 0 : if (PyLong_Check(value)) {
441 0 : unsigned long long test_var;
442 0 : test_var = PyLong_AsUnsignedLongLong(value);
443 0 : if (PyErr_Occurred() != NULL) {
444 0 : return -1;
445 : }
446 0 : if (test_var > uint_max) {
447 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
448 : PyLong_Type.tp_name, uint_max, test_var);
449 0 : return -1;
450 : }
451 0 : object->question_class = test_var;
452 : } else {
453 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
454 : PyLong_Type.tp_name);
455 0 : return -1;
456 : }
457 : }
458 0 : return 0;
459 : }
460 :
461 : static PyGetSetDef py_nbt_name_question_getsetters[] = {
462 : {
463 : .name = discard_const_p(char, "name"),
464 : .get = py_nbt_name_question_get_name,
465 : .set = py_nbt_name_question_set_name,
466 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
467 : },
468 : {
469 : .name = discard_const_p(char, "question_type"),
470 : .get = py_nbt_name_question_get_question_type,
471 : .set = py_nbt_name_question_set_question_type,
472 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
473 : },
474 : {
475 : .name = discard_const_p(char, "question_class"),
476 : .get = py_nbt_name_question_get_question_class,
477 : .set = py_nbt_name_question_set_question_class,
478 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
479 : },
480 : { .name = NULL }
481 : };
482 :
483 0 : static PyObject *py_nbt_name_question_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
484 : {
485 0 : return pytalloc_new(struct nbt_name_question, type);
486 : }
487 :
488 :
489 : static PyTypeObject nbt_name_question_Type = {
490 : PyVarObject_HEAD_INIT(NULL, 0)
491 : .tp_name = "nbt.name_question",
492 : .tp_getset = py_nbt_name_question_getsetters,
493 : .tp_methods = NULL,
494 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
495 : .tp_new = py_nbt_name_question_new,
496 : };
497 :
498 :
499 0 : static PyObject *py_nbt_rdata_address_get_nb_flags(PyObject *obj, void *closure)
500 : {
501 0 : struct nbt_rdata_address *object = pytalloc_get_ptr(obj);
502 0 : PyObject *py_nb_flags;
503 0 : py_nb_flags = PyLong_FromLong((uint16_t)(object->nb_flags));
504 0 : return py_nb_flags;
505 : }
506 :
507 0 : static int py_nbt_rdata_address_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
508 : {
509 0 : struct nbt_rdata_address *object = pytalloc_get_ptr(py_obj);
510 0 : if (value == NULL) {
511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nb_flags");
512 0 : return -1;
513 : }
514 : {
515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
516 0 : if (PyLong_Check(value)) {
517 0 : unsigned long long test_var;
518 0 : test_var = PyLong_AsUnsignedLongLong(value);
519 0 : if (PyErr_Occurred() != NULL) {
520 0 : return -1;
521 : }
522 0 : if (test_var > uint_max) {
523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
524 : PyLong_Type.tp_name, uint_max, test_var);
525 0 : return -1;
526 : }
527 0 : object->nb_flags = test_var;
528 : } else {
529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
530 : PyLong_Type.tp_name);
531 0 : return -1;
532 : }
533 : }
534 0 : return 0;
535 : }
536 :
537 0 : static PyObject *py_nbt_rdata_address_get_ipaddr(PyObject *obj, void *closure)
538 : {
539 0 : struct nbt_rdata_address *object = pytalloc_get_ptr(obj);
540 0 : PyObject *py_ipaddr;
541 0 : py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
542 0 : return py_ipaddr;
543 : }
544 :
545 0 : static int py_nbt_rdata_address_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
546 : {
547 0 : struct nbt_rdata_address *object = pytalloc_get_ptr(py_obj);
548 0 : if (value == NULL) {
549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ipaddr");
550 0 : return -1;
551 : }
552 : {
553 0 : const char *test_str;
554 0 : const char *talloc_str;
555 0 : PyObject *unicode = NULL;
556 0 : if (PyUnicode_Check(value)) {
557 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
558 0 : if (unicode == NULL) {
559 0 : return -1;
560 : }
561 0 : test_str = PyBytes_AS_STRING(unicode);
562 0 : } else if (PyBytes_Check(value)) {
563 0 : test_str = PyBytes_AS_STRING(value);
564 : } else {
565 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
566 0 : return -1;
567 : }
568 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
569 0 : if (unicode != NULL) {
570 0 : Py_DECREF(unicode);
571 : }
572 0 : if (talloc_str == NULL) {
573 0 : PyErr_NoMemory();
574 0 : return -1;
575 : }
576 0 : object->ipaddr = talloc_str;
577 : }
578 0 : return 0;
579 : }
580 :
581 : static PyGetSetDef py_nbt_rdata_address_getsetters[] = {
582 : {
583 : .name = discard_const_p(char, "nb_flags"),
584 : .get = py_nbt_rdata_address_get_nb_flags,
585 : .set = py_nbt_rdata_address_set_nb_flags,
586 : .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
587 : },
588 : {
589 : .name = discard_const_p(char, "ipaddr"),
590 : .get = py_nbt_rdata_address_get_ipaddr,
591 : .set = py_nbt_rdata_address_set_ipaddr,
592 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
593 : },
594 : { .name = NULL }
595 : };
596 :
597 0 : static PyObject *py_nbt_rdata_address_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
598 : {
599 0 : return pytalloc_new(struct nbt_rdata_address, type);
600 : }
601 :
602 :
603 : static PyTypeObject nbt_rdata_address_Type = {
604 : PyVarObject_HEAD_INIT(NULL, 0)
605 : .tp_name = "nbt.rdata_address",
606 : .tp_getset = py_nbt_rdata_address_getsetters,
607 : .tp_methods = NULL,
608 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
609 : .tp_new = py_nbt_rdata_address_new,
610 : };
611 :
612 :
613 0 : static PyObject *py_nbt_rdata_netbios_get_length(PyObject *obj, void *closure)
614 : {
615 0 : struct nbt_rdata_netbios *object = pytalloc_get_ptr(obj);
616 0 : PyObject *py_length;
617 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
618 0 : return py_length;
619 : }
620 :
621 0 : static int py_nbt_rdata_netbios_set_length(PyObject *py_obj, PyObject *value, void *closure)
622 : {
623 0 : struct nbt_rdata_netbios *object = pytalloc_get_ptr(py_obj);
624 0 : if (value == NULL) {
625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
626 0 : return -1;
627 : }
628 : {
629 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
630 0 : if (PyLong_Check(value)) {
631 0 : unsigned long long test_var;
632 0 : test_var = PyLong_AsUnsignedLongLong(value);
633 0 : if (PyErr_Occurred() != NULL) {
634 0 : return -1;
635 : }
636 0 : if (test_var > uint_max) {
637 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
638 : PyLong_Type.tp_name, uint_max, test_var);
639 0 : return -1;
640 : }
641 0 : object->length = test_var;
642 : } else {
643 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
644 : PyLong_Type.tp_name);
645 0 : return -1;
646 : }
647 : }
648 0 : return 0;
649 : }
650 :
651 0 : static PyObject *py_nbt_rdata_netbios_get_addresses(PyObject *obj, void *closure)
652 : {
653 0 : struct nbt_rdata_netbios *object = pytalloc_get_ptr(obj);
654 0 : PyObject *py_addresses;
655 0 : py_addresses = PyList_New(object->length / 6);
656 0 : if (py_addresses == NULL) {
657 0 : return NULL;
658 : }
659 : {
660 : int addresses_cntr_0;
661 0 : for (addresses_cntr_0 = 0; addresses_cntr_0 < (object->length / 6); addresses_cntr_0++) {
662 0 : PyObject *py_addresses_0;
663 0 : py_addresses_0 = pytalloc_reference_ex(&nbt_rdata_address_Type, object->addresses, &(object->addresses)[addresses_cntr_0]);
664 0 : PyList_SetItem(py_addresses, addresses_cntr_0, py_addresses_0);
665 : }
666 : }
667 0 : return py_addresses;
668 : }
669 :
670 0 : static int py_nbt_rdata_netbios_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
671 : {
672 0 : struct nbt_rdata_netbios *object = pytalloc_get_ptr(py_obj);
673 0 : if (value == NULL) {
674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->addresses");
675 0 : return -1;
676 : }
677 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
678 : {
679 0 : int addresses_cntr_0;
680 0 : object->addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addresses, PyList_GET_SIZE(value));
681 0 : if (!object->addresses) { return -1; }
682 0 : talloc_set_name_const(object->addresses, "ARRAY: object->addresses");
683 0 : for (addresses_cntr_0 = 0; addresses_cntr_0 < PyList_GET_SIZE(value); addresses_cntr_0++) {
684 0 : if (PyList_GET_ITEM(value, addresses_cntr_0) == NULL) {
685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->addresses)[addresses_cntr_0]");
686 0 : return -1;
687 : }
688 0 : PY_CHECK_TYPE(&nbt_rdata_address_Type, PyList_GET_ITEM(value, addresses_cntr_0), return -1;);
689 0 : if (talloc_reference(object->addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_0))) == NULL) {
690 0 : PyErr_NoMemory();
691 0 : return -1;
692 : }
693 0 : (object->addresses)[addresses_cntr_0] = *(struct nbt_rdata_address *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_0));
694 : }
695 : }
696 0 : return 0;
697 : }
698 :
699 : static PyGetSetDef py_nbt_rdata_netbios_getsetters[] = {
700 : {
701 : .name = discard_const_p(char, "length"),
702 : .get = py_nbt_rdata_netbios_get_length,
703 : .set = py_nbt_rdata_netbios_set_length,
704 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
705 : },
706 : {
707 : .name = discard_const_p(char, "addresses"),
708 : .get = py_nbt_rdata_netbios_get_addresses,
709 : .set = py_nbt_rdata_netbios_set_addresses,
710 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata_address")
711 : },
712 : { .name = NULL }
713 : };
714 :
715 0 : static PyObject *py_nbt_rdata_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
716 : {
717 0 : return pytalloc_new(struct nbt_rdata_netbios, type);
718 : }
719 :
720 :
721 : static PyTypeObject nbt_rdata_netbios_Type = {
722 : PyVarObject_HEAD_INIT(NULL, 0)
723 : .tp_name = "nbt.rdata_netbios",
724 : .tp_getset = py_nbt_rdata_netbios_getsetters,
725 : .tp_methods = NULL,
726 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
727 : .tp_new = py_nbt_rdata_netbios_new,
728 : };
729 :
730 :
731 0 : static PyObject *py_nbt_statistics_get_unit_id(PyObject *obj, void *closure)
732 : {
733 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
734 0 : PyObject *py_unit_id;
735 0 : py_unit_id = PyList_New(6);
736 0 : if (py_unit_id == NULL) {
737 0 : return NULL;
738 : }
739 : {
740 : int unit_id_cntr_0;
741 0 : for (unit_id_cntr_0 = 0; unit_id_cntr_0 < (6); unit_id_cntr_0++) {
742 0 : PyObject *py_unit_id_0;
743 0 : py_unit_id_0 = PyLong_FromLong((uint16_t)((object->unit_id)[unit_id_cntr_0]));
744 0 : PyList_SetItem(py_unit_id, unit_id_cntr_0, py_unit_id_0);
745 : }
746 : }
747 0 : return py_unit_id;
748 : }
749 :
750 0 : static int py_nbt_statistics_set_unit_id(PyObject *py_obj, PyObject *value, void *closure)
751 : {
752 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
753 0 : if (value == NULL) {
754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unit_id");
755 0 : return -1;
756 : }
757 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
758 : {
759 0 : int unit_id_cntr_0;
760 0 : if (ARRAY_SIZE(object->unit_id) != PyList_GET_SIZE(value)) {
761 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unit_id), PyList_GET_SIZE(value));
762 0 : return -1;
763 : }
764 0 : for (unit_id_cntr_0 = 0; unit_id_cntr_0 < PyList_GET_SIZE(value); unit_id_cntr_0++) {
765 0 : if (PyList_GET_ITEM(value, unit_id_cntr_0) == NULL) {
766 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->unit_id)[unit_id_cntr_0]");
767 0 : return -1;
768 : }
769 : {
770 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->unit_id)[unit_id_cntr_0]));
771 0 : if (PyLong_Check(PyList_GET_ITEM(value, unit_id_cntr_0))) {
772 0 : unsigned long long test_var;
773 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unit_id_cntr_0));
774 0 : if (PyErr_Occurred() != NULL) {
775 0 : return -1;
776 : }
777 0 : if (test_var > uint_max) {
778 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
779 : PyLong_Type.tp_name, uint_max, test_var);
780 0 : return -1;
781 : }
782 0 : (object->unit_id)[unit_id_cntr_0] = test_var;
783 : } else {
784 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
785 : PyLong_Type.tp_name);
786 0 : return -1;
787 : }
788 : }
789 : }
790 : }
791 0 : return 0;
792 : }
793 :
794 0 : static PyObject *py_nbt_statistics_get_jumpers(PyObject *obj, void *closure)
795 : {
796 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
797 0 : PyObject *py_jumpers;
798 0 : py_jumpers = PyLong_FromLong((uint16_t)(object->jumpers));
799 0 : return py_jumpers;
800 : }
801 :
802 0 : static int py_nbt_statistics_set_jumpers(PyObject *py_obj, PyObject *value, void *closure)
803 : {
804 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
805 0 : if (value == NULL) {
806 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->jumpers");
807 0 : return -1;
808 : }
809 : {
810 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->jumpers));
811 0 : if (PyLong_Check(value)) {
812 0 : unsigned long long test_var;
813 0 : test_var = PyLong_AsUnsignedLongLong(value);
814 0 : if (PyErr_Occurred() != NULL) {
815 0 : return -1;
816 : }
817 0 : if (test_var > uint_max) {
818 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
819 : PyLong_Type.tp_name, uint_max, test_var);
820 0 : return -1;
821 : }
822 0 : object->jumpers = test_var;
823 : } else {
824 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
825 : PyLong_Type.tp_name);
826 0 : return -1;
827 : }
828 : }
829 0 : return 0;
830 : }
831 :
832 0 : static PyObject *py_nbt_statistics_get_test_result(PyObject *obj, void *closure)
833 : {
834 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
835 0 : PyObject *py_test_result;
836 0 : py_test_result = PyLong_FromLong((uint16_t)(object->test_result));
837 0 : return py_test_result;
838 : }
839 :
840 0 : static int py_nbt_statistics_set_test_result(PyObject *py_obj, PyObject *value, void *closure)
841 : {
842 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
843 0 : if (value == NULL) {
844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->test_result");
845 0 : return -1;
846 : }
847 : {
848 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->test_result));
849 0 : if (PyLong_Check(value)) {
850 0 : unsigned long long test_var;
851 0 : test_var = PyLong_AsUnsignedLongLong(value);
852 0 : if (PyErr_Occurred() != NULL) {
853 0 : return -1;
854 : }
855 0 : if (test_var > uint_max) {
856 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
857 : PyLong_Type.tp_name, uint_max, test_var);
858 0 : return -1;
859 : }
860 0 : object->test_result = test_var;
861 : } else {
862 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
863 : PyLong_Type.tp_name);
864 0 : return -1;
865 : }
866 : }
867 0 : return 0;
868 : }
869 :
870 0 : static PyObject *py_nbt_statistics_get_version_number(PyObject *obj, void *closure)
871 : {
872 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
873 0 : PyObject *py_version_number;
874 0 : py_version_number = PyLong_FromLong((uint16_t)(object->version_number));
875 0 : return py_version_number;
876 : }
877 :
878 0 : static int py_nbt_statistics_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
879 : {
880 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
881 0 : if (value == NULL) {
882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version_number");
883 0 : return -1;
884 : }
885 : {
886 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_number));
887 0 : if (PyLong_Check(value)) {
888 0 : unsigned long long test_var;
889 0 : test_var = PyLong_AsUnsignedLongLong(value);
890 0 : if (PyErr_Occurred() != NULL) {
891 0 : return -1;
892 : }
893 0 : if (test_var > uint_max) {
894 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
895 : PyLong_Type.tp_name, uint_max, test_var);
896 0 : return -1;
897 : }
898 0 : object->version_number = test_var;
899 : } else {
900 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
901 : PyLong_Type.tp_name);
902 0 : return -1;
903 : }
904 : }
905 0 : return 0;
906 : }
907 :
908 0 : static PyObject *py_nbt_statistics_get_period_of_statistics(PyObject *obj, void *closure)
909 : {
910 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
911 0 : PyObject *py_period_of_statistics;
912 0 : py_period_of_statistics = PyLong_FromLong((uint16_t)(object->period_of_statistics));
913 0 : return py_period_of_statistics;
914 : }
915 :
916 0 : static int py_nbt_statistics_set_period_of_statistics(PyObject *py_obj, PyObject *value, void *closure)
917 : {
918 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
919 0 : if (value == NULL) {
920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->period_of_statistics");
921 0 : return -1;
922 : }
923 : {
924 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->period_of_statistics));
925 0 : if (PyLong_Check(value)) {
926 0 : unsigned long long test_var;
927 0 : test_var = PyLong_AsUnsignedLongLong(value);
928 0 : if (PyErr_Occurred() != NULL) {
929 0 : return -1;
930 : }
931 0 : if (test_var > uint_max) {
932 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
933 : PyLong_Type.tp_name, uint_max, test_var);
934 0 : return -1;
935 : }
936 0 : object->period_of_statistics = test_var;
937 : } else {
938 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
939 : PyLong_Type.tp_name);
940 0 : return -1;
941 : }
942 : }
943 0 : return 0;
944 : }
945 :
946 0 : static PyObject *py_nbt_statistics_get_number_of_crcs(PyObject *obj, void *closure)
947 : {
948 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
949 0 : PyObject *py_number_of_crcs;
950 0 : py_number_of_crcs = PyLong_FromLong((uint16_t)(object->number_of_crcs));
951 0 : return py_number_of_crcs;
952 : }
953 :
954 0 : static int py_nbt_statistics_set_number_of_crcs(PyObject *py_obj, PyObject *value, void *closure)
955 : {
956 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
957 0 : if (value == NULL) {
958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_of_crcs");
959 0 : return -1;
960 : }
961 : {
962 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_crcs));
963 0 : if (PyLong_Check(value)) {
964 0 : unsigned long long test_var;
965 0 : test_var = PyLong_AsUnsignedLongLong(value);
966 0 : if (PyErr_Occurred() != NULL) {
967 0 : return -1;
968 : }
969 0 : if (test_var > uint_max) {
970 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
971 : PyLong_Type.tp_name, uint_max, test_var);
972 0 : return -1;
973 : }
974 0 : object->number_of_crcs = test_var;
975 : } else {
976 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
977 : PyLong_Type.tp_name);
978 0 : return -1;
979 : }
980 : }
981 0 : return 0;
982 : }
983 :
984 0 : static PyObject *py_nbt_statistics_get_number_alignment_errors(PyObject *obj, void *closure)
985 : {
986 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
987 0 : PyObject *py_number_alignment_errors;
988 0 : py_number_alignment_errors = PyLong_FromLong((uint16_t)(object->number_alignment_errors));
989 0 : return py_number_alignment_errors;
990 : }
991 :
992 0 : static int py_nbt_statistics_set_number_alignment_errors(PyObject *py_obj, PyObject *value, void *closure)
993 : {
994 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
995 0 : if (value == NULL) {
996 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_alignment_errors");
997 0 : return -1;
998 : }
999 : {
1000 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_alignment_errors));
1001 0 : if (PyLong_Check(value)) {
1002 0 : unsigned long long test_var;
1003 0 : test_var = PyLong_AsUnsignedLongLong(value);
1004 0 : if (PyErr_Occurred() != NULL) {
1005 0 : return -1;
1006 : }
1007 0 : if (test_var > uint_max) {
1008 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1009 : PyLong_Type.tp_name, uint_max, test_var);
1010 0 : return -1;
1011 : }
1012 0 : object->number_alignment_errors = test_var;
1013 : } else {
1014 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1015 : PyLong_Type.tp_name);
1016 0 : return -1;
1017 : }
1018 : }
1019 0 : return 0;
1020 : }
1021 :
1022 0 : static PyObject *py_nbt_statistics_get_number_of_collisions(PyObject *obj, void *closure)
1023 : {
1024 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1025 0 : PyObject *py_number_of_collisions;
1026 0 : py_number_of_collisions = PyLong_FromLong((uint16_t)(object->number_of_collisions));
1027 0 : return py_number_of_collisions;
1028 : }
1029 :
1030 0 : static int py_nbt_statistics_set_number_of_collisions(PyObject *py_obj, PyObject *value, void *closure)
1031 : {
1032 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1033 0 : if (value == NULL) {
1034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_of_collisions");
1035 0 : return -1;
1036 : }
1037 : {
1038 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_collisions));
1039 0 : if (PyLong_Check(value)) {
1040 0 : unsigned long long test_var;
1041 0 : test_var = PyLong_AsUnsignedLongLong(value);
1042 0 : if (PyErr_Occurred() != NULL) {
1043 0 : return -1;
1044 : }
1045 0 : if (test_var > uint_max) {
1046 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1047 : PyLong_Type.tp_name, uint_max, test_var);
1048 0 : return -1;
1049 : }
1050 0 : object->number_of_collisions = test_var;
1051 : } else {
1052 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1053 : PyLong_Type.tp_name);
1054 0 : return -1;
1055 : }
1056 : }
1057 0 : return 0;
1058 : }
1059 :
1060 0 : static PyObject *py_nbt_statistics_get_number_send_aborts(PyObject *obj, void *closure)
1061 : {
1062 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1063 0 : PyObject *py_number_send_aborts;
1064 0 : py_number_send_aborts = PyLong_FromLong((uint16_t)(object->number_send_aborts));
1065 0 : return py_number_send_aborts;
1066 : }
1067 :
1068 0 : static int py_nbt_statistics_set_number_send_aborts(PyObject *py_obj, PyObject *value, void *closure)
1069 : {
1070 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1071 0 : if (value == NULL) {
1072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_send_aborts");
1073 0 : return -1;
1074 : }
1075 : {
1076 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_send_aborts));
1077 0 : if (PyLong_Check(value)) {
1078 0 : unsigned long long test_var;
1079 0 : test_var = PyLong_AsUnsignedLongLong(value);
1080 0 : if (PyErr_Occurred() != NULL) {
1081 0 : return -1;
1082 : }
1083 0 : if (test_var > uint_max) {
1084 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1085 : PyLong_Type.tp_name, uint_max, test_var);
1086 0 : return -1;
1087 : }
1088 0 : object->number_send_aborts = test_var;
1089 : } else {
1090 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1091 : PyLong_Type.tp_name);
1092 0 : return -1;
1093 : }
1094 : }
1095 0 : return 0;
1096 : }
1097 :
1098 0 : static PyObject *py_nbt_statistics_get_number_good_sends(PyObject *obj, void *closure)
1099 : {
1100 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1101 0 : PyObject *py_number_good_sends;
1102 0 : py_number_good_sends = PyLong_FromUnsignedLongLong((uint32_t)(object->number_good_sends));
1103 0 : return py_number_good_sends;
1104 : }
1105 :
1106 0 : static int py_nbt_statistics_set_number_good_sends(PyObject *py_obj, PyObject *value, void *closure)
1107 : {
1108 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1109 0 : if (value == NULL) {
1110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_good_sends");
1111 0 : return -1;
1112 : }
1113 : {
1114 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_sends));
1115 0 : if (PyLong_Check(value)) {
1116 0 : unsigned long long test_var;
1117 0 : test_var = PyLong_AsUnsignedLongLong(value);
1118 0 : if (PyErr_Occurred() != NULL) {
1119 0 : return -1;
1120 : }
1121 0 : if (test_var > uint_max) {
1122 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1123 : PyLong_Type.tp_name, uint_max, test_var);
1124 0 : return -1;
1125 : }
1126 0 : object->number_good_sends = test_var;
1127 : } else {
1128 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1129 : PyLong_Type.tp_name);
1130 0 : return -1;
1131 : }
1132 : }
1133 0 : return 0;
1134 : }
1135 :
1136 0 : static PyObject *py_nbt_statistics_get_number_good_receives(PyObject *obj, void *closure)
1137 : {
1138 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1139 0 : PyObject *py_number_good_receives;
1140 0 : py_number_good_receives = PyLong_FromUnsignedLongLong((uint32_t)(object->number_good_receives));
1141 0 : return py_number_good_receives;
1142 : }
1143 :
1144 0 : static int py_nbt_statistics_set_number_good_receives(PyObject *py_obj, PyObject *value, void *closure)
1145 : {
1146 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1147 0 : if (value == NULL) {
1148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_good_receives");
1149 0 : return -1;
1150 : }
1151 : {
1152 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_receives));
1153 0 : if (PyLong_Check(value)) {
1154 0 : unsigned long long test_var;
1155 0 : test_var = PyLong_AsUnsignedLongLong(value);
1156 0 : if (PyErr_Occurred() != NULL) {
1157 0 : return -1;
1158 : }
1159 0 : if (test_var > uint_max) {
1160 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1161 : PyLong_Type.tp_name, uint_max, test_var);
1162 0 : return -1;
1163 : }
1164 0 : object->number_good_receives = test_var;
1165 : } else {
1166 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1167 : PyLong_Type.tp_name);
1168 0 : return -1;
1169 : }
1170 : }
1171 0 : return 0;
1172 : }
1173 :
1174 0 : static PyObject *py_nbt_statistics_get_number_retransmits(PyObject *obj, void *closure)
1175 : {
1176 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1177 0 : PyObject *py_number_retransmits;
1178 0 : py_number_retransmits = PyLong_FromLong((uint16_t)(object->number_retransmits));
1179 0 : return py_number_retransmits;
1180 : }
1181 :
1182 0 : static int py_nbt_statistics_set_number_retransmits(PyObject *py_obj, PyObject *value, void *closure)
1183 : {
1184 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1185 0 : if (value == NULL) {
1186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_retransmits");
1187 0 : return -1;
1188 : }
1189 : {
1190 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_retransmits));
1191 0 : if (PyLong_Check(value)) {
1192 0 : unsigned long long test_var;
1193 0 : test_var = PyLong_AsUnsignedLongLong(value);
1194 0 : if (PyErr_Occurred() != NULL) {
1195 0 : return -1;
1196 : }
1197 0 : if (test_var > uint_max) {
1198 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1199 : PyLong_Type.tp_name, uint_max, test_var);
1200 0 : return -1;
1201 : }
1202 0 : object->number_retransmits = test_var;
1203 : } else {
1204 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1205 : PyLong_Type.tp_name);
1206 0 : return -1;
1207 : }
1208 : }
1209 0 : return 0;
1210 : }
1211 :
1212 0 : static PyObject *py_nbt_statistics_get_number_no_resource_conditions(PyObject *obj, void *closure)
1213 : {
1214 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1215 0 : PyObject *py_number_no_resource_conditions;
1216 0 : py_number_no_resource_conditions = PyLong_FromLong((uint16_t)(object->number_no_resource_conditions));
1217 0 : return py_number_no_resource_conditions;
1218 : }
1219 :
1220 0 : static int py_nbt_statistics_set_number_no_resource_conditions(PyObject *py_obj, PyObject *value, void *closure)
1221 : {
1222 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1223 0 : if (value == NULL) {
1224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_no_resource_conditions");
1225 0 : return -1;
1226 : }
1227 : {
1228 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_no_resource_conditions));
1229 0 : if (PyLong_Check(value)) {
1230 0 : unsigned long long test_var;
1231 0 : test_var = PyLong_AsUnsignedLongLong(value);
1232 0 : if (PyErr_Occurred() != NULL) {
1233 0 : return -1;
1234 : }
1235 0 : if (test_var > uint_max) {
1236 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1237 : PyLong_Type.tp_name, uint_max, test_var);
1238 0 : return -1;
1239 : }
1240 0 : object->number_no_resource_conditions = test_var;
1241 : } else {
1242 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1243 : PyLong_Type.tp_name);
1244 0 : return -1;
1245 : }
1246 : }
1247 0 : return 0;
1248 : }
1249 :
1250 0 : static PyObject *py_nbt_statistics_get_number_free_command_blocks(PyObject *obj, void *closure)
1251 : {
1252 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1253 0 : PyObject *py_number_free_command_blocks;
1254 0 : py_number_free_command_blocks = PyLong_FromLong((uint16_t)(object->number_free_command_blocks));
1255 0 : return py_number_free_command_blocks;
1256 : }
1257 :
1258 0 : static int py_nbt_statistics_set_number_free_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1259 : {
1260 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1261 0 : if (value == NULL) {
1262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_free_command_blocks");
1263 0 : return -1;
1264 : }
1265 : {
1266 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_free_command_blocks));
1267 0 : if (PyLong_Check(value)) {
1268 0 : unsigned long long test_var;
1269 0 : test_var = PyLong_AsUnsignedLongLong(value);
1270 0 : if (PyErr_Occurred() != NULL) {
1271 0 : return -1;
1272 : }
1273 0 : if (test_var > uint_max) {
1274 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1275 : PyLong_Type.tp_name, uint_max, test_var);
1276 0 : return -1;
1277 : }
1278 0 : object->number_free_command_blocks = test_var;
1279 : } else {
1280 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1281 : PyLong_Type.tp_name);
1282 0 : return -1;
1283 : }
1284 : }
1285 0 : return 0;
1286 : }
1287 :
1288 0 : static PyObject *py_nbt_statistics_get_total_number_command_blocks(PyObject *obj, void *closure)
1289 : {
1290 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1291 0 : PyObject *py_total_number_command_blocks;
1292 0 : py_total_number_command_blocks = PyLong_FromLong((uint16_t)(object->total_number_command_blocks));
1293 0 : return py_total_number_command_blocks;
1294 : }
1295 :
1296 0 : static int py_nbt_statistics_set_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1297 : {
1298 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1299 0 : if (value == NULL) {
1300 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_number_command_blocks");
1301 0 : return -1;
1302 : }
1303 : {
1304 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_number_command_blocks));
1305 0 : if (PyLong_Check(value)) {
1306 0 : unsigned long long test_var;
1307 0 : test_var = PyLong_AsUnsignedLongLong(value);
1308 0 : if (PyErr_Occurred() != NULL) {
1309 0 : return -1;
1310 : }
1311 0 : if (test_var > uint_max) {
1312 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1313 : PyLong_Type.tp_name, uint_max, test_var);
1314 0 : return -1;
1315 : }
1316 0 : object->total_number_command_blocks = test_var;
1317 : } else {
1318 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1319 : PyLong_Type.tp_name);
1320 0 : return -1;
1321 : }
1322 : }
1323 0 : return 0;
1324 : }
1325 :
1326 0 : static PyObject *py_nbt_statistics_get_max_total_number_command_blocks(PyObject *obj, void *closure)
1327 : {
1328 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1329 0 : PyObject *py_max_total_number_command_blocks;
1330 0 : py_max_total_number_command_blocks = PyLong_FromLong((uint16_t)(object->max_total_number_command_blocks));
1331 0 : return py_max_total_number_command_blocks;
1332 : }
1333 :
1334 0 : static int py_nbt_statistics_set_max_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
1335 : {
1336 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1337 0 : if (value == NULL) {
1338 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_total_number_command_blocks");
1339 0 : return -1;
1340 : }
1341 : {
1342 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_number_command_blocks));
1343 0 : if (PyLong_Check(value)) {
1344 0 : unsigned long long test_var;
1345 0 : test_var = PyLong_AsUnsignedLongLong(value);
1346 0 : if (PyErr_Occurred() != NULL) {
1347 0 : return -1;
1348 : }
1349 0 : if (test_var > uint_max) {
1350 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1351 : PyLong_Type.tp_name, uint_max, test_var);
1352 0 : return -1;
1353 : }
1354 0 : object->max_total_number_command_blocks = test_var;
1355 : } else {
1356 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1357 : PyLong_Type.tp_name);
1358 0 : return -1;
1359 : }
1360 : }
1361 0 : return 0;
1362 : }
1363 :
1364 0 : static PyObject *py_nbt_statistics_get_number_pending_sessions(PyObject *obj, void *closure)
1365 : {
1366 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1367 0 : PyObject *py_number_pending_sessions;
1368 0 : py_number_pending_sessions = PyLong_FromLong((uint16_t)(object->number_pending_sessions));
1369 0 : return py_number_pending_sessions;
1370 : }
1371 :
1372 0 : static int py_nbt_statistics_set_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
1373 : {
1374 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1375 0 : if (value == NULL) {
1376 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_pending_sessions");
1377 0 : return -1;
1378 : }
1379 : {
1380 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_pending_sessions));
1381 0 : if (PyLong_Check(value)) {
1382 0 : unsigned long long test_var;
1383 0 : test_var = PyLong_AsUnsignedLongLong(value);
1384 0 : if (PyErr_Occurred() != NULL) {
1385 0 : return -1;
1386 : }
1387 0 : if (test_var > uint_max) {
1388 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1389 : PyLong_Type.tp_name, uint_max, test_var);
1390 0 : return -1;
1391 : }
1392 0 : object->number_pending_sessions = test_var;
1393 : } else {
1394 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1395 : PyLong_Type.tp_name);
1396 0 : return -1;
1397 : }
1398 : }
1399 0 : return 0;
1400 : }
1401 :
1402 0 : static PyObject *py_nbt_statistics_get_max_number_pending_sessions(PyObject *obj, void *closure)
1403 : {
1404 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1405 0 : PyObject *py_max_number_pending_sessions;
1406 0 : py_max_number_pending_sessions = PyLong_FromLong((uint16_t)(object->max_number_pending_sessions));
1407 0 : return py_max_number_pending_sessions;
1408 : }
1409 :
1410 0 : static int py_nbt_statistics_set_max_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
1411 : {
1412 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1413 0 : if (value == NULL) {
1414 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_number_pending_sessions");
1415 0 : return -1;
1416 : }
1417 : {
1418 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_number_pending_sessions));
1419 0 : if (PyLong_Check(value)) {
1420 0 : unsigned long long test_var;
1421 0 : test_var = PyLong_AsUnsignedLongLong(value);
1422 0 : if (PyErr_Occurred() != NULL) {
1423 0 : return -1;
1424 : }
1425 0 : if (test_var > uint_max) {
1426 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1427 : PyLong_Type.tp_name, uint_max, test_var);
1428 0 : return -1;
1429 : }
1430 0 : object->max_number_pending_sessions = test_var;
1431 : } else {
1432 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1433 : PyLong_Type.tp_name);
1434 0 : return -1;
1435 : }
1436 : }
1437 0 : return 0;
1438 : }
1439 :
1440 0 : static PyObject *py_nbt_statistics_get_max_total_sessions_possible(PyObject *obj, void *closure)
1441 : {
1442 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1443 0 : PyObject *py_max_total_sessions_possible;
1444 0 : py_max_total_sessions_possible = PyLong_FromLong((uint16_t)(object->max_total_sessions_possible));
1445 0 : return py_max_total_sessions_possible;
1446 : }
1447 :
1448 0 : static int py_nbt_statistics_set_max_total_sessions_possible(PyObject *py_obj, PyObject *value, void *closure)
1449 : {
1450 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1451 0 : if (value == NULL) {
1452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_total_sessions_possible");
1453 0 : return -1;
1454 : }
1455 : {
1456 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_sessions_possible));
1457 0 : if (PyLong_Check(value)) {
1458 0 : unsigned long long test_var;
1459 0 : test_var = PyLong_AsUnsignedLongLong(value);
1460 0 : if (PyErr_Occurred() != NULL) {
1461 0 : return -1;
1462 : }
1463 0 : if (test_var > uint_max) {
1464 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1465 : PyLong_Type.tp_name, uint_max, test_var);
1466 0 : return -1;
1467 : }
1468 0 : object->max_total_sessions_possible = test_var;
1469 : } else {
1470 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1471 : PyLong_Type.tp_name);
1472 0 : return -1;
1473 : }
1474 : }
1475 0 : return 0;
1476 : }
1477 :
1478 0 : static PyObject *py_nbt_statistics_get_session_data_packet_size(PyObject *obj, void *closure)
1479 : {
1480 0 : struct nbt_statistics *object = pytalloc_get_ptr(obj);
1481 0 : PyObject *py_session_data_packet_size;
1482 0 : py_session_data_packet_size = PyLong_FromLong((uint16_t)(object->session_data_packet_size));
1483 0 : return py_session_data_packet_size;
1484 : }
1485 :
1486 0 : static int py_nbt_statistics_set_session_data_packet_size(PyObject *py_obj, PyObject *value, void *closure)
1487 : {
1488 0 : struct nbt_statistics *object = pytalloc_get_ptr(py_obj);
1489 0 : if (value == NULL) {
1490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->session_data_packet_size");
1491 0 : return -1;
1492 : }
1493 : {
1494 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->session_data_packet_size));
1495 0 : if (PyLong_Check(value)) {
1496 0 : unsigned long long test_var;
1497 0 : test_var = PyLong_AsUnsignedLongLong(value);
1498 0 : if (PyErr_Occurred() != NULL) {
1499 0 : return -1;
1500 : }
1501 0 : if (test_var > uint_max) {
1502 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1503 : PyLong_Type.tp_name, uint_max, test_var);
1504 0 : return -1;
1505 : }
1506 0 : object->session_data_packet_size = test_var;
1507 : } else {
1508 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1509 : PyLong_Type.tp_name);
1510 0 : return -1;
1511 : }
1512 : }
1513 0 : return 0;
1514 : }
1515 :
1516 : static PyGetSetDef py_nbt_statistics_getsetters[] = {
1517 : {
1518 : .name = discard_const_p(char, "unit_id"),
1519 : .get = py_nbt_statistics_get_unit_id,
1520 : .set = py_nbt_statistics_set_unit_id,
1521 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1522 : },
1523 : {
1524 : .name = discard_const_p(char, "jumpers"),
1525 : .get = py_nbt_statistics_get_jumpers,
1526 : .set = py_nbt_statistics_set_jumpers,
1527 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1528 : },
1529 : {
1530 : .name = discard_const_p(char, "test_result"),
1531 : .get = py_nbt_statistics_get_test_result,
1532 : .set = py_nbt_statistics_set_test_result,
1533 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1534 : },
1535 : {
1536 : .name = discard_const_p(char, "version_number"),
1537 : .get = py_nbt_statistics_get_version_number,
1538 : .set = py_nbt_statistics_set_version_number,
1539 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1540 : },
1541 : {
1542 : .name = discard_const_p(char, "period_of_statistics"),
1543 : .get = py_nbt_statistics_get_period_of_statistics,
1544 : .set = py_nbt_statistics_set_period_of_statistics,
1545 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1546 : },
1547 : {
1548 : .name = discard_const_p(char, "number_of_crcs"),
1549 : .get = py_nbt_statistics_get_number_of_crcs,
1550 : .set = py_nbt_statistics_set_number_of_crcs,
1551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1552 : },
1553 : {
1554 : .name = discard_const_p(char, "number_alignment_errors"),
1555 : .get = py_nbt_statistics_get_number_alignment_errors,
1556 : .set = py_nbt_statistics_set_number_alignment_errors,
1557 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1558 : },
1559 : {
1560 : .name = discard_const_p(char, "number_of_collisions"),
1561 : .get = py_nbt_statistics_get_number_of_collisions,
1562 : .set = py_nbt_statistics_set_number_of_collisions,
1563 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1564 : },
1565 : {
1566 : .name = discard_const_p(char, "number_send_aborts"),
1567 : .get = py_nbt_statistics_get_number_send_aborts,
1568 : .set = py_nbt_statistics_set_number_send_aborts,
1569 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1570 : },
1571 : {
1572 : .name = discard_const_p(char, "number_good_sends"),
1573 : .get = py_nbt_statistics_get_number_good_sends,
1574 : .set = py_nbt_statistics_set_number_good_sends,
1575 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1576 : },
1577 : {
1578 : .name = discard_const_p(char, "number_good_receives"),
1579 : .get = py_nbt_statistics_get_number_good_receives,
1580 : .set = py_nbt_statistics_set_number_good_receives,
1581 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1582 : },
1583 : {
1584 : .name = discard_const_p(char, "number_retransmits"),
1585 : .get = py_nbt_statistics_get_number_retransmits,
1586 : .set = py_nbt_statistics_set_number_retransmits,
1587 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1588 : },
1589 : {
1590 : .name = discard_const_p(char, "number_no_resource_conditions"),
1591 : .get = py_nbt_statistics_get_number_no_resource_conditions,
1592 : .set = py_nbt_statistics_set_number_no_resource_conditions,
1593 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1594 : },
1595 : {
1596 : .name = discard_const_p(char, "number_free_command_blocks"),
1597 : .get = py_nbt_statistics_get_number_free_command_blocks,
1598 : .set = py_nbt_statistics_set_number_free_command_blocks,
1599 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1600 : },
1601 : {
1602 : .name = discard_const_p(char, "total_number_command_blocks"),
1603 : .get = py_nbt_statistics_get_total_number_command_blocks,
1604 : .set = py_nbt_statistics_set_total_number_command_blocks,
1605 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1606 : },
1607 : {
1608 : .name = discard_const_p(char, "max_total_number_command_blocks"),
1609 : .get = py_nbt_statistics_get_max_total_number_command_blocks,
1610 : .set = py_nbt_statistics_set_max_total_number_command_blocks,
1611 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1612 : },
1613 : {
1614 : .name = discard_const_p(char, "number_pending_sessions"),
1615 : .get = py_nbt_statistics_get_number_pending_sessions,
1616 : .set = py_nbt_statistics_set_number_pending_sessions,
1617 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1618 : },
1619 : {
1620 : .name = discard_const_p(char, "max_number_pending_sessions"),
1621 : .get = py_nbt_statistics_get_max_number_pending_sessions,
1622 : .set = py_nbt_statistics_set_max_number_pending_sessions,
1623 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1624 : },
1625 : {
1626 : .name = discard_const_p(char, "max_total_sessions_possible"),
1627 : .get = py_nbt_statistics_get_max_total_sessions_possible,
1628 : .set = py_nbt_statistics_set_max_total_sessions_possible,
1629 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1630 : },
1631 : {
1632 : .name = discard_const_p(char, "session_data_packet_size"),
1633 : .get = py_nbt_statistics_get_session_data_packet_size,
1634 : .set = py_nbt_statistics_set_session_data_packet_size,
1635 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1636 : },
1637 : { .name = NULL }
1638 : };
1639 :
1640 0 : static PyObject *py_nbt_statistics_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1641 : {
1642 0 : return pytalloc_new(struct nbt_statistics, type);
1643 : }
1644 :
1645 :
1646 : static PyTypeObject nbt_statistics_Type = {
1647 : PyVarObject_HEAD_INIT(NULL, 0)
1648 : .tp_name = "nbt.statistics",
1649 : .tp_getset = py_nbt_statistics_getsetters,
1650 : .tp_methods = NULL,
1651 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1652 : .tp_new = py_nbt_statistics_new,
1653 : };
1654 :
1655 :
1656 0 : static PyObject *py_nbt_status_name_get_name(PyObject *obj, void *closure)
1657 : {
1658 0 : struct nbt_status_name *object = pytalloc_get_ptr(obj);
1659 0 : PyObject *py_name;
1660 0 : if (object->name == NULL) {
1661 0 : py_name = Py_None;
1662 0 : Py_INCREF(py_name);
1663 : } else {
1664 0 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
1665 : }
1666 0 : return py_name;
1667 : }
1668 :
1669 0 : static int py_nbt_status_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
1670 : {
1671 0 : struct nbt_status_name *object = pytalloc_get_ptr(py_obj);
1672 0 : if (value == NULL) {
1673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
1674 0 : return -1;
1675 : }
1676 : {
1677 0 : const char *test_str;
1678 0 : const char *talloc_str;
1679 0 : PyObject *unicode = NULL;
1680 0 : if (PyUnicode_Check(value)) {
1681 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1682 0 : if (unicode == NULL) {
1683 0 : return -1;
1684 : }
1685 0 : test_str = PyBytes_AS_STRING(unicode);
1686 0 : } else if (PyBytes_Check(value)) {
1687 0 : test_str = PyBytes_AS_STRING(value);
1688 : } else {
1689 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1690 0 : return -1;
1691 : }
1692 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1693 0 : if (unicode != NULL) {
1694 0 : Py_DECREF(unicode);
1695 : }
1696 0 : if (talloc_str == NULL) {
1697 0 : PyErr_NoMemory();
1698 0 : return -1;
1699 : }
1700 0 : object->name = talloc_str;
1701 : }
1702 0 : return 0;
1703 : }
1704 :
1705 0 : static PyObject *py_nbt_status_name_get_type(PyObject *obj, void *closure)
1706 : {
1707 0 : struct nbt_status_name *object = pytalloc_get_ptr(obj);
1708 0 : PyObject *py_type;
1709 0 : py_type = PyLong_FromLong((uint16_t)(object->type));
1710 0 : return py_type;
1711 : }
1712 :
1713 0 : static int py_nbt_status_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
1714 : {
1715 0 : struct nbt_status_name *object = pytalloc_get_ptr(py_obj);
1716 0 : if (value == NULL) {
1717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
1718 0 : return -1;
1719 : }
1720 : {
1721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1722 0 : if (PyLong_Check(value)) {
1723 0 : unsigned long long test_var;
1724 0 : test_var = PyLong_AsUnsignedLongLong(value);
1725 0 : if (PyErr_Occurred() != NULL) {
1726 0 : return -1;
1727 : }
1728 0 : if (test_var > uint_max) {
1729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1730 : PyLong_Type.tp_name, uint_max, test_var);
1731 0 : return -1;
1732 : }
1733 0 : object->type = test_var;
1734 : } else {
1735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1736 : PyLong_Type.tp_name);
1737 0 : return -1;
1738 : }
1739 : }
1740 0 : return 0;
1741 : }
1742 :
1743 0 : static PyObject *py_nbt_status_name_get_nb_flags(PyObject *obj, void *closure)
1744 : {
1745 0 : struct nbt_status_name *object = pytalloc_get_ptr(obj);
1746 0 : PyObject *py_nb_flags;
1747 0 : py_nb_flags = PyLong_FromLong((uint16_t)(object->nb_flags));
1748 0 : return py_nb_flags;
1749 : }
1750 :
1751 0 : static int py_nbt_status_name_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
1752 : {
1753 0 : struct nbt_status_name *object = pytalloc_get_ptr(py_obj);
1754 0 : if (value == NULL) {
1755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nb_flags");
1756 0 : return -1;
1757 : }
1758 : {
1759 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
1760 0 : if (PyLong_Check(value)) {
1761 0 : unsigned long long test_var;
1762 0 : test_var = PyLong_AsUnsignedLongLong(value);
1763 0 : if (PyErr_Occurred() != NULL) {
1764 0 : return -1;
1765 : }
1766 0 : if (test_var > uint_max) {
1767 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1768 : PyLong_Type.tp_name, uint_max, test_var);
1769 0 : return -1;
1770 : }
1771 0 : object->nb_flags = test_var;
1772 : } else {
1773 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1774 : PyLong_Type.tp_name);
1775 0 : return -1;
1776 : }
1777 : }
1778 0 : return 0;
1779 : }
1780 :
1781 : static PyGetSetDef py_nbt_status_name_getsetters[] = {
1782 : {
1783 : .name = discard_const_p(char, "name"),
1784 : .get = py_nbt_status_name_get_name,
1785 : .set = py_nbt_status_name_set_name,
1786 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1787 : },
1788 : {
1789 : .name = discard_const_p(char, "type"),
1790 : .get = py_nbt_status_name_get_type,
1791 : .set = py_nbt_status_name_set_type,
1792 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
1793 : },
1794 : {
1795 : .name = discard_const_p(char, "nb_flags"),
1796 : .get = py_nbt_status_name_get_nb_flags,
1797 : .set = py_nbt_status_name_set_nb_flags,
1798 : .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
1799 : },
1800 : { .name = NULL }
1801 : };
1802 :
1803 0 : static PyObject *py_nbt_status_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1804 : {
1805 0 : return pytalloc_new(struct nbt_status_name, type);
1806 : }
1807 :
1808 :
1809 : static PyTypeObject nbt_status_name_Type = {
1810 : PyVarObject_HEAD_INIT(NULL, 0)
1811 : .tp_name = "nbt.status_name",
1812 : .tp_getset = py_nbt_status_name_getsetters,
1813 : .tp_methods = NULL,
1814 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1815 : .tp_new = py_nbt_status_name_new,
1816 : };
1817 :
1818 :
1819 0 : static PyObject *py_nbt_rdata_status_get_length(PyObject *obj, void *closure)
1820 : {
1821 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(obj);
1822 0 : PyObject *py_length;
1823 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
1824 0 : return py_length;
1825 : }
1826 :
1827 0 : static int py_nbt_rdata_status_set_length(PyObject *py_obj, PyObject *value, void *closure)
1828 : {
1829 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(py_obj);
1830 0 : if (value == NULL) {
1831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
1832 0 : return -1;
1833 : }
1834 : {
1835 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1836 0 : if (PyLong_Check(value)) {
1837 0 : unsigned long long test_var;
1838 0 : test_var = PyLong_AsUnsignedLongLong(value);
1839 0 : if (PyErr_Occurred() != NULL) {
1840 0 : return -1;
1841 : }
1842 0 : if (test_var > uint_max) {
1843 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1844 : PyLong_Type.tp_name, uint_max, test_var);
1845 0 : return -1;
1846 : }
1847 0 : object->length = test_var;
1848 : } else {
1849 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1850 : PyLong_Type.tp_name);
1851 0 : return -1;
1852 : }
1853 : }
1854 0 : return 0;
1855 : }
1856 :
1857 0 : static PyObject *py_nbt_rdata_status_get_num_names(PyObject *obj, void *closure)
1858 : {
1859 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(obj);
1860 0 : PyObject *py_num_names;
1861 0 : py_num_names = PyLong_FromLong((uint16_t)(object->num_names));
1862 0 : return py_num_names;
1863 : }
1864 :
1865 0 : static int py_nbt_rdata_status_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
1866 : {
1867 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(py_obj);
1868 0 : if (value == NULL) {
1869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_names");
1870 0 : return -1;
1871 : }
1872 : {
1873 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_names));
1874 0 : if (PyLong_Check(value)) {
1875 0 : unsigned long long test_var;
1876 0 : test_var = PyLong_AsUnsignedLongLong(value);
1877 0 : if (PyErr_Occurred() != NULL) {
1878 0 : return -1;
1879 : }
1880 0 : if (test_var > uint_max) {
1881 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1882 : PyLong_Type.tp_name, uint_max, test_var);
1883 0 : return -1;
1884 : }
1885 0 : object->num_names = test_var;
1886 : } else {
1887 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1888 : PyLong_Type.tp_name);
1889 0 : return -1;
1890 : }
1891 : }
1892 0 : return 0;
1893 : }
1894 :
1895 0 : static PyObject *py_nbt_rdata_status_get_names(PyObject *obj, void *closure)
1896 : {
1897 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(obj);
1898 0 : PyObject *py_names;
1899 0 : py_names = PyList_New(object->num_names);
1900 0 : if (py_names == NULL) {
1901 0 : return NULL;
1902 : }
1903 : {
1904 : int names_cntr_0;
1905 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->num_names); names_cntr_0++) {
1906 0 : PyObject *py_names_0;
1907 0 : py_names_0 = pytalloc_reference_ex(&nbt_status_name_Type, object->names, &(object->names)[names_cntr_0]);
1908 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
1909 : }
1910 : }
1911 0 : return py_names;
1912 : }
1913 :
1914 0 : static int py_nbt_rdata_status_set_names(PyObject *py_obj, PyObject *value, void *closure)
1915 : {
1916 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(py_obj);
1917 0 : if (value == NULL) {
1918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->names");
1919 0 : return -1;
1920 : }
1921 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1922 : {
1923 0 : int names_cntr_0;
1924 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
1925 0 : if (!object->names) { return -1; }
1926 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
1927 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
1928 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
1929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->names)[names_cntr_0]");
1930 0 : return -1;
1931 : }
1932 0 : PY_CHECK_TYPE(&nbt_status_name_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
1933 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
1934 0 : PyErr_NoMemory();
1935 0 : return -1;
1936 : }
1937 0 : (object->names)[names_cntr_0] = *(struct nbt_status_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
1938 : }
1939 : }
1940 0 : return 0;
1941 : }
1942 :
1943 0 : static PyObject *py_nbt_rdata_status_get_statistics(PyObject *obj, void *closure)
1944 : {
1945 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(obj);
1946 0 : PyObject *py_statistics;
1947 0 : py_statistics = pytalloc_reference_ex(&nbt_statistics_Type, pytalloc_get_mem_ctx(obj), &object->statistics);
1948 0 : return py_statistics;
1949 : }
1950 :
1951 0 : static int py_nbt_rdata_status_set_statistics(PyObject *py_obj, PyObject *value, void *closure)
1952 : {
1953 0 : struct nbt_rdata_status *object = pytalloc_get_ptr(py_obj);
1954 0 : if (value == NULL) {
1955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->statistics");
1956 0 : return -1;
1957 : }
1958 0 : PY_CHECK_TYPE(&nbt_statistics_Type, value, return -1;);
1959 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1960 0 : PyErr_NoMemory();
1961 0 : return -1;
1962 : }
1963 0 : object->statistics = *(struct nbt_statistics *)pytalloc_get_ptr(value);
1964 0 : return 0;
1965 : }
1966 :
1967 : static PyGetSetDef py_nbt_rdata_status_getsetters[] = {
1968 : {
1969 : .name = discard_const_p(char, "length"),
1970 : .get = py_nbt_rdata_status_get_length,
1971 : .set = py_nbt_rdata_status_set_length,
1972 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1973 : },
1974 : {
1975 : .name = discard_const_p(char, "num_names"),
1976 : .get = py_nbt_rdata_status_get_num_names,
1977 : .set = py_nbt_rdata_status_set_num_names,
1978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1979 : },
1980 : {
1981 : .name = discard_const_p(char, "names"),
1982 : .get = py_nbt_rdata_status_get_names,
1983 : .set = py_nbt_rdata_status_set_names,
1984 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_status_name")
1985 : },
1986 : {
1987 : .name = discard_const_p(char, "statistics"),
1988 : .get = py_nbt_rdata_status_get_statistics,
1989 : .set = py_nbt_rdata_status_set_statistics,
1990 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_statistics")
1991 : },
1992 : { .name = NULL }
1993 : };
1994 :
1995 0 : static PyObject *py_nbt_rdata_status_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1996 : {
1997 0 : return pytalloc_new(struct nbt_rdata_status, type);
1998 : }
1999 :
2000 :
2001 : static PyTypeObject nbt_rdata_status_Type = {
2002 : PyVarObject_HEAD_INIT(NULL, 0)
2003 : .tp_name = "nbt.rdata_status",
2004 : .tp_getset = py_nbt_rdata_status_getsetters,
2005 : .tp_methods = NULL,
2006 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2007 : .tp_new = py_nbt_rdata_status_new,
2008 : };
2009 :
2010 :
2011 0 : static PyObject *py_nbt_rdata_data_get_length(PyObject *obj, void *closure)
2012 : {
2013 0 : struct nbt_rdata_data *object = pytalloc_get_ptr(obj);
2014 0 : PyObject *py_length;
2015 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
2016 0 : return py_length;
2017 : }
2018 :
2019 0 : static int py_nbt_rdata_data_set_length(PyObject *py_obj, PyObject *value, void *closure)
2020 : {
2021 0 : struct nbt_rdata_data *object = pytalloc_get_ptr(py_obj);
2022 0 : if (value == NULL) {
2023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
2024 0 : return -1;
2025 : }
2026 : {
2027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
2028 0 : if (PyLong_Check(value)) {
2029 0 : unsigned long long test_var;
2030 0 : test_var = PyLong_AsUnsignedLongLong(value);
2031 0 : if (PyErr_Occurred() != NULL) {
2032 0 : return -1;
2033 : }
2034 0 : if (test_var > uint_max) {
2035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2036 : PyLong_Type.tp_name, uint_max, test_var);
2037 0 : return -1;
2038 : }
2039 0 : object->length = test_var;
2040 : } else {
2041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2042 : PyLong_Type.tp_name);
2043 0 : return -1;
2044 : }
2045 : }
2046 0 : return 0;
2047 : }
2048 :
2049 0 : static PyObject *py_nbt_rdata_data_get_data(PyObject *obj, void *closure)
2050 : {
2051 0 : struct nbt_rdata_data *object = pytalloc_get_ptr(obj);
2052 0 : PyObject *py_data;
2053 0 : py_data = PyList_New(object->length);
2054 0 : if (py_data == NULL) {
2055 0 : return NULL;
2056 : }
2057 : {
2058 : int data_cntr_0;
2059 0 : for (data_cntr_0 = 0; data_cntr_0 < (object->length); data_cntr_0++) {
2060 0 : PyObject *py_data_0;
2061 0 : py_data_0 = PyLong_FromLong((uint16_t)((object->data)[data_cntr_0]));
2062 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
2063 : }
2064 : }
2065 0 : return py_data;
2066 : }
2067 :
2068 0 : static int py_nbt_rdata_data_set_data(PyObject *py_obj, PyObject *value, void *closure)
2069 : {
2070 0 : struct nbt_rdata_data *object = pytalloc_get_ptr(py_obj);
2071 0 : if (value == NULL) {
2072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
2073 0 : return -1;
2074 : }
2075 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2076 : {
2077 0 : int data_cntr_0;
2078 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
2079 0 : if (!object->data) { return -1; }
2080 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
2081 0 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
2082 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
2083 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->data)[data_cntr_0]");
2084 0 : return -1;
2085 : }
2086 : {
2087 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->data)[data_cntr_0]));
2088 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
2089 0 : unsigned long long test_var;
2090 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
2091 0 : if (PyErr_Occurred() != NULL) {
2092 0 : return -1;
2093 : }
2094 0 : if (test_var > uint_max) {
2095 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2096 : PyLong_Type.tp_name, uint_max, test_var);
2097 0 : return -1;
2098 : }
2099 0 : (object->data)[data_cntr_0] = test_var;
2100 : } else {
2101 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2102 : PyLong_Type.tp_name);
2103 0 : return -1;
2104 : }
2105 : }
2106 : }
2107 : }
2108 0 : return 0;
2109 : }
2110 :
2111 : static PyGetSetDef py_nbt_rdata_data_getsetters[] = {
2112 : {
2113 : .name = discard_const_p(char, "length"),
2114 : .get = py_nbt_rdata_data_get_length,
2115 : .set = py_nbt_rdata_data_set_length,
2116 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2117 : },
2118 : {
2119 : .name = discard_const_p(char, "data"),
2120 : .get = py_nbt_rdata_data_get_data,
2121 : .set = py_nbt_rdata_data_set_data,
2122 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2123 : },
2124 : { .name = NULL }
2125 : };
2126 :
2127 0 : static PyObject *py_nbt_rdata_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2128 : {
2129 0 : return pytalloc_new(struct nbt_rdata_data, type);
2130 : }
2131 :
2132 :
2133 : static PyTypeObject nbt_rdata_data_Type = {
2134 : PyVarObject_HEAD_INIT(NULL, 0)
2135 : .tp_name = "nbt.rdata_data",
2136 : .tp_getset = py_nbt_rdata_data_getsetters,
2137 : .tp_methods = NULL,
2138 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2139 : .tp_new = py_nbt_rdata_data_new,
2140 : };
2141 :
2142 0 : static PyObject *py_import_nbt_rdata(TALLOC_CTX *mem_ctx, int level, union nbt_rdata *in)
2143 : {
2144 0 : PyObject *ret;
2145 :
2146 0 : switch (level) {
2147 0 : case NBT_QTYPE_NETBIOS:
2148 0 : ret = pytalloc_reference_ex(&nbt_rdata_netbios_Type, mem_ctx, &in->netbios);
2149 0 : return ret;
2150 :
2151 0 : case NBT_QTYPE_STATUS:
2152 0 : ret = pytalloc_reference_ex(&nbt_rdata_status_Type, mem_ctx, &in->status);
2153 0 : return ret;
2154 :
2155 0 : default:
2156 0 : ret = pytalloc_reference_ex(&nbt_rdata_data_Type, mem_ctx, &in->data);
2157 0 : return ret;
2158 :
2159 : }
2160 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2161 : return NULL;
2162 : }
2163 :
2164 0 : static union nbt_rdata *py_export_nbt_rdata(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2165 : {
2166 0 : union nbt_rdata *ret = talloc_zero(mem_ctx, union nbt_rdata);
2167 0 : switch (level) {
2168 0 : case NBT_QTYPE_NETBIOS:
2169 0 : if (in == NULL) {
2170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->netbios");
2171 0 : talloc_free(ret); return NULL;
2172 : }
2173 0 : PY_CHECK_TYPE(&nbt_rdata_netbios_Type, in, talloc_free(ret); return NULL;);
2174 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2175 0 : PyErr_NoMemory();
2176 0 : talloc_free(ret); return NULL;
2177 : }
2178 0 : ret->netbios = *(struct nbt_rdata_netbios *)pytalloc_get_ptr(in);
2179 0 : break;
2180 :
2181 0 : case NBT_QTYPE_STATUS:
2182 0 : if (in == NULL) {
2183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->status");
2184 0 : talloc_free(ret); return NULL;
2185 : }
2186 0 : PY_CHECK_TYPE(&nbt_rdata_status_Type, in, talloc_free(ret); return NULL;);
2187 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2188 0 : PyErr_NoMemory();
2189 0 : talloc_free(ret); return NULL;
2190 : }
2191 0 : ret->status = *(struct nbt_rdata_status *)pytalloc_get_ptr(in);
2192 0 : break;
2193 :
2194 0 : default:
2195 0 : if (in == NULL) {
2196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->data");
2197 0 : talloc_free(ret); return NULL;
2198 : }
2199 0 : PY_CHECK_TYPE(&nbt_rdata_data_Type, in, talloc_free(ret); return NULL;);
2200 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2201 0 : PyErr_NoMemory();
2202 0 : talloc_free(ret); return NULL;
2203 : }
2204 0 : ret->data = *(struct nbt_rdata_data *)pytalloc_get_ptr(in);
2205 0 : break;
2206 :
2207 : }
2208 :
2209 0 : return ret;
2210 : }
2211 :
2212 0 : static PyObject *py_nbt_rdata_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2213 : {
2214 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2215 0 : PyObject *mem_ctx_obj = NULL;
2216 0 : TALLOC_CTX *mem_ctx = NULL;
2217 0 : int level = 0;
2218 0 : PyObject *in_obj = NULL;
2219 0 : union nbt_rdata *in = NULL;
2220 :
2221 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2222 : discard_const_p(char *, kwnames),
2223 : &mem_ctx_obj,
2224 : &level,
2225 : &in_obj)) {
2226 0 : return NULL;
2227 : }
2228 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2229 0 : if (mem_ctx == NULL) {
2230 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2231 0 : return NULL;
2232 : }
2233 0 : in = (union nbt_rdata *)pytalloc_get_ptr(in_obj);
2234 0 : if (in == NULL) {
2235 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_rdata!");
2236 0 : return NULL;
2237 : }
2238 :
2239 0 : return py_import_nbt_rdata(mem_ctx, level, in);
2240 : }
2241 :
2242 0 : static PyObject *py_nbt_rdata_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2243 : {
2244 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2245 0 : PyObject *mem_ctx_obj = NULL;
2246 0 : TALLOC_CTX *mem_ctx = NULL;
2247 0 : int level = 0;
2248 0 : PyObject *in = NULL;
2249 0 : union nbt_rdata *out = NULL;
2250 :
2251 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2252 : discard_const_p(char *, kwnames),
2253 : &mem_ctx_obj,
2254 : &level,
2255 : &in)) {
2256 0 : return NULL;
2257 : }
2258 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2259 0 : if (mem_ctx == NULL) {
2260 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2261 0 : return NULL;
2262 : }
2263 :
2264 0 : out = py_export_nbt_rdata(mem_ctx, level, in);
2265 0 : if (out == NULL) {
2266 0 : return NULL;
2267 : }
2268 :
2269 0 : return pytalloc_GenericObject_reference(out);
2270 : }
2271 :
2272 : static PyMethodDef py_nbt_rdata_methods[] = {
2273 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_import),
2274 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2275 : "T.__import__(mem_ctx, level, in) => ret." },
2276 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_export),
2277 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2278 : "T.__export__(mem_ctx, level, in) => ret." },
2279 : { NULL, NULL, 0, NULL }
2280 : };
2281 :
2282 0 : static PyObject *py_nbt_rdata_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2283 : {
2284 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2285 0 : return NULL;
2286 : }
2287 :
2288 :
2289 : static PyTypeObject nbt_rdata_Type = {
2290 : PyVarObject_HEAD_INIT(NULL, 0)
2291 : .tp_name = "nbt.rdata",
2292 : .tp_getset = NULL,
2293 : .tp_methods = py_nbt_rdata_methods,
2294 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2295 : .tp_new = py_nbt_rdata_new,
2296 : };
2297 :
2298 :
2299 0 : static PyObject *py_nbt_res_rec_get_name(PyObject *obj, void *closure)
2300 : {
2301 0 : struct nbt_res_rec *object = pytalloc_get_ptr(obj);
2302 0 : PyObject *py_name;
2303 0 : py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
2304 0 : return py_name;
2305 : }
2306 :
2307 0 : static int py_nbt_res_rec_set_name(PyObject *py_obj, PyObject *value, void *closure)
2308 : {
2309 0 : struct nbt_res_rec *object = pytalloc_get_ptr(py_obj);
2310 0 : if (value == NULL) {
2311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
2312 0 : return -1;
2313 : }
2314 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
2315 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2316 0 : PyErr_NoMemory();
2317 0 : return -1;
2318 : }
2319 0 : object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
2320 0 : return 0;
2321 : }
2322 :
2323 0 : static PyObject *py_nbt_res_rec_get_rr_type(PyObject *obj, void *closure)
2324 : {
2325 0 : struct nbt_res_rec *object = pytalloc_get_ptr(obj);
2326 0 : PyObject *py_rr_type;
2327 0 : py_rr_type = PyLong_FromLong((uint16_t)(object->rr_type));
2328 0 : return py_rr_type;
2329 : }
2330 :
2331 0 : static int py_nbt_res_rec_set_rr_type(PyObject *py_obj, PyObject *value, void *closure)
2332 : {
2333 0 : struct nbt_res_rec *object = pytalloc_get_ptr(py_obj);
2334 0 : if (value == NULL) {
2335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rr_type");
2336 0 : return -1;
2337 : }
2338 : {
2339 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_type));
2340 0 : if (PyLong_Check(value)) {
2341 0 : unsigned long long test_var;
2342 0 : test_var = PyLong_AsUnsignedLongLong(value);
2343 0 : if (PyErr_Occurred() != NULL) {
2344 0 : return -1;
2345 : }
2346 0 : if (test_var > uint_max) {
2347 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2348 : PyLong_Type.tp_name, uint_max, test_var);
2349 0 : return -1;
2350 : }
2351 0 : object->rr_type = test_var;
2352 : } else {
2353 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2354 : PyLong_Type.tp_name);
2355 0 : return -1;
2356 : }
2357 : }
2358 0 : return 0;
2359 : }
2360 :
2361 0 : static PyObject *py_nbt_res_rec_get_rr_class(PyObject *obj, void *closure)
2362 : {
2363 0 : struct nbt_res_rec *object = pytalloc_get_ptr(obj);
2364 0 : PyObject *py_rr_class;
2365 0 : py_rr_class = PyLong_FromLong((uint16_t)(object->rr_class));
2366 0 : return py_rr_class;
2367 : }
2368 :
2369 0 : static int py_nbt_res_rec_set_rr_class(PyObject *py_obj, PyObject *value, void *closure)
2370 : {
2371 0 : struct nbt_res_rec *object = pytalloc_get_ptr(py_obj);
2372 0 : if (value == NULL) {
2373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rr_class");
2374 0 : return -1;
2375 : }
2376 : {
2377 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_class));
2378 0 : if (PyLong_Check(value)) {
2379 0 : unsigned long long test_var;
2380 0 : test_var = PyLong_AsUnsignedLongLong(value);
2381 0 : if (PyErr_Occurred() != NULL) {
2382 0 : return -1;
2383 : }
2384 0 : if (test_var > uint_max) {
2385 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2386 : PyLong_Type.tp_name, uint_max, test_var);
2387 0 : return -1;
2388 : }
2389 0 : object->rr_class = test_var;
2390 : } else {
2391 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2392 : PyLong_Type.tp_name);
2393 0 : return -1;
2394 : }
2395 : }
2396 0 : return 0;
2397 : }
2398 :
2399 0 : static PyObject *py_nbt_res_rec_get_ttl(PyObject *obj, void *closure)
2400 : {
2401 0 : struct nbt_res_rec *object = pytalloc_get_ptr(obj);
2402 0 : PyObject *py_ttl;
2403 0 : py_ttl = PyLong_FromUnsignedLongLong((uint32_t)(object->ttl));
2404 0 : return py_ttl;
2405 : }
2406 :
2407 0 : static int py_nbt_res_rec_set_ttl(PyObject *py_obj, PyObject *value, void *closure)
2408 : {
2409 0 : struct nbt_res_rec *object = pytalloc_get_ptr(py_obj);
2410 0 : if (value == NULL) {
2411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ttl");
2412 0 : return -1;
2413 : }
2414 : {
2415 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ttl));
2416 0 : if (PyLong_Check(value)) {
2417 0 : unsigned long long test_var;
2418 0 : test_var = PyLong_AsUnsignedLongLong(value);
2419 0 : if (PyErr_Occurred() != NULL) {
2420 0 : return -1;
2421 : }
2422 0 : if (test_var > uint_max) {
2423 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2424 : PyLong_Type.tp_name, uint_max, test_var);
2425 0 : return -1;
2426 : }
2427 0 : object->ttl = test_var;
2428 : } else {
2429 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2430 : PyLong_Type.tp_name);
2431 0 : return -1;
2432 : }
2433 : }
2434 0 : return 0;
2435 : }
2436 :
2437 0 : static PyObject *py_nbt_res_rec_get_rdata(PyObject *obj, void *closure)
2438 : {
2439 0 : struct nbt_res_rec *object = pytalloc_get_ptr(obj);
2440 0 : PyObject *py_rdata;
2441 0 : py_rdata = pyrpc_import_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(obj), object->rr_type, &object->rdata, "union nbt_rdata");
2442 0 : if (py_rdata == NULL) {
2443 0 : return NULL;
2444 : }
2445 0 : return py_rdata;
2446 : }
2447 :
2448 0 : static int py_nbt_res_rec_set_rdata(PyObject *py_obj, PyObject *value, void *closure)
2449 : {
2450 0 : struct nbt_res_rec *object = pytalloc_get_ptr(py_obj);
2451 0 : if (value == NULL) {
2452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rdata");
2453 0 : return -1;
2454 : }
2455 : {
2456 0 : union nbt_rdata *rdata_switch_0;
2457 0 : rdata_switch_0 = (union nbt_rdata *)pyrpc_export_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(py_obj), object->rr_type, value, "union nbt_rdata");
2458 0 : if (rdata_switch_0 == NULL) {
2459 0 : return -1;
2460 : }
2461 0 : object->rdata = *rdata_switch_0;
2462 : }
2463 0 : return 0;
2464 : }
2465 :
2466 : static PyGetSetDef py_nbt_res_rec_getsetters[] = {
2467 : {
2468 : .name = discard_const_p(char, "name"),
2469 : .get = py_nbt_res_rec_get_name,
2470 : .set = py_nbt_res_rec_set_name,
2471 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
2472 : },
2473 : {
2474 : .name = discard_const_p(char, "rr_type"),
2475 : .get = py_nbt_res_rec_get_rr_type,
2476 : .set = py_nbt_res_rec_set_rr_type,
2477 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
2478 : },
2479 : {
2480 : .name = discard_const_p(char, "rr_class"),
2481 : .get = py_nbt_res_rec_get_rr_class,
2482 : .set = py_nbt_res_rec_set_rr_class,
2483 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
2484 : },
2485 : {
2486 : .name = discard_const_p(char, "ttl"),
2487 : .get = py_nbt_res_rec_get_ttl,
2488 : .set = py_nbt_res_rec_set_ttl,
2489 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2490 : },
2491 : {
2492 : .name = discard_const_p(char, "rdata"),
2493 : .get = py_nbt_res_rec_get_rdata,
2494 : .set = py_nbt_res_rec_set_rdata,
2495 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata")
2496 : },
2497 : { .name = NULL }
2498 : };
2499 :
2500 0 : static PyObject *py_nbt_res_rec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2501 : {
2502 0 : return pytalloc_new(struct nbt_res_rec, type);
2503 : }
2504 :
2505 :
2506 : static PyTypeObject nbt_res_rec_Type = {
2507 : PyVarObject_HEAD_INIT(NULL, 0)
2508 : .tp_name = "nbt.res_rec",
2509 : .tp_getset = py_nbt_res_rec_getsetters,
2510 : .tp_methods = NULL,
2511 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2512 : .tp_new = py_nbt_res_rec_new,
2513 : };
2514 :
2515 :
2516 0 : static PyObject *py_nbt_name_packet_get_name_trn_id(PyObject *obj, void *closure)
2517 : {
2518 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2519 0 : PyObject *py_name_trn_id;
2520 0 : py_name_trn_id = PyLong_FromLong((uint16_t)(object->name_trn_id));
2521 0 : return py_name_trn_id;
2522 : }
2523 :
2524 0 : static int py_nbt_name_packet_set_name_trn_id(PyObject *py_obj, PyObject *value, void *closure)
2525 : {
2526 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2527 0 : if (value == NULL) {
2528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name_trn_id");
2529 0 : return -1;
2530 : }
2531 : {
2532 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_trn_id));
2533 0 : if (PyLong_Check(value)) {
2534 0 : unsigned long long test_var;
2535 0 : test_var = PyLong_AsUnsignedLongLong(value);
2536 0 : if (PyErr_Occurred() != NULL) {
2537 0 : return -1;
2538 : }
2539 0 : if (test_var > uint_max) {
2540 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2541 : PyLong_Type.tp_name, uint_max, test_var);
2542 0 : return -1;
2543 : }
2544 0 : object->name_trn_id = test_var;
2545 : } else {
2546 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2547 : PyLong_Type.tp_name);
2548 0 : return -1;
2549 : }
2550 : }
2551 0 : return 0;
2552 : }
2553 :
2554 0 : static PyObject *py_nbt_name_packet_get_operation(PyObject *obj, void *closure)
2555 : {
2556 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2557 0 : PyObject *py_operation;
2558 0 : py_operation = PyLong_FromLong((uint16_t)(object->operation));
2559 0 : return py_operation;
2560 : }
2561 :
2562 0 : static int py_nbt_name_packet_set_operation(PyObject *py_obj, PyObject *value, void *closure)
2563 : {
2564 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2565 0 : if (value == NULL) {
2566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->operation");
2567 0 : return -1;
2568 : }
2569 : {
2570 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->operation));
2571 0 : if (PyLong_Check(value)) {
2572 0 : unsigned long long test_var;
2573 0 : test_var = PyLong_AsUnsignedLongLong(value);
2574 0 : if (PyErr_Occurred() != NULL) {
2575 0 : return -1;
2576 : }
2577 0 : if (test_var > uint_max) {
2578 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2579 : PyLong_Type.tp_name, uint_max, test_var);
2580 0 : return -1;
2581 : }
2582 0 : object->operation = test_var;
2583 : } else {
2584 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2585 : PyLong_Type.tp_name);
2586 0 : return -1;
2587 : }
2588 : }
2589 0 : return 0;
2590 : }
2591 :
2592 0 : static PyObject *py_nbt_name_packet_get_qdcount(PyObject *obj, void *closure)
2593 : {
2594 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2595 0 : PyObject *py_qdcount;
2596 0 : py_qdcount = PyLong_FromLong((uint16_t)(object->qdcount));
2597 0 : return py_qdcount;
2598 : }
2599 :
2600 0 : static int py_nbt_name_packet_set_qdcount(PyObject *py_obj, PyObject *value, void *closure)
2601 : {
2602 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2603 0 : if (value == NULL) {
2604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->qdcount");
2605 0 : return -1;
2606 : }
2607 : {
2608 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->qdcount));
2609 0 : if (PyLong_Check(value)) {
2610 0 : unsigned long long test_var;
2611 0 : test_var = PyLong_AsUnsignedLongLong(value);
2612 0 : if (PyErr_Occurred() != NULL) {
2613 0 : return -1;
2614 : }
2615 0 : if (test_var > uint_max) {
2616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2617 : PyLong_Type.tp_name, uint_max, test_var);
2618 0 : return -1;
2619 : }
2620 0 : object->qdcount = test_var;
2621 : } else {
2622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2623 : PyLong_Type.tp_name);
2624 0 : return -1;
2625 : }
2626 : }
2627 0 : return 0;
2628 : }
2629 :
2630 0 : static PyObject *py_nbt_name_packet_get_ancount(PyObject *obj, void *closure)
2631 : {
2632 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2633 0 : PyObject *py_ancount;
2634 0 : py_ancount = PyLong_FromLong((uint16_t)(object->ancount));
2635 0 : return py_ancount;
2636 : }
2637 :
2638 0 : static int py_nbt_name_packet_set_ancount(PyObject *py_obj, PyObject *value, void *closure)
2639 : {
2640 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2641 0 : if (value == NULL) {
2642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ancount");
2643 0 : return -1;
2644 : }
2645 : {
2646 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ancount));
2647 0 : if (PyLong_Check(value)) {
2648 0 : unsigned long long test_var;
2649 0 : test_var = PyLong_AsUnsignedLongLong(value);
2650 0 : if (PyErr_Occurred() != NULL) {
2651 0 : return -1;
2652 : }
2653 0 : if (test_var > uint_max) {
2654 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2655 : PyLong_Type.tp_name, uint_max, test_var);
2656 0 : return -1;
2657 : }
2658 0 : object->ancount = test_var;
2659 : } else {
2660 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2661 : PyLong_Type.tp_name);
2662 0 : return -1;
2663 : }
2664 : }
2665 0 : return 0;
2666 : }
2667 :
2668 0 : static PyObject *py_nbt_name_packet_get_nscount(PyObject *obj, void *closure)
2669 : {
2670 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2671 0 : PyObject *py_nscount;
2672 0 : py_nscount = PyLong_FromLong((uint16_t)(object->nscount));
2673 0 : return py_nscount;
2674 : }
2675 :
2676 0 : static int py_nbt_name_packet_set_nscount(PyObject *py_obj, PyObject *value, void *closure)
2677 : {
2678 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2679 0 : if (value == NULL) {
2680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nscount");
2681 0 : return -1;
2682 : }
2683 : {
2684 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nscount));
2685 0 : if (PyLong_Check(value)) {
2686 0 : unsigned long long test_var;
2687 0 : test_var = PyLong_AsUnsignedLongLong(value);
2688 0 : if (PyErr_Occurred() != NULL) {
2689 0 : return -1;
2690 : }
2691 0 : if (test_var > uint_max) {
2692 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2693 : PyLong_Type.tp_name, uint_max, test_var);
2694 0 : return -1;
2695 : }
2696 0 : object->nscount = test_var;
2697 : } else {
2698 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2699 : PyLong_Type.tp_name);
2700 0 : return -1;
2701 : }
2702 : }
2703 0 : return 0;
2704 : }
2705 :
2706 0 : static PyObject *py_nbt_name_packet_get_arcount(PyObject *obj, void *closure)
2707 : {
2708 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2709 0 : PyObject *py_arcount;
2710 0 : py_arcount = PyLong_FromLong((uint16_t)(object->arcount));
2711 0 : return py_arcount;
2712 : }
2713 :
2714 0 : static int py_nbt_name_packet_set_arcount(PyObject *py_obj, PyObject *value, void *closure)
2715 : {
2716 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2717 0 : if (value == NULL) {
2718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->arcount");
2719 0 : return -1;
2720 : }
2721 : {
2722 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->arcount));
2723 0 : if (PyLong_Check(value)) {
2724 0 : unsigned long long test_var;
2725 0 : test_var = PyLong_AsUnsignedLongLong(value);
2726 0 : if (PyErr_Occurred() != NULL) {
2727 0 : return -1;
2728 : }
2729 0 : if (test_var > uint_max) {
2730 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2731 : PyLong_Type.tp_name, uint_max, test_var);
2732 0 : return -1;
2733 : }
2734 0 : object->arcount = test_var;
2735 : } else {
2736 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2737 : PyLong_Type.tp_name);
2738 0 : return -1;
2739 : }
2740 : }
2741 0 : return 0;
2742 : }
2743 :
2744 0 : static PyObject *py_nbt_name_packet_get_questions(PyObject *obj, void *closure)
2745 : {
2746 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2747 0 : PyObject *py_questions;
2748 0 : py_questions = PyList_New(object->qdcount);
2749 0 : if (py_questions == NULL) {
2750 0 : return NULL;
2751 : }
2752 : {
2753 : int questions_cntr_0;
2754 0 : for (questions_cntr_0 = 0; questions_cntr_0 < (object->qdcount); questions_cntr_0++) {
2755 0 : PyObject *py_questions_0;
2756 0 : py_questions_0 = pytalloc_reference_ex(&nbt_name_question_Type, object->questions, &(object->questions)[questions_cntr_0]);
2757 0 : PyList_SetItem(py_questions, questions_cntr_0, py_questions_0);
2758 : }
2759 : }
2760 0 : return py_questions;
2761 : }
2762 :
2763 0 : static int py_nbt_name_packet_set_questions(PyObject *py_obj, PyObject *value, void *closure)
2764 : {
2765 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2766 0 : if (value == NULL) {
2767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->questions");
2768 0 : return -1;
2769 : }
2770 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2771 : {
2772 0 : int questions_cntr_0;
2773 0 : object->questions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->questions, PyList_GET_SIZE(value));
2774 0 : if (!object->questions) { return -1; }
2775 0 : talloc_set_name_const(object->questions, "ARRAY: object->questions");
2776 0 : for (questions_cntr_0 = 0; questions_cntr_0 < PyList_GET_SIZE(value); questions_cntr_0++) {
2777 0 : if (PyList_GET_ITEM(value, questions_cntr_0) == NULL) {
2778 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->questions)[questions_cntr_0]");
2779 0 : return -1;
2780 : }
2781 0 : PY_CHECK_TYPE(&nbt_name_question_Type, PyList_GET_ITEM(value, questions_cntr_0), return -1;);
2782 0 : if (talloc_reference(object->questions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, questions_cntr_0))) == NULL) {
2783 0 : PyErr_NoMemory();
2784 0 : return -1;
2785 : }
2786 0 : (object->questions)[questions_cntr_0] = *(struct nbt_name_question *)pytalloc_get_ptr(PyList_GET_ITEM(value, questions_cntr_0));
2787 : }
2788 : }
2789 0 : return 0;
2790 : }
2791 :
2792 0 : static PyObject *py_nbt_name_packet_get_answers(PyObject *obj, void *closure)
2793 : {
2794 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2795 0 : PyObject *py_answers;
2796 0 : py_answers = PyList_New(object->ancount);
2797 0 : if (py_answers == NULL) {
2798 0 : return NULL;
2799 : }
2800 : {
2801 : int answers_cntr_0;
2802 0 : for (answers_cntr_0 = 0; answers_cntr_0 < (object->ancount); answers_cntr_0++) {
2803 0 : PyObject *py_answers_0;
2804 0 : py_answers_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->answers, &(object->answers)[answers_cntr_0]);
2805 0 : PyList_SetItem(py_answers, answers_cntr_0, py_answers_0);
2806 : }
2807 : }
2808 0 : return py_answers;
2809 : }
2810 :
2811 0 : static int py_nbt_name_packet_set_answers(PyObject *py_obj, PyObject *value, void *closure)
2812 : {
2813 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2814 0 : if (value == NULL) {
2815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->answers");
2816 0 : return -1;
2817 : }
2818 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2819 : {
2820 0 : int answers_cntr_0;
2821 0 : object->answers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->answers, PyList_GET_SIZE(value));
2822 0 : if (!object->answers) { return -1; }
2823 0 : talloc_set_name_const(object->answers, "ARRAY: object->answers");
2824 0 : for (answers_cntr_0 = 0; answers_cntr_0 < PyList_GET_SIZE(value); answers_cntr_0++) {
2825 0 : if (PyList_GET_ITEM(value, answers_cntr_0) == NULL) {
2826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->answers)[answers_cntr_0]");
2827 0 : return -1;
2828 : }
2829 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, answers_cntr_0), return -1;);
2830 0 : if (talloc_reference(object->answers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, answers_cntr_0))) == NULL) {
2831 0 : PyErr_NoMemory();
2832 0 : return -1;
2833 : }
2834 0 : (object->answers)[answers_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, answers_cntr_0));
2835 : }
2836 : }
2837 0 : return 0;
2838 : }
2839 :
2840 0 : static PyObject *py_nbt_name_packet_get_nsrecs(PyObject *obj, void *closure)
2841 : {
2842 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2843 0 : PyObject *py_nsrecs;
2844 0 : py_nsrecs = PyList_New(object->nscount);
2845 0 : if (py_nsrecs == NULL) {
2846 0 : return NULL;
2847 : }
2848 : {
2849 : int nsrecs_cntr_0;
2850 0 : for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < (object->nscount); nsrecs_cntr_0++) {
2851 0 : PyObject *py_nsrecs_0;
2852 0 : py_nsrecs_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->nsrecs, &(object->nsrecs)[nsrecs_cntr_0]);
2853 0 : PyList_SetItem(py_nsrecs, nsrecs_cntr_0, py_nsrecs_0);
2854 : }
2855 : }
2856 0 : return py_nsrecs;
2857 : }
2858 :
2859 0 : static int py_nbt_name_packet_set_nsrecs(PyObject *py_obj, PyObject *value, void *closure)
2860 : {
2861 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2862 0 : if (value == NULL) {
2863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nsrecs");
2864 0 : return -1;
2865 : }
2866 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2867 : {
2868 0 : int nsrecs_cntr_0;
2869 0 : object->nsrecs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nsrecs, PyList_GET_SIZE(value));
2870 0 : if (!object->nsrecs) { return -1; }
2871 0 : talloc_set_name_const(object->nsrecs, "ARRAY: object->nsrecs");
2872 0 : for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < PyList_GET_SIZE(value); nsrecs_cntr_0++) {
2873 0 : if (PyList_GET_ITEM(value, nsrecs_cntr_0) == NULL) {
2874 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->nsrecs)[nsrecs_cntr_0]");
2875 0 : return -1;
2876 : }
2877 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, nsrecs_cntr_0), return -1;);
2878 0 : if (talloc_reference(object->nsrecs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, nsrecs_cntr_0))) == NULL) {
2879 0 : PyErr_NoMemory();
2880 0 : return -1;
2881 : }
2882 0 : (object->nsrecs)[nsrecs_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, nsrecs_cntr_0));
2883 : }
2884 : }
2885 0 : return 0;
2886 : }
2887 :
2888 0 : static PyObject *py_nbt_name_packet_get_additional(PyObject *obj, void *closure)
2889 : {
2890 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2891 0 : PyObject *py_additional;
2892 0 : py_additional = PyList_New(object->arcount);
2893 0 : if (py_additional == NULL) {
2894 0 : return NULL;
2895 : }
2896 : {
2897 : int additional_cntr_0;
2898 0 : for (additional_cntr_0 = 0; additional_cntr_0 < (object->arcount); additional_cntr_0++) {
2899 0 : PyObject *py_additional_0;
2900 0 : py_additional_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->additional, &(object->additional)[additional_cntr_0]);
2901 0 : PyList_SetItem(py_additional, additional_cntr_0, py_additional_0);
2902 : }
2903 : }
2904 0 : return py_additional;
2905 : }
2906 :
2907 0 : static int py_nbt_name_packet_set_additional(PyObject *py_obj, PyObject *value, void *closure)
2908 : {
2909 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2910 0 : if (value == NULL) {
2911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->additional");
2912 0 : return -1;
2913 : }
2914 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2915 : {
2916 0 : int additional_cntr_0;
2917 0 : object->additional = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->additional, PyList_GET_SIZE(value));
2918 0 : if (!object->additional) { return -1; }
2919 0 : talloc_set_name_const(object->additional, "ARRAY: object->additional");
2920 0 : for (additional_cntr_0 = 0; additional_cntr_0 < PyList_GET_SIZE(value); additional_cntr_0++) {
2921 0 : if (PyList_GET_ITEM(value, additional_cntr_0) == NULL) {
2922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->additional)[additional_cntr_0]");
2923 0 : return -1;
2924 : }
2925 0 : PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, additional_cntr_0), return -1;);
2926 0 : if (talloc_reference(object->additional, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, additional_cntr_0))) == NULL) {
2927 0 : PyErr_NoMemory();
2928 0 : return -1;
2929 : }
2930 0 : (object->additional)[additional_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, additional_cntr_0));
2931 : }
2932 : }
2933 0 : return 0;
2934 : }
2935 :
2936 0 : static PyObject *py_nbt_name_packet_get_padding(PyObject *obj, void *closure)
2937 : {
2938 0 : struct nbt_name_packet *object = pytalloc_get_ptr(obj);
2939 0 : PyObject *py_padding;
2940 0 : py_padding = PyBytes_FromStringAndSize((char *)(object->padding).data, (object->padding).length);
2941 0 : return py_padding;
2942 : }
2943 :
2944 0 : static int py_nbt_name_packet_set_padding(PyObject *py_obj, PyObject *value, void *closure)
2945 : {
2946 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
2947 0 : if (value == NULL) {
2948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->padding");
2949 0 : return -1;
2950 : }
2951 0 : object->padding = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2952 0 : return 0;
2953 : }
2954 :
2955 : static PyGetSetDef py_nbt_name_packet_getsetters[] = {
2956 : {
2957 : .name = discard_const_p(char, "name_trn_id"),
2958 : .get = py_nbt_name_packet_get_name_trn_id,
2959 : .set = py_nbt_name_packet_set_name_trn_id,
2960 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2961 : },
2962 : {
2963 : .name = discard_const_p(char, "operation"),
2964 : .get = py_nbt_name_packet_get_operation,
2965 : .set = py_nbt_name_packet_set_operation,
2966 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_operation")
2967 : },
2968 : {
2969 : .name = discard_const_p(char, "qdcount"),
2970 : .get = py_nbt_name_packet_get_qdcount,
2971 : .set = py_nbt_name_packet_set_qdcount,
2972 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2973 : },
2974 : {
2975 : .name = discard_const_p(char, "ancount"),
2976 : .get = py_nbt_name_packet_get_ancount,
2977 : .set = py_nbt_name_packet_set_ancount,
2978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2979 : },
2980 : {
2981 : .name = discard_const_p(char, "nscount"),
2982 : .get = py_nbt_name_packet_get_nscount,
2983 : .set = py_nbt_name_packet_set_nscount,
2984 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2985 : },
2986 : {
2987 : .name = discard_const_p(char, "arcount"),
2988 : .get = py_nbt_name_packet_get_arcount,
2989 : .set = py_nbt_name_packet_set_arcount,
2990 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2991 : },
2992 : {
2993 : .name = discard_const_p(char, "questions"),
2994 : .get = py_nbt_name_packet_get_questions,
2995 : .set = py_nbt_name_packet_set_questions,
2996 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_question")
2997 : },
2998 : {
2999 : .name = discard_const_p(char, "answers"),
3000 : .get = py_nbt_name_packet_get_answers,
3001 : .set = py_nbt_name_packet_set_answers,
3002 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3003 : },
3004 : {
3005 : .name = discard_const_p(char, "nsrecs"),
3006 : .get = py_nbt_name_packet_get_nsrecs,
3007 : .set = py_nbt_name_packet_set_nsrecs,
3008 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3009 : },
3010 : {
3011 : .name = discard_const_p(char, "additional"),
3012 : .get = py_nbt_name_packet_get_additional,
3013 : .set = py_nbt_name_packet_set_additional,
3014 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
3015 : },
3016 : {
3017 : .name = discard_const_p(char, "padding"),
3018 : .get = py_nbt_name_packet_get_padding,
3019 : .set = py_nbt_name_packet_set_padding,
3020 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
3021 : },
3022 : { .name = NULL }
3023 : };
3024 :
3025 0 : static PyObject *py_nbt_name_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3026 : {
3027 0 : return pytalloc_new(struct nbt_name_packet, type);
3028 : }
3029 :
3030 0 : static PyObject *py_nbt_name_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3031 : {
3032 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
3033 0 : PyObject *ret = NULL;
3034 0 : DATA_BLOB blob;
3035 0 : enum ndr_err_code err;
3036 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3037 0 : if (tmp_ctx == NULL) {
3038 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3039 0 : return NULL;
3040 : }
3041 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name_packet);
3042 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3043 0 : TALLOC_FREE(tmp_ctx);
3044 0 : PyErr_SetNdrError(err);
3045 0 : return NULL;
3046 : }
3047 :
3048 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3049 0 : TALLOC_FREE(tmp_ctx);
3050 0 : return ret;
3051 : }
3052 :
3053 0 : static PyObject *py_nbt_name_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3054 : {
3055 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
3056 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3057 0 : Py_ssize_t blob_length = 0;
3058 0 : enum ndr_err_code err;
3059 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3060 0 : PyObject *allow_remaining_obj = NULL;
3061 0 : bool allow_remaining = false;
3062 :
3063 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3064 : discard_const_p(char *, kwnames),
3065 : &blob.data, &blob_length,
3066 : &allow_remaining_obj)) {
3067 0 : return NULL;
3068 : }
3069 0 : blob.length = blob_length;
3070 :
3071 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3072 0 : allow_remaining = true;
3073 : }
3074 :
3075 0 : if (allow_remaining) {
3076 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
3077 : } else {
3078 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
3079 : }
3080 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3081 0 : PyErr_SetNdrError(err);
3082 0 : return NULL;
3083 : }
3084 :
3085 0 : Py_RETURN_NONE;
3086 : }
3087 :
3088 0 : static PyObject *py_nbt_name_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3089 : {
3090 0 : struct nbt_name_packet *object = pytalloc_get_ptr(py_obj);
3091 0 : PyObject *ret;
3092 0 : char *retstr;
3093 :
3094 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name_packet, "nbt_name_packet", object);
3095 0 : ret = PyUnicode_FromString(retstr);
3096 0 : talloc_free(retstr);
3097 :
3098 0 : return ret;
3099 : }
3100 :
3101 : static PyMethodDef py_nbt_name_packet_methods[] = {
3102 : { "__ndr_pack__", (PyCFunction)py_nbt_name_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3103 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_name_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3104 : { "__ndr_print__", (PyCFunction)py_nbt_name_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3105 : { NULL, NULL, 0, NULL }
3106 : };
3107 :
3108 :
3109 : static PyTypeObject nbt_name_packet_Type = {
3110 : PyVarObject_HEAD_INIT(NULL, 0)
3111 : .tp_name = "nbt.name_packet",
3112 : .tp_getset = py_nbt_name_packet_getsetters,
3113 : .tp_methods = py_nbt_name_packet_methods,
3114 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3115 : .tp_new = py_nbt_name_packet_new,
3116 : };
3117 :
3118 :
3119 0 : static PyObject *py_smb_trans_body_get_wct(PyObject *obj, void *closure)
3120 : {
3121 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3122 0 : PyObject *py_wct;
3123 0 : py_wct = PyLong_FromLong((uint16_t)(object->wct));
3124 0 : return py_wct;
3125 : }
3126 :
3127 0 : static int py_smb_trans_body_set_wct(PyObject *py_obj, PyObject *value, void *closure)
3128 : {
3129 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3130 0 : if (value == NULL) {
3131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wct");
3132 0 : return -1;
3133 : }
3134 : {
3135 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wct));
3136 0 : if (PyLong_Check(value)) {
3137 0 : unsigned long long test_var;
3138 0 : test_var = PyLong_AsUnsignedLongLong(value);
3139 0 : if (PyErr_Occurred() != NULL) {
3140 0 : return -1;
3141 : }
3142 0 : if (test_var > uint_max) {
3143 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3144 : PyLong_Type.tp_name, uint_max, test_var);
3145 0 : return -1;
3146 : }
3147 0 : object->wct = test_var;
3148 : } else {
3149 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3150 : PyLong_Type.tp_name);
3151 0 : return -1;
3152 : }
3153 : }
3154 0 : return 0;
3155 : }
3156 :
3157 0 : static PyObject *py_smb_trans_body_get_total_param_count(PyObject *obj, void *closure)
3158 : {
3159 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3160 0 : PyObject *py_total_param_count;
3161 0 : py_total_param_count = PyLong_FromLong((uint16_t)(object->total_param_count));
3162 0 : return py_total_param_count;
3163 : }
3164 :
3165 0 : static int py_smb_trans_body_set_total_param_count(PyObject *py_obj, PyObject *value, void *closure)
3166 : {
3167 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3168 0 : if (value == NULL) {
3169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_param_count");
3170 0 : return -1;
3171 : }
3172 : {
3173 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_param_count));
3174 0 : if (PyLong_Check(value)) {
3175 0 : unsigned long long test_var;
3176 0 : test_var = PyLong_AsUnsignedLongLong(value);
3177 0 : if (PyErr_Occurred() != NULL) {
3178 0 : return -1;
3179 : }
3180 0 : if (test_var > uint_max) {
3181 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3182 : PyLong_Type.tp_name, uint_max, test_var);
3183 0 : return -1;
3184 : }
3185 0 : object->total_param_count = test_var;
3186 : } else {
3187 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3188 : PyLong_Type.tp_name);
3189 0 : return -1;
3190 : }
3191 : }
3192 0 : return 0;
3193 : }
3194 :
3195 0 : static PyObject *py_smb_trans_body_get_total_data_count(PyObject *obj, void *closure)
3196 : {
3197 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3198 0 : PyObject *py_total_data_count;
3199 0 : py_total_data_count = PyLong_FromLong((uint16_t)(object->total_data_count));
3200 0 : return py_total_data_count;
3201 : }
3202 :
3203 0 : static int py_smb_trans_body_set_total_data_count(PyObject *py_obj, PyObject *value, void *closure)
3204 : {
3205 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3206 0 : if (value == NULL) {
3207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_data_count");
3208 0 : return -1;
3209 : }
3210 : {
3211 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_data_count));
3212 0 : if (PyLong_Check(value)) {
3213 0 : unsigned long long test_var;
3214 0 : test_var = PyLong_AsUnsignedLongLong(value);
3215 0 : if (PyErr_Occurred() != NULL) {
3216 0 : return -1;
3217 : }
3218 0 : if (test_var > uint_max) {
3219 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3220 : PyLong_Type.tp_name, uint_max, test_var);
3221 0 : return -1;
3222 : }
3223 0 : object->total_data_count = test_var;
3224 : } else {
3225 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3226 : PyLong_Type.tp_name);
3227 0 : return -1;
3228 : }
3229 : }
3230 0 : return 0;
3231 : }
3232 :
3233 0 : static PyObject *py_smb_trans_body_get_max_param_count(PyObject *obj, void *closure)
3234 : {
3235 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3236 0 : PyObject *py_max_param_count;
3237 0 : py_max_param_count = PyLong_FromLong((uint16_t)(object->max_param_count));
3238 0 : return py_max_param_count;
3239 : }
3240 :
3241 0 : static int py_smb_trans_body_set_max_param_count(PyObject *py_obj, PyObject *value, void *closure)
3242 : {
3243 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3244 0 : if (value == NULL) {
3245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_param_count");
3246 0 : return -1;
3247 : }
3248 : {
3249 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_param_count));
3250 0 : if (PyLong_Check(value)) {
3251 0 : unsigned long long test_var;
3252 0 : test_var = PyLong_AsUnsignedLongLong(value);
3253 0 : if (PyErr_Occurred() != NULL) {
3254 0 : return -1;
3255 : }
3256 0 : if (test_var > uint_max) {
3257 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3258 : PyLong_Type.tp_name, uint_max, test_var);
3259 0 : return -1;
3260 : }
3261 0 : object->max_param_count = test_var;
3262 : } else {
3263 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3264 : PyLong_Type.tp_name);
3265 0 : return -1;
3266 : }
3267 : }
3268 0 : return 0;
3269 : }
3270 :
3271 0 : static PyObject *py_smb_trans_body_get_max_data_count(PyObject *obj, void *closure)
3272 : {
3273 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3274 0 : PyObject *py_max_data_count;
3275 0 : py_max_data_count = PyLong_FromLong((uint16_t)(object->max_data_count));
3276 0 : return py_max_data_count;
3277 : }
3278 :
3279 0 : static int py_smb_trans_body_set_max_data_count(PyObject *py_obj, PyObject *value, void *closure)
3280 : {
3281 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3282 0 : if (value == NULL) {
3283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_data_count");
3284 0 : return -1;
3285 : }
3286 : {
3287 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_data_count));
3288 0 : if (PyLong_Check(value)) {
3289 0 : unsigned long long test_var;
3290 0 : test_var = PyLong_AsUnsignedLongLong(value);
3291 0 : if (PyErr_Occurred() != NULL) {
3292 0 : return -1;
3293 : }
3294 0 : if (test_var > uint_max) {
3295 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3296 : PyLong_Type.tp_name, uint_max, test_var);
3297 0 : return -1;
3298 : }
3299 0 : object->max_data_count = test_var;
3300 : } else {
3301 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3302 : PyLong_Type.tp_name);
3303 0 : return -1;
3304 : }
3305 : }
3306 0 : return 0;
3307 : }
3308 :
3309 0 : static PyObject *py_smb_trans_body_get_max_setup_count(PyObject *obj, void *closure)
3310 : {
3311 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3312 0 : PyObject *py_max_setup_count;
3313 0 : py_max_setup_count = PyLong_FromLong((uint16_t)(object->max_setup_count));
3314 0 : return py_max_setup_count;
3315 : }
3316 :
3317 0 : static int py_smb_trans_body_set_max_setup_count(PyObject *py_obj, PyObject *value, void *closure)
3318 : {
3319 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3320 0 : if (value == NULL) {
3321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_setup_count");
3322 0 : return -1;
3323 : }
3324 : {
3325 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_setup_count));
3326 0 : if (PyLong_Check(value)) {
3327 0 : unsigned long long test_var;
3328 0 : test_var = PyLong_AsUnsignedLongLong(value);
3329 0 : if (PyErr_Occurred() != NULL) {
3330 0 : return -1;
3331 : }
3332 0 : if (test_var > uint_max) {
3333 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3334 : PyLong_Type.tp_name, uint_max, test_var);
3335 0 : return -1;
3336 : }
3337 0 : object->max_setup_count = test_var;
3338 : } else {
3339 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3340 : PyLong_Type.tp_name);
3341 0 : return -1;
3342 : }
3343 : }
3344 0 : return 0;
3345 : }
3346 :
3347 0 : static PyObject *py_smb_trans_body_get_pad(PyObject *obj, void *closure)
3348 : {
3349 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3350 0 : PyObject *py_pad;
3351 0 : py_pad = PyLong_FromLong((uint16_t)(object->pad));
3352 0 : return py_pad;
3353 : }
3354 :
3355 0 : static int py_smb_trans_body_set_pad(PyObject *py_obj, PyObject *value, void *closure)
3356 : {
3357 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3358 0 : if (value == NULL) {
3359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pad");
3360 0 : return -1;
3361 : }
3362 : {
3363 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
3364 0 : if (PyLong_Check(value)) {
3365 0 : unsigned long long test_var;
3366 0 : test_var = PyLong_AsUnsignedLongLong(value);
3367 0 : if (PyErr_Occurred() != NULL) {
3368 0 : return -1;
3369 : }
3370 0 : if (test_var > uint_max) {
3371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3372 : PyLong_Type.tp_name, uint_max, test_var);
3373 0 : return -1;
3374 : }
3375 0 : object->pad = test_var;
3376 : } else {
3377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3378 : PyLong_Type.tp_name);
3379 0 : return -1;
3380 : }
3381 : }
3382 0 : return 0;
3383 : }
3384 :
3385 0 : static PyObject *py_smb_trans_body_get_trans_flags(PyObject *obj, void *closure)
3386 : {
3387 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3388 0 : PyObject *py_trans_flags;
3389 0 : py_trans_flags = PyLong_FromLong((uint16_t)(object->trans_flags));
3390 0 : return py_trans_flags;
3391 : }
3392 :
3393 0 : static int py_smb_trans_body_set_trans_flags(PyObject *py_obj, PyObject *value, void *closure)
3394 : {
3395 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3396 0 : if (value == NULL) {
3397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->trans_flags");
3398 0 : return -1;
3399 : }
3400 : {
3401 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trans_flags));
3402 0 : if (PyLong_Check(value)) {
3403 0 : unsigned long long test_var;
3404 0 : test_var = PyLong_AsUnsignedLongLong(value);
3405 0 : if (PyErr_Occurred() != NULL) {
3406 0 : return -1;
3407 : }
3408 0 : if (test_var > uint_max) {
3409 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3410 : PyLong_Type.tp_name, uint_max, test_var);
3411 0 : return -1;
3412 : }
3413 0 : object->trans_flags = test_var;
3414 : } else {
3415 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3416 : PyLong_Type.tp_name);
3417 0 : return -1;
3418 : }
3419 : }
3420 0 : return 0;
3421 : }
3422 :
3423 0 : static PyObject *py_smb_trans_body_get_timeout(PyObject *obj, void *closure)
3424 : {
3425 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3426 0 : PyObject *py_timeout;
3427 0 : py_timeout = PyLong_FromUnsignedLongLong((uint32_t)(object->timeout));
3428 0 : return py_timeout;
3429 : }
3430 :
3431 0 : static int py_smb_trans_body_set_timeout(PyObject *py_obj, PyObject *value, void *closure)
3432 : {
3433 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3434 0 : if (value == NULL) {
3435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->timeout");
3436 0 : return -1;
3437 : }
3438 : {
3439 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timeout));
3440 0 : if (PyLong_Check(value)) {
3441 0 : unsigned long long test_var;
3442 0 : test_var = PyLong_AsUnsignedLongLong(value);
3443 0 : if (PyErr_Occurred() != NULL) {
3444 0 : return -1;
3445 : }
3446 0 : if (test_var > uint_max) {
3447 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3448 : PyLong_Type.tp_name, uint_max, test_var);
3449 0 : return -1;
3450 : }
3451 0 : object->timeout = test_var;
3452 : } else {
3453 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3454 : PyLong_Type.tp_name);
3455 0 : return -1;
3456 : }
3457 : }
3458 0 : return 0;
3459 : }
3460 :
3461 0 : static PyObject *py_smb_trans_body_get_reserved(PyObject *obj, void *closure)
3462 : {
3463 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3464 0 : PyObject *py_reserved;
3465 0 : py_reserved = PyLong_FromLong((uint16_t)(object->reserved));
3466 0 : return py_reserved;
3467 : }
3468 :
3469 0 : static int py_smb_trans_body_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3470 : {
3471 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3472 0 : if (value == NULL) {
3473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
3474 0 : return -1;
3475 : }
3476 : {
3477 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
3478 0 : if (PyLong_Check(value)) {
3479 0 : unsigned long long test_var;
3480 0 : test_var = PyLong_AsUnsignedLongLong(value);
3481 0 : if (PyErr_Occurred() != NULL) {
3482 0 : return -1;
3483 : }
3484 0 : if (test_var > uint_max) {
3485 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3486 : PyLong_Type.tp_name, uint_max, test_var);
3487 0 : return -1;
3488 : }
3489 0 : object->reserved = test_var;
3490 : } else {
3491 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3492 : PyLong_Type.tp_name);
3493 0 : return -1;
3494 : }
3495 : }
3496 0 : return 0;
3497 : }
3498 :
3499 0 : static PyObject *py_smb_trans_body_get_param_count(PyObject *obj, void *closure)
3500 : {
3501 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3502 0 : PyObject *py_param_count;
3503 0 : py_param_count = PyLong_FromLong((uint16_t)(object->param_count));
3504 0 : return py_param_count;
3505 : }
3506 :
3507 0 : static int py_smb_trans_body_set_param_count(PyObject *py_obj, PyObject *value, void *closure)
3508 : {
3509 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3510 0 : if (value == NULL) {
3511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->param_count");
3512 0 : return -1;
3513 : }
3514 : {
3515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_count));
3516 0 : if (PyLong_Check(value)) {
3517 0 : unsigned long long test_var;
3518 0 : test_var = PyLong_AsUnsignedLongLong(value);
3519 0 : if (PyErr_Occurred() != NULL) {
3520 0 : return -1;
3521 : }
3522 0 : if (test_var > uint_max) {
3523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3524 : PyLong_Type.tp_name, uint_max, test_var);
3525 0 : return -1;
3526 : }
3527 0 : object->param_count = test_var;
3528 : } else {
3529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3530 : PyLong_Type.tp_name);
3531 0 : return -1;
3532 : }
3533 : }
3534 0 : return 0;
3535 : }
3536 :
3537 0 : static PyObject *py_smb_trans_body_get_param_offset(PyObject *obj, void *closure)
3538 : {
3539 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3540 0 : PyObject *py_param_offset;
3541 0 : py_param_offset = PyLong_FromLong((uint16_t)(object->param_offset));
3542 0 : return py_param_offset;
3543 : }
3544 :
3545 0 : static int py_smb_trans_body_set_param_offset(PyObject *py_obj, PyObject *value, void *closure)
3546 : {
3547 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3548 0 : if (value == NULL) {
3549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->param_offset");
3550 0 : return -1;
3551 : }
3552 : {
3553 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_offset));
3554 0 : if (PyLong_Check(value)) {
3555 0 : unsigned long long test_var;
3556 0 : test_var = PyLong_AsUnsignedLongLong(value);
3557 0 : if (PyErr_Occurred() != NULL) {
3558 0 : return -1;
3559 : }
3560 0 : if (test_var > uint_max) {
3561 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3562 : PyLong_Type.tp_name, uint_max, test_var);
3563 0 : return -1;
3564 : }
3565 0 : object->param_offset = test_var;
3566 : } else {
3567 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3568 : PyLong_Type.tp_name);
3569 0 : return -1;
3570 : }
3571 : }
3572 0 : return 0;
3573 : }
3574 :
3575 0 : static PyObject *py_smb_trans_body_get_data_count(PyObject *obj, void *closure)
3576 : {
3577 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3578 0 : PyObject *py_data_count;
3579 0 : py_data_count = PyLong_FromLong((uint16_t)(object->data_count));
3580 0 : return py_data_count;
3581 : }
3582 :
3583 0 : static int py_smb_trans_body_set_data_count(PyObject *py_obj, PyObject *value, void *closure)
3584 : {
3585 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3586 0 : if (value == NULL) {
3587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_count");
3588 0 : return -1;
3589 : }
3590 : {
3591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_count));
3592 0 : if (PyLong_Check(value)) {
3593 0 : unsigned long long test_var;
3594 0 : test_var = PyLong_AsUnsignedLongLong(value);
3595 0 : if (PyErr_Occurred() != NULL) {
3596 0 : return -1;
3597 : }
3598 0 : if (test_var > uint_max) {
3599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3600 : PyLong_Type.tp_name, uint_max, test_var);
3601 0 : return -1;
3602 : }
3603 0 : object->data_count = test_var;
3604 : } else {
3605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3606 : PyLong_Type.tp_name);
3607 0 : return -1;
3608 : }
3609 : }
3610 0 : return 0;
3611 : }
3612 :
3613 0 : static PyObject *py_smb_trans_body_get_data_offset(PyObject *obj, void *closure)
3614 : {
3615 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3616 0 : PyObject *py_data_offset;
3617 0 : py_data_offset = PyLong_FromLong((uint16_t)(object->data_offset));
3618 0 : return py_data_offset;
3619 : }
3620 :
3621 0 : static int py_smb_trans_body_set_data_offset(PyObject *py_obj, PyObject *value, void *closure)
3622 : {
3623 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3624 0 : if (value == NULL) {
3625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_offset");
3626 0 : return -1;
3627 : }
3628 : {
3629 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_offset));
3630 0 : if (PyLong_Check(value)) {
3631 0 : unsigned long long test_var;
3632 0 : test_var = PyLong_AsUnsignedLongLong(value);
3633 0 : if (PyErr_Occurred() != NULL) {
3634 0 : return -1;
3635 : }
3636 0 : if (test_var > uint_max) {
3637 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3638 : PyLong_Type.tp_name, uint_max, test_var);
3639 0 : return -1;
3640 : }
3641 0 : object->data_offset = test_var;
3642 : } else {
3643 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3644 : PyLong_Type.tp_name);
3645 0 : return -1;
3646 : }
3647 : }
3648 0 : return 0;
3649 : }
3650 :
3651 0 : static PyObject *py_smb_trans_body_get_setup_count(PyObject *obj, void *closure)
3652 : {
3653 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3654 0 : PyObject *py_setup_count;
3655 0 : py_setup_count = PyLong_FromLong((uint16_t)(object->setup_count));
3656 0 : return py_setup_count;
3657 : }
3658 :
3659 0 : static int py_smb_trans_body_set_setup_count(PyObject *py_obj, PyObject *value, void *closure)
3660 : {
3661 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3662 0 : if (value == NULL) {
3663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->setup_count");
3664 0 : return -1;
3665 : }
3666 : {
3667 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->setup_count));
3668 0 : if (PyLong_Check(value)) {
3669 0 : unsigned long long test_var;
3670 0 : test_var = PyLong_AsUnsignedLongLong(value);
3671 0 : if (PyErr_Occurred() != NULL) {
3672 0 : return -1;
3673 : }
3674 0 : if (test_var > uint_max) {
3675 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3676 : PyLong_Type.tp_name, uint_max, test_var);
3677 0 : return -1;
3678 : }
3679 0 : object->setup_count = test_var;
3680 : } else {
3681 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3682 : PyLong_Type.tp_name);
3683 0 : return -1;
3684 : }
3685 : }
3686 0 : return 0;
3687 : }
3688 :
3689 0 : static PyObject *py_smb_trans_body_get_pad2(PyObject *obj, void *closure)
3690 : {
3691 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3692 0 : PyObject *py_pad2;
3693 0 : py_pad2 = PyLong_FromLong((uint16_t)(object->pad2));
3694 0 : return py_pad2;
3695 : }
3696 :
3697 0 : static int py_smb_trans_body_set_pad2(PyObject *py_obj, PyObject *value, void *closure)
3698 : {
3699 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3700 0 : if (value == NULL) {
3701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pad2");
3702 0 : return -1;
3703 : }
3704 : {
3705 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad2));
3706 0 : if (PyLong_Check(value)) {
3707 0 : unsigned long long test_var;
3708 0 : test_var = PyLong_AsUnsignedLongLong(value);
3709 0 : if (PyErr_Occurred() != NULL) {
3710 0 : return -1;
3711 : }
3712 0 : if (test_var > uint_max) {
3713 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3714 : PyLong_Type.tp_name, uint_max, test_var);
3715 0 : return -1;
3716 : }
3717 0 : object->pad2 = test_var;
3718 : } else {
3719 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3720 : PyLong_Type.tp_name);
3721 0 : return -1;
3722 : }
3723 : }
3724 0 : return 0;
3725 : }
3726 :
3727 0 : static PyObject *py_smb_trans_body_get_opcode(PyObject *obj, void *closure)
3728 : {
3729 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3730 0 : PyObject *py_opcode;
3731 0 : py_opcode = PyLong_FromLong((uint16_t)(object->opcode));
3732 0 : return py_opcode;
3733 : }
3734 :
3735 0 : static int py_smb_trans_body_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
3736 : {
3737 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3738 0 : if (value == NULL) {
3739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->opcode");
3740 0 : return -1;
3741 : }
3742 : {
3743 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
3744 0 : if (PyLong_Check(value)) {
3745 0 : unsigned long long test_var;
3746 0 : test_var = PyLong_AsUnsignedLongLong(value);
3747 0 : if (PyErr_Occurred() != NULL) {
3748 0 : return -1;
3749 : }
3750 0 : if (test_var > uint_max) {
3751 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3752 : PyLong_Type.tp_name, uint_max, test_var);
3753 0 : return -1;
3754 : }
3755 0 : object->opcode = test_var;
3756 : } else {
3757 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3758 : PyLong_Type.tp_name);
3759 0 : return -1;
3760 : }
3761 : }
3762 0 : return 0;
3763 : }
3764 :
3765 0 : static PyObject *py_smb_trans_body_get_priority(PyObject *obj, void *closure)
3766 : {
3767 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3768 0 : PyObject *py_priority;
3769 0 : py_priority = PyLong_FromLong((uint16_t)(object->priority));
3770 0 : return py_priority;
3771 : }
3772 :
3773 0 : static int py_smb_trans_body_set_priority(PyObject *py_obj, PyObject *value, void *closure)
3774 : {
3775 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3776 0 : if (value == NULL) {
3777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
3778 0 : return -1;
3779 : }
3780 : {
3781 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
3782 0 : if (PyLong_Check(value)) {
3783 0 : unsigned long long test_var;
3784 0 : test_var = PyLong_AsUnsignedLongLong(value);
3785 0 : if (PyErr_Occurred() != NULL) {
3786 0 : return -1;
3787 : }
3788 0 : if (test_var > uint_max) {
3789 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3790 : PyLong_Type.tp_name, uint_max, test_var);
3791 0 : return -1;
3792 : }
3793 0 : object->priority = test_var;
3794 : } else {
3795 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3796 : PyLong_Type.tp_name);
3797 0 : return -1;
3798 : }
3799 : }
3800 0 : return 0;
3801 : }
3802 :
3803 0 : static PyObject *py_smb_trans_body_get__class(PyObject *obj, void *closure)
3804 : {
3805 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3806 0 : PyObject *py__class;
3807 0 : py__class = PyLong_FromLong((uint16_t)(object->_class));
3808 0 : return py__class;
3809 : }
3810 :
3811 0 : static int py_smb_trans_body_set__class(PyObject *py_obj, PyObject *value, void *closure)
3812 : {
3813 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3814 0 : if (value == NULL) {
3815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_class");
3816 0 : return -1;
3817 : }
3818 : {
3819 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_class));
3820 0 : if (PyLong_Check(value)) {
3821 0 : unsigned long long test_var;
3822 0 : test_var = PyLong_AsUnsignedLongLong(value);
3823 0 : if (PyErr_Occurred() != NULL) {
3824 0 : return -1;
3825 : }
3826 0 : if (test_var > uint_max) {
3827 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3828 : PyLong_Type.tp_name, uint_max, test_var);
3829 0 : return -1;
3830 : }
3831 0 : object->_class = test_var;
3832 : } else {
3833 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3834 : PyLong_Type.tp_name);
3835 0 : return -1;
3836 : }
3837 : }
3838 0 : return 0;
3839 : }
3840 :
3841 0 : static PyObject *py_smb_trans_body_get_byte_count(PyObject *obj, void *closure)
3842 : {
3843 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3844 0 : PyObject *py_byte_count;
3845 0 : py_byte_count = PyLong_FromLong((uint16_t)(object->byte_count));
3846 0 : return py_byte_count;
3847 : }
3848 :
3849 0 : static int py_smb_trans_body_set_byte_count(PyObject *py_obj, PyObject *value, void *closure)
3850 : {
3851 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3852 0 : if (value == NULL) {
3853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->byte_count");
3854 0 : return -1;
3855 : }
3856 : {
3857 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->byte_count));
3858 0 : if (PyLong_Check(value)) {
3859 0 : unsigned long long test_var;
3860 0 : test_var = PyLong_AsUnsignedLongLong(value);
3861 0 : if (PyErr_Occurred() != NULL) {
3862 0 : return -1;
3863 : }
3864 0 : if (test_var > uint_max) {
3865 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3866 : PyLong_Type.tp_name, uint_max, test_var);
3867 0 : return -1;
3868 : }
3869 0 : object->byte_count = test_var;
3870 : } else {
3871 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3872 : PyLong_Type.tp_name);
3873 0 : return -1;
3874 : }
3875 : }
3876 0 : return 0;
3877 : }
3878 :
3879 0 : static PyObject *py_smb_trans_body_get_mailslot_name(PyObject *obj, void *closure)
3880 : {
3881 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3882 0 : PyObject *py_mailslot_name;
3883 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
3884 0 : return py_mailslot_name;
3885 : }
3886 :
3887 0 : static int py_smb_trans_body_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
3888 : {
3889 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3890 0 : if (value == NULL) {
3891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mailslot_name");
3892 0 : return -1;
3893 : }
3894 : {
3895 0 : const char *test_str;
3896 0 : const char *talloc_str;
3897 0 : PyObject *unicode = NULL;
3898 0 : if (PyUnicode_Check(value)) {
3899 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3900 0 : if (unicode == NULL) {
3901 0 : return -1;
3902 : }
3903 0 : test_str = PyBytes_AS_STRING(unicode);
3904 0 : } else if (PyBytes_Check(value)) {
3905 0 : test_str = PyBytes_AS_STRING(value);
3906 : } else {
3907 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3908 0 : return -1;
3909 : }
3910 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3911 0 : if (unicode != NULL) {
3912 0 : Py_DECREF(unicode);
3913 : }
3914 0 : if (talloc_str == NULL) {
3915 0 : PyErr_NoMemory();
3916 0 : return -1;
3917 : }
3918 0 : object->mailslot_name = talloc_str;
3919 : }
3920 0 : return 0;
3921 : }
3922 :
3923 0 : static PyObject *py_smb_trans_body_get_data(PyObject *obj, void *closure)
3924 : {
3925 0 : struct smb_trans_body *object = pytalloc_get_ptr(obj);
3926 0 : PyObject *py_data;
3927 0 : py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
3928 0 : return py_data;
3929 : }
3930 :
3931 0 : static int py_smb_trans_body_set_data(PyObject *py_obj, PyObject *value, void *closure)
3932 : {
3933 0 : struct smb_trans_body *object = pytalloc_get_ptr(py_obj);
3934 0 : if (value == NULL) {
3935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
3936 0 : return -1;
3937 : }
3938 0 : object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
3939 0 : return 0;
3940 : }
3941 :
3942 : static PyGetSetDef py_smb_trans_body_getsetters[] = {
3943 : {
3944 : .name = discard_const_p(char, "wct"),
3945 : .get = py_smb_trans_body_get_wct,
3946 : .set = py_smb_trans_body_set_wct,
3947 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3948 : },
3949 : {
3950 : .name = discard_const_p(char, "total_param_count"),
3951 : .get = py_smb_trans_body_get_total_param_count,
3952 : .set = py_smb_trans_body_set_total_param_count,
3953 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3954 : },
3955 : {
3956 : .name = discard_const_p(char, "total_data_count"),
3957 : .get = py_smb_trans_body_get_total_data_count,
3958 : .set = py_smb_trans_body_set_total_data_count,
3959 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3960 : },
3961 : {
3962 : .name = discard_const_p(char, "max_param_count"),
3963 : .get = py_smb_trans_body_get_max_param_count,
3964 : .set = py_smb_trans_body_set_max_param_count,
3965 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3966 : },
3967 : {
3968 : .name = discard_const_p(char, "max_data_count"),
3969 : .get = py_smb_trans_body_get_max_data_count,
3970 : .set = py_smb_trans_body_set_max_data_count,
3971 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3972 : },
3973 : {
3974 : .name = discard_const_p(char, "max_setup_count"),
3975 : .get = py_smb_trans_body_get_max_setup_count,
3976 : .set = py_smb_trans_body_set_max_setup_count,
3977 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3978 : },
3979 : {
3980 : .name = discard_const_p(char, "pad"),
3981 : .get = py_smb_trans_body_get_pad,
3982 : .set = py_smb_trans_body_set_pad,
3983 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3984 : },
3985 : {
3986 : .name = discard_const_p(char, "trans_flags"),
3987 : .get = py_smb_trans_body_get_trans_flags,
3988 : .set = py_smb_trans_body_set_trans_flags,
3989 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3990 : },
3991 : {
3992 : .name = discard_const_p(char, "timeout"),
3993 : .get = py_smb_trans_body_get_timeout,
3994 : .set = py_smb_trans_body_set_timeout,
3995 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3996 : },
3997 : {
3998 : .name = discard_const_p(char, "reserved"),
3999 : .get = py_smb_trans_body_get_reserved,
4000 : .set = py_smb_trans_body_set_reserved,
4001 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4002 : },
4003 : {
4004 : .name = discard_const_p(char, "param_count"),
4005 : .get = py_smb_trans_body_get_param_count,
4006 : .set = py_smb_trans_body_set_param_count,
4007 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4008 : },
4009 : {
4010 : .name = discard_const_p(char, "param_offset"),
4011 : .get = py_smb_trans_body_get_param_offset,
4012 : .set = py_smb_trans_body_set_param_offset,
4013 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4014 : },
4015 : {
4016 : .name = discard_const_p(char, "data_count"),
4017 : .get = py_smb_trans_body_get_data_count,
4018 : .set = py_smb_trans_body_set_data_count,
4019 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4020 : },
4021 : {
4022 : .name = discard_const_p(char, "data_offset"),
4023 : .get = py_smb_trans_body_get_data_offset,
4024 : .set = py_smb_trans_body_set_data_offset,
4025 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4026 : },
4027 : {
4028 : .name = discard_const_p(char, "setup_count"),
4029 : .get = py_smb_trans_body_get_setup_count,
4030 : .set = py_smb_trans_body_set_setup_count,
4031 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4032 : },
4033 : {
4034 : .name = discard_const_p(char, "pad2"),
4035 : .get = py_smb_trans_body_get_pad2,
4036 : .set = py_smb_trans_body_set_pad2,
4037 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4038 : },
4039 : {
4040 : .name = discard_const_p(char, "opcode"),
4041 : .get = py_smb_trans_body_get_opcode,
4042 : .set = py_smb_trans_body_set_opcode,
4043 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4044 : },
4045 : {
4046 : .name = discard_const_p(char, "priority"),
4047 : .get = py_smb_trans_body_get_priority,
4048 : .set = py_smb_trans_body_set_priority,
4049 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4050 : },
4051 : {
4052 : .name = discard_const_p(char, "_class"),
4053 : .get = py_smb_trans_body_get__class,
4054 : .set = py_smb_trans_body_set__class,
4055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4056 : },
4057 : {
4058 : .name = discard_const_p(char, "byte_count"),
4059 : .get = py_smb_trans_body_get_byte_count,
4060 : .set = py_smb_trans_body_set_byte_count,
4061 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4062 : },
4063 : {
4064 : .name = discard_const_p(char, "mailslot_name"),
4065 : .get = py_smb_trans_body_get_mailslot_name,
4066 : .set = py_smb_trans_body_set_mailslot_name,
4067 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
4068 : },
4069 : {
4070 : .name = discard_const_p(char, "data"),
4071 : .get = py_smb_trans_body_get_data,
4072 : .set = py_smb_trans_body_set_data,
4073 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
4074 : },
4075 : { .name = NULL }
4076 : };
4077 :
4078 0 : static PyObject *py_smb_trans_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4079 : {
4080 0 : return pytalloc_new(struct smb_trans_body, type);
4081 : }
4082 :
4083 :
4084 : static PyTypeObject smb_trans_body_Type = {
4085 : PyVarObject_HEAD_INIT(NULL, 0)
4086 : .tp_name = "nbt.smb_trans_body",
4087 : .tp_getset = py_smb_trans_body_getsetters,
4088 : .tp_methods = NULL,
4089 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4090 : .tp_new = py_smb_trans_body_new,
4091 : };
4092 :
4093 0 : static PyObject *py_import_smb_body(TALLOC_CTX *mem_ctx, int level, union smb_body *in)
4094 : {
4095 0 : PyObject *ret;
4096 :
4097 0 : switch (level) {
4098 0 : case SMB_TRANSACTION:
4099 0 : ret = pytalloc_reference_ex(&smb_trans_body_Type, mem_ctx, &in->trans);
4100 0 : return ret;
4101 :
4102 : }
4103 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4104 0 : return NULL;
4105 : }
4106 :
4107 0 : static union smb_body *py_export_smb_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4108 : {
4109 0 : union smb_body *ret = talloc_zero(mem_ctx, union smb_body);
4110 0 : switch (level) {
4111 0 : case SMB_TRANSACTION:
4112 0 : if (in == NULL) {
4113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->trans");
4114 0 : talloc_free(ret); return NULL;
4115 : }
4116 0 : PY_CHECK_TYPE(&smb_trans_body_Type, in, talloc_free(ret); return NULL;);
4117 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4118 0 : PyErr_NoMemory();
4119 0 : talloc_free(ret); return NULL;
4120 : }
4121 0 : ret->trans = *(struct smb_trans_body *)pytalloc_get_ptr(in);
4122 0 : break;
4123 :
4124 0 : default:
4125 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4126 0 : talloc_free(ret);
4127 0 : ret = NULL;
4128 : }
4129 :
4130 0 : return ret;
4131 : }
4132 :
4133 0 : static PyObject *py_smb_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4134 : {
4135 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4136 0 : PyObject *mem_ctx_obj = NULL;
4137 0 : TALLOC_CTX *mem_ctx = NULL;
4138 0 : int level = 0;
4139 0 : PyObject *in_obj = NULL;
4140 0 : union smb_body *in = NULL;
4141 :
4142 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4143 : discard_const_p(char *, kwnames),
4144 : &mem_ctx_obj,
4145 : &level,
4146 : &in_obj)) {
4147 0 : return NULL;
4148 : }
4149 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4150 0 : if (mem_ctx == NULL) {
4151 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4152 0 : return NULL;
4153 : }
4154 0 : in = (union smb_body *)pytalloc_get_ptr(in_obj);
4155 0 : if (in == NULL) {
4156 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union smb_body!");
4157 0 : return NULL;
4158 : }
4159 :
4160 0 : return py_import_smb_body(mem_ctx, level, in);
4161 : }
4162 :
4163 0 : static PyObject *py_smb_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4164 : {
4165 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4166 0 : PyObject *mem_ctx_obj = NULL;
4167 0 : TALLOC_CTX *mem_ctx = NULL;
4168 0 : int level = 0;
4169 0 : PyObject *in = NULL;
4170 0 : union smb_body *out = NULL;
4171 :
4172 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4173 : discard_const_p(char *, kwnames),
4174 : &mem_ctx_obj,
4175 : &level,
4176 : &in)) {
4177 0 : return NULL;
4178 : }
4179 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4180 0 : if (mem_ctx == NULL) {
4181 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4182 0 : return NULL;
4183 : }
4184 :
4185 0 : out = py_export_smb_body(mem_ctx, level, in);
4186 0 : if (out == NULL) {
4187 0 : return NULL;
4188 : }
4189 :
4190 0 : return pytalloc_GenericObject_reference(out);
4191 : }
4192 :
4193 : static PyMethodDef py_smb_body_methods[] = {
4194 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_import),
4195 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4196 : "T.__import__(mem_ctx, level, in) => ret." },
4197 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_export),
4198 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4199 : "T.__export__(mem_ctx, level, in) => ret." },
4200 : { NULL, NULL, 0, NULL }
4201 : };
4202 :
4203 0 : static PyObject *py_smb_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4204 : {
4205 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4206 0 : return NULL;
4207 : }
4208 :
4209 :
4210 : static PyTypeObject smb_body_Type = {
4211 : PyVarObject_HEAD_INIT(NULL, 0)
4212 : .tp_name = "nbt.smb_body",
4213 : .tp_getset = NULL,
4214 : .tp_methods = py_smb_body_methods,
4215 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4216 : .tp_new = py_smb_body_new,
4217 : };
4218 :
4219 :
4220 0 : static PyObject *py_dgram_smb_packet_get_smb_command(PyObject *obj, void *closure)
4221 : {
4222 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4223 0 : PyObject *py_smb_command;
4224 0 : py_smb_command = PyLong_FromLong((uint16_t)(object->smb_command));
4225 0 : return py_smb_command;
4226 : }
4227 :
4228 0 : static int py_dgram_smb_packet_set_smb_command(PyObject *py_obj, PyObject *value, void *closure)
4229 : {
4230 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4231 0 : if (value == NULL) {
4232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->smb_command");
4233 0 : return -1;
4234 : }
4235 : {
4236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->smb_command));
4237 0 : if (PyLong_Check(value)) {
4238 0 : unsigned long long test_var;
4239 0 : test_var = PyLong_AsUnsignedLongLong(value);
4240 0 : if (PyErr_Occurred() != NULL) {
4241 0 : return -1;
4242 : }
4243 0 : if (test_var > uint_max) {
4244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4245 : PyLong_Type.tp_name, uint_max, test_var);
4246 0 : return -1;
4247 : }
4248 0 : object->smb_command = test_var;
4249 : } else {
4250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4251 : PyLong_Type.tp_name);
4252 0 : return -1;
4253 : }
4254 : }
4255 0 : return 0;
4256 : }
4257 :
4258 0 : static PyObject *py_dgram_smb_packet_get_err_class(PyObject *obj, void *closure)
4259 : {
4260 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4261 0 : PyObject *py_err_class;
4262 0 : py_err_class = PyLong_FromLong((uint16_t)(object->err_class));
4263 0 : return py_err_class;
4264 : }
4265 :
4266 0 : static int py_dgram_smb_packet_set_err_class(PyObject *py_obj, PyObject *value, void *closure)
4267 : {
4268 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4269 0 : if (value == NULL) {
4270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->err_class");
4271 0 : return -1;
4272 : }
4273 : {
4274 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_class));
4275 0 : if (PyLong_Check(value)) {
4276 0 : unsigned long long test_var;
4277 0 : test_var = PyLong_AsUnsignedLongLong(value);
4278 0 : if (PyErr_Occurred() != NULL) {
4279 0 : return -1;
4280 : }
4281 0 : if (test_var > uint_max) {
4282 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4283 : PyLong_Type.tp_name, uint_max, test_var);
4284 0 : return -1;
4285 : }
4286 0 : object->err_class = test_var;
4287 : } else {
4288 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4289 : PyLong_Type.tp_name);
4290 0 : return -1;
4291 : }
4292 : }
4293 0 : return 0;
4294 : }
4295 :
4296 0 : static PyObject *py_dgram_smb_packet_get_pad(PyObject *obj, void *closure)
4297 : {
4298 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4299 0 : PyObject *py_pad;
4300 0 : py_pad = PyLong_FromLong((uint16_t)(object->pad));
4301 0 : return py_pad;
4302 : }
4303 :
4304 0 : static int py_dgram_smb_packet_set_pad(PyObject *py_obj, PyObject *value, void *closure)
4305 : {
4306 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4307 0 : if (value == NULL) {
4308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pad");
4309 0 : return -1;
4310 : }
4311 : {
4312 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
4313 0 : if (PyLong_Check(value)) {
4314 0 : unsigned long long test_var;
4315 0 : test_var = PyLong_AsUnsignedLongLong(value);
4316 0 : if (PyErr_Occurred() != NULL) {
4317 0 : return -1;
4318 : }
4319 0 : if (test_var > uint_max) {
4320 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4321 : PyLong_Type.tp_name, uint_max, test_var);
4322 0 : return -1;
4323 : }
4324 0 : object->pad = test_var;
4325 : } else {
4326 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4327 : PyLong_Type.tp_name);
4328 0 : return -1;
4329 : }
4330 : }
4331 0 : return 0;
4332 : }
4333 :
4334 0 : static PyObject *py_dgram_smb_packet_get_err_code(PyObject *obj, void *closure)
4335 : {
4336 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4337 0 : PyObject *py_err_code;
4338 0 : py_err_code = PyLong_FromLong((uint16_t)(object->err_code));
4339 0 : return py_err_code;
4340 : }
4341 :
4342 0 : static int py_dgram_smb_packet_set_err_code(PyObject *py_obj, PyObject *value, void *closure)
4343 : {
4344 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4345 0 : if (value == NULL) {
4346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->err_code");
4347 0 : return -1;
4348 : }
4349 : {
4350 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_code));
4351 0 : if (PyLong_Check(value)) {
4352 0 : unsigned long long test_var;
4353 0 : test_var = PyLong_AsUnsignedLongLong(value);
4354 0 : if (PyErr_Occurred() != NULL) {
4355 0 : return -1;
4356 : }
4357 0 : if (test_var > uint_max) {
4358 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4359 : PyLong_Type.tp_name, uint_max, test_var);
4360 0 : return -1;
4361 : }
4362 0 : object->err_code = test_var;
4363 : } else {
4364 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4365 : PyLong_Type.tp_name);
4366 0 : return -1;
4367 : }
4368 : }
4369 0 : return 0;
4370 : }
4371 :
4372 0 : static PyObject *py_dgram_smb_packet_get_flags(PyObject *obj, void *closure)
4373 : {
4374 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4375 0 : PyObject *py_flags;
4376 0 : py_flags = PyLong_FromLong((uint16_t)(object->flags));
4377 0 : return py_flags;
4378 : }
4379 :
4380 0 : static int py_dgram_smb_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
4381 : {
4382 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4383 0 : if (value == NULL) {
4384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
4385 0 : return -1;
4386 : }
4387 : {
4388 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
4389 0 : if (PyLong_Check(value)) {
4390 0 : unsigned long long test_var;
4391 0 : test_var = PyLong_AsUnsignedLongLong(value);
4392 0 : if (PyErr_Occurred() != NULL) {
4393 0 : return -1;
4394 : }
4395 0 : if (test_var > uint_max) {
4396 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4397 : PyLong_Type.tp_name, uint_max, test_var);
4398 0 : return -1;
4399 : }
4400 0 : object->flags = test_var;
4401 : } else {
4402 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4403 : PyLong_Type.tp_name);
4404 0 : return -1;
4405 : }
4406 : }
4407 0 : return 0;
4408 : }
4409 :
4410 0 : static PyObject *py_dgram_smb_packet_get_flags2(PyObject *obj, void *closure)
4411 : {
4412 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4413 0 : PyObject *py_flags2;
4414 0 : py_flags2 = PyLong_FromLong((uint16_t)(object->flags2));
4415 0 : return py_flags2;
4416 : }
4417 :
4418 0 : static int py_dgram_smb_packet_set_flags2(PyObject *py_obj, PyObject *value, void *closure)
4419 : {
4420 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4421 0 : if (value == NULL) {
4422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags2");
4423 0 : return -1;
4424 : }
4425 : {
4426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags2));
4427 0 : if (PyLong_Check(value)) {
4428 0 : unsigned long long test_var;
4429 0 : test_var = PyLong_AsUnsignedLongLong(value);
4430 0 : if (PyErr_Occurred() != NULL) {
4431 0 : return -1;
4432 : }
4433 0 : if (test_var > uint_max) {
4434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4435 : PyLong_Type.tp_name, uint_max, test_var);
4436 0 : return -1;
4437 : }
4438 0 : object->flags2 = test_var;
4439 : } else {
4440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4441 : PyLong_Type.tp_name);
4442 0 : return -1;
4443 : }
4444 : }
4445 0 : return 0;
4446 : }
4447 :
4448 0 : static PyObject *py_dgram_smb_packet_get_pid_high(PyObject *obj, void *closure)
4449 : {
4450 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4451 0 : PyObject *py_pid_high;
4452 0 : py_pid_high = PyLong_FromLong((uint16_t)(object->pid_high));
4453 0 : return py_pid_high;
4454 : }
4455 :
4456 0 : static int py_dgram_smb_packet_set_pid_high(PyObject *py_obj, PyObject *value, void *closure)
4457 : {
4458 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4459 0 : if (value == NULL) {
4460 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pid_high");
4461 0 : return -1;
4462 : }
4463 : {
4464 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid_high));
4465 0 : if (PyLong_Check(value)) {
4466 0 : unsigned long long test_var;
4467 0 : test_var = PyLong_AsUnsignedLongLong(value);
4468 0 : if (PyErr_Occurred() != NULL) {
4469 0 : return -1;
4470 : }
4471 0 : if (test_var > uint_max) {
4472 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4473 : PyLong_Type.tp_name, uint_max, test_var);
4474 0 : return -1;
4475 : }
4476 0 : object->pid_high = test_var;
4477 : } else {
4478 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4479 : PyLong_Type.tp_name);
4480 0 : return -1;
4481 : }
4482 : }
4483 0 : return 0;
4484 : }
4485 :
4486 0 : static PyObject *py_dgram_smb_packet_get_signature(PyObject *obj, void *closure)
4487 : {
4488 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4489 0 : PyObject *py_signature;
4490 0 : py_signature = PyList_New(8);
4491 0 : if (py_signature == NULL) {
4492 0 : return NULL;
4493 : }
4494 : {
4495 : int signature_cntr_0;
4496 0 : for (signature_cntr_0 = 0; signature_cntr_0 < (8); signature_cntr_0++) {
4497 0 : PyObject *py_signature_0;
4498 0 : py_signature_0 = PyLong_FromLong((uint16_t)((object->signature)[signature_cntr_0]));
4499 0 : PyList_SetItem(py_signature, signature_cntr_0, py_signature_0);
4500 : }
4501 : }
4502 0 : return py_signature;
4503 : }
4504 :
4505 0 : static int py_dgram_smb_packet_set_signature(PyObject *py_obj, PyObject *value, void *closure)
4506 : {
4507 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4508 0 : if (value == NULL) {
4509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->signature");
4510 0 : return -1;
4511 : }
4512 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4513 : {
4514 0 : int signature_cntr_0;
4515 0 : if (ARRAY_SIZE(object->signature) != PyList_GET_SIZE(value)) {
4516 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->signature), PyList_GET_SIZE(value));
4517 0 : return -1;
4518 : }
4519 0 : for (signature_cntr_0 = 0; signature_cntr_0 < PyList_GET_SIZE(value); signature_cntr_0++) {
4520 0 : if (PyList_GET_ITEM(value, signature_cntr_0) == NULL) {
4521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->signature)[signature_cntr_0]");
4522 0 : return -1;
4523 : }
4524 : {
4525 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->signature)[signature_cntr_0]));
4526 0 : if (PyLong_Check(PyList_GET_ITEM(value, signature_cntr_0))) {
4527 0 : unsigned long long test_var;
4528 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, signature_cntr_0));
4529 0 : if (PyErr_Occurred() != NULL) {
4530 0 : return -1;
4531 : }
4532 0 : if (test_var > uint_max) {
4533 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4534 : PyLong_Type.tp_name, uint_max, test_var);
4535 0 : return -1;
4536 : }
4537 0 : (object->signature)[signature_cntr_0] = test_var;
4538 : } else {
4539 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4540 : PyLong_Type.tp_name);
4541 0 : return -1;
4542 : }
4543 : }
4544 : }
4545 : }
4546 0 : return 0;
4547 : }
4548 :
4549 0 : static PyObject *py_dgram_smb_packet_get_reserved(PyObject *obj, void *closure)
4550 : {
4551 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4552 0 : PyObject *py_reserved;
4553 0 : py_reserved = PyLong_FromLong((uint16_t)(object->reserved));
4554 0 : return py_reserved;
4555 : }
4556 :
4557 0 : static int py_dgram_smb_packet_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
4558 : {
4559 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4560 0 : if (value == NULL) {
4561 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
4562 0 : return -1;
4563 : }
4564 : {
4565 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
4566 0 : if (PyLong_Check(value)) {
4567 0 : unsigned long long test_var;
4568 0 : test_var = PyLong_AsUnsignedLongLong(value);
4569 0 : if (PyErr_Occurred() != NULL) {
4570 0 : return -1;
4571 : }
4572 0 : if (test_var > uint_max) {
4573 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4574 : PyLong_Type.tp_name, uint_max, test_var);
4575 0 : return -1;
4576 : }
4577 0 : object->reserved = test_var;
4578 : } else {
4579 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4580 : PyLong_Type.tp_name);
4581 0 : return -1;
4582 : }
4583 : }
4584 0 : return 0;
4585 : }
4586 :
4587 0 : static PyObject *py_dgram_smb_packet_get_tid(PyObject *obj, void *closure)
4588 : {
4589 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4590 0 : PyObject *py_tid;
4591 0 : py_tid = PyLong_FromLong((uint16_t)(object->tid));
4592 0 : return py_tid;
4593 : }
4594 :
4595 0 : static int py_dgram_smb_packet_set_tid(PyObject *py_obj, PyObject *value, void *closure)
4596 : {
4597 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4598 0 : if (value == NULL) {
4599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->tid");
4600 0 : return -1;
4601 : }
4602 : {
4603 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tid));
4604 0 : if (PyLong_Check(value)) {
4605 0 : unsigned long long test_var;
4606 0 : test_var = PyLong_AsUnsignedLongLong(value);
4607 0 : if (PyErr_Occurred() != NULL) {
4608 0 : return -1;
4609 : }
4610 0 : if (test_var > uint_max) {
4611 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4612 : PyLong_Type.tp_name, uint_max, test_var);
4613 0 : return -1;
4614 : }
4615 0 : object->tid = test_var;
4616 : } else {
4617 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4618 : PyLong_Type.tp_name);
4619 0 : return -1;
4620 : }
4621 : }
4622 0 : return 0;
4623 : }
4624 :
4625 0 : static PyObject *py_dgram_smb_packet_get_pid(PyObject *obj, void *closure)
4626 : {
4627 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4628 0 : PyObject *py_pid;
4629 0 : py_pid = PyLong_FromLong((uint16_t)(object->pid));
4630 0 : return py_pid;
4631 : }
4632 :
4633 0 : static int py_dgram_smb_packet_set_pid(PyObject *py_obj, PyObject *value, void *closure)
4634 : {
4635 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4636 0 : if (value == NULL) {
4637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pid");
4638 0 : return -1;
4639 : }
4640 : {
4641 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid));
4642 0 : if (PyLong_Check(value)) {
4643 0 : unsigned long long test_var;
4644 0 : test_var = PyLong_AsUnsignedLongLong(value);
4645 0 : if (PyErr_Occurred() != NULL) {
4646 0 : return -1;
4647 : }
4648 0 : if (test_var > uint_max) {
4649 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4650 : PyLong_Type.tp_name, uint_max, test_var);
4651 0 : return -1;
4652 : }
4653 0 : object->pid = test_var;
4654 : } else {
4655 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4656 : PyLong_Type.tp_name);
4657 0 : return -1;
4658 : }
4659 : }
4660 0 : return 0;
4661 : }
4662 :
4663 0 : static PyObject *py_dgram_smb_packet_get_vuid(PyObject *obj, void *closure)
4664 : {
4665 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4666 0 : PyObject *py_vuid;
4667 0 : py_vuid = PyLong_FromLong((uint16_t)(object->vuid));
4668 0 : return py_vuid;
4669 : }
4670 :
4671 0 : static int py_dgram_smb_packet_set_vuid(PyObject *py_obj, PyObject *value, void *closure)
4672 : {
4673 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4674 0 : if (value == NULL) {
4675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->vuid");
4676 0 : return -1;
4677 : }
4678 : {
4679 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vuid));
4680 0 : if (PyLong_Check(value)) {
4681 0 : unsigned long long test_var;
4682 0 : test_var = PyLong_AsUnsignedLongLong(value);
4683 0 : if (PyErr_Occurred() != NULL) {
4684 0 : return -1;
4685 : }
4686 0 : if (test_var > uint_max) {
4687 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4688 : PyLong_Type.tp_name, uint_max, test_var);
4689 0 : return -1;
4690 : }
4691 0 : object->vuid = test_var;
4692 : } else {
4693 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4694 : PyLong_Type.tp_name);
4695 0 : return -1;
4696 : }
4697 : }
4698 0 : return 0;
4699 : }
4700 :
4701 0 : static PyObject *py_dgram_smb_packet_get_mid(PyObject *obj, void *closure)
4702 : {
4703 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4704 0 : PyObject *py_mid;
4705 0 : py_mid = PyLong_FromLong((uint16_t)(object->mid));
4706 0 : return py_mid;
4707 : }
4708 :
4709 0 : static int py_dgram_smb_packet_set_mid(PyObject *py_obj, PyObject *value, void *closure)
4710 : {
4711 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4712 0 : if (value == NULL) {
4713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mid");
4714 0 : return -1;
4715 : }
4716 : {
4717 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mid));
4718 0 : if (PyLong_Check(value)) {
4719 0 : unsigned long long test_var;
4720 0 : test_var = PyLong_AsUnsignedLongLong(value);
4721 0 : if (PyErr_Occurred() != NULL) {
4722 0 : return -1;
4723 : }
4724 0 : if (test_var > uint_max) {
4725 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4726 : PyLong_Type.tp_name, uint_max, test_var);
4727 0 : return -1;
4728 : }
4729 0 : object->mid = test_var;
4730 : } else {
4731 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4732 : PyLong_Type.tp_name);
4733 0 : return -1;
4734 : }
4735 : }
4736 0 : return 0;
4737 : }
4738 :
4739 0 : static PyObject *py_dgram_smb_packet_get_body(PyObject *obj, void *closure)
4740 : {
4741 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(obj);
4742 0 : PyObject *py_body;
4743 0 : py_body = pyrpc_import_union(&smb_body_Type, pytalloc_get_mem_ctx(obj), object->smb_command, &object->body, "union smb_body");
4744 0 : if (py_body == NULL) {
4745 0 : return NULL;
4746 : }
4747 0 : return py_body;
4748 : }
4749 :
4750 0 : static int py_dgram_smb_packet_set_body(PyObject *py_obj, PyObject *value, void *closure)
4751 : {
4752 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4753 0 : if (value == NULL) {
4754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->body");
4755 0 : return -1;
4756 : }
4757 : {
4758 0 : union smb_body *body_switch_0;
4759 0 : body_switch_0 = (union smb_body *)pyrpc_export_union(&smb_body_Type, pytalloc_get_mem_ctx(py_obj), object->smb_command, value, "union smb_body");
4760 0 : if (body_switch_0 == NULL) {
4761 0 : return -1;
4762 : }
4763 0 : object->body = *body_switch_0;
4764 : }
4765 0 : return 0;
4766 : }
4767 :
4768 : static PyGetSetDef py_dgram_smb_packet_getsetters[] = {
4769 : {
4770 : .name = discard_const_p(char, "smb_command"),
4771 : .get = py_dgram_smb_packet_get_smb_command,
4772 : .set = py_dgram_smb_packet_set_smb_command,
4773 : .doc = discard_const_p(char, "PIDL-generated element of base type smb_command")
4774 : },
4775 : {
4776 : .name = discard_const_p(char, "err_class"),
4777 : .get = py_dgram_smb_packet_get_err_class,
4778 : .set = py_dgram_smb_packet_set_err_class,
4779 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4780 : },
4781 : {
4782 : .name = discard_const_p(char, "pad"),
4783 : .get = py_dgram_smb_packet_get_pad,
4784 : .set = py_dgram_smb_packet_set_pad,
4785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4786 : },
4787 : {
4788 : .name = discard_const_p(char, "err_code"),
4789 : .get = py_dgram_smb_packet_get_err_code,
4790 : .set = py_dgram_smb_packet_set_err_code,
4791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4792 : },
4793 : {
4794 : .name = discard_const_p(char, "flags"),
4795 : .get = py_dgram_smb_packet_get_flags,
4796 : .set = py_dgram_smb_packet_set_flags,
4797 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4798 : },
4799 : {
4800 : .name = discard_const_p(char, "flags2"),
4801 : .get = py_dgram_smb_packet_get_flags2,
4802 : .set = py_dgram_smb_packet_set_flags2,
4803 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4804 : },
4805 : {
4806 : .name = discard_const_p(char, "pid_high"),
4807 : .get = py_dgram_smb_packet_get_pid_high,
4808 : .set = py_dgram_smb_packet_set_pid_high,
4809 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4810 : },
4811 : {
4812 : .name = discard_const_p(char, "signature"),
4813 : .get = py_dgram_smb_packet_get_signature,
4814 : .set = py_dgram_smb_packet_set_signature,
4815 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4816 : },
4817 : {
4818 : .name = discard_const_p(char, "reserved"),
4819 : .get = py_dgram_smb_packet_get_reserved,
4820 : .set = py_dgram_smb_packet_set_reserved,
4821 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4822 : },
4823 : {
4824 : .name = discard_const_p(char, "tid"),
4825 : .get = py_dgram_smb_packet_get_tid,
4826 : .set = py_dgram_smb_packet_set_tid,
4827 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4828 : },
4829 : {
4830 : .name = discard_const_p(char, "pid"),
4831 : .get = py_dgram_smb_packet_get_pid,
4832 : .set = py_dgram_smb_packet_set_pid,
4833 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4834 : },
4835 : {
4836 : .name = discard_const_p(char, "vuid"),
4837 : .get = py_dgram_smb_packet_get_vuid,
4838 : .set = py_dgram_smb_packet_set_vuid,
4839 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4840 : },
4841 : {
4842 : .name = discard_const_p(char, "mid"),
4843 : .get = py_dgram_smb_packet_get_mid,
4844 : .set = py_dgram_smb_packet_set_mid,
4845 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4846 : },
4847 : {
4848 : .name = discard_const_p(char, "body"),
4849 : .get = py_dgram_smb_packet_get_body,
4850 : .set = py_dgram_smb_packet_set_body,
4851 : .doc = discard_const_p(char, "PIDL-generated element of base type smb_body")
4852 : },
4853 : { .name = NULL }
4854 : };
4855 :
4856 0 : static PyObject *py_dgram_smb_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4857 : {
4858 0 : return pytalloc_new(struct dgram_smb_packet, type);
4859 : }
4860 :
4861 0 : static PyObject *py_dgram_smb_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4862 : {
4863 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4864 0 : PyObject *ret = NULL;
4865 0 : DATA_BLOB blob;
4866 0 : enum ndr_err_code err;
4867 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4868 0 : if (tmp_ctx == NULL) {
4869 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4870 0 : return NULL;
4871 : }
4872 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dgram_smb_packet);
4873 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4874 0 : TALLOC_FREE(tmp_ctx);
4875 0 : PyErr_SetNdrError(err);
4876 0 : return NULL;
4877 : }
4878 :
4879 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4880 0 : TALLOC_FREE(tmp_ctx);
4881 0 : return ret;
4882 : }
4883 :
4884 0 : static PyObject *py_dgram_smb_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4885 : {
4886 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4887 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4888 0 : Py_ssize_t blob_length = 0;
4889 0 : enum ndr_err_code err;
4890 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4891 0 : PyObject *allow_remaining_obj = NULL;
4892 0 : bool allow_remaining = false;
4893 :
4894 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4895 : discard_const_p(char *, kwnames),
4896 : &blob.data, &blob_length,
4897 : &allow_remaining_obj)) {
4898 0 : return NULL;
4899 : }
4900 0 : blob.length = blob_length;
4901 :
4902 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4903 0 : allow_remaining = true;
4904 : }
4905 :
4906 0 : if (allow_remaining) {
4907 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
4908 : } else {
4909 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
4910 : }
4911 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4912 0 : PyErr_SetNdrError(err);
4913 0 : return NULL;
4914 : }
4915 :
4916 0 : Py_RETURN_NONE;
4917 : }
4918 :
4919 0 : static PyObject *py_dgram_smb_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4920 : {
4921 0 : struct dgram_smb_packet *object = pytalloc_get_ptr(py_obj);
4922 0 : PyObject *ret;
4923 0 : char *retstr;
4924 :
4925 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dgram_smb_packet, "dgram_smb_packet", object);
4926 0 : ret = PyUnicode_FromString(retstr);
4927 0 : talloc_free(retstr);
4928 :
4929 0 : return ret;
4930 : }
4931 :
4932 : static PyMethodDef py_dgram_smb_packet_methods[] = {
4933 : { "__ndr_pack__", (PyCFunction)py_dgram_smb_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4934 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_smb_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4935 : { "__ndr_print__", (PyCFunction)py_dgram_smb_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4936 : { NULL, NULL, 0, NULL }
4937 : };
4938 :
4939 :
4940 : static PyTypeObject dgram_smb_packet_Type = {
4941 : PyVarObject_HEAD_INIT(NULL, 0)
4942 : .tp_name = "nbt.dgram_smb_packet",
4943 : .tp_getset = py_dgram_smb_packet_getsetters,
4944 : .tp_methods = py_dgram_smb_packet_methods,
4945 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4946 : .tp_new = py_dgram_smb_packet_new,
4947 : };
4948 :
4949 0 : static PyObject *py_import_dgram_message_body(TALLOC_CTX *mem_ctx, int level, union dgram_message_body *in)
4950 : {
4951 0 : PyObject *ret;
4952 :
4953 0 : switch (level) {
4954 0 : case DGRAM_SMB:
4955 0 : ret = pytalloc_reference_ex(&dgram_smb_packet_Type, mem_ctx, &in->smb);
4956 0 : return ret;
4957 :
4958 : }
4959 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4960 0 : return NULL;
4961 : }
4962 :
4963 0 : static union dgram_message_body *py_export_dgram_message_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4964 : {
4965 0 : union dgram_message_body *ret = talloc_zero(mem_ctx, union dgram_message_body);
4966 0 : switch (level) {
4967 0 : case DGRAM_SMB:
4968 0 : if (in == NULL) {
4969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->smb");
4970 0 : talloc_free(ret); return NULL;
4971 : }
4972 0 : PY_CHECK_TYPE(&dgram_smb_packet_Type, in, talloc_free(ret); return NULL;);
4973 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4974 0 : PyErr_NoMemory();
4975 0 : talloc_free(ret); return NULL;
4976 : }
4977 0 : ret->smb = *(struct dgram_smb_packet *)pytalloc_get_ptr(in);
4978 0 : break;
4979 :
4980 0 : default:
4981 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4982 0 : talloc_free(ret);
4983 0 : ret = NULL;
4984 : }
4985 :
4986 0 : return ret;
4987 : }
4988 :
4989 0 : static PyObject *py_dgram_message_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4990 : {
4991 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4992 0 : PyObject *mem_ctx_obj = NULL;
4993 0 : TALLOC_CTX *mem_ctx = NULL;
4994 0 : int level = 0;
4995 0 : PyObject *in_obj = NULL;
4996 0 : union dgram_message_body *in = NULL;
4997 :
4998 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4999 : discard_const_p(char *, kwnames),
5000 : &mem_ctx_obj,
5001 : &level,
5002 : &in_obj)) {
5003 0 : return NULL;
5004 : }
5005 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5006 0 : if (mem_ctx == NULL) {
5007 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5008 0 : return NULL;
5009 : }
5010 0 : in = (union dgram_message_body *)pytalloc_get_ptr(in_obj);
5011 0 : if (in == NULL) {
5012 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_message_body!");
5013 0 : return NULL;
5014 : }
5015 :
5016 0 : return py_import_dgram_message_body(mem_ctx, level, in);
5017 : }
5018 :
5019 0 : static PyObject *py_dgram_message_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5020 : {
5021 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5022 0 : PyObject *mem_ctx_obj = NULL;
5023 0 : TALLOC_CTX *mem_ctx = NULL;
5024 0 : int level = 0;
5025 0 : PyObject *in = NULL;
5026 0 : union dgram_message_body *out = NULL;
5027 :
5028 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5029 : discard_const_p(char *, kwnames),
5030 : &mem_ctx_obj,
5031 : &level,
5032 : &in)) {
5033 0 : return NULL;
5034 : }
5035 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5036 0 : if (mem_ctx == NULL) {
5037 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5038 0 : return NULL;
5039 : }
5040 :
5041 0 : out = py_export_dgram_message_body(mem_ctx, level, in);
5042 0 : if (out == NULL) {
5043 0 : return NULL;
5044 : }
5045 :
5046 0 : return pytalloc_GenericObject_reference(out);
5047 : }
5048 :
5049 : static PyMethodDef py_dgram_message_body_methods[] = {
5050 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_import),
5051 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5052 : "T.__import__(mem_ctx, level, in) => ret." },
5053 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_export),
5054 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5055 : "T.__export__(mem_ctx, level, in) => ret." },
5056 : { NULL, NULL, 0, NULL }
5057 : };
5058 :
5059 0 : static PyObject *py_dgram_message_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5060 : {
5061 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5062 0 : return NULL;
5063 : }
5064 :
5065 :
5066 : static PyTypeObject dgram_message_body_Type = {
5067 : PyVarObject_HEAD_INIT(NULL, 0)
5068 : .tp_name = "nbt.dgram_message_body",
5069 : .tp_getset = NULL,
5070 : .tp_methods = py_dgram_message_body_methods,
5071 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5072 : .tp_new = py_dgram_message_body_new,
5073 : };
5074 :
5075 :
5076 0 : static PyObject *py_dgram_message_get_length(PyObject *obj, void *closure)
5077 : {
5078 0 : struct dgram_message *object = pytalloc_get_ptr(obj);
5079 0 : PyObject *py_length;
5080 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
5081 0 : return py_length;
5082 : }
5083 :
5084 0 : static int py_dgram_message_set_length(PyObject *py_obj, PyObject *value, void *closure)
5085 : {
5086 0 : struct dgram_message *object = pytalloc_get_ptr(py_obj);
5087 0 : if (value == NULL) {
5088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
5089 0 : return -1;
5090 : }
5091 : {
5092 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
5093 0 : if (PyLong_Check(value)) {
5094 0 : unsigned long long test_var;
5095 0 : test_var = PyLong_AsUnsignedLongLong(value);
5096 0 : if (PyErr_Occurred() != NULL) {
5097 0 : return -1;
5098 : }
5099 0 : if (test_var > uint_max) {
5100 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5101 : PyLong_Type.tp_name, uint_max, test_var);
5102 0 : return -1;
5103 : }
5104 0 : object->length = test_var;
5105 : } else {
5106 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5107 : PyLong_Type.tp_name);
5108 0 : return -1;
5109 : }
5110 : }
5111 0 : return 0;
5112 : }
5113 :
5114 0 : static PyObject *py_dgram_message_get_offset(PyObject *obj, void *closure)
5115 : {
5116 0 : struct dgram_message *object = pytalloc_get_ptr(obj);
5117 0 : PyObject *py_offset;
5118 0 : py_offset = PyLong_FromLong((uint16_t)(object->offset));
5119 0 : return py_offset;
5120 : }
5121 :
5122 0 : static int py_dgram_message_set_offset(PyObject *py_obj, PyObject *value, void *closure)
5123 : {
5124 0 : struct dgram_message *object = pytalloc_get_ptr(py_obj);
5125 0 : if (value == NULL) {
5126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->offset");
5127 0 : return -1;
5128 : }
5129 : {
5130 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->offset));
5131 0 : if (PyLong_Check(value)) {
5132 0 : unsigned long long test_var;
5133 0 : test_var = PyLong_AsUnsignedLongLong(value);
5134 0 : if (PyErr_Occurred() != NULL) {
5135 0 : return -1;
5136 : }
5137 0 : if (test_var > uint_max) {
5138 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5139 : PyLong_Type.tp_name, uint_max, test_var);
5140 0 : return -1;
5141 : }
5142 0 : object->offset = test_var;
5143 : } else {
5144 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5145 : PyLong_Type.tp_name);
5146 0 : return -1;
5147 : }
5148 : }
5149 0 : return 0;
5150 : }
5151 :
5152 0 : static PyObject *py_dgram_message_get_source_name(PyObject *obj, void *closure)
5153 : {
5154 0 : struct dgram_message *object = pytalloc_get_ptr(obj);
5155 0 : PyObject *py_source_name;
5156 0 : py_source_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->source_name);
5157 0 : return py_source_name;
5158 : }
5159 :
5160 0 : static int py_dgram_message_set_source_name(PyObject *py_obj, PyObject *value, void *closure)
5161 : {
5162 0 : struct dgram_message *object = pytalloc_get_ptr(py_obj);
5163 0 : if (value == NULL) {
5164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->source_name");
5165 0 : return -1;
5166 : }
5167 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
5168 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5169 0 : PyErr_NoMemory();
5170 0 : return -1;
5171 : }
5172 0 : object->source_name = *(struct nbt_name *)pytalloc_get_ptr(value);
5173 0 : return 0;
5174 : }
5175 :
5176 0 : static PyObject *py_dgram_message_get_dest_name(PyObject *obj, void *closure)
5177 : {
5178 0 : struct dgram_message *object = pytalloc_get_ptr(obj);
5179 0 : PyObject *py_dest_name;
5180 0 : py_dest_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->dest_name);
5181 0 : return py_dest_name;
5182 : }
5183 :
5184 0 : static int py_dgram_message_set_dest_name(PyObject *py_obj, PyObject *value, void *closure)
5185 : {
5186 0 : struct dgram_message *object = pytalloc_get_ptr(py_obj);
5187 0 : if (value == NULL) {
5188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dest_name");
5189 0 : return -1;
5190 : }
5191 0 : PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
5192 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5193 0 : PyErr_NoMemory();
5194 0 : return -1;
5195 : }
5196 0 : object->dest_name = *(struct nbt_name *)pytalloc_get_ptr(value);
5197 0 : return 0;
5198 : }
5199 :
5200 0 : static PyObject *py_dgram_message_get_dgram_body_type(PyObject *obj, void *closure)
5201 : {
5202 0 : struct dgram_message *object = pytalloc_get_ptr(obj);
5203 0 : PyObject *py_dgram_body_type;
5204 0 : py_dgram_body_type = PyLong_FromUnsignedLongLong((uint32_t)(object->dgram_body_type));
5205 0 : return py_dgram_body_type;
5206 : }
5207 :
5208 0 : static int py_dgram_message_set_dgram_body_type(PyObject *py_obj, PyObject *value, void *closure)
5209 : {
5210 0 : struct dgram_message *object = pytalloc_get_ptr(py_obj);
5211 0 : if (value == NULL) {
5212 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dgram_body_type");
5213 0 : return -1;
5214 : }
5215 : {
5216 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_body_type));
5217 0 : if (PyLong_Check(value)) {
5218 0 : unsigned long long test_var;
5219 0 : test_var = PyLong_AsUnsignedLongLong(value);
5220 0 : if (PyErr_Occurred() != NULL) {
5221 0 : return -1;
5222 : }
5223 0 : if (test_var > uint_max) {
5224 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5225 : PyLong_Type.tp_name, uint_max, test_var);
5226 0 : return -1;
5227 : }
5228 0 : object->dgram_body_type = test_var;
5229 : } else {
5230 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5231 : PyLong_Type.tp_name);
5232 0 : return -1;
5233 : }
5234 : }
5235 0 : return 0;
5236 : }
5237 :
5238 0 : static PyObject *py_dgram_message_get_body(PyObject *obj, void *closure)
5239 : {
5240 0 : struct dgram_message *object = pytalloc_get_ptr(obj);
5241 0 : PyObject *py_body;
5242 0 : py_body = pyrpc_import_union(&dgram_message_body_Type, pytalloc_get_mem_ctx(obj), object->dgram_body_type, &object->body, "union dgram_message_body");
5243 0 : if (py_body == NULL) {
5244 0 : return NULL;
5245 : }
5246 0 : return py_body;
5247 : }
5248 :
5249 0 : static int py_dgram_message_set_body(PyObject *py_obj, PyObject *value, void *closure)
5250 : {
5251 0 : struct dgram_message *object = pytalloc_get_ptr(py_obj);
5252 0 : if (value == NULL) {
5253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->body");
5254 0 : return -1;
5255 : }
5256 : {
5257 0 : union dgram_message_body *body_switch_0;
5258 0 : body_switch_0 = (union dgram_message_body *)pyrpc_export_union(&dgram_message_body_Type, pytalloc_get_mem_ctx(py_obj), object->dgram_body_type, value, "union dgram_message_body");
5259 0 : if (body_switch_0 == NULL) {
5260 0 : return -1;
5261 : }
5262 0 : object->body = *body_switch_0;
5263 : }
5264 0 : return 0;
5265 : }
5266 :
5267 : static PyGetSetDef py_dgram_message_getsetters[] = {
5268 : {
5269 : .name = discard_const_p(char, "length"),
5270 : .get = py_dgram_message_get_length,
5271 : .set = py_dgram_message_set_length,
5272 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5273 : },
5274 : {
5275 : .name = discard_const_p(char, "offset"),
5276 : .get = py_dgram_message_get_offset,
5277 : .set = py_dgram_message_set_offset,
5278 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5279 : },
5280 : {
5281 : .name = discard_const_p(char, "source_name"),
5282 : .get = py_dgram_message_get_source_name,
5283 : .set = py_dgram_message_set_source_name,
5284 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
5285 : },
5286 : {
5287 : .name = discard_const_p(char, "dest_name"),
5288 : .get = py_dgram_message_get_dest_name,
5289 : .set = py_dgram_message_set_dest_name,
5290 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
5291 : },
5292 : {
5293 : .name = discard_const_p(char, "dgram_body_type"),
5294 : .get = py_dgram_message_get_dgram_body_type,
5295 : .set = py_dgram_message_set_dgram_body_type,
5296 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5297 : },
5298 : {
5299 : .name = discard_const_p(char, "body"),
5300 : .get = py_dgram_message_get_body,
5301 : .set = py_dgram_message_set_body,
5302 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_message_body")
5303 : },
5304 : { .name = NULL }
5305 : };
5306 :
5307 0 : static PyObject *py_dgram_message_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5308 : {
5309 0 : return pytalloc_new(struct dgram_message, type);
5310 : }
5311 :
5312 :
5313 : static PyTypeObject dgram_message_Type = {
5314 : PyVarObject_HEAD_INIT(NULL, 0)
5315 : .tp_name = "nbt.dgram_message",
5316 : .tp_getset = py_dgram_message_getsetters,
5317 : .tp_methods = NULL,
5318 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5319 : .tp_new = py_dgram_message_new,
5320 : };
5321 :
5322 0 : static PyObject *py_import_dgram_data(TALLOC_CTX *mem_ctx, int level, union dgram_data *in)
5323 : {
5324 0 : PyObject *ret;
5325 :
5326 0 : switch (level) {
5327 0 : case DGRAM_DIRECT_UNIQUE:
5328 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5329 0 : return ret;
5330 :
5331 0 : case DGRAM_DIRECT_GROUP:
5332 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5333 0 : return ret;
5334 :
5335 0 : case DGRAM_BCAST:
5336 0 : ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
5337 0 : return ret;
5338 :
5339 0 : case DGRAM_ERROR:
5340 0 : ret = PyLong_FromLong((uint16_t)(in->error));
5341 0 : return ret;
5342 :
5343 0 : case DGRAM_QUERY:
5344 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5345 0 : return ret;
5346 :
5347 0 : case DGRAM_QUERY_POSITIVE:
5348 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5349 0 : return ret;
5350 :
5351 0 : case DGRAM_QUERY_NEGATIVE:
5352 0 : ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
5353 0 : return ret;
5354 :
5355 : }
5356 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
5357 0 : return NULL;
5358 : }
5359 :
5360 0 : static union dgram_data *py_export_dgram_data(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5361 : {
5362 0 : union dgram_data *ret = talloc_zero(mem_ctx, union dgram_data);
5363 0 : switch (level) {
5364 0 : case DGRAM_DIRECT_UNIQUE:
5365 0 : if (in == NULL) {
5366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->msg");
5367 0 : talloc_free(ret); return NULL;
5368 : }
5369 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5370 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5371 0 : PyErr_NoMemory();
5372 0 : talloc_free(ret); return NULL;
5373 : }
5374 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5375 0 : break;
5376 :
5377 0 : case DGRAM_DIRECT_GROUP:
5378 0 : if (in == NULL) {
5379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->msg");
5380 0 : talloc_free(ret); return NULL;
5381 : }
5382 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5383 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5384 0 : PyErr_NoMemory();
5385 0 : talloc_free(ret); return NULL;
5386 : }
5387 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5388 0 : break;
5389 :
5390 0 : case DGRAM_BCAST:
5391 0 : if (in == NULL) {
5392 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->msg");
5393 0 : talloc_free(ret); return NULL;
5394 : }
5395 0 : PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
5396 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5397 0 : PyErr_NoMemory();
5398 0 : talloc_free(ret); return NULL;
5399 : }
5400 0 : ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
5401 0 : break;
5402 :
5403 0 : case DGRAM_ERROR:
5404 0 : if (in == NULL) {
5405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->error");
5406 0 : talloc_free(ret); return NULL;
5407 : }
5408 : {
5409 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->error));
5410 0 : if (PyLong_Check(in)) {
5411 0 : unsigned long long test_var;
5412 0 : test_var = PyLong_AsUnsignedLongLong(in);
5413 0 : if (PyErr_Occurred() != NULL) {
5414 0 : talloc_free(ret); return NULL;
5415 : }
5416 0 : if (test_var > uint_max) {
5417 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5418 : PyLong_Type.tp_name, uint_max, test_var);
5419 0 : talloc_free(ret); return NULL;
5420 : }
5421 0 : ret->error = test_var;
5422 : } else {
5423 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5424 : PyLong_Type.tp_name);
5425 0 : talloc_free(ret); return NULL;
5426 : }
5427 : }
5428 0 : break;
5429 :
5430 0 : case DGRAM_QUERY:
5431 0 : if (in == NULL) {
5432 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dest_name");
5433 0 : talloc_free(ret); return NULL;
5434 : }
5435 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5436 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5437 0 : PyErr_NoMemory();
5438 0 : talloc_free(ret); return NULL;
5439 : }
5440 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5441 0 : break;
5442 :
5443 0 : case DGRAM_QUERY_POSITIVE:
5444 0 : if (in == NULL) {
5445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dest_name");
5446 0 : talloc_free(ret); return NULL;
5447 : }
5448 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5449 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5450 0 : PyErr_NoMemory();
5451 0 : talloc_free(ret); return NULL;
5452 : }
5453 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5454 0 : break;
5455 :
5456 0 : case DGRAM_QUERY_NEGATIVE:
5457 0 : if (in == NULL) {
5458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dest_name");
5459 0 : talloc_free(ret); return NULL;
5460 : }
5461 0 : PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
5462 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5463 0 : PyErr_NoMemory();
5464 0 : talloc_free(ret); return NULL;
5465 : }
5466 0 : ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
5467 0 : break;
5468 :
5469 0 : default:
5470 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
5471 0 : talloc_free(ret);
5472 0 : ret = NULL;
5473 : }
5474 :
5475 0 : return ret;
5476 : }
5477 :
5478 0 : static PyObject *py_dgram_data_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5479 : {
5480 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5481 0 : PyObject *mem_ctx_obj = NULL;
5482 0 : TALLOC_CTX *mem_ctx = NULL;
5483 0 : int level = 0;
5484 0 : PyObject *in_obj = NULL;
5485 0 : union dgram_data *in = NULL;
5486 :
5487 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
5488 : discard_const_p(char *, kwnames),
5489 : &mem_ctx_obj,
5490 : &level,
5491 : &in_obj)) {
5492 0 : return NULL;
5493 : }
5494 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5495 0 : if (mem_ctx == NULL) {
5496 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5497 0 : return NULL;
5498 : }
5499 0 : in = (union dgram_data *)pytalloc_get_ptr(in_obj);
5500 0 : if (in == NULL) {
5501 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_data!");
5502 0 : return NULL;
5503 : }
5504 :
5505 0 : return py_import_dgram_data(mem_ctx, level, in);
5506 : }
5507 :
5508 0 : static PyObject *py_dgram_data_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5509 : {
5510 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5511 0 : PyObject *mem_ctx_obj = NULL;
5512 0 : TALLOC_CTX *mem_ctx = NULL;
5513 0 : int level = 0;
5514 0 : PyObject *in = NULL;
5515 0 : union dgram_data *out = NULL;
5516 :
5517 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5518 : discard_const_p(char *, kwnames),
5519 : &mem_ctx_obj,
5520 : &level,
5521 : &in)) {
5522 0 : return NULL;
5523 : }
5524 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5525 0 : if (mem_ctx == NULL) {
5526 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5527 0 : return NULL;
5528 : }
5529 :
5530 0 : out = py_export_dgram_data(mem_ctx, level, in);
5531 0 : if (out == NULL) {
5532 0 : return NULL;
5533 : }
5534 :
5535 0 : return pytalloc_GenericObject_reference(out);
5536 : }
5537 :
5538 : static PyMethodDef py_dgram_data_methods[] = {
5539 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_import),
5540 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5541 : "T.__import__(mem_ctx, level, in) => ret." },
5542 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_export),
5543 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5544 : "T.__export__(mem_ctx, level, in) => ret." },
5545 : { NULL, NULL, 0, NULL }
5546 : };
5547 :
5548 0 : static PyObject *py_dgram_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5549 : {
5550 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5551 0 : return NULL;
5552 : }
5553 :
5554 :
5555 : static PyTypeObject dgram_data_Type = {
5556 : PyVarObject_HEAD_INIT(NULL, 0)
5557 : .tp_name = "nbt.dgram_data",
5558 : .tp_getset = NULL,
5559 : .tp_methods = py_dgram_data_methods,
5560 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5561 : .tp_new = py_dgram_data_new,
5562 : };
5563 :
5564 :
5565 0 : static PyObject *py_nbt_dgram_packet_get_msg_type(PyObject *obj, void *closure)
5566 : {
5567 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(obj);
5568 0 : PyObject *py_msg_type;
5569 0 : py_msg_type = PyLong_FromLong((uint16_t)(object->msg_type));
5570 0 : return py_msg_type;
5571 : }
5572 :
5573 0 : static int py_nbt_dgram_packet_set_msg_type(PyObject *py_obj, PyObject *value, void *closure)
5574 : {
5575 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5576 0 : if (value == NULL) {
5577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->msg_type");
5578 0 : return -1;
5579 : }
5580 : {
5581 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->msg_type));
5582 0 : if (PyLong_Check(value)) {
5583 0 : unsigned long long test_var;
5584 0 : test_var = PyLong_AsUnsignedLongLong(value);
5585 0 : if (PyErr_Occurred() != NULL) {
5586 0 : return -1;
5587 : }
5588 0 : if (test_var > uint_max) {
5589 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5590 : PyLong_Type.tp_name, uint_max, test_var);
5591 0 : return -1;
5592 : }
5593 0 : object->msg_type = test_var;
5594 : } else {
5595 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5596 : PyLong_Type.tp_name);
5597 0 : return -1;
5598 : }
5599 : }
5600 0 : return 0;
5601 : }
5602 :
5603 0 : static PyObject *py_nbt_dgram_packet_get_flags(PyObject *obj, void *closure)
5604 : {
5605 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(obj);
5606 0 : PyObject *py_flags;
5607 0 : py_flags = PyLong_FromLong((uint16_t)(object->flags));
5608 0 : return py_flags;
5609 : }
5610 :
5611 0 : static int py_nbt_dgram_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
5612 : {
5613 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5614 0 : if (value == NULL) {
5615 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
5616 0 : return -1;
5617 : }
5618 : {
5619 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
5620 0 : if (PyLong_Check(value)) {
5621 0 : unsigned long long test_var;
5622 0 : test_var = PyLong_AsUnsignedLongLong(value);
5623 0 : if (PyErr_Occurred() != NULL) {
5624 0 : return -1;
5625 : }
5626 0 : if (test_var > uint_max) {
5627 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5628 : PyLong_Type.tp_name, uint_max, test_var);
5629 0 : return -1;
5630 : }
5631 0 : object->flags = test_var;
5632 : } else {
5633 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5634 : PyLong_Type.tp_name);
5635 0 : return -1;
5636 : }
5637 : }
5638 0 : return 0;
5639 : }
5640 :
5641 0 : static PyObject *py_nbt_dgram_packet_get_dgram_id(PyObject *obj, void *closure)
5642 : {
5643 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(obj);
5644 0 : PyObject *py_dgram_id;
5645 0 : py_dgram_id = PyLong_FromLong((uint16_t)(object->dgram_id));
5646 0 : return py_dgram_id;
5647 : }
5648 :
5649 0 : static int py_nbt_dgram_packet_set_dgram_id(PyObject *py_obj, PyObject *value, void *closure)
5650 : {
5651 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5652 0 : if (value == NULL) {
5653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dgram_id");
5654 0 : return -1;
5655 : }
5656 : {
5657 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_id));
5658 0 : if (PyLong_Check(value)) {
5659 0 : unsigned long long test_var;
5660 0 : test_var = PyLong_AsUnsignedLongLong(value);
5661 0 : if (PyErr_Occurred() != NULL) {
5662 0 : return -1;
5663 : }
5664 0 : if (test_var > uint_max) {
5665 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5666 : PyLong_Type.tp_name, uint_max, test_var);
5667 0 : return -1;
5668 : }
5669 0 : object->dgram_id = test_var;
5670 : } else {
5671 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5672 : PyLong_Type.tp_name);
5673 0 : return -1;
5674 : }
5675 : }
5676 0 : return 0;
5677 : }
5678 :
5679 0 : static PyObject *py_nbt_dgram_packet_get_src_addr(PyObject *obj, void *closure)
5680 : {
5681 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(obj);
5682 0 : PyObject *py_src_addr;
5683 0 : py_src_addr = PyString_FromStringOrNULL(object->src_addr);
5684 0 : return py_src_addr;
5685 : }
5686 :
5687 0 : static int py_nbt_dgram_packet_set_src_addr(PyObject *py_obj, PyObject *value, void *closure)
5688 : {
5689 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5690 0 : if (value == NULL) {
5691 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->src_addr");
5692 0 : return -1;
5693 : }
5694 : {
5695 0 : const char *test_str;
5696 0 : const char *talloc_str;
5697 0 : PyObject *unicode = NULL;
5698 0 : if (PyUnicode_Check(value)) {
5699 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5700 0 : if (unicode == NULL) {
5701 0 : return -1;
5702 : }
5703 0 : test_str = PyBytes_AS_STRING(unicode);
5704 0 : } else if (PyBytes_Check(value)) {
5705 0 : test_str = PyBytes_AS_STRING(value);
5706 : } else {
5707 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5708 0 : return -1;
5709 : }
5710 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5711 0 : if (unicode != NULL) {
5712 0 : Py_DECREF(unicode);
5713 : }
5714 0 : if (talloc_str == NULL) {
5715 0 : PyErr_NoMemory();
5716 0 : return -1;
5717 : }
5718 0 : object->src_addr = talloc_str;
5719 : }
5720 0 : return 0;
5721 : }
5722 :
5723 0 : static PyObject *py_nbt_dgram_packet_get_src_port(PyObject *obj, void *closure)
5724 : {
5725 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(obj);
5726 0 : PyObject *py_src_port;
5727 0 : py_src_port = PyLong_FromLong((uint16_t)(object->src_port));
5728 0 : return py_src_port;
5729 : }
5730 :
5731 0 : static int py_nbt_dgram_packet_set_src_port(PyObject *py_obj, PyObject *value, void *closure)
5732 : {
5733 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5734 0 : if (value == NULL) {
5735 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->src_port");
5736 0 : return -1;
5737 : }
5738 : {
5739 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->src_port));
5740 0 : if (PyLong_Check(value)) {
5741 0 : unsigned long long test_var;
5742 0 : test_var = PyLong_AsUnsignedLongLong(value);
5743 0 : if (PyErr_Occurred() != NULL) {
5744 0 : return -1;
5745 : }
5746 0 : if (test_var > uint_max) {
5747 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5748 : PyLong_Type.tp_name, uint_max, test_var);
5749 0 : return -1;
5750 : }
5751 0 : object->src_port = test_var;
5752 : } else {
5753 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5754 : PyLong_Type.tp_name);
5755 0 : return -1;
5756 : }
5757 : }
5758 0 : return 0;
5759 : }
5760 :
5761 0 : static PyObject *py_nbt_dgram_packet_get_data(PyObject *obj, void *closure)
5762 : {
5763 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(obj);
5764 0 : PyObject *py_data;
5765 0 : py_data = pyrpc_import_union(&dgram_data_Type, pytalloc_get_mem_ctx(obj), object->msg_type, &object->data, "union dgram_data");
5766 0 : if (py_data == NULL) {
5767 0 : return NULL;
5768 : }
5769 0 : return py_data;
5770 : }
5771 :
5772 0 : static int py_nbt_dgram_packet_set_data(PyObject *py_obj, PyObject *value, void *closure)
5773 : {
5774 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5775 0 : if (value == NULL) {
5776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
5777 0 : return -1;
5778 : }
5779 : {
5780 0 : union dgram_data *data_switch_0;
5781 0 : data_switch_0 = (union dgram_data *)pyrpc_export_union(&dgram_data_Type, pytalloc_get_mem_ctx(py_obj), object->msg_type, value, "union dgram_data");
5782 0 : if (data_switch_0 == NULL) {
5783 0 : return -1;
5784 : }
5785 0 : object->data = *data_switch_0;
5786 : }
5787 0 : return 0;
5788 : }
5789 :
5790 : static PyGetSetDef py_nbt_dgram_packet_getsetters[] = {
5791 : {
5792 : .name = discard_const_p(char, "msg_type"),
5793 : .get = py_nbt_dgram_packet_get_msg_type,
5794 : .set = py_nbt_dgram_packet_set_msg_type,
5795 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_msg_type")
5796 : },
5797 : {
5798 : .name = discard_const_p(char, "flags"),
5799 : .get = py_nbt_dgram_packet_get_flags,
5800 : .set = py_nbt_dgram_packet_set_flags,
5801 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_flags")
5802 : },
5803 : {
5804 : .name = discard_const_p(char, "dgram_id"),
5805 : .get = py_nbt_dgram_packet_get_dgram_id,
5806 : .set = py_nbt_dgram_packet_set_dgram_id,
5807 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5808 : },
5809 : {
5810 : .name = discard_const_p(char, "src_addr"),
5811 : .get = py_nbt_dgram_packet_get_src_addr,
5812 : .set = py_nbt_dgram_packet_set_src_addr,
5813 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
5814 : },
5815 : {
5816 : .name = discard_const_p(char, "src_port"),
5817 : .get = py_nbt_dgram_packet_get_src_port,
5818 : .set = py_nbt_dgram_packet_set_src_port,
5819 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5820 : },
5821 : {
5822 : .name = discard_const_p(char, "data"),
5823 : .get = py_nbt_dgram_packet_get_data,
5824 : .set = py_nbt_dgram_packet_set_data,
5825 : .doc = discard_const_p(char, "PIDL-generated element of base type dgram_data")
5826 : },
5827 : { .name = NULL }
5828 : };
5829 :
5830 0 : static PyObject *py_nbt_dgram_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5831 : {
5832 0 : return pytalloc_new(struct nbt_dgram_packet, type);
5833 : }
5834 :
5835 0 : static PyObject *py_nbt_dgram_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5836 : {
5837 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5838 0 : PyObject *ret = NULL;
5839 0 : DATA_BLOB blob;
5840 0 : enum ndr_err_code err;
5841 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5842 0 : if (tmp_ctx == NULL) {
5843 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5844 0 : return NULL;
5845 : }
5846 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_dgram_packet);
5847 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5848 0 : TALLOC_FREE(tmp_ctx);
5849 0 : PyErr_SetNdrError(err);
5850 0 : return NULL;
5851 : }
5852 :
5853 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5854 0 : TALLOC_FREE(tmp_ctx);
5855 0 : return ret;
5856 : }
5857 :
5858 0 : static PyObject *py_nbt_dgram_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5859 : {
5860 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5861 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5862 0 : Py_ssize_t blob_length = 0;
5863 0 : enum ndr_err_code err;
5864 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5865 0 : PyObject *allow_remaining_obj = NULL;
5866 0 : bool allow_remaining = false;
5867 :
5868 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5869 : discard_const_p(char *, kwnames),
5870 : &blob.data, &blob_length,
5871 : &allow_remaining_obj)) {
5872 0 : return NULL;
5873 : }
5874 0 : blob.length = blob_length;
5875 :
5876 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5877 0 : allow_remaining = true;
5878 : }
5879 :
5880 0 : if (allow_remaining) {
5881 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
5882 : } else {
5883 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
5884 : }
5885 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5886 0 : PyErr_SetNdrError(err);
5887 0 : return NULL;
5888 : }
5889 :
5890 0 : Py_RETURN_NONE;
5891 : }
5892 :
5893 0 : static PyObject *py_nbt_dgram_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5894 : {
5895 0 : struct nbt_dgram_packet *object = pytalloc_get_ptr(py_obj);
5896 0 : PyObject *ret;
5897 0 : char *retstr;
5898 :
5899 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_dgram_packet, "nbt_dgram_packet", object);
5900 0 : ret = PyUnicode_FromString(retstr);
5901 0 : talloc_free(retstr);
5902 :
5903 0 : return ret;
5904 : }
5905 :
5906 : static PyMethodDef py_nbt_dgram_packet_methods[] = {
5907 : { "__ndr_pack__", (PyCFunction)py_nbt_dgram_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5908 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_dgram_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5909 : { "__ndr_print__", (PyCFunction)py_nbt_dgram_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5910 : { NULL, NULL, 0, NULL }
5911 : };
5912 :
5913 :
5914 : static PyTypeObject nbt_dgram_packet_Type = {
5915 : PyVarObject_HEAD_INIT(NULL, 0)
5916 : .tp_name = "nbt.dgram_packet",
5917 : .tp_getset = py_nbt_dgram_packet_getsetters,
5918 : .tp_methods = py_nbt_dgram_packet_methods,
5919 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5920 : .tp_new = py_nbt_dgram_packet_new,
5921 : };
5922 :
5923 :
5924 0 : static PyObject *py_nbt_sockaddr_get_sockaddr_family(PyObject *obj, void *closure)
5925 : {
5926 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(obj);
5927 0 : PyObject *py_sockaddr_family;
5928 0 : py_sockaddr_family = PyLong_FromUnsignedLongLong((uint32_t)(object->sockaddr_family));
5929 0 : return py_sockaddr_family;
5930 : }
5931 :
5932 0 : static int py_nbt_sockaddr_set_sockaddr_family(PyObject *py_obj, PyObject *value, void *closure)
5933 : {
5934 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(py_obj);
5935 0 : if (value == NULL) {
5936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sockaddr_family");
5937 0 : return -1;
5938 : }
5939 : {
5940 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_family));
5941 0 : if (PyLong_Check(value)) {
5942 0 : unsigned long long test_var;
5943 0 : test_var = PyLong_AsUnsignedLongLong(value);
5944 0 : if (PyErr_Occurred() != NULL) {
5945 0 : return -1;
5946 : }
5947 0 : if (test_var > uint_max) {
5948 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5949 : PyLong_Type.tp_name, uint_max, test_var);
5950 0 : return -1;
5951 : }
5952 0 : object->sockaddr_family = test_var;
5953 : } else {
5954 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5955 : PyLong_Type.tp_name);
5956 0 : return -1;
5957 : }
5958 : }
5959 0 : return 0;
5960 : }
5961 :
5962 0 : static PyObject *py_nbt_sockaddr_get_pdc_ip(PyObject *obj, void *closure)
5963 : {
5964 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(obj);
5965 0 : PyObject *py_pdc_ip;
5966 0 : py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
5967 0 : return py_pdc_ip;
5968 : }
5969 :
5970 0 : static int py_nbt_sockaddr_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
5971 : {
5972 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(py_obj);
5973 0 : if (value == NULL) {
5974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_ip");
5975 0 : return -1;
5976 : }
5977 : {
5978 0 : const char *test_str;
5979 0 : const char *talloc_str;
5980 0 : PyObject *unicode = NULL;
5981 0 : if (PyUnicode_Check(value)) {
5982 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5983 0 : if (unicode == NULL) {
5984 0 : return -1;
5985 : }
5986 0 : test_str = PyBytes_AS_STRING(unicode);
5987 0 : } else if (PyBytes_Check(value)) {
5988 0 : test_str = PyBytes_AS_STRING(value);
5989 : } else {
5990 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5991 0 : return -1;
5992 : }
5993 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5994 0 : if (unicode != NULL) {
5995 0 : Py_DECREF(unicode);
5996 : }
5997 0 : if (talloc_str == NULL) {
5998 0 : PyErr_NoMemory();
5999 0 : return -1;
6000 : }
6001 0 : object->pdc_ip = talloc_str;
6002 : }
6003 0 : return 0;
6004 : }
6005 :
6006 0 : static PyObject *py_nbt_sockaddr_get_remaining(PyObject *obj, void *closure)
6007 : {
6008 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(obj);
6009 0 : PyObject *py_remaining;
6010 0 : py_remaining = PyBytes_FromStringAndSize((char *)(object->remaining).data, (object->remaining).length);
6011 0 : return py_remaining;
6012 : }
6013 :
6014 0 : static int py_nbt_sockaddr_set_remaining(PyObject *py_obj, PyObject *value, void *closure)
6015 : {
6016 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(py_obj);
6017 0 : if (value == NULL) {
6018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->remaining");
6019 0 : return -1;
6020 : }
6021 0 : object->remaining = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
6022 0 : return 0;
6023 : }
6024 :
6025 : static PyGetSetDef py_nbt_sockaddr_getsetters[] = {
6026 : {
6027 : .name = discard_const_p(char, "sockaddr_family"),
6028 : .get = py_nbt_sockaddr_get_sockaddr_family,
6029 : .set = py_nbt_sockaddr_set_sockaddr_family,
6030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6031 : },
6032 : {
6033 : .name = discard_const_p(char, "pdc_ip"),
6034 : .get = py_nbt_sockaddr_get_pdc_ip,
6035 : .set = py_nbt_sockaddr_set_pdc_ip,
6036 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
6037 : },
6038 : {
6039 : .name = discard_const_p(char, "remaining"),
6040 : .get = py_nbt_sockaddr_get_remaining,
6041 : .set = py_nbt_sockaddr_set_remaining,
6042 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
6043 : },
6044 : { .name = NULL }
6045 : };
6046 :
6047 0 : static PyObject *py_nbt_sockaddr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6048 : {
6049 0 : return pytalloc_new(struct nbt_sockaddr, type);
6050 : }
6051 :
6052 0 : static PyObject *py_nbt_sockaddr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6053 : {
6054 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(py_obj);
6055 0 : PyObject *ret = NULL;
6056 0 : DATA_BLOB blob;
6057 0 : enum ndr_err_code err;
6058 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6059 0 : if (tmp_ctx == NULL) {
6060 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6061 0 : return NULL;
6062 : }
6063 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr);
6064 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6065 0 : TALLOC_FREE(tmp_ctx);
6066 0 : PyErr_SetNdrError(err);
6067 0 : return NULL;
6068 : }
6069 :
6070 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6071 0 : TALLOC_FREE(tmp_ctx);
6072 0 : return ret;
6073 : }
6074 :
6075 0 : static PyObject *py_nbt_sockaddr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6076 : {
6077 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(py_obj);
6078 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6079 0 : Py_ssize_t blob_length = 0;
6080 0 : enum ndr_err_code err;
6081 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6082 0 : PyObject *allow_remaining_obj = NULL;
6083 0 : bool allow_remaining = false;
6084 :
6085 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6086 : discard_const_p(char *, kwnames),
6087 : &blob.data, &blob_length,
6088 : &allow_remaining_obj)) {
6089 0 : return NULL;
6090 : }
6091 0 : blob.length = blob_length;
6092 :
6093 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6094 0 : allow_remaining = true;
6095 : }
6096 :
6097 0 : if (allow_remaining) {
6098 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
6099 : } else {
6100 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
6101 : }
6102 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6103 0 : PyErr_SetNdrError(err);
6104 0 : return NULL;
6105 : }
6106 :
6107 0 : Py_RETURN_NONE;
6108 : }
6109 :
6110 0 : static PyObject *py_nbt_sockaddr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6111 : {
6112 0 : struct nbt_sockaddr *object = pytalloc_get_ptr(py_obj);
6113 0 : PyObject *ret;
6114 0 : char *retstr;
6115 :
6116 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_sockaddr, "nbt_sockaddr", object);
6117 0 : ret = PyUnicode_FromString(retstr);
6118 0 : talloc_free(retstr);
6119 :
6120 0 : return ret;
6121 : }
6122 :
6123 : static PyMethodDef py_nbt_sockaddr_methods[] = {
6124 : { "__ndr_pack__", (PyCFunction)py_nbt_sockaddr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6125 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_sockaddr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6126 : { "__ndr_print__", (PyCFunction)py_nbt_sockaddr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6127 : { NULL, NULL, 0, NULL }
6128 : };
6129 :
6130 :
6131 : static PyTypeObject nbt_sockaddr_Type = {
6132 : PyVarObject_HEAD_INIT(NULL, 0)
6133 : .tp_name = "nbt.sockaddr",
6134 : .tp_getset = py_nbt_sockaddr_getsetters,
6135 : .tp_methods = py_nbt_sockaddr_methods,
6136 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6137 : .tp_new = py_nbt_sockaddr_new,
6138 : };
6139 :
6140 :
6141 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
6142 : {
6143 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6144 0 : PyObject *py_request_count;
6145 0 : py_request_count = PyLong_FromLong((uint16_t)(object->request_count));
6146 0 : return py_request_count;
6147 : }
6148 :
6149 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
6150 : {
6151 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6152 0 : if (value == NULL) {
6153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->request_count");
6154 0 : return -1;
6155 : }
6156 : {
6157 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
6158 0 : if (PyLong_Check(value)) {
6159 0 : unsigned long long test_var;
6160 0 : test_var = PyLong_AsUnsignedLongLong(value);
6161 0 : if (PyErr_Occurred() != NULL) {
6162 0 : return -1;
6163 : }
6164 0 : if (test_var > uint_max) {
6165 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6166 : PyLong_Type.tp_name, uint_max, test_var);
6167 0 : return -1;
6168 : }
6169 0 : object->request_count = test_var;
6170 : } else {
6171 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6172 : PyLong_Type.tp_name);
6173 0 : return -1;
6174 : }
6175 : }
6176 0 : return 0;
6177 : }
6178 :
6179 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
6180 : {
6181 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6182 0 : PyObject *py_computer_name;
6183 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
6184 0 : return py_computer_name;
6185 : }
6186 :
6187 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
6188 : {
6189 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6190 0 : if (value == NULL) {
6191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->computer_name");
6192 0 : return -1;
6193 : }
6194 : {
6195 0 : const char *test_str;
6196 0 : const char *talloc_str;
6197 0 : PyObject *unicode = NULL;
6198 0 : if (PyUnicode_Check(value)) {
6199 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6200 0 : if (unicode == NULL) {
6201 0 : return -1;
6202 : }
6203 0 : test_str = PyBytes_AS_STRING(unicode);
6204 0 : } else if (PyBytes_Check(value)) {
6205 0 : test_str = PyBytes_AS_STRING(value);
6206 : } else {
6207 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6208 0 : return -1;
6209 : }
6210 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6211 0 : if (unicode != NULL) {
6212 0 : Py_DECREF(unicode);
6213 : }
6214 0 : if (talloc_str == NULL) {
6215 0 : PyErr_NoMemory();
6216 0 : return -1;
6217 : }
6218 0 : object->computer_name = talloc_str;
6219 : }
6220 0 : return 0;
6221 : }
6222 :
6223 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
6224 : {
6225 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6226 0 : PyObject *py_user_name;
6227 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
6228 0 : return py_user_name;
6229 : }
6230 :
6231 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
6232 : {
6233 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6234 0 : if (value == NULL) {
6235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
6236 0 : return -1;
6237 : }
6238 : {
6239 0 : const char *test_str;
6240 0 : const char *talloc_str;
6241 0 : PyObject *unicode = NULL;
6242 0 : if (PyUnicode_Check(value)) {
6243 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6244 0 : if (unicode == NULL) {
6245 0 : return -1;
6246 : }
6247 0 : test_str = PyBytes_AS_STRING(unicode);
6248 0 : } else if (PyBytes_Check(value)) {
6249 0 : test_str = PyBytes_AS_STRING(value);
6250 : } else {
6251 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6252 0 : return -1;
6253 : }
6254 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6255 0 : if (unicode != NULL) {
6256 0 : Py_DECREF(unicode);
6257 : }
6258 0 : if (talloc_str == NULL) {
6259 0 : PyErr_NoMemory();
6260 0 : return -1;
6261 : }
6262 0 : object->user_name = talloc_str;
6263 : }
6264 0 : return 0;
6265 : }
6266 :
6267 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
6268 : {
6269 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6270 0 : PyObject *py_mailslot_name;
6271 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
6272 0 : return py_mailslot_name;
6273 : }
6274 :
6275 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
6276 : {
6277 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6278 0 : if (value == NULL) {
6279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mailslot_name");
6280 0 : return -1;
6281 : }
6282 : {
6283 0 : const char *test_str;
6284 0 : const char *talloc_str;
6285 0 : PyObject *unicode = NULL;
6286 0 : if (PyUnicode_Check(value)) {
6287 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6288 0 : if (unicode == NULL) {
6289 0 : return -1;
6290 : }
6291 0 : test_str = PyBytes_AS_STRING(unicode);
6292 0 : } else if (PyBytes_Check(value)) {
6293 0 : test_str = PyBytes_AS_STRING(value);
6294 : } else {
6295 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6296 0 : return -1;
6297 : }
6298 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6299 0 : if (unicode != NULL) {
6300 0 : Py_DECREF(unicode);
6301 : }
6302 0 : if (talloc_str == NULL) {
6303 0 : PyErr_NoMemory();
6304 0 : return -1;
6305 : }
6306 0 : object->mailslot_name = talloc_str;
6307 : }
6308 0 : return 0;
6309 : }
6310 :
6311 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control(PyObject *obj, void *closure)
6312 : {
6313 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6314 0 : PyObject *py_acct_control;
6315 0 : py_acct_control = PyLong_FromUnsignedLongLong((uint32_t)(object->acct_control));
6316 0 : return py_acct_control;
6317 : }
6318 :
6319 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control(PyObject *py_obj, PyObject *value, void *closure)
6320 : {
6321 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6322 0 : if (value == NULL) {
6323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->acct_control");
6324 0 : return -1;
6325 : }
6326 : {
6327 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_control));
6328 0 : if (PyLong_Check(value)) {
6329 0 : unsigned long long test_var;
6330 0 : test_var = PyLong_AsUnsignedLongLong(value);
6331 0 : if (PyErr_Occurred() != NULL) {
6332 0 : return -1;
6333 : }
6334 0 : if (test_var > uint_max) {
6335 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6336 : PyLong_Type.tp_name, uint_max, test_var);
6337 0 : return -1;
6338 : }
6339 0 : object->acct_control = test_var;
6340 : } else {
6341 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6342 : PyLong_Type.tp_name);
6343 0 : return -1;
6344 : }
6345 : }
6346 0 : return 0;
6347 : }
6348 :
6349 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size(PyObject *obj, void *closure)
6350 : {
6351 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6352 0 : PyObject *py_sid_size;
6353 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_size));
6354 0 : return py_sid_size;
6355 : }
6356 :
6357 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
6358 : {
6359 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6360 0 : if (value == NULL) {
6361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_size");
6362 0 : return -1;
6363 : }
6364 : {
6365 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
6366 0 : if (PyLong_Check(value)) {
6367 0 : unsigned long long test_var;
6368 0 : test_var = PyLong_AsUnsignedLongLong(value);
6369 0 : if (PyErr_Occurred() != NULL) {
6370 0 : return -1;
6371 : }
6372 0 : if (test_var > uint_max) {
6373 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6374 : PyLong_Type.tp_name, uint_max, test_var);
6375 0 : return -1;
6376 : }
6377 0 : object->sid_size = test_var;
6378 : } else {
6379 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6380 : PyLong_Type.tp_name);
6381 0 : return -1;
6382 : }
6383 : }
6384 0 : return 0;
6385 : }
6386 :
6387 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get__pad(PyObject *obj, void *closure)
6388 : {
6389 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6390 0 : PyObject *py__pad;
6391 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
6392 0 : return py__pad;
6393 : }
6394 :
6395 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set__pad(PyObject *py_obj, PyObject *value, void *closure)
6396 : {
6397 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6398 0 : if (value == NULL) {
6399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
6400 0 : return -1;
6401 : }
6402 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
6403 0 : return 0;
6404 : }
6405 :
6406 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid(PyObject *obj, void *closure)
6407 : {
6408 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6409 0 : PyObject *py_sid;
6410 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
6411 0 : return py_sid;
6412 : }
6413 :
6414 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6415 : {
6416 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6417 0 : if (value == NULL) {
6418 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
6419 0 : return -1;
6420 : }
6421 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6422 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6423 0 : PyErr_NoMemory();
6424 0 : return -1;
6425 : }
6426 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
6427 0 : return 0;
6428 : }
6429 :
6430 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version(PyObject *obj, void *closure)
6431 : {
6432 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6433 0 : PyObject *py_nt_version;
6434 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)(object->nt_version));
6435 0 : return py_nt_version;
6436 : }
6437 :
6438 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
6439 : {
6440 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6441 0 : if (value == NULL) {
6442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nt_version");
6443 0 : return -1;
6444 : }
6445 : {
6446 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
6447 0 : if (PyLong_Check(value)) {
6448 0 : unsigned long long test_var;
6449 0 : test_var = PyLong_AsUnsignedLongLong(value);
6450 0 : if (PyErr_Occurred() != NULL) {
6451 0 : return -1;
6452 : }
6453 0 : if (test_var > uint_max) {
6454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6455 : PyLong_Type.tp_name, uint_max, test_var);
6456 0 : return -1;
6457 : }
6458 0 : object->nt_version = test_var;
6459 : } else {
6460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6461 : PyLong_Type.tp_name);
6462 0 : return -1;
6463 : }
6464 : }
6465 0 : return 0;
6466 : }
6467 :
6468 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
6469 : {
6470 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6471 0 : PyObject *py_lmnt_token;
6472 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
6473 0 : return py_lmnt_token;
6474 : }
6475 :
6476 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
6477 : {
6478 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6479 0 : if (value == NULL) {
6480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
6481 0 : return -1;
6482 : }
6483 : {
6484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
6485 0 : if (PyLong_Check(value)) {
6486 0 : unsigned long long test_var;
6487 0 : test_var = PyLong_AsUnsignedLongLong(value);
6488 0 : if (PyErr_Occurred() != NULL) {
6489 0 : return -1;
6490 : }
6491 0 : if (test_var > uint_max) {
6492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6493 : PyLong_Type.tp_name, uint_max, test_var);
6494 0 : return -1;
6495 : }
6496 0 : object->lmnt_token = test_var;
6497 : } else {
6498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6499 : PyLong_Type.tp_name);
6500 0 : return -1;
6501 : }
6502 : }
6503 0 : return 0;
6504 : }
6505 :
6506 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
6507 : {
6508 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6509 0 : PyObject *py_lm20_token;
6510 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
6511 0 : return py_lm20_token;
6512 : }
6513 :
6514 0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
6515 : {
6516 0 : struct NETLOGON_SAM_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6517 0 : if (value == NULL) {
6518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
6519 0 : return -1;
6520 : }
6521 : {
6522 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
6523 0 : if (PyLong_Check(value)) {
6524 0 : unsigned long long test_var;
6525 0 : test_var = PyLong_AsUnsignedLongLong(value);
6526 0 : if (PyErr_Occurred() != NULL) {
6527 0 : return -1;
6528 : }
6529 0 : if (test_var > uint_max) {
6530 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6531 : PyLong_Type.tp_name, uint_max, test_var);
6532 0 : return -1;
6533 : }
6534 0 : object->lm20_token = test_var;
6535 : } else {
6536 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6537 : PyLong_Type.tp_name);
6538 0 : return -1;
6539 : }
6540 : }
6541 0 : return 0;
6542 : }
6543 :
6544 : static PyGetSetDef py_NETLOGON_SAM_LOGON_REQUEST_getsetters[] = {
6545 : {
6546 : .name = discard_const_p(char, "request_count"),
6547 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_request_count,
6548 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_request_count,
6549 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6550 : },
6551 : {
6552 : .name = discard_const_p(char, "computer_name"),
6553 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name,
6554 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name,
6555 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6556 : },
6557 : {
6558 : .name = discard_const_p(char, "user_name"),
6559 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_user_name,
6560 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_user_name,
6561 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6562 : },
6563 : {
6564 : .name = discard_const_p(char, "mailslot_name"),
6565 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name,
6566 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name,
6567 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6568 : },
6569 : {
6570 : .name = discard_const_p(char, "acct_control"),
6571 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control,
6572 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control,
6573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6574 : },
6575 : {
6576 : .name = discard_const_p(char, "sid_size"),
6577 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size,
6578 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size,
6579 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6580 : },
6581 : {
6582 : .name = discard_const_p(char, "_pad"),
6583 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get__pad,
6584 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set__pad,
6585 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
6586 : },
6587 : {
6588 : .name = discard_const_p(char, "sid"),
6589 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid,
6590 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid,
6591 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
6592 : },
6593 : {
6594 : .name = discard_const_p(char, "nt_version"),
6595 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version,
6596 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version,
6597 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
6598 : },
6599 : {
6600 : .name = discard_const_p(char, "lmnt_token"),
6601 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token,
6602 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token,
6603 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6604 : },
6605 : {
6606 : .name = discard_const_p(char, "lm20_token"),
6607 : .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token,
6608 : .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token,
6609 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6610 : },
6611 : { .name = NULL }
6612 : };
6613 :
6614 0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6615 : {
6616 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_REQUEST, type);
6617 : }
6618 :
6619 :
6620 : static PyTypeObject NETLOGON_SAM_LOGON_REQUEST_Type = {
6621 : PyVarObject_HEAD_INIT(NULL, 0)
6622 : .tp_name = "nbt.NETLOGON_SAM_LOGON_REQUEST",
6623 : .tp_getset = py_NETLOGON_SAM_LOGON_REQUEST_getsetters,
6624 : .tp_methods = NULL,
6625 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6626 : .tp_new = py_NETLOGON_SAM_LOGON_REQUEST_new,
6627 : };
6628 :
6629 :
6630 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
6631 : {
6632 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6633 0 : PyObject *py_computer_name;
6634 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
6635 0 : return py_computer_name;
6636 : }
6637 :
6638 0 : static int py_NETLOGON_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
6639 : {
6640 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6641 0 : if (value == NULL) {
6642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->computer_name");
6643 0 : return -1;
6644 : }
6645 : {
6646 0 : const char *test_str;
6647 0 : const char *talloc_str;
6648 0 : PyObject *unicode = NULL;
6649 0 : if (PyUnicode_Check(value)) {
6650 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6651 0 : if (unicode == NULL) {
6652 0 : return -1;
6653 : }
6654 0 : test_str = PyBytes_AS_STRING(unicode);
6655 0 : } else if (PyBytes_Check(value)) {
6656 0 : test_str = PyBytes_AS_STRING(value);
6657 : } else {
6658 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6659 0 : return -1;
6660 : }
6661 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6662 0 : if (unicode != NULL) {
6663 0 : Py_DECREF(unicode);
6664 : }
6665 0 : if (talloc_str == NULL) {
6666 0 : PyErr_NoMemory();
6667 0 : return -1;
6668 : }
6669 0 : object->computer_name = talloc_str;
6670 : }
6671 0 : return 0;
6672 : }
6673 :
6674 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
6675 : {
6676 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6677 0 : PyObject *py_user_name;
6678 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
6679 0 : return py_user_name;
6680 : }
6681 :
6682 0 : static int py_NETLOGON_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
6683 : {
6684 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6685 0 : if (value == NULL) {
6686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
6687 0 : return -1;
6688 : }
6689 : {
6690 0 : const char *test_str;
6691 0 : const char *talloc_str;
6692 0 : PyObject *unicode = NULL;
6693 0 : if (PyUnicode_Check(value)) {
6694 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6695 0 : if (unicode == NULL) {
6696 0 : return -1;
6697 : }
6698 0 : test_str = PyBytes_AS_STRING(unicode);
6699 0 : } else if (PyBytes_Check(value)) {
6700 0 : test_str = PyBytes_AS_STRING(value);
6701 : } else {
6702 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6703 0 : return -1;
6704 : }
6705 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6706 0 : if (unicode != NULL) {
6707 0 : Py_DECREF(unicode);
6708 : }
6709 0 : if (talloc_str == NULL) {
6710 0 : PyErr_NoMemory();
6711 0 : return -1;
6712 : }
6713 0 : object->user_name = talloc_str;
6714 : }
6715 0 : return 0;
6716 : }
6717 :
6718 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
6719 : {
6720 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6721 0 : PyObject *py_mailslot_name;
6722 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
6723 0 : return py_mailslot_name;
6724 : }
6725 :
6726 0 : static int py_NETLOGON_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
6727 : {
6728 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6729 0 : if (value == NULL) {
6730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mailslot_name");
6731 0 : return -1;
6732 : }
6733 : {
6734 0 : const char *test_str;
6735 0 : const char *talloc_str;
6736 0 : PyObject *unicode = NULL;
6737 0 : if (PyUnicode_Check(value)) {
6738 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6739 0 : if (unicode == NULL) {
6740 0 : return -1;
6741 : }
6742 0 : test_str = PyBytes_AS_STRING(unicode);
6743 0 : } else if (PyBytes_Check(value)) {
6744 0 : test_str = PyBytes_AS_STRING(value);
6745 : } else {
6746 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6747 0 : return -1;
6748 : }
6749 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6750 0 : if (unicode != NULL) {
6751 0 : Py_DECREF(unicode);
6752 : }
6753 0 : if (talloc_str == NULL) {
6754 0 : PyErr_NoMemory();
6755 0 : return -1;
6756 : }
6757 0 : object->mailslot_name = talloc_str;
6758 : }
6759 0 : return 0;
6760 : }
6761 :
6762 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
6763 : {
6764 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6765 0 : PyObject *py_request_count;
6766 0 : py_request_count = PyLong_FromLong((uint16_t)(object->request_count));
6767 0 : return py_request_count;
6768 : }
6769 :
6770 0 : static int py_NETLOGON_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
6771 : {
6772 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6773 0 : if (value == NULL) {
6774 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->request_count");
6775 0 : return -1;
6776 : }
6777 : {
6778 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
6779 0 : if (PyLong_Check(value)) {
6780 0 : unsigned long long test_var;
6781 0 : test_var = PyLong_AsUnsignedLongLong(value);
6782 0 : if (PyErr_Occurred() != NULL) {
6783 0 : return -1;
6784 : }
6785 0 : if (test_var > uint_max) {
6786 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6787 : PyLong_Type.tp_name, uint_max, test_var);
6788 0 : return -1;
6789 : }
6790 0 : object->request_count = test_var;
6791 : } else {
6792 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6793 : PyLong_Type.tp_name);
6794 0 : return -1;
6795 : }
6796 : }
6797 0 : return 0;
6798 : }
6799 :
6800 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
6801 : {
6802 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6803 0 : PyObject *py_lmnt_token;
6804 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
6805 0 : return py_lmnt_token;
6806 : }
6807 :
6808 0 : static int py_NETLOGON_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
6809 : {
6810 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6811 0 : if (value == NULL) {
6812 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
6813 0 : return -1;
6814 : }
6815 : {
6816 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
6817 0 : if (PyLong_Check(value)) {
6818 0 : unsigned long long test_var;
6819 0 : test_var = PyLong_AsUnsignedLongLong(value);
6820 0 : if (PyErr_Occurred() != NULL) {
6821 0 : return -1;
6822 : }
6823 0 : if (test_var > uint_max) {
6824 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6825 : PyLong_Type.tp_name, uint_max, test_var);
6826 0 : return -1;
6827 : }
6828 0 : object->lmnt_token = test_var;
6829 : } else {
6830 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6831 : PyLong_Type.tp_name);
6832 0 : return -1;
6833 : }
6834 : }
6835 0 : return 0;
6836 : }
6837 :
6838 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
6839 : {
6840 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(obj);
6841 0 : PyObject *py_lm20_token;
6842 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
6843 0 : return py_lm20_token;
6844 : }
6845 :
6846 0 : static int py_NETLOGON_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
6847 : {
6848 0 : struct NETLOGON_LOGON_REQUEST *object = pytalloc_get_ptr(py_obj);
6849 0 : if (value == NULL) {
6850 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
6851 0 : return -1;
6852 : }
6853 : {
6854 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
6855 0 : if (PyLong_Check(value)) {
6856 0 : unsigned long long test_var;
6857 0 : test_var = PyLong_AsUnsignedLongLong(value);
6858 0 : if (PyErr_Occurred() != NULL) {
6859 0 : return -1;
6860 : }
6861 0 : if (test_var > uint_max) {
6862 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6863 : PyLong_Type.tp_name, uint_max, test_var);
6864 0 : return -1;
6865 : }
6866 0 : object->lm20_token = test_var;
6867 : } else {
6868 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6869 : PyLong_Type.tp_name);
6870 0 : return -1;
6871 : }
6872 : }
6873 0 : return 0;
6874 : }
6875 :
6876 : static PyGetSetDef py_NETLOGON_LOGON_REQUEST_getsetters[] = {
6877 : {
6878 : .name = discard_const_p(char, "computer_name"),
6879 : .get = py_NETLOGON_LOGON_REQUEST_get_computer_name,
6880 : .set = py_NETLOGON_LOGON_REQUEST_set_computer_name,
6881 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6882 : },
6883 : {
6884 : .name = discard_const_p(char, "user_name"),
6885 : .get = py_NETLOGON_LOGON_REQUEST_get_user_name,
6886 : .set = py_NETLOGON_LOGON_REQUEST_set_user_name,
6887 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6888 : },
6889 : {
6890 : .name = discard_const_p(char, "mailslot_name"),
6891 : .get = py_NETLOGON_LOGON_REQUEST_get_mailslot_name,
6892 : .set = py_NETLOGON_LOGON_REQUEST_set_mailslot_name,
6893 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
6894 : },
6895 : {
6896 : .name = discard_const_p(char, "request_count"),
6897 : .get = py_NETLOGON_LOGON_REQUEST_get_request_count,
6898 : .set = py_NETLOGON_LOGON_REQUEST_set_request_count,
6899 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6900 : },
6901 : {
6902 : .name = discard_const_p(char, "lmnt_token"),
6903 : .get = py_NETLOGON_LOGON_REQUEST_get_lmnt_token,
6904 : .set = py_NETLOGON_LOGON_REQUEST_set_lmnt_token,
6905 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6906 : },
6907 : {
6908 : .name = discard_const_p(char, "lm20_token"),
6909 : .get = py_NETLOGON_LOGON_REQUEST_get_lm20_token,
6910 : .set = py_NETLOGON_LOGON_REQUEST_set_lm20_token,
6911 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6912 : },
6913 : { .name = NULL }
6914 : };
6915 :
6916 0 : static PyObject *py_NETLOGON_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6917 : {
6918 0 : return pytalloc_new(struct NETLOGON_LOGON_REQUEST, type);
6919 : }
6920 :
6921 :
6922 : static PyTypeObject NETLOGON_LOGON_REQUEST_Type = {
6923 : PyVarObject_HEAD_INIT(NULL, 0)
6924 : .tp_name = "nbt.NETLOGON_LOGON_REQUEST",
6925 : .tp_getset = py_NETLOGON_LOGON_REQUEST_getsetters,
6926 : .tp_methods = NULL,
6927 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6928 : .tp_new = py_NETLOGON_LOGON_REQUEST_new,
6929 : };
6930 :
6931 :
6932 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command(PyObject *obj, void *closure)
6933 : {
6934 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
6935 0 : PyObject *py_command;
6936 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
6937 0 : return py_command;
6938 : }
6939 :
6940 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command(PyObject *py_obj, PyObject *value, void *closure)
6941 : {
6942 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
6943 0 : if (value == NULL) {
6944 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
6945 0 : return -1;
6946 : }
6947 : {
6948 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
6949 0 : if (PyLong_Check(value)) {
6950 0 : unsigned long long test_var;
6951 0 : test_var = PyLong_AsUnsignedLongLong(value);
6952 0 : if (PyErr_Occurred() != NULL) {
6953 0 : return -1;
6954 : }
6955 0 : if (test_var > uint_max) {
6956 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6957 : PyLong_Type.tp_name, uint_max, test_var);
6958 0 : return -1;
6959 : }
6960 0 : object->command = test_var;
6961 : } else {
6962 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6963 : PyLong_Type.tp_name);
6964 0 : return -1;
6965 : }
6966 : }
6967 0 : return 0;
6968 : }
6969 :
6970 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name(PyObject *obj, void *closure)
6971 : {
6972 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
6973 0 : PyObject *py_pdc_name;
6974 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
6975 0 : return py_pdc_name;
6976 : }
6977 :
6978 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
6979 : {
6980 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
6981 0 : if (value == NULL) {
6982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_name");
6983 0 : return -1;
6984 : }
6985 : {
6986 0 : const char *test_str;
6987 0 : const char *talloc_str;
6988 0 : PyObject *unicode = NULL;
6989 0 : if (PyUnicode_Check(value)) {
6990 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6991 0 : if (unicode == NULL) {
6992 0 : return -1;
6993 : }
6994 0 : test_str = PyBytes_AS_STRING(unicode);
6995 0 : } else if (PyBytes_Check(value)) {
6996 0 : test_str = PyBytes_AS_STRING(value);
6997 : } else {
6998 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6999 0 : return -1;
7000 : }
7001 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7002 0 : if (unicode != NULL) {
7003 0 : Py_DECREF(unicode);
7004 : }
7005 0 : if (talloc_str == NULL) {
7006 0 : PyErr_NoMemory();
7007 0 : return -1;
7008 : }
7009 0 : object->pdc_name = talloc_str;
7010 : }
7011 0 : return 0;
7012 : }
7013 :
7014 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name(PyObject *obj, void *closure)
7015 : {
7016 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
7017 0 : PyObject *py_user_name;
7018 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
7019 0 : return py_user_name;
7020 : }
7021 :
7022 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
7023 : {
7024 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7025 0 : if (value == NULL) {
7026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
7027 0 : return -1;
7028 : }
7029 : {
7030 0 : const char *test_str;
7031 0 : const char *talloc_str;
7032 0 : PyObject *unicode = NULL;
7033 0 : if (PyUnicode_Check(value)) {
7034 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7035 0 : if (unicode == NULL) {
7036 0 : return -1;
7037 : }
7038 0 : test_str = PyBytes_AS_STRING(unicode);
7039 0 : } else if (PyBytes_Check(value)) {
7040 0 : test_str = PyBytes_AS_STRING(value);
7041 : } else {
7042 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7043 0 : return -1;
7044 : }
7045 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7046 0 : if (unicode != NULL) {
7047 0 : Py_DECREF(unicode);
7048 : }
7049 0 : if (talloc_str == NULL) {
7050 0 : PyErr_NoMemory();
7051 0 : return -1;
7052 : }
7053 0 : object->user_name = talloc_str;
7054 : }
7055 0 : return 0;
7056 : }
7057 :
7058 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name(PyObject *obj, void *closure)
7059 : {
7060 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
7061 0 : PyObject *py_domain_name;
7062 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
7063 0 : return py_domain_name;
7064 : }
7065 :
7066 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
7067 : {
7068 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7069 0 : if (value == NULL) {
7070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
7071 0 : return -1;
7072 : }
7073 : {
7074 0 : const char *test_str;
7075 0 : const char *talloc_str;
7076 0 : PyObject *unicode = NULL;
7077 0 : if (PyUnicode_Check(value)) {
7078 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7079 0 : if (unicode == NULL) {
7080 0 : return -1;
7081 : }
7082 0 : test_str = PyBytes_AS_STRING(unicode);
7083 0 : } else if (PyBytes_Check(value)) {
7084 0 : test_str = PyBytes_AS_STRING(value);
7085 : } else {
7086 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7087 0 : return -1;
7088 : }
7089 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7090 0 : if (unicode != NULL) {
7091 0 : Py_DECREF(unicode);
7092 : }
7093 0 : if (talloc_str == NULL) {
7094 0 : PyErr_NoMemory();
7095 0 : return -1;
7096 : }
7097 0 : object->domain_name = talloc_str;
7098 : }
7099 0 : return 0;
7100 : }
7101 :
7102 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version(PyObject *obj, void *closure)
7103 : {
7104 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
7105 0 : PyObject *py_nt_version;
7106 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)(object->nt_version));
7107 0 : return py_nt_version;
7108 : }
7109 :
7110 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
7111 : {
7112 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7113 0 : if (value == NULL) {
7114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nt_version");
7115 0 : return -1;
7116 : }
7117 : {
7118 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
7119 0 : if (PyLong_Check(value)) {
7120 0 : unsigned long long test_var;
7121 0 : test_var = PyLong_AsUnsignedLongLong(value);
7122 0 : if (PyErr_Occurred() != NULL) {
7123 0 : return -1;
7124 : }
7125 0 : if (test_var > uint_max) {
7126 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7127 : PyLong_Type.tp_name, uint_max, test_var);
7128 0 : return -1;
7129 : }
7130 0 : object->nt_version = test_var;
7131 : } else {
7132 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7133 : PyLong_Type.tp_name);
7134 0 : return -1;
7135 : }
7136 : }
7137 0 : return 0;
7138 : }
7139 :
7140 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token(PyObject *obj, void *closure)
7141 : {
7142 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
7143 0 : PyObject *py_lmnt_token;
7144 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
7145 0 : return py_lmnt_token;
7146 : }
7147 :
7148 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
7149 : {
7150 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7151 0 : if (value == NULL) {
7152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
7153 0 : return -1;
7154 : }
7155 : {
7156 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
7157 0 : if (PyLong_Check(value)) {
7158 0 : unsigned long long test_var;
7159 0 : test_var = PyLong_AsUnsignedLongLong(value);
7160 0 : if (PyErr_Occurred() != NULL) {
7161 0 : return -1;
7162 : }
7163 0 : if (test_var > uint_max) {
7164 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7165 : PyLong_Type.tp_name, uint_max, test_var);
7166 0 : return -1;
7167 : }
7168 0 : object->lmnt_token = test_var;
7169 : } else {
7170 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7171 : PyLong_Type.tp_name);
7172 0 : return -1;
7173 : }
7174 : }
7175 0 : return 0;
7176 : }
7177 :
7178 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token(PyObject *obj, void *closure)
7179 : {
7180 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(obj);
7181 0 : PyObject *py_lm20_token;
7182 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
7183 0 : return py_lm20_token;
7184 : }
7185 :
7186 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
7187 : {
7188 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7189 0 : if (value == NULL) {
7190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
7191 0 : return -1;
7192 : }
7193 : {
7194 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
7195 0 : if (PyLong_Check(value)) {
7196 0 : unsigned long long test_var;
7197 0 : test_var = PyLong_AsUnsignedLongLong(value);
7198 0 : if (PyErr_Occurred() != NULL) {
7199 0 : return -1;
7200 : }
7201 0 : if (test_var > uint_max) {
7202 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7203 : PyLong_Type.tp_name, uint_max, test_var);
7204 0 : return -1;
7205 : }
7206 0 : object->lm20_token = test_var;
7207 : } else {
7208 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7209 : PyLong_Type.tp_name);
7210 0 : return -1;
7211 : }
7212 : }
7213 0 : return 0;
7214 : }
7215 :
7216 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters[] = {
7217 : {
7218 : .name = discard_const_p(char, "command"),
7219 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command,
7220 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command,
7221 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
7222 : },
7223 : {
7224 : .name = discard_const_p(char, "pdc_name"),
7225 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name,
7226 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name,
7227 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7228 : },
7229 : {
7230 : .name = discard_const_p(char, "user_name"),
7231 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name,
7232 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name,
7233 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7234 : },
7235 : {
7236 : .name = discard_const_p(char, "domain_name"),
7237 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name,
7238 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name,
7239 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7240 : },
7241 : {
7242 : .name = discard_const_p(char, "nt_version"),
7243 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version,
7244 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version,
7245 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
7246 : },
7247 : {
7248 : .name = discard_const_p(char, "lmnt_token"),
7249 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token,
7250 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token,
7251 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7252 : },
7253 : {
7254 : .name = discard_const_p(char, "lm20_token"),
7255 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token,
7256 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token,
7257 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7258 : },
7259 : { .name = NULL }
7260 : };
7261 :
7262 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7263 : {
7264 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_NT40, type);
7265 : }
7266 :
7267 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7268 : {
7269 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7270 0 : PyObject *ret = NULL;
7271 0 : DATA_BLOB blob;
7272 0 : enum ndr_err_code err;
7273 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7274 0 : if (tmp_ctx == NULL) {
7275 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7276 0 : return NULL;
7277 : }
7278 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7279 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7280 0 : TALLOC_FREE(tmp_ctx);
7281 0 : PyErr_SetNdrError(err);
7282 0 : return NULL;
7283 : }
7284 :
7285 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7286 0 : TALLOC_FREE(tmp_ctx);
7287 0 : return ret;
7288 : }
7289 :
7290 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7291 : {
7292 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7293 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7294 0 : Py_ssize_t blob_length = 0;
7295 0 : enum ndr_err_code err;
7296 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7297 0 : PyObject *allow_remaining_obj = NULL;
7298 0 : bool allow_remaining = false;
7299 :
7300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7301 : discard_const_p(char *, kwnames),
7302 : &blob.data, &blob_length,
7303 : &allow_remaining_obj)) {
7304 0 : return NULL;
7305 : }
7306 0 : blob.length = blob_length;
7307 :
7308 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7309 0 : allow_remaining = true;
7310 : }
7311 :
7312 0 : if (allow_remaining) {
7313 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7314 : } else {
7315 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
7316 : }
7317 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7318 0 : PyErr_SetNdrError(err);
7319 0 : return NULL;
7320 : }
7321 :
7322 0 : Py_RETURN_NONE;
7323 : }
7324 :
7325 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7326 : {
7327 0 : struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = pytalloc_get_ptr(py_obj);
7328 0 : PyObject *ret;
7329 0 : char *retstr;
7330 :
7331 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40, "NETLOGON_SAM_LOGON_RESPONSE_NT40", object);
7332 0 : ret = PyUnicode_FromString(retstr);
7333 0 : talloc_free(retstr);
7334 :
7335 0 : return ret;
7336 : }
7337 :
7338 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods[] = {
7339 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7340 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7341 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7342 : { NULL, NULL, 0, NULL }
7343 : };
7344 :
7345 :
7346 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_NT40_Type = {
7347 : PyVarObject_HEAD_INIT(NULL, 0)
7348 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40",
7349 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters,
7350 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods,
7351 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7352 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new,
7353 : };
7354 :
7355 :
7356 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_command(PyObject *obj, void *closure)
7357 : {
7358 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7359 0 : PyObject *py_command;
7360 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
7361 0 : return py_command;
7362 : }
7363 :
7364 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_command(PyObject *py_obj, PyObject *value, void *closure)
7365 : {
7366 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7367 0 : if (value == NULL) {
7368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
7369 0 : return -1;
7370 : }
7371 : {
7372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
7373 0 : if (PyLong_Check(value)) {
7374 0 : unsigned long long test_var;
7375 0 : test_var = PyLong_AsUnsignedLongLong(value);
7376 0 : if (PyErr_Occurred() != NULL) {
7377 0 : return -1;
7378 : }
7379 0 : if (test_var > uint_max) {
7380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7381 : PyLong_Type.tp_name, uint_max, test_var);
7382 0 : return -1;
7383 : }
7384 0 : object->command = test_var;
7385 : } else {
7386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7387 : PyLong_Type.tp_name);
7388 0 : return -1;
7389 : }
7390 : }
7391 0 : return 0;
7392 : }
7393 :
7394 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name(PyObject *obj, void *closure)
7395 : {
7396 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7397 0 : PyObject *py_pdc_name;
7398 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
7399 0 : return py_pdc_name;
7400 : }
7401 :
7402 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
7403 : {
7404 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7405 0 : if (value == NULL) {
7406 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_name");
7407 0 : return -1;
7408 : }
7409 : {
7410 0 : const char *test_str;
7411 0 : const char *talloc_str;
7412 0 : PyObject *unicode = NULL;
7413 0 : if (PyUnicode_Check(value)) {
7414 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7415 0 : if (unicode == NULL) {
7416 0 : return -1;
7417 : }
7418 0 : test_str = PyBytes_AS_STRING(unicode);
7419 0 : } else if (PyBytes_Check(value)) {
7420 0 : test_str = PyBytes_AS_STRING(value);
7421 : } else {
7422 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7423 0 : return -1;
7424 : }
7425 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7426 0 : if (unicode != NULL) {
7427 0 : Py_DECREF(unicode);
7428 : }
7429 0 : if (talloc_str == NULL) {
7430 0 : PyErr_NoMemory();
7431 0 : return -1;
7432 : }
7433 0 : object->pdc_name = talloc_str;
7434 : }
7435 0 : return 0;
7436 : }
7437 :
7438 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name(PyObject *obj, void *closure)
7439 : {
7440 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7441 0 : PyObject *py_user_name;
7442 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
7443 0 : return py_user_name;
7444 : }
7445 :
7446 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
7447 : {
7448 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7449 0 : if (value == NULL) {
7450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
7451 0 : return -1;
7452 : }
7453 : {
7454 0 : const char *test_str;
7455 0 : const char *talloc_str;
7456 0 : PyObject *unicode = NULL;
7457 0 : if (PyUnicode_Check(value)) {
7458 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7459 0 : if (unicode == NULL) {
7460 0 : return -1;
7461 : }
7462 0 : test_str = PyBytes_AS_STRING(unicode);
7463 0 : } else if (PyBytes_Check(value)) {
7464 0 : test_str = PyBytes_AS_STRING(value);
7465 : } else {
7466 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7467 0 : return -1;
7468 : }
7469 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7470 0 : if (unicode != NULL) {
7471 0 : Py_DECREF(unicode);
7472 : }
7473 0 : if (talloc_str == NULL) {
7474 0 : PyErr_NoMemory();
7475 0 : return -1;
7476 : }
7477 0 : object->user_name = talloc_str;
7478 : }
7479 0 : return 0;
7480 : }
7481 :
7482 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name(PyObject *obj, void *closure)
7483 : {
7484 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7485 0 : PyObject *py_domain_name;
7486 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
7487 0 : return py_domain_name;
7488 : }
7489 :
7490 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
7491 : {
7492 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7493 0 : if (value == NULL) {
7494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
7495 0 : return -1;
7496 : }
7497 : {
7498 0 : const char *test_str;
7499 0 : const char *talloc_str;
7500 0 : PyObject *unicode = NULL;
7501 0 : if (PyUnicode_Check(value)) {
7502 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7503 0 : if (unicode == NULL) {
7504 0 : return -1;
7505 : }
7506 0 : test_str = PyBytes_AS_STRING(unicode);
7507 0 : } else if (PyBytes_Check(value)) {
7508 0 : test_str = PyBytes_AS_STRING(value);
7509 : } else {
7510 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7511 0 : return -1;
7512 : }
7513 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7514 0 : if (unicode != NULL) {
7515 0 : Py_DECREF(unicode);
7516 : }
7517 0 : if (talloc_str == NULL) {
7518 0 : PyErr_NoMemory();
7519 0 : return -1;
7520 : }
7521 0 : object->domain_name = talloc_str;
7522 : }
7523 0 : return 0;
7524 : }
7525 :
7526 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid(PyObject *obj, void *closure)
7527 : {
7528 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7529 0 : PyObject *py_domain_uuid;
7530 0 : py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
7531 0 : return py_domain_uuid;
7532 : }
7533 :
7534 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
7535 : {
7536 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7537 0 : if (value == NULL) {
7538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_uuid");
7539 0 : return -1;
7540 : }
7541 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
7542 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7543 0 : PyErr_NoMemory();
7544 0 : return -1;
7545 : }
7546 0 : object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
7547 0 : return 0;
7548 : }
7549 :
7550 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid(PyObject *obj, void *closure)
7551 : {
7552 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7553 0 : PyObject *py_zero_uuid;
7554 0 : py_zero_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->zero_uuid);
7555 0 : return py_zero_uuid;
7556 : }
7557 :
7558 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid(PyObject *py_obj, PyObject *value, void *closure)
7559 : {
7560 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7561 0 : if (value == NULL) {
7562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->zero_uuid");
7563 0 : return -1;
7564 : }
7565 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
7566 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7567 0 : PyErr_NoMemory();
7568 0 : return -1;
7569 : }
7570 0 : object->zero_uuid = *(struct GUID *)pytalloc_get_ptr(value);
7571 0 : return 0;
7572 : }
7573 :
7574 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_forest(PyObject *obj, void *closure)
7575 : {
7576 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7577 0 : PyObject *py_forest;
7578 0 : py_forest = PyString_FromStringOrNULL(object->forest);
7579 0 : return py_forest;
7580 : }
7581 :
7582 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_forest(PyObject *py_obj, PyObject *value, void *closure)
7583 : {
7584 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7585 0 : if (value == NULL) {
7586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->forest");
7587 0 : return -1;
7588 : }
7589 : {
7590 0 : const char *test_str;
7591 0 : const char *talloc_str;
7592 0 : PyObject *unicode = NULL;
7593 0 : if (PyUnicode_Check(value)) {
7594 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7595 0 : if (unicode == NULL) {
7596 0 : return -1;
7597 : }
7598 0 : test_str = PyBytes_AS_STRING(unicode);
7599 0 : } else if (PyBytes_Check(value)) {
7600 0 : test_str = PyBytes_AS_STRING(value);
7601 : } else {
7602 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7603 0 : return -1;
7604 : }
7605 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7606 0 : if (unicode != NULL) {
7607 0 : Py_DECREF(unicode);
7608 : }
7609 0 : if (talloc_str == NULL) {
7610 0 : PyErr_NoMemory();
7611 0 : return -1;
7612 : }
7613 0 : object->forest = talloc_str;
7614 : }
7615 0 : return 0;
7616 : }
7617 :
7618 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain(PyObject *obj, void *closure)
7619 : {
7620 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7621 0 : PyObject *py_dns_domain;
7622 0 : py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
7623 0 : return py_dns_domain;
7624 : }
7625 :
7626 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
7627 : {
7628 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7629 0 : if (value == NULL) {
7630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dns_domain");
7631 0 : return -1;
7632 : }
7633 : {
7634 0 : const char *test_str;
7635 0 : const char *talloc_str;
7636 0 : PyObject *unicode = NULL;
7637 0 : if (PyUnicode_Check(value)) {
7638 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7639 0 : if (unicode == NULL) {
7640 0 : return -1;
7641 : }
7642 0 : test_str = PyBytes_AS_STRING(unicode);
7643 0 : } else if (PyBytes_Check(value)) {
7644 0 : test_str = PyBytes_AS_STRING(value);
7645 : } else {
7646 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7647 0 : return -1;
7648 : }
7649 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7650 0 : if (unicode != NULL) {
7651 0 : Py_DECREF(unicode);
7652 : }
7653 0 : if (talloc_str == NULL) {
7654 0 : PyErr_NoMemory();
7655 0 : return -1;
7656 : }
7657 0 : object->dns_domain = talloc_str;
7658 : }
7659 0 : return 0;
7660 : }
7661 :
7662 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name(PyObject *obj, void *closure)
7663 : {
7664 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7665 0 : PyObject *py_pdc_dns_name;
7666 0 : py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
7667 0 : return py_pdc_dns_name;
7668 : }
7669 :
7670 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
7671 : {
7672 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7673 0 : if (value == NULL) {
7674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_dns_name");
7675 0 : return -1;
7676 : }
7677 : {
7678 0 : const char *test_str;
7679 0 : const char *talloc_str;
7680 0 : PyObject *unicode = NULL;
7681 0 : if (PyUnicode_Check(value)) {
7682 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7683 0 : if (unicode == NULL) {
7684 0 : return -1;
7685 : }
7686 0 : test_str = PyBytes_AS_STRING(unicode);
7687 0 : } else if (PyBytes_Check(value)) {
7688 0 : test_str = PyBytes_AS_STRING(value);
7689 : } else {
7690 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7691 0 : return -1;
7692 : }
7693 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7694 0 : if (unicode != NULL) {
7695 0 : Py_DECREF(unicode);
7696 : }
7697 0 : if (talloc_str == NULL) {
7698 0 : PyErr_NoMemory();
7699 0 : return -1;
7700 : }
7701 0 : object->pdc_dns_name = talloc_str;
7702 : }
7703 0 : return 0;
7704 : }
7705 :
7706 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip(PyObject *obj, void *closure)
7707 : {
7708 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7709 0 : PyObject *py_pdc_ip;
7710 0 : py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
7711 0 : return py_pdc_ip;
7712 : }
7713 :
7714 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
7715 : {
7716 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7717 0 : if (value == NULL) {
7718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_ip");
7719 0 : return -1;
7720 : }
7721 : {
7722 0 : const char *test_str;
7723 0 : const char *talloc_str;
7724 0 : PyObject *unicode = NULL;
7725 0 : if (PyUnicode_Check(value)) {
7726 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7727 0 : if (unicode == NULL) {
7728 0 : return -1;
7729 : }
7730 0 : test_str = PyBytes_AS_STRING(unicode);
7731 0 : } else if (PyBytes_Check(value)) {
7732 0 : test_str = PyBytes_AS_STRING(value);
7733 : } else {
7734 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7735 0 : return -1;
7736 : }
7737 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7738 0 : if (unicode != NULL) {
7739 0 : Py_DECREF(unicode);
7740 : }
7741 0 : if (talloc_str == NULL) {
7742 0 : PyErr_NoMemory();
7743 0 : return -1;
7744 : }
7745 0 : object->pdc_ip = talloc_str;
7746 : }
7747 0 : return 0;
7748 : }
7749 :
7750 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type(PyObject *obj, void *closure)
7751 : {
7752 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7753 0 : PyObject *py_server_type;
7754 0 : py_server_type = PyLong_FromUnsignedLongLong((uint32_t)(object->server_type));
7755 0 : return py_server_type;
7756 : }
7757 :
7758 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
7759 : {
7760 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7761 0 : if (value == NULL) {
7762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_type");
7763 0 : return -1;
7764 : }
7765 : {
7766 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
7767 0 : if (PyLong_Check(value)) {
7768 0 : unsigned long long test_var;
7769 0 : test_var = PyLong_AsUnsignedLongLong(value);
7770 0 : if (PyErr_Occurred() != NULL) {
7771 0 : return -1;
7772 : }
7773 0 : if (test_var > uint_max) {
7774 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7775 : PyLong_Type.tp_name, uint_max, test_var);
7776 0 : return -1;
7777 : }
7778 0 : object->server_type = test_var;
7779 : } else {
7780 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7781 : PyLong_Type.tp_name);
7782 0 : return -1;
7783 : }
7784 : }
7785 0 : return 0;
7786 : }
7787 :
7788 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version(PyObject *obj, void *closure)
7789 : {
7790 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7791 0 : PyObject *py_nt_version;
7792 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)(object->nt_version));
7793 0 : return py_nt_version;
7794 : }
7795 :
7796 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
7797 : {
7798 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7799 0 : if (value == NULL) {
7800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nt_version");
7801 0 : return -1;
7802 : }
7803 : {
7804 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
7805 0 : if (PyLong_Check(value)) {
7806 0 : unsigned long long test_var;
7807 0 : test_var = PyLong_AsUnsignedLongLong(value);
7808 0 : if (PyErr_Occurred() != NULL) {
7809 0 : return -1;
7810 : }
7811 0 : if (test_var > uint_max) {
7812 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7813 : PyLong_Type.tp_name, uint_max, test_var);
7814 0 : return -1;
7815 : }
7816 0 : object->nt_version = test_var;
7817 : } else {
7818 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7819 : PyLong_Type.tp_name);
7820 0 : return -1;
7821 : }
7822 : }
7823 0 : return 0;
7824 : }
7825 :
7826 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token(PyObject *obj, void *closure)
7827 : {
7828 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7829 0 : PyObject *py_lmnt_token;
7830 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
7831 0 : return py_lmnt_token;
7832 : }
7833 :
7834 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
7835 : {
7836 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7837 0 : if (value == NULL) {
7838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
7839 0 : return -1;
7840 : }
7841 : {
7842 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
7843 0 : if (PyLong_Check(value)) {
7844 0 : unsigned long long test_var;
7845 0 : test_var = PyLong_AsUnsignedLongLong(value);
7846 0 : if (PyErr_Occurred() != NULL) {
7847 0 : return -1;
7848 : }
7849 0 : if (test_var > uint_max) {
7850 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7851 : PyLong_Type.tp_name, uint_max, test_var);
7852 0 : return -1;
7853 : }
7854 0 : object->lmnt_token = test_var;
7855 : } else {
7856 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7857 : PyLong_Type.tp_name);
7858 0 : return -1;
7859 : }
7860 : }
7861 0 : return 0;
7862 : }
7863 :
7864 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token(PyObject *obj, void *closure)
7865 : {
7866 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(obj);
7867 0 : PyObject *py_lm20_token;
7868 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
7869 0 : return py_lm20_token;
7870 : }
7871 :
7872 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
7873 : {
7874 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7875 0 : if (value == NULL) {
7876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
7877 0 : return -1;
7878 : }
7879 : {
7880 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
7881 0 : if (PyLong_Check(value)) {
7882 0 : unsigned long long test_var;
7883 0 : test_var = PyLong_AsUnsignedLongLong(value);
7884 0 : if (PyErr_Occurred() != NULL) {
7885 0 : return -1;
7886 : }
7887 0 : if (test_var > uint_max) {
7888 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7889 : PyLong_Type.tp_name, uint_max, test_var);
7890 0 : return -1;
7891 : }
7892 0 : object->lm20_token = test_var;
7893 : } else {
7894 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7895 : PyLong_Type.tp_name);
7896 0 : return -1;
7897 : }
7898 : }
7899 0 : return 0;
7900 : }
7901 :
7902 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_getsetters[] = {
7903 : {
7904 : .name = discard_const_p(char, "command"),
7905 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_command,
7906 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_command,
7907 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
7908 : },
7909 : {
7910 : .name = discard_const_p(char, "pdc_name"),
7911 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name,
7912 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name,
7913 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7914 : },
7915 : {
7916 : .name = discard_const_p(char, "user_name"),
7917 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name,
7918 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name,
7919 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7920 : },
7921 : {
7922 : .name = discard_const_p(char, "domain_name"),
7923 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name,
7924 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name,
7925 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7926 : },
7927 : {
7928 : .name = discard_const_p(char, "domain_uuid"),
7929 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid,
7930 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid,
7931 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
7932 : },
7933 : {
7934 : .name = discard_const_p(char, "zero_uuid"),
7935 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid,
7936 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid,
7937 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
7938 : },
7939 : {
7940 : .name = discard_const_p(char, "forest"),
7941 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_forest,
7942 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_forest,
7943 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7944 : },
7945 : {
7946 : .name = discard_const_p(char, "dns_domain"),
7947 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain,
7948 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain,
7949 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7950 : },
7951 : {
7952 : .name = discard_const_p(char, "pdc_dns_name"),
7953 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name,
7954 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name,
7955 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
7956 : },
7957 : {
7958 : .name = discard_const_p(char, "pdc_ip"),
7959 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip,
7960 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip,
7961 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
7962 : },
7963 : {
7964 : .name = discard_const_p(char, "server_type"),
7965 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type,
7966 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type,
7967 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
7968 : },
7969 : {
7970 : .name = discard_const_p(char, "nt_version"),
7971 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version,
7972 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version,
7973 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
7974 : },
7975 : {
7976 : .name = discard_const_p(char, "lmnt_token"),
7977 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token,
7978 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token,
7979 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7980 : },
7981 : {
7982 : .name = discard_const_p(char, "lm20_token"),
7983 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token,
7984 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token,
7985 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7986 : },
7987 : { .name = NULL }
7988 : };
7989 :
7990 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7991 : {
7992 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE, type);
7993 : }
7994 :
7995 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7996 : {
7997 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
7998 0 : PyObject *ret = NULL;
7999 0 : DATA_BLOB blob;
8000 0 : enum ndr_err_code err;
8001 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8002 0 : if (tmp_ctx == NULL) {
8003 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8004 0 : return NULL;
8005 : }
8006 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE);
8007 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8008 0 : TALLOC_FREE(tmp_ctx);
8009 0 : PyErr_SetNdrError(err);
8010 0 : return NULL;
8011 : }
8012 :
8013 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8014 0 : TALLOC_FREE(tmp_ctx);
8015 0 : return ret;
8016 : }
8017 :
8018 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8019 : {
8020 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
8021 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8022 0 : Py_ssize_t blob_length = 0;
8023 0 : enum ndr_err_code err;
8024 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8025 0 : PyObject *allow_remaining_obj = NULL;
8026 0 : bool allow_remaining = false;
8027 :
8028 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8029 : discard_const_p(char *, kwnames),
8030 : &blob.data, &blob_length,
8031 : &allow_remaining_obj)) {
8032 0 : return NULL;
8033 : }
8034 0 : blob.length = blob_length;
8035 :
8036 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8037 0 : allow_remaining = true;
8038 : }
8039 :
8040 0 : if (allow_remaining) {
8041 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
8042 : } else {
8043 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
8044 : }
8045 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8046 0 : PyErr_SetNdrError(err);
8047 0 : return NULL;
8048 : }
8049 :
8050 0 : Py_RETURN_NONE;
8051 : }
8052 :
8053 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8054 : {
8055 0 : struct NETLOGON_SAM_LOGON_RESPONSE *object = pytalloc_get_ptr(py_obj);
8056 0 : PyObject *ret;
8057 0 : char *retstr;
8058 :
8059 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE, "NETLOGON_SAM_LOGON_RESPONSE", object);
8060 0 : ret = PyUnicode_FromString(retstr);
8061 0 : talloc_free(retstr);
8062 :
8063 0 : return ret;
8064 : }
8065 :
8066 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_methods[] = {
8067 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8068 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8069 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8070 : { NULL, NULL, 0, NULL }
8071 : };
8072 :
8073 :
8074 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_Type = {
8075 : PyVarObject_HEAD_INIT(NULL, 0)
8076 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE",
8077 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_getsetters,
8078 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_methods,
8079 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8080 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_new,
8081 : };
8082 :
8083 :
8084 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command(PyObject *obj, void *closure)
8085 : {
8086 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8087 0 : PyObject *py_command;
8088 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
8089 0 : return py_command;
8090 : }
8091 :
8092 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command(PyObject *py_obj, PyObject *value, void *closure)
8093 : {
8094 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8095 0 : if (value == NULL) {
8096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
8097 0 : return -1;
8098 : }
8099 : {
8100 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
8101 0 : if (PyLong_Check(value)) {
8102 0 : unsigned long long test_var;
8103 0 : test_var = PyLong_AsUnsignedLongLong(value);
8104 0 : if (PyErr_Occurred() != NULL) {
8105 0 : return -1;
8106 : }
8107 0 : if (test_var > uint_max) {
8108 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8109 : PyLong_Type.tp_name, uint_max, test_var);
8110 0 : return -1;
8111 : }
8112 0 : object->command = test_var;
8113 : } else {
8114 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8115 : PyLong_Type.tp_name);
8116 0 : return -1;
8117 : }
8118 : }
8119 0 : return 0;
8120 : }
8121 :
8122 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz(PyObject *obj, void *closure)
8123 : {
8124 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8125 0 : PyObject *py_sbz;
8126 0 : py_sbz = PyLong_FromLong((uint16_t)(object->sbz));
8127 0 : return py_sbz;
8128 : }
8129 :
8130 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz(PyObject *py_obj, PyObject *value, void *closure)
8131 : {
8132 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8133 0 : if (value == NULL) {
8134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sbz");
8135 0 : return -1;
8136 : }
8137 : {
8138 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sbz));
8139 0 : if (PyLong_Check(value)) {
8140 0 : unsigned long long test_var;
8141 0 : test_var = PyLong_AsUnsignedLongLong(value);
8142 0 : if (PyErr_Occurred() != NULL) {
8143 0 : return -1;
8144 : }
8145 0 : if (test_var > uint_max) {
8146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8147 : PyLong_Type.tp_name, uint_max, test_var);
8148 0 : return -1;
8149 : }
8150 0 : object->sbz = test_var;
8151 : } else {
8152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8153 : PyLong_Type.tp_name);
8154 0 : return -1;
8155 : }
8156 : }
8157 0 : return 0;
8158 : }
8159 :
8160 35 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type(PyObject *obj, void *closure)
8161 : {
8162 35 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8163 0 : PyObject *py_server_type;
8164 35 : py_server_type = PyLong_FromUnsignedLongLong((uint32_t)(object->server_type));
8165 35 : return py_server_type;
8166 : }
8167 :
8168 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
8169 : {
8170 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8171 0 : if (value == NULL) {
8172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_type");
8173 0 : return -1;
8174 : }
8175 : {
8176 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
8177 0 : if (PyLong_Check(value)) {
8178 0 : unsigned long long test_var;
8179 0 : test_var = PyLong_AsUnsignedLongLong(value);
8180 0 : if (PyErr_Occurred() != NULL) {
8181 0 : return -1;
8182 : }
8183 0 : if (test_var > uint_max) {
8184 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8185 : PyLong_Type.tp_name, uint_max, test_var);
8186 0 : return -1;
8187 : }
8188 0 : object->server_type = test_var;
8189 : } else {
8190 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8191 : PyLong_Type.tp_name);
8192 0 : return -1;
8193 : }
8194 : }
8195 0 : return 0;
8196 : }
8197 :
8198 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid(PyObject *obj, void *closure)
8199 : {
8200 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8201 0 : PyObject *py_domain_uuid;
8202 0 : py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
8203 0 : return py_domain_uuid;
8204 : }
8205 :
8206 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
8207 : {
8208 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8209 0 : if (value == NULL) {
8210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_uuid");
8211 0 : return -1;
8212 : }
8213 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
8214 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8215 0 : PyErr_NoMemory();
8216 0 : return -1;
8217 : }
8218 0 : object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
8219 0 : return 0;
8220 : }
8221 :
8222 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest(PyObject *obj, void *closure)
8223 : {
8224 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8225 0 : PyObject *py_forest;
8226 1 : py_forest = PyString_FromStringOrNULL(object->forest);
8227 1 : return py_forest;
8228 : }
8229 :
8230 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest(PyObject *py_obj, PyObject *value, void *closure)
8231 : {
8232 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8233 0 : if (value == NULL) {
8234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->forest");
8235 0 : return -1;
8236 : }
8237 : {
8238 0 : const char *test_str;
8239 0 : const char *talloc_str;
8240 0 : PyObject *unicode = NULL;
8241 0 : if (PyUnicode_Check(value)) {
8242 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8243 0 : if (unicode == NULL) {
8244 0 : return -1;
8245 : }
8246 0 : test_str = PyBytes_AS_STRING(unicode);
8247 0 : } else if (PyBytes_Check(value)) {
8248 0 : test_str = PyBytes_AS_STRING(value);
8249 : } else {
8250 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8251 0 : return -1;
8252 : }
8253 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8254 0 : if (unicode != NULL) {
8255 0 : Py_DECREF(unicode);
8256 : }
8257 0 : if (talloc_str == NULL) {
8258 0 : PyErr_NoMemory();
8259 0 : return -1;
8260 : }
8261 0 : object->forest = talloc_str;
8262 : }
8263 0 : return 0;
8264 : }
8265 :
8266 253 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain(PyObject *obj, void *closure)
8267 : {
8268 253 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8269 0 : PyObject *py_dns_domain;
8270 253 : py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
8271 253 : return py_dns_domain;
8272 : }
8273 :
8274 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
8275 : {
8276 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8277 0 : if (value == NULL) {
8278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dns_domain");
8279 0 : return -1;
8280 : }
8281 : {
8282 0 : const char *test_str;
8283 0 : const char *talloc_str;
8284 0 : PyObject *unicode = NULL;
8285 0 : if (PyUnicode_Check(value)) {
8286 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8287 0 : if (unicode == NULL) {
8288 0 : return -1;
8289 : }
8290 0 : test_str = PyBytes_AS_STRING(unicode);
8291 0 : } else if (PyBytes_Check(value)) {
8292 0 : test_str = PyBytes_AS_STRING(value);
8293 : } else {
8294 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8295 0 : return -1;
8296 : }
8297 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8298 0 : if (unicode != NULL) {
8299 0 : Py_DECREF(unicode);
8300 : }
8301 0 : if (talloc_str == NULL) {
8302 0 : PyErr_NoMemory();
8303 0 : return -1;
8304 : }
8305 0 : object->dns_domain = talloc_str;
8306 : }
8307 0 : return 0;
8308 : }
8309 :
8310 189 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name(PyObject *obj, void *closure)
8311 : {
8312 189 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8313 0 : PyObject *py_pdc_dns_name;
8314 189 : py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
8315 189 : return py_pdc_dns_name;
8316 : }
8317 :
8318 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
8319 : {
8320 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8321 0 : if (value == NULL) {
8322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_dns_name");
8323 0 : return -1;
8324 : }
8325 : {
8326 0 : const char *test_str;
8327 0 : const char *talloc_str;
8328 0 : PyObject *unicode = NULL;
8329 0 : if (PyUnicode_Check(value)) {
8330 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8331 0 : if (unicode == NULL) {
8332 0 : return -1;
8333 : }
8334 0 : test_str = PyBytes_AS_STRING(unicode);
8335 0 : } else if (PyBytes_Check(value)) {
8336 0 : test_str = PyBytes_AS_STRING(value);
8337 : } else {
8338 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8339 0 : return -1;
8340 : }
8341 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8342 0 : if (unicode != NULL) {
8343 0 : Py_DECREF(unicode);
8344 : }
8345 0 : if (talloc_str == NULL) {
8346 0 : PyErr_NoMemory();
8347 0 : return -1;
8348 : }
8349 0 : object->pdc_dns_name = talloc_str;
8350 : }
8351 0 : return 0;
8352 : }
8353 :
8354 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name(PyObject *obj, void *closure)
8355 : {
8356 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8357 0 : PyObject *py_domain_name;
8358 1 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
8359 1 : return py_domain_name;
8360 : }
8361 :
8362 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
8363 : {
8364 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8365 0 : if (value == NULL) {
8366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
8367 0 : return -1;
8368 : }
8369 : {
8370 0 : const char *test_str;
8371 0 : const char *talloc_str;
8372 0 : PyObject *unicode = NULL;
8373 0 : if (PyUnicode_Check(value)) {
8374 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8375 0 : if (unicode == NULL) {
8376 0 : return -1;
8377 : }
8378 0 : test_str = PyBytes_AS_STRING(unicode);
8379 0 : } else if (PyBytes_Check(value)) {
8380 0 : test_str = PyBytes_AS_STRING(value);
8381 : } else {
8382 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8383 0 : return -1;
8384 : }
8385 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8386 0 : if (unicode != NULL) {
8387 0 : Py_DECREF(unicode);
8388 : }
8389 0 : if (talloc_str == NULL) {
8390 0 : PyErr_NoMemory();
8391 0 : return -1;
8392 : }
8393 0 : object->domain_name = talloc_str;
8394 : }
8395 0 : return 0;
8396 : }
8397 :
8398 22 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name(PyObject *obj, void *closure)
8399 : {
8400 22 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8401 0 : PyObject *py_pdc_name;
8402 22 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
8403 22 : return py_pdc_name;
8404 : }
8405 :
8406 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
8407 : {
8408 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8409 0 : if (value == NULL) {
8410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_name");
8411 0 : return -1;
8412 : }
8413 : {
8414 0 : const char *test_str;
8415 0 : const char *talloc_str;
8416 0 : PyObject *unicode = NULL;
8417 0 : if (PyUnicode_Check(value)) {
8418 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8419 0 : if (unicode == NULL) {
8420 0 : return -1;
8421 : }
8422 0 : test_str = PyBytes_AS_STRING(unicode);
8423 0 : } else if (PyBytes_Check(value)) {
8424 0 : test_str = PyBytes_AS_STRING(value);
8425 : } else {
8426 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8427 0 : return -1;
8428 : }
8429 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8430 0 : if (unicode != NULL) {
8431 0 : Py_DECREF(unicode);
8432 : }
8433 0 : if (talloc_str == NULL) {
8434 0 : PyErr_NoMemory();
8435 0 : return -1;
8436 : }
8437 0 : object->pdc_name = talloc_str;
8438 : }
8439 0 : return 0;
8440 : }
8441 :
8442 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name(PyObject *obj, void *closure)
8443 : {
8444 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8445 0 : PyObject *py_user_name;
8446 0 : py_user_name = PyString_FromStringOrNULL(object->user_name);
8447 0 : return py_user_name;
8448 : }
8449 :
8450 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
8451 : {
8452 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8453 0 : if (value == NULL) {
8454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
8455 0 : return -1;
8456 : }
8457 : {
8458 0 : const char *test_str;
8459 0 : const char *talloc_str;
8460 0 : PyObject *unicode = NULL;
8461 0 : if (PyUnicode_Check(value)) {
8462 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8463 0 : if (unicode == NULL) {
8464 0 : return -1;
8465 : }
8466 0 : test_str = PyBytes_AS_STRING(unicode);
8467 0 : } else if (PyBytes_Check(value)) {
8468 0 : test_str = PyBytes_AS_STRING(value);
8469 : } else {
8470 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8471 0 : return -1;
8472 : }
8473 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8474 0 : if (unicode != NULL) {
8475 0 : Py_DECREF(unicode);
8476 : }
8477 0 : if (talloc_str == NULL) {
8478 0 : PyErr_NoMemory();
8479 0 : return -1;
8480 : }
8481 0 : object->user_name = talloc_str;
8482 : }
8483 0 : return 0;
8484 : }
8485 :
8486 1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site(PyObject *obj, void *closure)
8487 : {
8488 1 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8489 0 : PyObject *py_server_site;
8490 1 : py_server_site = PyString_FromStringOrNULL(object->server_site);
8491 1 : return py_server_site;
8492 : }
8493 :
8494 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site(PyObject *py_obj, PyObject *value, void *closure)
8495 : {
8496 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8497 0 : if (value == NULL) {
8498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_site");
8499 0 : return -1;
8500 : }
8501 : {
8502 0 : const char *test_str;
8503 0 : const char *talloc_str;
8504 0 : PyObject *unicode = NULL;
8505 0 : if (PyUnicode_Check(value)) {
8506 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8507 0 : if (unicode == NULL) {
8508 0 : return -1;
8509 : }
8510 0 : test_str = PyBytes_AS_STRING(unicode);
8511 0 : } else if (PyBytes_Check(value)) {
8512 0 : test_str = PyBytes_AS_STRING(value);
8513 : } else {
8514 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8515 0 : return -1;
8516 : }
8517 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8518 0 : if (unicode != NULL) {
8519 0 : Py_DECREF(unicode);
8520 : }
8521 0 : if (talloc_str == NULL) {
8522 0 : PyErr_NoMemory();
8523 0 : return -1;
8524 : }
8525 0 : object->server_site = talloc_str;
8526 : }
8527 0 : return 0;
8528 : }
8529 :
8530 653 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site(PyObject *obj, void *closure)
8531 : {
8532 653 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8533 0 : PyObject *py_client_site;
8534 653 : py_client_site = PyString_FromStringOrNULL(object->client_site);
8535 653 : return py_client_site;
8536 : }
8537 :
8538 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site(PyObject *py_obj, PyObject *value, void *closure)
8539 : {
8540 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8541 0 : if (value == NULL) {
8542 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->client_site");
8543 0 : return -1;
8544 : }
8545 : {
8546 0 : const char *test_str;
8547 0 : const char *talloc_str;
8548 0 : PyObject *unicode = NULL;
8549 0 : if (PyUnicode_Check(value)) {
8550 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8551 0 : if (unicode == NULL) {
8552 0 : return -1;
8553 : }
8554 0 : test_str = PyBytes_AS_STRING(unicode);
8555 0 : } else if (PyBytes_Check(value)) {
8556 0 : test_str = PyBytes_AS_STRING(value);
8557 : } else {
8558 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8559 0 : return -1;
8560 : }
8561 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8562 0 : if (unicode != NULL) {
8563 0 : Py_DECREF(unicode);
8564 : }
8565 0 : if (talloc_str == NULL) {
8566 0 : PyErr_NoMemory();
8567 0 : return -1;
8568 : }
8569 0 : object->client_site = talloc_str;
8570 : }
8571 0 : return 0;
8572 : }
8573 :
8574 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size(PyObject *obj, void *closure)
8575 : {
8576 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8577 0 : PyObject *py_sockaddr_size;
8578 0 : py_sockaddr_size = PyLong_FromLong((uint16_t)(object->sockaddr_size));
8579 0 : return py_sockaddr_size;
8580 : }
8581 :
8582 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size(PyObject *py_obj, PyObject *value, void *closure)
8583 : {
8584 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8585 0 : if (value == NULL) {
8586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sockaddr_size");
8587 0 : return -1;
8588 : }
8589 : {
8590 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_size));
8591 0 : if (PyLong_Check(value)) {
8592 0 : unsigned long long test_var;
8593 0 : test_var = PyLong_AsUnsignedLongLong(value);
8594 0 : if (PyErr_Occurred() != NULL) {
8595 0 : return -1;
8596 : }
8597 0 : if (test_var > uint_max) {
8598 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8599 : PyLong_Type.tp_name, uint_max, test_var);
8600 0 : return -1;
8601 : }
8602 0 : object->sockaddr_size = test_var;
8603 : } else {
8604 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8605 : PyLong_Type.tp_name);
8606 0 : return -1;
8607 : }
8608 : }
8609 0 : return 0;
8610 : }
8611 :
8612 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr(PyObject *obj, void *closure)
8613 : {
8614 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8615 0 : PyObject *py_sockaddr;
8616 0 : py_sockaddr = pytalloc_reference_ex(&nbt_sockaddr_Type, pytalloc_get_mem_ctx(obj), &object->sockaddr);
8617 0 : return py_sockaddr;
8618 : }
8619 :
8620 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr(PyObject *py_obj, PyObject *value, void *closure)
8621 : {
8622 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8623 0 : if (value == NULL) {
8624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sockaddr");
8625 0 : return -1;
8626 : }
8627 0 : PY_CHECK_TYPE(&nbt_sockaddr_Type, value, return -1;);
8628 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8629 0 : PyErr_NoMemory();
8630 0 : return -1;
8631 : }
8632 0 : object->sockaddr = *(struct nbt_sockaddr *)pytalloc_get_ptr(value);
8633 0 : return 0;
8634 : }
8635 :
8636 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site(PyObject *obj, void *closure)
8637 : {
8638 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8639 0 : PyObject *py_next_closest_site;
8640 0 : py_next_closest_site = PyString_FromStringOrNULL(object->next_closest_site);
8641 0 : return py_next_closest_site;
8642 : }
8643 :
8644 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site(PyObject *py_obj, PyObject *value, void *closure)
8645 : {
8646 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8647 0 : if (value == NULL) {
8648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->next_closest_site");
8649 0 : return -1;
8650 : }
8651 : {
8652 0 : const char *test_str;
8653 0 : const char *talloc_str;
8654 0 : PyObject *unicode = NULL;
8655 0 : if (PyUnicode_Check(value)) {
8656 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8657 0 : if (unicode == NULL) {
8658 0 : return -1;
8659 : }
8660 0 : test_str = PyBytes_AS_STRING(unicode);
8661 0 : } else if (PyBytes_Check(value)) {
8662 0 : test_str = PyBytes_AS_STRING(value);
8663 : } else {
8664 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8665 0 : return -1;
8666 : }
8667 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8668 0 : if (unicode != NULL) {
8669 0 : Py_DECREF(unicode);
8670 : }
8671 0 : if (talloc_str == NULL) {
8672 0 : PyErr_NoMemory();
8673 0 : return -1;
8674 : }
8675 0 : object->next_closest_site = talloc_str;
8676 : }
8677 0 : return 0;
8678 : }
8679 :
8680 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version(PyObject *obj, void *closure)
8681 : {
8682 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8683 0 : PyObject *py_nt_version;
8684 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)(object->nt_version));
8685 0 : return py_nt_version;
8686 : }
8687 :
8688 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
8689 : {
8690 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8691 0 : if (value == NULL) {
8692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nt_version");
8693 0 : return -1;
8694 : }
8695 : {
8696 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
8697 0 : if (PyLong_Check(value)) {
8698 0 : unsigned long long test_var;
8699 0 : test_var = PyLong_AsUnsignedLongLong(value);
8700 0 : if (PyErr_Occurred() != NULL) {
8701 0 : return -1;
8702 : }
8703 0 : if (test_var > uint_max) {
8704 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8705 : PyLong_Type.tp_name, uint_max, test_var);
8706 0 : return -1;
8707 : }
8708 0 : object->nt_version = test_var;
8709 : } else {
8710 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8711 : PyLong_Type.tp_name);
8712 0 : return -1;
8713 : }
8714 : }
8715 0 : return 0;
8716 : }
8717 :
8718 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token(PyObject *obj, void *closure)
8719 : {
8720 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8721 0 : PyObject *py_lmnt_token;
8722 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
8723 0 : return py_lmnt_token;
8724 : }
8725 :
8726 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
8727 : {
8728 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8729 0 : if (value == NULL) {
8730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
8731 0 : return -1;
8732 : }
8733 : {
8734 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
8735 0 : if (PyLong_Check(value)) {
8736 0 : unsigned long long test_var;
8737 0 : test_var = PyLong_AsUnsignedLongLong(value);
8738 0 : if (PyErr_Occurred() != NULL) {
8739 0 : return -1;
8740 : }
8741 0 : if (test_var > uint_max) {
8742 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8743 : PyLong_Type.tp_name, uint_max, test_var);
8744 0 : return -1;
8745 : }
8746 0 : object->lmnt_token = test_var;
8747 : } else {
8748 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8749 : PyLong_Type.tp_name);
8750 0 : return -1;
8751 : }
8752 : }
8753 0 : return 0;
8754 : }
8755 :
8756 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token(PyObject *obj, void *closure)
8757 : {
8758 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(obj);
8759 0 : PyObject *py_lm20_token;
8760 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
8761 0 : return py_lm20_token;
8762 : }
8763 :
8764 0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
8765 : {
8766 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8767 0 : if (value == NULL) {
8768 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
8769 0 : return -1;
8770 : }
8771 : {
8772 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
8773 0 : if (PyLong_Check(value)) {
8774 0 : unsigned long long test_var;
8775 0 : test_var = PyLong_AsUnsignedLongLong(value);
8776 0 : if (PyErr_Occurred() != NULL) {
8777 0 : return -1;
8778 : }
8779 0 : if (test_var > uint_max) {
8780 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8781 : PyLong_Type.tp_name, uint_max, test_var);
8782 0 : return -1;
8783 : }
8784 0 : object->lm20_token = test_var;
8785 : } else {
8786 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8787 : PyLong_Type.tp_name);
8788 0 : return -1;
8789 : }
8790 : }
8791 0 : return 0;
8792 : }
8793 :
8794 : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters[] = {
8795 : {
8796 : .name = discard_const_p(char, "command"),
8797 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command,
8798 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command,
8799 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
8800 : },
8801 : {
8802 : .name = discard_const_p(char, "sbz"),
8803 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz,
8804 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz,
8805 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8806 : },
8807 : {
8808 : .name = discard_const_p(char, "server_type"),
8809 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type,
8810 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type,
8811 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
8812 : },
8813 : {
8814 : .name = discard_const_p(char, "domain_uuid"),
8815 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid,
8816 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid,
8817 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
8818 : },
8819 : {
8820 : .name = discard_const_p(char, "forest"),
8821 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest,
8822 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest,
8823 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8824 : },
8825 : {
8826 : .name = discard_const_p(char, "dns_domain"),
8827 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain,
8828 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain,
8829 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8830 : },
8831 : {
8832 : .name = discard_const_p(char, "pdc_dns_name"),
8833 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name,
8834 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name,
8835 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8836 : },
8837 : {
8838 : .name = discard_const_p(char, "domain_name"),
8839 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name,
8840 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name,
8841 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8842 : },
8843 : {
8844 : .name = discard_const_p(char, "pdc_name"),
8845 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name,
8846 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name,
8847 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8848 : },
8849 : {
8850 : .name = discard_const_p(char, "user_name"),
8851 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name,
8852 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name,
8853 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8854 : },
8855 : {
8856 : .name = discard_const_p(char, "server_site"),
8857 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site,
8858 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site,
8859 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8860 : },
8861 : {
8862 : .name = discard_const_p(char, "client_site"),
8863 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site,
8864 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site,
8865 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8866 : },
8867 : {
8868 : .name = discard_const_p(char, "sockaddr_size"),
8869 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size,
8870 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size,
8871 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8872 : },
8873 : {
8874 : .name = discard_const_p(char, "sockaddr"),
8875 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr,
8876 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr,
8877 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_sockaddr")
8878 : },
8879 : {
8880 : .name = discard_const_p(char, "next_closest_site"),
8881 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site,
8882 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site,
8883 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
8884 : },
8885 : {
8886 : .name = discard_const_p(char, "nt_version"),
8887 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version,
8888 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version,
8889 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
8890 : },
8891 : {
8892 : .name = discard_const_p(char, "lmnt_token"),
8893 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token,
8894 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token,
8895 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8896 : },
8897 : {
8898 : .name = discard_const_p(char, "lm20_token"),
8899 : .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token,
8900 : .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token,
8901 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8902 : },
8903 : { .name = NULL }
8904 : };
8905 :
8906 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8907 : {
8908 0 : return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_EX, type);
8909 : }
8910 :
8911 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8912 : {
8913 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8914 0 : PyObject *ret = NULL;
8915 0 : DATA_BLOB blob;
8916 0 : enum ndr_err_code err;
8917 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8918 0 : if (tmp_ctx == NULL) {
8919 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8920 0 : return NULL;
8921 : }
8922 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX);
8923 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8924 0 : TALLOC_FREE(tmp_ctx);
8925 0 : PyErr_SetNdrError(err);
8926 0 : return NULL;
8927 : }
8928 :
8929 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8930 0 : TALLOC_FREE(tmp_ctx);
8931 0 : return ret;
8932 : }
8933 :
8934 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8935 : {
8936 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8937 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8938 0 : Py_ssize_t blob_length = 0;
8939 0 : enum ndr_err_code err;
8940 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8941 0 : PyObject *allow_remaining_obj = NULL;
8942 0 : bool allow_remaining = false;
8943 :
8944 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8945 : discard_const_p(char *, kwnames),
8946 : &blob.data, &blob_length,
8947 : &allow_remaining_obj)) {
8948 0 : return NULL;
8949 : }
8950 0 : blob.length = blob_length;
8951 :
8952 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8953 0 : allow_remaining = true;
8954 : }
8955 :
8956 0 : if (allow_remaining) {
8957 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
8958 : } else {
8959 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
8960 : }
8961 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8962 0 : PyErr_SetNdrError(err);
8963 0 : return NULL;
8964 : }
8965 :
8966 0 : Py_RETURN_NONE;
8967 : }
8968 :
8969 0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8970 : {
8971 0 : struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = pytalloc_get_ptr(py_obj);
8972 0 : PyObject *ret;
8973 0 : char *retstr;
8974 :
8975 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX, "NETLOGON_SAM_LOGON_RESPONSE_EX", object);
8976 0 : ret = PyUnicode_FromString(retstr);
8977 0 : talloc_free(retstr);
8978 :
8979 0 : return ret;
8980 : }
8981 :
8982 : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods[] = {
8983 : { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8984 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8985 : { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8986 : { NULL, NULL, 0, NULL }
8987 : };
8988 :
8989 :
8990 : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_EX_Type = {
8991 : PyVarObject_HEAD_INIT(NULL, 0)
8992 : .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX",
8993 : .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters,
8994 : .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods,
8995 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8996 : .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_EX_new,
8997 : };
8998 :
8999 150 : static PyObject *py_import_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, union netlogon_samlogon_response_union *in)
9000 : {
9001 0 : PyObject *ret;
9002 :
9003 150 : switch (level) {
9004 0 : case NETLOGON_NT_VERSION_1:
9005 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, mem_ctx, &in->nt4);
9006 0 : return ret;
9007 :
9008 0 : case NETLOGON_NT_VERSION_5:
9009 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_Type, mem_ctx, &in->nt5);
9010 0 : return ret;
9011 :
9012 150 : case NETLOGON_NT_VERSION_5EX:
9013 150 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, mem_ctx, &in->nt5_ex);
9014 150 : return ret;
9015 :
9016 : }
9017 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9018 0 : return NULL;
9019 : }
9020 :
9021 0 : static union netlogon_samlogon_response_union *py_export_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9022 : {
9023 0 : union netlogon_samlogon_response_union *ret = talloc_zero(mem_ctx, union netlogon_samlogon_response_union);
9024 0 : switch (level) {
9025 0 : case NETLOGON_NT_VERSION_1:
9026 0 : if (in == NULL) {
9027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->nt4");
9028 0 : talloc_free(ret); return NULL;
9029 : }
9030 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, in, talloc_free(ret); return NULL;);
9031 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9032 0 : PyErr_NoMemory();
9033 0 : talloc_free(ret); return NULL;
9034 : }
9035 0 : ret->nt4 = *(struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(in);
9036 0 : break;
9037 :
9038 0 : case NETLOGON_NT_VERSION_5:
9039 0 : if (in == NULL) {
9040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->nt5");
9041 0 : talloc_free(ret); return NULL;
9042 : }
9043 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_Type, in, talloc_free(ret); return NULL;);
9044 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9045 0 : PyErr_NoMemory();
9046 0 : talloc_free(ret); return NULL;
9047 : }
9048 0 : ret->nt5 = *(struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(in);
9049 0 : break;
9050 :
9051 0 : case NETLOGON_NT_VERSION_5EX:
9052 0 : if (in == NULL) {
9053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->nt5_ex");
9054 0 : talloc_free(ret); return NULL;
9055 : }
9056 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, in, talloc_free(ret); return NULL;);
9057 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9058 0 : PyErr_NoMemory();
9059 0 : talloc_free(ret); return NULL;
9060 : }
9061 0 : ret->nt5_ex = *(struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(in);
9062 0 : break;
9063 :
9064 0 : default:
9065 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9066 0 : talloc_free(ret);
9067 0 : ret = NULL;
9068 : }
9069 :
9070 0 : return ret;
9071 : }
9072 :
9073 150 : static PyObject *py_netlogon_samlogon_response_union_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9074 : {
9075 150 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9076 150 : PyObject *mem_ctx_obj = NULL;
9077 150 : TALLOC_CTX *mem_ctx = NULL;
9078 150 : int level = 0;
9079 150 : PyObject *in_obj = NULL;
9080 150 : union netlogon_samlogon_response_union *in = NULL;
9081 :
9082 150 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9083 : discard_const_p(char *, kwnames),
9084 : &mem_ctx_obj,
9085 : &level,
9086 : &in_obj)) {
9087 0 : return NULL;
9088 : }
9089 150 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9090 150 : if (mem_ctx == NULL) {
9091 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9092 0 : return NULL;
9093 : }
9094 150 : in = (union netlogon_samlogon_response_union *)pytalloc_get_ptr(in_obj);
9095 150 : if (in == NULL) {
9096 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netlogon_samlogon_response_union!");
9097 0 : return NULL;
9098 : }
9099 :
9100 150 : return py_import_netlogon_samlogon_response_union(mem_ctx, level, in);
9101 : }
9102 :
9103 0 : static PyObject *py_netlogon_samlogon_response_union_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9104 : {
9105 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9106 0 : PyObject *mem_ctx_obj = NULL;
9107 0 : TALLOC_CTX *mem_ctx = NULL;
9108 0 : int level = 0;
9109 0 : PyObject *in = NULL;
9110 0 : union netlogon_samlogon_response_union *out = NULL;
9111 :
9112 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9113 : discard_const_p(char *, kwnames),
9114 : &mem_ctx_obj,
9115 : &level,
9116 : &in)) {
9117 0 : return NULL;
9118 : }
9119 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9120 0 : if (mem_ctx == NULL) {
9121 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9122 0 : return NULL;
9123 : }
9124 :
9125 0 : out = py_export_netlogon_samlogon_response_union(mem_ctx, level, in);
9126 0 : if (out == NULL) {
9127 0 : return NULL;
9128 : }
9129 :
9130 0 : return pytalloc_GenericObject_reference(out);
9131 : }
9132 :
9133 : static PyMethodDef py_netlogon_samlogon_response_union_methods[] = {
9134 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_import),
9135 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9136 : "T.__import__(mem_ctx, level, in) => ret." },
9137 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_export),
9138 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9139 : "T.__export__(mem_ctx, level, in) => ret." },
9140 : { NULL, NULL, 0, NULL }
9141 : };
9142 :
9143 0 : static PyObject *py_netlogon_samlogon_response_union_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9144 : {
9145 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9146 0 : return NULL;
9147 : }
9148 :
9149 :
9150 : static PyTypeObject netlogon_samlogon_response_union_Type = {
9151 : PyVarObject_HEAD_INIT(NULL, 0)
9152 : .tp_name = "nbt.netlogon_samlogon_response_union",
9153 : .tp_getset = NULL,
9154 : .tp_methods = py_netlogon_samlogon_response_union_methods,
9155 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9156 : .tp_new = py_netlogon_samlogon_response_union_new,
9157 : };
9158 :
9159 :
9160 150 : static PyObject *py_netlogon_samlogon_response_get_ntver(PyObject *obj, void *closure)
9161 : {
9162 150 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(obj);
9163 0 : PyObject *py_ntver;
9164 150 : py_ntver = PyLong_FromUnsignedLongLong((uint32_t)(object->ntver));
9165 150 : return py_ntver;
9166 : }
9167 :
9168 150 : static int py_netlogon_samlogon_response_set_ntver(PyObject *py_obj, PyObject *value, void *closure)
9169 : {
9170 150 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(py_obj);
9171 150 : if (value == NULL) {
9172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ntver");
9173 0 : return -1;
9174 : }
9175 : {
9176 150 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ntver));
9177 150 : if (PyLong_Check(value)) {
9178 0 : unsigned long long test_var;
9179 150 : test_var = PyLong_AsUnsignedLongLong(value);
9180 150 : if (PyErr_Occurred() != NULL) {
9181 0 : return -1;
9182 : }
9183 150 : if (test_var > uint_max) {
9184 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9185 : PyLong_Type.tp_name, uint_max, test_var);
9186 0 : return -1;
9187 : }
9188 150 : object->ntver = test_var;
9189 : } else {
9190 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9191 : PyLong_Type.tp_name);
9192 0 : return -1;
9193 : }
9194 : }
9195 150 : return 0;
9196 : }
9197 :
9198 150 : static PyObject *py_netlogon_samlogon_response_get_data(PyObject *obj, void *closure)
9199 : {
9200 150 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(obj);
9201 0 : PyObject *py_data;
9202 150 : py_data = pyrpc_import_union(&netlogon_samlogon_response_union_Type, pytalloc_get_mem_ctx(obj), object->ntver, &object->data, "union netlogon_samlogon_response_union");
9203 150 : if (py_data == NULL) {
9204 0 : return NULL;
9205 : }
9206 150 : return py_data;
9207 : }
9208 :
9209 0 : static int py_netlogon_samlogon_response_set_data(PyObject *py_obj, PyObject *value, void *closure)
9210 : {
9211 0 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(py_obj);
9212 0 : if (value == NULL) {
9213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
9214 0 : return -1;
9215 : }
9216 : {
9217 0 : union netlogon_samlogon_response_union *data_switch_0;
9218 0 : data_switch_0 = (union netlogon_samlogon_response_union *)pyrpc_export_union(&netlogon_samlogon_response_union_Type, pytalloc_get_mem_ctx(py_obj), object->ntver, value, "union netlogon_samlogon_response_union");
9219 0 : if (data_switch_0 == NULL) {
9220 0 : return -1;
9221 : }
9222 0 : object->data = *data_switch_0;
9223 : }
9224 0 : return 0;
9225 : }
9226 :
9227 : static PyGetSetDef py_netlogon_samlogon_response_getsetters[] = {
9228 : {
9229 : .name = discard_const_p(char, "ntver"),
9230 : .get = py_netlogon_samlogon_response_get_ntver,
9231 : .set = py_netlogon_samlogon_response_set_ntver,
9232 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9233 : },
9234 : {
9235 : .name = discard_const_p(char, "data"),
9236 : .get = py_netlogon_samlogon_response_get_data,
9237 : .set = py_netlogon_samlogon_response_set_data,
9238 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_samlogon_response_union")
9239 : },
9240 : { .name = NULL }
9241 : };
9242 :
9243 150 : static PyObject *py_netlogon_samlogon_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9244 : {
9245 150 : return pytalloc_new(struct netlogon_samlogon_response, type);
9246 : }
9247 :
9248 0 : static PyObject *py_netlogon_samlogon_response_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9249 : {
9250 0 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(py_obj);
9251 0 : PyObject *ret = NULL;
9252 0 : DATA_BLOB blob;
9253 0 : enum ndr_err_code err;
9254 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9255 0 : if (tmp_ctx == NULL) {
9256 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9257 0 : return NULL;
9258 : }
9259 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netlogon_samlogon_response);
9260 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9261 0 : TALLOC_FREE(tmp_ctx);
9262 0 : PyErr_SetNdrError(err);
9263 0 : return NULL;
9264 : }
9265 :
9266 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9267 0 : TALLOC_FREE(tmp_ctx);
9268 0 : return ret;
9269 : }
9270 :
9271 150 : static PyObject *py_netlogon_samlogon_response_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9272 : {
9273 150 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(py_obj);
9274 150 : DATA_BLOB blob = {.data = NULL, .length = 0};
9275 150 : Py_ssize_t blob_length = 0;
9276 0 : enum ndr_err_code err;
9277 150 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9278 150 : PyObject *allow_remaining_obj = NULL;
9279 150 : bool allow_remaining = false;
9280 :
9281 150 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
9282 : discard_const_p(char *, kwnames),
9283 : &blob.data, &blob_length,
9284 : &allow_remaining_obj)) {
9285 0 : return NULL;
9286 : }
9287 150 : blob.length = blob_length;
9288 :
9289 150 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9290 0 : allow_remaining = true;
9291 : }
9292 :
9293 150 : if (allow_remaining) {
9294 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netlogon_samlogon_response);
9295 : } else {
9296 150 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netlogon_samlogon_response);
9297 : }
9298 150 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9299 0 : PyErr_SetNdrError(err);
9300 0 : return NULL;
9301 : }
9302 :
9303 150 : Py_RETURN_NONE;
9304 : }
9305 :
9306 0 : static PyObject *py_netlogon_samlogon_response_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9307 : {
9308 0 : struct netlogon_samlogon_response *object = pytalloc_get_ptr(py_obj);
9309 0 : PyObject *ret;
9310 0 : char *retstr;
9311 :
9312 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netlogon_samlogon_response, "netlogon_samlogon_response", object);
9313 0 : ret = PyUnicode_FromString(retstr);
9314 0 : talloc_free(retstr);
9315 :
9316 0 : return ret;
9317 : }
9318 :
9319 : static PyMethodDef py_netlogon_samlogon_response_methods[] = {
9320 : { "__ndr_pack__", (PyCFunction)py_netlogon_samlogon_response_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9321 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9322 : { "__ndr_print__", (PyCFunction)py_netlogon_samlogon_response_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
9323 : { NULL, NULL, 0, NULL }
9324 : };
9325 :
9326 :
9327 : static PyTypeObject netlogon_samlogon_response_Type = {
9328 : PyVarObject_HEAD_INIT(NULL, 0)
9329 : .tp_name = "nbt.netlogon_samlogon_response",
9330 : .tp_getset = py_netlogon_samlogon_response_getsetters,
9331 : .tp_methods = py_netlogon_samlogon_response_methods,
9332 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9333 : .tp_new = py_netlogon_samlogon_response_new,
9334 : };
9335 :
9336 :
9337 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_computer_name(PyObject *obj, void *closure)
9338 : {
9339 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9340 0 : PyObject *py_computer_name;
9341 0 : py_computer_name = PyString_FromStringOrNULL(object->computer_name);
9342 0 : return py_computer_name;
9343 : }
9344 :
9345 0 : static int py_nbt_netlogon_query_for_pdc_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
9346 : {
9347 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9348 0 : if (value == NULL) {
9349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->computer_name");
9350 0 : return -1;
9351 : }
9352 : {
9353 0 : const char *test_str;
9354 0 : const char *talloc_str;
9355 0 : PyObject *unicode = NULL;
9356 0 : if (PyUnicode_Check(value)) {
9357 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9358 0 : if (unicode == NULL) {
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->computer_name = talloc_str;
9377 : }
9378 0 : return 0;
9379 : }
9380 :
9381 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_mailslot_name(PyObject *obj, void *closure)
9382 : {
9383 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9384 0 : PyObject *py_mailslot_name;
9385 0 : py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
9386 0 : return py_mailslot_name;
9387 : }
9388 :
9389 0 : static int py_nbt_netlogon_query_for_pdc_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
9390 : {
9391 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9392 0 : if (value == NULL) {
9393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mailslot_name");
9394 0 : return -1;
9395 : }
9396 : {
9397 0 : const char *test_str;
9398 0 : const char *talloc_str;
9399 0 : PyObject *unicode = NULL;
9400 0 : if (PyUnicode_Check(value)) {
9401 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9402 0 : if (unicode == NULL) {
9403 0 : return -1;
9404 : }
9405 0 : test_str = PyBytes_AS_STRING(unicode);
9406 0 : } else if (PyBytes_Check(value)) {
9407 0 : test_str = PyBytes_AS_STRING(value);
9408 : } else {
9409 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9410 0 : return -1;
9411 : }
9412 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9413 0 : if (unicode != NULL) {
9414 0 : Py_DECREF(unicode);
9415 : }
9416 0 : if (talloc_str == NULL) {
9417 0 : PyErr_NoMemory();
9418 0 : return -1;
9419 : }
9420 0 : object->mailslot_name = talloc_str;
9421 : }
9422 0 : return 0;
9423 : }
9424 :
9425 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get__pad(PyObject *obj, void *closure)
9426 : {
9427 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9428 0 : PyObject *py__pad;
9429 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9430 0 : return py__pad;
9431 : }
9432 :
9433 0 : static int py_nbt_netlogon_query_for_pdc_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9434 : {
9435 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9436 0 : if (value == NULL) {
9437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
9438 0 : return -1;
9439 : }
9440 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9441 0 : return 0;
9442 : }
9443 :
9444 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_unicode_name(PyObject *obj, void *closure)
9445 : {
9446 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9447 0 : PyObject *py_unicode_name;
9448 0 : py_unicode_name = PyString_FromStringOrNULL(object->unicode_name);
9449 0 : return py_unicode_name;
9450 : }
9451 :
9452 0 : static int py_nbt_netlogon_query_for_pdc_set_unicode_name(PyObject *py_obj, PyObject *value, void *closure)
9453 : {
9454 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9455 0 : if (value == NULL) {
9456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unicode_name");
9457 0 : return -1;
9458 : }
9459 : {
9460 0 : const char *test_str;
9461 0 : const char *talloc_str;
9462 0 : PyObject *unicode = NULL;
9463 0 : if (PyUnicode_Check(value)) {
9464 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9465 0 : if (unicode == NULL) {
9466 0 : return -1;
9467 : }
9468 0 : test_str = PyBytes_AS_STRING(unicode);
9469 0 : } else if (PyBytes_Check(value)) {
9470 0 : test_str = PyBytes_AS_STRING(value);
9471 : } else {
9472 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9473 0 : return -1;
9474 : }
9475 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9476 0 : if (unicode != NULL) {
9477 0 : Py_DECREF(unicode);
9478 : }
9479 0 : if (talloc_str == NULL) {
9480 0 : PyErr_NoMemory();
9481 0 : return -1;
9482 : }
9483 0 : object->unicode_name = talloc_str;
9484 : }
9485 0 : return 0;
9486 : }
9487 :
9488 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_nt_version(PyObject *obj, void *closure)
9489 : {
9490 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9491 0 : PyObject *py_nt_version;
9492 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)(object->nt_version));
9493 0 : return py_nt_version;
9494 : }
9495 :
9496 0 : static int py_nbt_netlogon_query_for_pdc_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
9497 : {
9498 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9499 0 : if (value == NULL) {
9500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nt_version");
9501 0 : return -1;
9502 : }
9503 : {
9504 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
9505 0 : if (PyLong_Check(value)) {
9506 0 : unsigned long long test_var;
9507 0 : test_var = PyLong_AsUnsignedLongLong(value);
9508 0 : if (PyErr_Occurred() != NULL) {
9509 0 : return -1;
9510 : }
9511 0 : if (test_var > uint_max) {
9512 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9513 : PyLong_Type.tp_name, uint_max, test_var);
9514 0 : return -1;
9515 : }
9516 0 : object->nt_version = test_var;
9517 : } else {
9518 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9519 : PyLong_Type.tp_name);
9520 0 : return -1;
9521 : }
9522 : }
9523 0 : return 0;
9524 : }
9525 :
9526 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_lmnt_token(PyObject *obj, void *closure)
9527 : {
9528 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9529 0 : PyObject *py_lmnt_token;
9530 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
9531 0 : return py_lmnt_token;
9532 : }
9533 :
9534 0 : static int py_nbt_netlogon_query_for_pdc_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
9535 : {
9536 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9537 0 : if (value == NULL) {
9538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
9539 0 : return -1;
9540 : }
9541 : {
9542 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
9543 0 : if (PyLong_Check(value)) {
9544 0 : unsigned long long test_var;
9545 0 : test_var = PyLong_AsUnsignedLongLong(value);
9546 0 : if (PyErr_Occurred() != NULL) {
9547 0 : return -1;
9548 : }
9549 0 : if (test_var > uint_max) {
9550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9551 : PyLong_Type.tp_name, uint_max, test_var);
9552 0 : return -1;
9553 : }
9554 0 : object->lmnt_token = test_var;
9555 : } else {
9556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9557 : PyLong_Type.tp_name);
9558 0 : return -1;
9559 : }
9560 : }
9561 0 : return 0;
9562 : }
9563 :
9564 0 : static PyObject *py_nbt_netlogon_query_for_pdc_get_lm20_token(PyObject *obj, void *closure)
9565 : {
9566 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(obj);
9567 0 : PyObject *py_lm20_token;
9568 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
9569 0 : return py_lm20_token;
9570 : }
9571 :
9572 0 : static int py_nbt_netlogon_query_for_pdc_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
9573 : {
9574 0 : struct nbt_netlogon_query_for_pdc *object = pytalloc_get_ptr(py_obj);
9575 0 : if (value == NULL) {
9576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
9577 0 : return -1;
9578 : }
9579 : {
9580 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
9581 0 : if (PyLong_Check(value)) {
9582 0 : unsigned long long test_var;
9583 0 : test_var = PyLong_AsUnsignedLongLong(value);
9584 0 : if (PyErr_Occurred() != NULL) {
9585 0 : return -1;
9586 : }
9587 0 : if (test_var > uint_max) {
9588 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9589 : PyLong_Type.tp_name, uint_max, test_var);
9590 0 : return -1;
9591 : }
9592 0 : object->lm20_token = test_var;
9593 : } else {
9594 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9595 : PyLong_Type.tp_name);
9596 0 : return -1;
9597 : }
9598 : }
9599 0 : return 0;
9600 : }
9601 :
9602 : static PyGetSetDef py_nbt_netlogon_query_for_pdc_getsetters[] = {
9603 : {
9604 : .name = discard_const_p(char, "computer_name"),
9605 : .get = py_nbt_netlogon_query_for_pdc_get_computer_name,
9606 : .set = py_nbt_netlogon_query_for_pdc_set_computer_name,
9607 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9608 : },
9609 : {
9610 : .name = discard_const_p(char, "mailslot_name"),
9611 : .get = py_nbt_netlogon_query_for_pdc_get_mailslot_name,
9612 : .set = py_nbt_netlogon_query_for_pdc_set_mailslot_name,
9613 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9614 : },
9615 : {
9616 : .name = discard_const_p(char, "_pad"),
9617 : .get = py_nbt_netlogon_query_for_pdc_get__pad,
9618 : .set = py_nbt_netlogon_query_for_pdc_set__pad,
9619 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9620 : },
9621 : {
9622 : .name = discard_const_p(char, "unicode_name"),
9623 : .get = py_nbt_netlogon_query_for_pdc_get_unicode_name,
9624 : .set = py_nbt_netlogon_query_for_pdc_set_unicode_name,
9625 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9626 : },
9627 : {
9628 : .name = discard_const_p(char, "nt_version"),
9629 : .get = py_nbt_netlogon_query_for_pdc_get_nt_version,
9630 : .set = py_nbt_netlogon_query_for_pdc_set_nt_version,
9631 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
9632 : },
9633 : {
9634 : .name = discard_const_p(char, "lmnt_token"),
9635 : .get = py_nbt_netlogon_query_for_pdc_get_lmnt_token,
9636 : .set = py_nbt_netlogon_query_for_pdc_set_lmnt_token,
9637 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9638 : },
9639 : {
9640 : .name = discard_const_p(char, "lm20_token"),
9641 : .get = py_nbt_netlogon_query_for_pdc_get_lm20_token,
9642 : .set = py_nbt_netlogon_query_for_pdc_set_lm20_token,
9643 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9644 : },
9645 : { .name = NULL }
9646 : };
9647 :
9648 0 : static PyObject *py_nbt_netlogon_query_for_pdc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9649 : {
9650 0 : return pytalloc_new(struct nbt_netlogon_query_for_pdc, type);
9651 : }
9652 :
9653 :
9654 : static PyTypeObject nbt_netlogon_query_for_pdc_Type = {
9655 : PyVarObject_HEAD_INIT(NULL, 0)
9656 : .tp_name = "nbt.netlogon_query_for_pdc",
9657 : .tp_getset = py_nbt_netlogon_query_for_pdc_getsetters,
9658 : .tp_methods = NULL,
9659 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9660 : .tp_new = py_nbt_netlogon_query_for_pdc_new,
9661 : };
9662 :
9663 :
9664 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_command(PyObject *obj, void *closure)
9665 : {
9666 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9667 0 : PyObject *py_command;
9668 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
9669 0 : return py_command;
9670 : }
9671 :
9672 0 : static int py_nbt_netlogon_response_from_pdc_set_command(PyObject *py_obj, PyObject *value, void *closure)
9673 : {
9674 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9675 0 : if (value == NULL) {
9676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
9677 0 : return -1;
9678 : }
9679 : {
9680 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
9681 0 : if (PyLong_Check(value)) {
9682 0 : unsigned long long test_var;
9683 0 : test_var = PyLong_AsUnsignedLongLong(value);
9684 0 : if (PyErr_Occurred() != NULL) {
9685 0 : return -1;
9686 : }
9687 0 : if (test_var > uint_max) {
9688 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9689 : PyLong_Type.tp_name, uint_max, test_var);
9690 0 : return -1;
9691 : }
9692 0 : object->command = test_var;
9693 : } else {
9694 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9695 : PyLong_Type.tp_name);
9696 0 : return -1;
9697 : }
9698 : }
9699 0 : return 0;
9700 : }
9701 :
9702 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_pdc_name(PyObject *obj, void *closure)
9703 : {
9704 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9705 0 : PyObject *py_pdc_name;
9706 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
9707 0 : return py_pdc_name;
9708 : }
9709 :
9710 0 : static int py_nbt_netlogon_response_from_pdc_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
9711 : {
9712 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9713 0 : if (value == NULL) {
9714 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_name");
9715 0 : return -1;
9716 : }
9717 : {
9718 0 : const char *test_str;
9719 0 : const char *talloc_str;
9720 0 : PyObject *unicode = NULL;
9721 0 : if (PyUnicode_Check(value)) {
9722 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9723 0 : if (unicode == NULL) {
9724 0 : return -1;
9725 : }
9726 0 : test_str = PyBytes_AS_STRING(unicode);
9727 0 : } else if (PyBytes_Check(value)) {
9728 0 : test_str = PyBytes_AS_STRING(value);
9729 : } else {
9730 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9731 0 : return -1;
9732 : }
9733 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9734 0 : if (unicode != NULL) {
9735 0 : Py_DECREF(unicode);
9736 : }
9737 0 : if (talloc_str == NULL) {
9738 0 : PyErr_NoMemory();
9739 0 : return -1;
9740 : }
9741 0 : object->pdc_name = talloc_str;
9742 : }
9743 0 : return 0;
9744 : }
9745 :
9746 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get__pad(PyObject *obj, void *closure)
9747 : {
9748 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9749 0 : PyObject *py__pad;
9750 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9751 0 : return py__pad;
9752 : }
9753 :
9754 0 : static int py_nbt_netlogon_response_from_pdc_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9755 : {
9756 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9757 0 : if (value == NULL) {
9758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
9759 0 : return -1;
9760 : }
9761 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
9762 0 : return 0;
9763 : }
9764 :
9765 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_unicode_pdc_name(PyObject *obj, void *closure)
9766 : {
9767 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9768 0 : PyObject *py_unicode_pdc_name;
9769 0 : py_unicode_pdc_name = PyString_FromStringOrNULL(object->unicode_pdc_name);
9770 0 : return py_unicode_pdc_name;
9771 : }
9772 :
9773 0 : static int py_nbt_netlogon_response_from_pdc_set_unicode_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
9774 : {
9775 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9776 0 : if (value == NULL) {
9777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unicode_pdc_name");
9778 0 : return -1;
9779 : }
9780 : {
9781 0 : const char *test_str;
9782 0 : const char *talloc_str;
9783 0 : PyObject *unicode = NULL;
9784 0 : if (PyUnicode_Check(value)) {
9785 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9786 0 : if (unicode == NULL) {
9787 0 : return -1;
9788 : }
9789 0 : test_str = PyBytes_AS_STRING(unicode);
9790 0 : } else if (PyBytes_Check(value)) {
9791 0 : test_str = PyBytes_AS_STRING(value);
9792 : } else {
9793 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9794 0 : return -1;
9795 : }
9796 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9797 0 : if (unicode != NULL) {
9798 0 : Py_DECREF(unicode);
9799 : }
9800 0 : if (talloc_str == NULL) {
9801 0 : PyErr_NoMemory();
9802 0 : return -1;
9803 : }
9804 0 : object->unicode_pdc_name = talloc_str;
9805 : }
9806 0 : return 0;
9807 : }
9808 :
9809 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_domain_name(PyObject *obj, void *closure)
9810 : {
9811 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9812 0 : PyObject *py_domain_name;
9813 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
9814 0 : return py_domain_name;
9815 : }
9816 :
9817 0 : static int py_nbt_netlogon_response_from_pdc_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
9818 : {
9819 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9820 0 : if (value == NULL) {
9821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
9822 0 : return -1;
9823 : }
9824 : {
9825 0 : const char *test_str;
9826 0 : const char *talloc_str;
9827 0 : PyObject *unicode = NULL;
9828 0 : if (PyUnicode_Check(value)) {
9829 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9830 0 : if (unicode == NULL) {
9831 0 : return -1;
9832 : }
9833 0 : test_str = PyBytes_AS_STRING(unicode);
9834 0 : } else if (PyBytes_Check(value)) {
9835 0 : test_str = PyBytes_AS_STRING(value);
9836 : } else {
9837 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9838 0 : return -1;
9839 : }
9840 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9841 0 : if (unicode != NULL) {
9842 0 : Py_DECREF(unicode);
9843 : }
9844 0 : if (talloc_str == NULL) {
9845 0 : PyErr_NoMemory();
9846 0 : return -1;
9847 : }
9848 0 : object->domain_name = talloc_str;
9849 : }
9850 0 : return 0;
9851 : }
9852 :
9853 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_nt_version(PyObject *obj, void *closure)
9854 : {
9855 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9856 0 : PyObject *py_nt_version;
9857 0 : py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)(object->nt_version));
9858 0 : return py_nt_version;
9859 : }
9860 :
9861 0 : static int py_nbt_netlogon_response_from_pdc_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
9862 : {
9863 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9864 0 : if (value == NULL) {
9865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->nt_version");
9866 0 : return -1;
9867 : }
9868 : {
9869 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
9870 0 : if (PyLong_Check(value)) {
9871 0 : unsigned long long test_var;
9872 0 : test_var = PyLong_AsUnsignedLongLong(value);
9873 0 : if (PyErr_Occurred() != NULL) {
9874 0 : return -1;
9875 : }
9876 0 : if (test_var > uint_max) {
9877 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9878 : PyLong_Type.tp_name, uint_max, test_var);
9879 0 : return -1;
9880 : }
9881 0 : object->nt_version = test_var;
9882 : } else {
9883 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9884 : PyLong_Type.tp_name);
9885 0 : return -1;
9886 : }
9887 : }
9888 0 : return 0;
9889 : }
9890 :
9891 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_lmnt_token(PyObject *obj, void *closure)
9892 : {
9893 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9894 0 : PyObject *py_lmnt_token;
9895 0 : py_lmnt_token = PyLong_FromLong((uint16_t)(object->lmnt_token));
9896 0 : return py_lmnt_token;
9897 : }
9898 :
9899 0 : static int py_nbt_netlogon_response_from_pdc_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
9900 : {
9901 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9902 0 : if (value == NULL) {
9903 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lmnt_token");
9904 0 : return -1;
9905 : }
9906 : {
9907 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
9908 0 : if (PyLong_Check(value)) {
9909 0 : unsigned long long test_var;
9910 0 : test_var = PyLong_AsUnsignedLongLong(value);
9911 0 : if (PyErr_Occurred() != NULL) {
9912 0 : return -1;
9913 : }
9914 0 : if (test_var > uint_max) {
9915 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9916 : PyLong_Type.tp_name, uint_max, test_var);
9917 0 : return -1;
9918 : }
9919 0 : object->lmnt_token = test_var;
9920 : } else {
9921 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9922 : PyLong_Type.tp_name);
9923 0 : return -1;
9924 : }
9925 : }
9926 0 : return 0;
9927 : }
9928 :
9929 0 : static PyObject *py_nbt_netlogon_response_from_pdc_get_lm20_token(PyObject *obj, void *closure)
9930 : {
9931 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(obj);
9932 0 : PyObject *py_lm20_token;
9933 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
9934 0 : return py_lm20_token;
9935 : }
9936 :
9937 0 : static int py_nbt_netlogon_response_from_pdc_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
9938 : {
9939 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
9940 0 : if (value == NULL) {
9941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
9942 0 : return -1;
9943 : }
9944 : {
9945 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
9946 0 : if (PyLong_Check(value)) {
9947 0 : unsigned long long test_var;
9948 0 : test_var = PyLong_AsUnsignedLongLong(value);
9949 0 : if (PyErr_Occurred() != NULL) {
9950 0 : return -1;
9951 : }
9952 0 : if (test_var > uint_max) {
9953 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9954 : PyLong_Type.tp_name, uint_max, test_var);
9955 0 : return -1;
9956 : }
9957 0 : object->lm20_token = test_var;
9958 : } else {
9959 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9960 : PyLong_Type.tp_name);
9961 0 : return -1;
9962 : }
9963 : }
9964 0 : return 0;
9965 : }
9966 :
9967 : static PyGetSetDef py_nbt_netlogon_response_from_pdc_getsetters[] = {
9968 : {
9969 : .name = discard_const_p(char, "command"),
9970 : .get = py_nbt_netlogon_response_from_pdc_get_command,
9971 : .set = py_nbt_netlogon_response_from_pdc_set_command,
9972 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
9973 : },
9974 : {
9975 : .name = discard_const_p(char, "pdc_name"),
9976 : .get = py_nbt_netlogon_response_from_pdc_get_pdc_name,
9977 : .set = py_nbt_netlogon_response_from_pdc_set_pdc_name,
9978 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9979 : },
9980 : {
9981 : .name = discard_const_p(char, "_pad"),
9982 : .get = py_nbt_netlogon_response_from_pdc_get__pad,
9983 : .set = py_nbt_netlogon_response_from_pdc_set__pad,
9984 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
9985 : },
9986 : {
9987 : .name = discard_const_p(char, "unicode_pdc_name"),
9988 : .get = py_nbt_netlogon_response_from_pdc_get_unicode_pdc_name,
9989 : .set = py_nbt_netlogon_response_from_pdc_set_unicode_pdc_name,
9990 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9991 : },
9992 : {
9993 : .name = discard_const_p(char, "domain_name"),
9994 : .get = py_nbt_netlogon_response_from_pdc_get_domain_name,
9995 : .set = py_nbt_netlogon_response_from_pdc_set_domain_name,
9996 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
9997 : },
9998 : {
9999 : .name = discard_const_p(char, "nt_version"),
10000 : .get = py_nbt_netlogon_response_from_pdc_get_nt_version,
10001 : .set = py_nbt_netlogon_response_from_pdc_set_nt_version,
10002 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
10003 : },
10004 : {
10005 : .name = discard_const_p(char, "lmnt_token"),
10006 : .get = py_nbt_netlogon_response_from_pdc_get_lmnt_token,
10007 : .set = py_nbt_netlogon_response_from_pdc_set_lmnt_token,
10008 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10009 : },
10010 : {
10011 : .name = discard_const_p(char, "lm20_token"),
10012 : .get = py_nbt_netlogon_response_from_pdc_get_lm20_token,
10013 : .set = py_nbt_netlogon_response_from_pdc_set_lm20_token,
10014 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10015 : },
10016 : { .name = NULL }
10017 : };
10018 :
10019 0 : static PyObject *py_nbt_netlogon_response_from_pdc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10020 : {
10021 0 : return pytalloc_new(struct nbt_netlogon_response_from_pdc, type);
10022 : }
10023 :
10024 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10025 : {
10026 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
10027 0 : PyObject *ret = NULL;
10028 0 : DATA_BLOB blob;
10029 0 : enum ndr_err_code err;
10030 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10031 0 : if (tmp_ctx == NULL) {
10032 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10033 0 : return NULL;
10034 : }
10035 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response_from_pdc);
10036 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10037 0 : TALLOC_FREE(tmp_ctx);
10038 0 : PyErr_SetNdrError(err);
10039 0 : return NULL;
10040 : }
10041 :
10042 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10043 0 : TALLOC_FREE(tmp_ctx);
10044 0 : return ret;
10045 : }
10046 :
10047 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10048 : {
10049 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
10050 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10051 0 : Py_ssize_t blob_length = 0;
10052 0 : enum ndr_err_code err;
10053 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10054 0 : PyObject *allow_remaining_obj = NULL;
10055 0 : bool allow_remaining = false;
10056 :
10057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10058 : discard_const_p(char *, kwnames),
10059 : &blob.data, &blob_length,
10060 : &allow_remaining_obj)) {
10061 0 : return NULL;
10062 : }
10063 0 : blob.length = blob_length;
10064 :
10065 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10066 0 : allow_remaining = true;
10067 : }
10068 :
10069 0 : if (allow_remaining) {
10070 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);
10071 : } else {
10072 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);
10073 : }
10074 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10075 0 : PyErr_SetNdrError(err);
10076 0 : return NULL;
10077 : }
10078 :
10079 0 : Py_RETURN_NONE;
10080 : }
10081 :
10082 0 : static PyObject *py_nbt_netlogon_response_from_pdc_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10083 : {
10084 0 : struct nbt_netlogon_response_from_pdc *object = pytalloc_get_ptr(py_obj);
10085 0 : PyObject *ret;
10086 0 : char *retstr;
10087 :
10088 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);
10089 0 : ret = PyUnicode_FromString(retstr);
10090 0 : talloc_free(retstr);
10091 :
10092 0 : return ret;
10093 : }
10094 :
10095 : static PyMethodDef py_nbt_netlogon_response_from_pdc_methods[] = {
10096 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_response_from_pdc_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10097 : { "__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" },
10098 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_response_from_pdc_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10099 : { NULL, NULL, 0, NULL }
10100 : };
10101 :
10102 :
10103 : static PyTypeObject nbt_netlogon_response_from_pdc_Type = {
10104 : PyVarObject_HEAD_INIT(NULL, 0)
10105 : .tp_name = "nbt.netlogon_response_from_pdc",
10106 : .tp_getset = py_nbt_netlogon_response_from_pdc_getsetters,
10107 : .tp_methods = py_nbt_netlogon_response_from_pdc_methods,
10108 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10109 : .tp_new = py_nbt_netlogon_response_from_pdc_new,
10110 : };
10111 :
10112 :
10113 0 : static PyObject *py_nbt_netlogon_response2_get_command(PyObject *obj, void *closure)
10114 : {
10115 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(obj);
10116 0 : PyObject *py_command;
10117 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
10118 0 : return py_command;
10119 : }
10120 :
10121 0 : static int py_nbt_netlogon_response2_set_command(PyObject *py_obj, PyObject *value, void *closure)
10122 : {
10123 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(py_obj);
10124 0 : if (value == NULL) {
10125 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
10126 0 : return -1;
10127 : }
10128 : {
10129 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
10130 0 : if (PyLong_Check(value)) {
10131 0 : unsigned long long test_var;
10132 0 : test_var = PyLong_AsUnsignedLongLong(value);
10133 0 : if (PyErr_Occurred() != NULL) {
10134 0 : return -1;
10135 : }
10136 0 : if (test_var > uint_max) {
10137 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10138 : PyLong_Type.tp_name, uint_max, test_var);
10139 0 : return -1;
10140 : }
10141 0 : object->command = test_var;
10142 : } else {
10143 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10144 : PyLong_Type.tp_name);
10145 0 : return -1;
10146 : }
10147 : }
10148 0 : return 0;
10149 : }
10150 :
10151 0 : static PyObject *py_nbt_netlogon_response2_get_pdc_name(PyObject *obj, void *closure)
10152 : {
10153 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(obj);
10154 0 : PyObject *py_pdc_name;
10155 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
10156 0 : return py_pdc_name;
10157 : }
10158 :
10159 0 : static int py_nbt_netlogon_response2_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10160 : {
10161 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(py_obj);
10162 0 : if (value == NULL) {
10163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_name");
10164 0 : return -1;
10165 : }
10166 : {
10167 0 : const char *test_str;
10168 0 : const char *talloc_str;
10169 0 : PyObject *unicode = NULL;
10170 0 : if (PyUnicode_Check(value)) {
10171 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10172 0 : if (unicode == NULL) {
10173 0 : return -1;
10174 : }
10175 0 : test_str = PyBytes_AS_STRING(unicode);
10176 0 : } else if (PyBytes_Check(value)) {
10177 0 : test_str = PyBytes_AS_STRING(value);
10178 : } else {
10179 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10180 0 : return -1;
10181 : }
10182 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10183 0 : if (unicode != NULL) {
10184 0 : Py_DECREF(unicode);
10185 : }
10186 0 : if (talloc_str == NULL) {
10187 0 : PyErr_NoMemory();
10188 0 : return -1;
10189 : }
10190 0 : object->pdc_name = talloc_str;
10191 : }
10192 0 : return 0;
10193 : }
10194 :
10195 0 : static PyObject *py_nbt_netlogon_response2_get_lm20_token(PyObject *obj, void *closure)
10196 : {
10197 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(obj);
10198 0 : PyObject *py_lm20_token;
10199 0 : py_lm20_token = PyLong_FromLong((uint16_t)(object->lm20_token));
10200 0 : return py_lm20_token;
10201 : }
10202 :
10203 0 : static int py_nbt_netlogon_response2_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
10204 : {
10205 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(py_obj);
10206 0 : if (value == NULL) {
10207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lm20_token");
10208 0 : return -1;
10209 : }
10210 : {
10211 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
10212 0 : if (PyLong_Check(value)) {
10213 0 : unsigned long long test_var;
10214 0 : test_var = PyLong_AsUnsignedLongLong(value);
10215 0 : if (PyErr_Occurred() != NULL) {
10216 0 : return -1;
10217 : }
10218 0 : if (test_var > uint_max) {
10219 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10220 : PyLong_Type.tp_name, uint_max, test_var);
10221 0 : return -1;
10222 : }
10223 0 : object->lm20_token = test_var;
10224 : } else {
10225 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10226 : PyLong_Type.tp_name);
10227 0 : return -1;
10228 : }
10229 : }
10230 0 : return 0;
10231 : }
10232 :
10233 : static PyGetSetDef py_nbt_netlogon_response2_getsetters[] = {
10234 : {
10235 : .name = discard_const_p(char, "command"),
10236 : .get = py_nbt_netlogon_response2_get_command,
10237 : .set = py_nbt_netlogon_response2_set_command,
10238 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
10239 : },
10240 : {
10241 : .name = discard_const_p(char, "pdc_name"),
10242 : .get = py_nbt_netlogon_response2_get_pdc_name,
10243 : .set = py_nbt_netlogon_response2_set_pdc_name,
10244 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
10245 : },
10246 : {
10247 : .name = discard_const_p(char, "lm20_token"),
10248 : .get = py_nbt_netlogon_response2_get_lm20_token,
10249 : .set = py_nbt_netlogon_response2_set_lm20_token,
10250 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10251 : },
10252 : { .name = NULL }
10253 : };
10254 :
10255 0 : static PyObject *py_nbt_netlogon_response2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10256 : {
10257 0 : return pytalloc_new(struct nbt_netlogon_response2, type);
10258 : }
10259 :
10260 0 : static PyObject *py_nbt_netlogon_response2_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10261 : {
10262 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(py_obj);
10263 0 : PyObject *ret = NULL;
10264 0 : DATA_BLOB blob;
10265 0 : enum ndr_err_code err;
10266 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10267 0 : if (tmp_ctx == NULL) {
10268 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10269 0 : return NULL;
10270 : }
10271 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response2);
10272 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10273 0 : TALLOC_FREE(tmp_ctx);
10274 0 : PyErr_SetNdrError(err);
10275 0 : return NULL;
10276 : }
10277 :
10278 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10279 0 : TALLOC_FREE(tmp_ctx);
10280 0 : return ret;
10281 : }
10282 :
10283 0 : static PyObject *py_nbt_netlogon_response2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10284 : {
10285 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(py_obj);
10286 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10287 0 : Py_ssize_t blob_length = 0;
10288 0 : enum ndr_err_code err;
10289 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10290 0 : PyObject *allow_remaining_obj = NULL;
10291 0 : bool allow_remaining = false;
10292 :
10293 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10294 : discard_const_p(char *, kwnames),
10295 : &blob.data, &blob_length,
10296 : &allow_remaining_obj)) {
10297 0 : return NULL;
10298 : }
10299 0 : blob.length = blob_length;
10300 :
10301 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10302 0 : allow_remaining = true;
10303 : }
10304 :
10305 0 : if (allow_remaining) {
10306 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response2);
10307 : } else {
10308 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);
10309 : }
10310 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10311 0 : PyErr_SetNdrError(err);
10312 0 : return NULL;
10313 : }
10314 :
10315 0 : Py_RETURN_NONE;
10316 : }
10317 :
10318 0 : static PyObject *py_nbt_netlogon_response2_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10319 : {
10320 0 : struct nbt_netlogon_response2 *object = pytalloc_get_ptr(py_obj);
10321 0 : PyObject *ret;
10322 0 : char *retstr;
10323 :
10324 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);
10325 0 : ret = PyUnicode_FromString(retstr);
10326 0 : talloc_free(retstr);
10327 :
10328 0 : return ret;
10329 : }
10330 :
10331 : static PyMethodDef py_nbt_netlogon_response2_methods[] = {
10332 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_response2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10333 : { "__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" },
10334 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_response2_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10335 : { NULL, NULL, 0, NULL }
10336 : };
10337 :
10338 :
10339 : static PyTypeObject nbt_netlogon_response2_Type = {
10340 : PyVarObject_HEAD_INIT(NULL, 0)
10341 : .tp_name = "nbt.netlogon_response2",
10342 : .tp_getset = py_nbt_netlogon_response2_getsetters,
10343 : .tp_methods = py_nbt_netlogon_response2_methods,
10344 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10345 : .tp_new = py_nbt_netlogon_response2_new,
10346 : };
10347 :
10348 :
10349 0 : static PyObject *py_nbt_db_change_info_get_db_index(PyObject *obj, void *closure)
10350 : {
10351 0 : struct nbt_db_change_info *object = pytalloc_get_ptr(obj);
10352 0 : PyObject *py_db_index;
10353 0 : py_db_index = PyLong_FromUnsignedLongLong((uint32_t)(object->db_index));
10354 0 : return py_db_index;
10355 : }
10356 :
10357 0 : static int py_nbt_db_change_info_set_db_index(PyObject *py_obj, PyObject *value, void *closure)
10358 : {
10359 0 : struct nbt_db_change_info *object = pytalloc_get_ptr(py_obj);
10360 0 : if (value == NULL) {
10361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->db_index");
10362 0 : return -1;
10363 : }
10364 : {
10365 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_index));
10366 0 : if (PyLong_Check(value)) {
10367 0 : unsigned long long test_var;
10368 0 : test_var = PyLong_AsUnsignedLongLong(value);
10369 0 : if (PyErr_Occurred() != NULL) {
10370 0 : return -1;
10371 : }
10372 0 : if (test_var > uint_max) {
10373 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10374 : PyLong_Type.tp_name, uint_max, test_var);
10375 0 : return -1;
10376 : }
10377 0 : object->db_index = test_var;
10378 : } else {
10379 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10380 : PyLong_Type.tp_name);
10381 0 : return -1;
10382 : }
10383 : }
10384 0 : return 0;
10385 : }
10386 :
10387 0 : static PyObject *py_nbt_db_change_info_get_serial(PyObject *obj, void *closure)
10388 : {
10389 0 : struct nbt_db_change_info *object = pytalloc_get_ptr(obj);
10390 0 : PyObject *py_serial;
10391 0 : py_serial = PyLong_FromUnsignedLongLong(object->serial);
10392 0 : return py_serial;
10393 : }
10394 :
10395 0 : static int py_nbt_db_change_info_set_serial(PyObject *py_obj, PyObject *value, void *closure)
10396 : {
10397 0 : struct nbt_db_change_info *object = pytalloc_get_ptr(py_obj);
10398 0 : if (value == NULL) {
10399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->serial");
10400 0 : return -1;
10401 : }
10402 : {
10403 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial));
10404 0 : if (PyLong_Check(value)) {
10405 0 : unsigned long long test_var;
10406 0 : test_var = PyLong_AsUnsignedLongLong(value);
10407 0 : if (PyErr_Occurred() != NULL) {
10408 0 : return -1;
10409 : }
10410 0 : if (test_var > uint_max) {
10411 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10412 : PyLong_Type.tp_name, uint_max, test_var);
10413 0 : return -1;
10414 : }
10415 0 : object->serial = test_var;
10416 : } else {
10417 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10418 : PyLong_Type.tp_name);
10419 0 : return -1;
10420 : }
10421 : }
10422 0 : return 0;
10423 : }
10424 :
10425 0 : static PyObject *py_nbt_db_change_info_get_timestamp(PyObject *obj, void *closure)
10426 : {
10427 0 : struct nbt_db_change_info *object = pytalloc_get_ptr(obj);
10428 0 : PyObject *py_timestamp;
10429 0 : py_timestamp = PyLong_FromUnsignedLongLong(object->timestamp);
10430 0 : return py_timestamp;
10431 : }
10432 :
10433 0 : static int py_nbt_db_change_info_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
10434 : {
10435 0 : struct nbt_db_change_info *object = pytalloc_get_ptr(py_obj);
10436 0 : if (value == NULL) {
10437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->timestamp");
10438 0 : return -1;
10439 : }
10440 : {
10441 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timestamp));
10442 0 : if (PyLong_Check(value)) {
10443 0 : unsigned long long test_var;
10444 0 : test_var = PyLong_AsUnsignedLongLong(value);
10445 0 : if (PyErr_Occurred() != NULL) {
10446 0 : return -1;
10447 : }
10448 0 : if (test_var > uint_max) {
10449 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10450 : PyLong_Type.tp_name, uint_max, test_var);
10451 0 : return -1;
10452 : }
10453 0 : object->timestamp = test_var;
10454 : } else {
10455 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10456 : PyLong_Type.tp_name);
10457 0 : return -1;
10458 : }
10459 : }
10460 0 : return 0;
10461 : }
10462 :
10463 : static PyGetSetDef py_nbt_db_change_info_getsetters[] = {
10464 : {
10465 : .name = discard_const_p(char, "db_index"),
10466 : .get = py_nbt_db_change_info_get_db_index,
10467 : .set = py_nbt_db_change_info_set_db_index,
10468 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID")
10469 : },
10470 : {
10471 : .name = discard_const_p(char, "serial"),
10472 : .get = py_nbt_db_change_info_get_serial,
10473 : .set = py_nbt_db_change_info_set_serial,
10474 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
10475 : },
10476 : {
10477 : .name = discard_const_p(char, "timestamp"),
10478 : .get = py_nbt_db_change_info_get_timestamp,
10479 : .set = py_nbt_db_change_info_set_timestamp,
10480 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
10481 : },
10482 : { .name = NULL }
10483 : };
10484 :
10485 0 : static PyObject *py_nbt_db_change_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10486 : {
10487 0 : return pytalloc_new(struct nbt_db_change_info, type);
10488 : }
10489 :
10490 :
10491 : static PyTypeObject nbt_db_change_info_Type = {
10492 : PyVarObject_HEAD_INIT(NULL, 0)
10493 : .tp_name = "nbt.db_change_info",
10494 : .tp_getset = py_nbt_db_change_info_getsetters,
10495 : .tp_methods = NULL,
10496 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10497 : .tp_new = py_nbt_db_change_info_new,
10498 : };
10499 :
10500 :
10501 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_serial_lo(PyObject *obj, void *closure)
10502 : {
10503 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10504 0 : PyObject *py_serial_lo;
10505 0 : py_serial_lo = PyLong_FromUnsignedLongLong((uint32_t)(object->serial_lo));
10506 0 : return py_serial_lo;
10507 : }
10508 :
10509 0 : static int py_NETLOGON_DB_CHANGE_set_serial_lo(PyObject *py_obj, PyObject *value, void *closure)
10510 : {
10511 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10512 0 : if (value == NULL) {
10513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->serial_lo");
10514 0 : return -1;
10515 : }
10516 : {
10517 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_lo));
10518 0 : if (PyLong_Check(value)) {
10519 0 : unsigned long long test_var;
10520 0 : test_var = PyLong_AsUnsignedLongLong(value);
10521 0 : if (PyErr_Occurred() != NULL) {
10522 0 : return -1;
10523 : }
10524 0 : if (test_var > uint_max) {
10525 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10526 : PyLong_Type.tp_name, uint_max, test_var);
10527 0 : return -1;
10528 : }
10529 0 : object->serial_lo = 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_timestamp(PyObject *obj, void *closure)
10540 : {
10541 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10542 0 : PyObject *py_timestamp;
10543 0 : py_timestamp = PyLong_FromLong(object->timestamp);
10544 0 : return py_timestamp;
10545 : }
10546 :
10547 0 : static int py_NETLOGON_DB_CHANGE_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
10548 : {
10549 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10550 0 : if (value == NULL) {
10551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->timestamp");
10552 0 : return -1;
10553 : }
10554 : {
10555 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp));
10556 0 : const long long int_min = -int_max - 1;
10557 0 : if (PyLong_Check(value)) {
10558 0 : long long test_var;
10559 0 : test_var = PyLong_AsLongLong(value);
10560 0 : if (PyErr_Occurred() != NULL) {
10561 0 : return -1;
10562 : }
10563 0 : if (test_var < int_min || test_var > int_max) {
10564 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
10565 : PyLong_Type.tp_name, int_min, int_max, test_var);
10566 0 : return -1;
10567 : }
10568 0 : object->timestamp = test_var;
10569 : } else {
10570 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10571 : PyLong_Type.tp_name);
10572 0 : return -1;
10573 : }
10574 : }
10575 0 : return 0;
10576 : }
10577 :
10578 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_pulse(PyObject *obj, void *closure)
10579 : {
10580 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10581 0 : PyObject *py_pulse;
10582 0 : py_pulse = PyLong_FromUnsignedLongLong((uint32_t)(object->pulse));
10583 0 : return py_pulse;
10584 : }
10585 :
10586 0 : static int py_NETLOGON_DB_CHANGE_set_pulse(PyObject *py_obj, PyObject *value, void *closure)
10587 : {
10588 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10589 0 : if (value == NULL) {
10590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pulse");
10591 0 : return -1;
10592 : }
10593 : {
10594 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pulse));
10595 0 : if (PyLong_Check(value)) {
10596 0 : unsigned long long test_var;
10597 0 : test_var = PyLong_AsUnsignedLongLong(value);
10598 0 : if (PyErr_Occurred() != NULL) {
10599 0 : return -1;
10600 : }
10601 0 : if (test_var > uint_max) {
10602 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10603 : PyLong_Type.tp_name, uint_max, test_var);
10604 0 : return -1;
10605 : }
10606 0 : object->pulse = test_var;
10607 : } else {
10608 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10609 : PyLong_Type.tp_name);
10610 0 : return -1;
10611 : }
10612 : }
10613 0 : return 0;
10614 : }
10615 :
10616 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_random(PyObject *obj, void *closure)
10617 : {
10618 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10619 0 : PyObject *py_random;
10620 0 : py_random = PyLong_FromUnsignedLongLong((uint32_t)(object->random));
10621 0 : return py_random;
10622 : }
10623 :
10624 0 : static int py_NETLOGON_DB_CHANGE_set_random(PyObject *py_obj, PyObject *value, void *closure)
10625 : {
10626 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10627 0 : if (value == NULL) {
10628 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->random");
10629 0 : return -1;
10630 : }
10631 : {
10632 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->random));
10633 0 : if (PyLong_Check(value)) {
10634 0 : unsigned long long test_var;
10635 0 : test_var = PyLong_AsUnsignedLongLong(value);
10636 0 : if (PyErr_Occurred() != NULL) {
10637 0 : return -1;
10638 : }
10639 0 : if (test_var > uint_max) {
10640 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10641 : PyLong_Type.tp_name, uint_max, test_var);
10642 0 : return -1;
10643 : }
10644 0 : object->random = test_var;
10645 : } else {
10646 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10647 : PyLong_Type.tp_name);
10648 0 : return -1;
10649 : }
10650 : }
10651 0 : return 0;
10652 : }
10653 :
10654 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_pdc_name(PyObject *obj, void *closure)
10655 : {
10656 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10657 0 : PyObject *py_pdc_name;
10658 0 : py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
10659 0 : return py_pdc_name;
10660 : }
10661 :
10662 0 : static int py_NETLOGON_DB_CHANGE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10663 : {
10664 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10665 0 : if (value == NULL) {
10666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pdc_name");
10667 0 : return -1;
10668 : }
10669 : {
10670 0 : const char *test_str;
10671 0 : const char *talloc_str;
10672 0 : PyObject *unicode = NULL;
10673 0 : if (PyUnicode_Check(value)) {
10674 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10675 0 : if (unicode == NULL) {
10676 0 : return -1;
10677 : }
10678 0 : test_str = PyBytes_AS_STRING(unicode);
10679 0 : } else if (PyBytes_Check(value)) {
10680 0 : test_str = PyBytes_AS_STRING(value);
10681 : } else {
10682 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10683 0 : return -1;
10684 : }
10685 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10686 0 : if (unicode != NULL) {
10687 0 : Py_DECREF(unicode);
10688 : }
10689 0 : if (talloc_str == NULL) {
10690 0 : PyErr_NoMemory();
10691 0 : return -1;
10692 : }
10693 0 : object->pdc_name = talloc_str;
10694 : }
10695 0 : return 0;
10696 : }
10697 :
10698 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_domain(PyObject *obj, void *closure)
10699 : {
10700 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10701 0 : PyObject *py_domain;
10702 0 : py_domain = PyString_FromStringOrNULL(object->domain);
10703 0 : return py_domain;
10704 : }
10705 :
10706 0 : static int py_NETLOGON_DB_CHANGE_set_domain(PyObject *py_obj, PyObject *value, void *closure)
10707 : {
10708 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10709 0 : if (value == NULL) {
10710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain");
10711 0 : return -1;
10712 : }
10713 : {
10714 0 : const char *test_str;
10715 0 : const char *talloc_str;
10716 0 : PyObject *unicode = NULL;
10717 0 : if (PyUnicode_Check(value)) {
10718 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10719 0 : if (unicode == NULL) {
10720 0 : return -1;
10721 : }
10722 0 : test_str = PyBytes_AS_STRING(unicode);
10723 0 : } else if (PyBytes_Check(value)) {
10724 0 : test_str = PyBytes_AS_STRING(value);
10725 : } else {
10726 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10727 0 : return -1;
10728 : }
10729 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10730 0 : if (unicode != NULL) {
10731 0 : Py_DECREF(unicode);
10732 : }
10733 0 : if (talloc_str == NULL) {
10734 0 : PyErr_NoMemory();
10735 0 : return -1;
10736 : }
10737 0 : object->domain = talloc_str;
10738 : }
10739 0 : return 0;
10740 : }
10741 :
10742 0 : static PyObject *py_NETLOGON_DB_CHANGE_get__pad(PyObject *obj, void *closure)
10743 : {
10744 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10745 0 : PyObject *py__pad;
10746 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
10747 0 : return py__pad;
10748 : }
10749 :
10750 0 : static int py_NETLOGON_DB_CHANGE_set__pad(PyObject *py_obj, PyObject *value, void *closure)
10751 : {
10752 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10753 0 : if (value == NULL) {
10754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
10755 0 : return -1;
10756 : }
10757 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
10758 0 : return 0;
10759 : }
10760 :
10761 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_unicode_pdc_name(PyObject *obj, void *closure)
10762 : {
10763 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10764 0 : PyObject *py_unicode_pdc_name;
10765 0 : py_unicode_pdc_name = PyString_FromStringOrNULL(object->unicode_pdc_name);
10766 0 : return py_unicode_pdc_name;
10767 : }
10768 :
10769 0 : static int py_NETLOGON_DB_CHANGE_set_unicode_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
10770 : {
10771 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10772 0 : if (value == NULL) {
10773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unicode_pdc_name");
10774 0 : return -1;
10775 : }
10776 : {
10777 0 : const char *test_str;
10778 0 : const char *talloc_str;
10779 0 : PyObject *unicode = NULL;
10780 0 : if (PyUnicode_Check(value)) {
10781 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10782 0 : if (unicode == NULL) {
10783 0 : return -1;
10784 : }
10785 0 : test_str = PyBytes_AS_STRING(unicode);
10786 0 : } else if (PyBytes_Check(value)) {
10787 0 : test_str = PyBytes_AS_STRING(value);
10788 : } else {
10789 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10790 0 : return -1;
10791 : }
10792 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10793 0 : if (unicode != NULL) {
10794 0 : Py_DECREF(unicode);
10795 : }
10796 0 : if (talloc_str == NULL) {
10797 0 : PyErr_NoMemory();
10798 0 : return -1;
10799 : }
10800 0 : object->unicode_pdc_name = talloc_str;
10801 : }
10802 0 : return 0;
10803 : }
10804 :
10805 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_unicode_domain(PyObject *obj, void *closure)
10806 : {
10807 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10808 0 : PyObject *py_unicode_domain;
10809 0 : py_unicode_domain = PyString_FromStringOrNULL(object->unicode_domain);
10810 0 : return py_unicode_domain;
10811 : }
10812 :
10813 0 : static int py_NETLOGON_DB_CHANGE_set_unicode_domain(PyObject *py_obj, PyObject *value, void *closure)
10814 : {
10815 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10816 0 : if (value == NULL) {
10817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unicode_domain");
10818 0 : return -1;
10819 : }
10820 : {
10821 0 : const char *test_str;
10822 0 : const char *talloc_str;
10823 0 : PyObject *unicode = NULL;
10824 0 : if (PyUnicode_Check(value)) {
10825 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10826 0 : if (unicode == NULL) {
10827 0 : return -1;
10828 : }
10829 0 : test_str = PyBytes_AS_STRING(unicode);
10830 0 : } else if (PyBytes_Check(value)) {
10831 0 : test_str = PyBytes_AS_STRING(value);
10832 : } else {
10833 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10834 0 : return -1;
10835 : }
10836 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10837 0 : if (unicode != NULL) {
10838 0 : Py_DECREF(unicode);
10839 : }
10840 0 : if (talloc_str == NULL) {
10841 0 : PyErr_NoMemory();
10842 0 : return -1;
10843 : }
10844 0 : object->unicode_domain = talloc_str;
10845 : }
10846 0 : return 0;
10847 : }
10848 :
10849 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_db_count(PyObject *obj, void *closure)
10850 : {
10851 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10852 0 : PyObject *py_db_count;
10853 0 : py_db_count = PyLong_FromUnsignedLongLong((uint32_t)(object->db_count));
10854 0 : return py_db_count;
10855 : }
10856 :
10857 0 : static int py_NETLOGON_DB_CHANGE_set_db_count(PyObject *py_obj, PyObject *value, void *closure)
10858 : {
10859 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10860 0 : if (value == NULL) {
10861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->db_count");
10862 0 : return -1;
10863 : }
10864 : {
10865 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_count));
10866 0 : if (PyLong_Check(value)) {
10867 0 : unsigned long long test_var;
10868 0 : test_var = PyLong_AsUnsignedLongLong(value);
10869 0 : if (PyErr_Occurred() != NULL) {
10870 0 : return -1;
10871 : }
10872 0 : if (test_var > uint_max) {
10873 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10874 : PyLong_Type.tp_name, uint_max, test_var);
10875 0 : return -1;
10876 : }
10877 0 : object->db_count = test_var;
10878 : } else {
10879 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10880 : PyLong_Type.tp_name);
10881 0 : return -1;
10882 : }
10883 : }
10884 0 : return 0;
10885 : }
10886 :
10887 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_dbchange(PyObject *obj, void *closure)
10888 : {
10889 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10890 0 : PyObject *py_dbchange;
10891 0 : py_dbchange = PyList_New(object->db_count);
10892 0 : if (py_dbchange == NULL) {
10893 0 : return NULL;
10894 : }
10895 : {
10896 : int dbchange_cntr_0;
10897 0 : for (dbchange_cntr_0 = 0; dbchange_cntr_0 < (object->db_count); dbchange_cntr_0++) {
10898 0 : PyObject *py_dbchange_0;
10899 0 : py_dbchange_0 = pytalloc_reference_ex(&nbt_db_change_info_Type, object->dbchange, &(object->dbchange)[dbchange_cntr_0]);
10900 0 : PyList_SetItem(py_dbchange, dbchange_cntr_0, py_dbchange_0);
10901 : }
10902 : }
10903 0 : return py_dbchange;
10904 : }
10905 :
10906 0 : static int py_NETLOGON_DB_CHANGE_set_dbchange(PyObject *py_obj, PyObject *value, void *closure)
10907 : {
10908 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10909 0 : if (value == NULL) {
10910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dbchange");
10911 0 : return -1;
10912 : }
10913 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10914 : {
10915 0 : int dbchange_cntr_0;
10916 0 : object->dbchange = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->dbchange, PyList_GET_SIZE(value));
10917 0 : if (!object->dbchange) { return -1; }
10918 0 : talloc_set_name_const(object->dbchange, "ARRAY: object->dbchange");
10919 0 : for (dbchange_cntr_0 = 0; dbchange_cntr_0 < PyList_GET_SIZE(value); dbchange_cntr_0++) {
10920 0 : if (PyList_GET_ITEM(value, dbchange_cntr_0) == NULL) {
10921 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->dbchange)[dbchange_cntr_0]");
10922 0 : return -1;
10923 : }
10924 0 : PY_CHECK_TYPE(&nbt_db_change_info_Type, PyList_GET_ITEM(value, dbchange_cntr_0), return -1;);
10925 0 : if (talloc_reference(object->dbchange, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, dbchange_cntr_0))) == NULL) {
10926 0 : PyErr_NoMemory();
10927 0 : return -1;
10928 : }
10929 0 : (object->dbchange)[dbchange_cntr_0] = *(struct nbt_db_change_info *)pytalloc_get_ptr(PyList_GET_ITEM(value, dbchange_cntr_0));
10930 : }
10931 : }
10932 0 : return 0;
10933 : }
10934 :
10935 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_sid_size(PyObject *obj, void *closure)
10936 : {
10937 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10938 0 : PyObject *py_sid_size;
10939 0 : py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_size));
10940 0 : return py_sid_size;
10941 : }
10942 :
10943 0 : static int py_NETLOGON_DB_CHANGE_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
10944 : {
10945 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10946 0 : if (value == NULL) {
10947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_size");
10948 0 : return -1;
10949 : }
10950 : {
10951 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
10952 0 : if (PyLong_Check(value)) {
10953 0 : unsigned long long test_var;
10954 0 : test_var = PyLong_AsUnsignedLongLong(value);
10955 0 : if (PyErr_Occurred() != NULL) {
10956 0 : return -1;
10957 : }
10958 0 : if (test_var > uint_max) {
10959 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10960 : PyLong_Type.tp_name, uint_max, test_var);
10961 0 : return -1;
10962 : }
10963 0 : object->sid_size = test_var;
10964 : } else {
10965 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10966 : PyLong_Type.tp_name);
10967 0 : return -1;
10968 : }
10969 : }
10970 0 : return 0;
10971 : }
10972 :
10973 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_sid(PyObject *obj, void *closure)
10974 : {
10975 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
10976 0 : PyObject *py_sid;
10977 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
10978 0 : return py_sid;
10979 : }
10980 :
10981 0 : static int py_NETLOGON_DB_CHANGE_set_sid(PyObject *py_obj, PyObject *value, void *closure)
10982 : {
10983 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
10984 0 : if (value == NULL) {
10985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
10986 0 : return -1;
10987 : }
10988 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10989 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10990 0 : PyErr_NoMemory();
10991 0 : return -1;
10992 : }
10993 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
10994 0 : return 0;
10995 : }
10996 :
10997 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_message_format_version(PyObject *obj, void *closure)
10998 : {
10999 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
11000 0 : PyObject *py_message_format_version;
11001 0 : py_message_format_version = PyLong_FromUnsignedLongLong((uint32_t)(object->message_format_version));
11002 0 : return py_message_format_version;
11003 : }
11004 :
11005 0 : static int py_NETLOGON_DB_CHANGE_set_message_format_version(PyObject *py_obj, PyObject *value, void *closure)
11006 : {
11007 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
11008 0 : if (value == NULL) {
11009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->message_format_version");
11010 0 : return -1;
11011 : }
11012 : {
11013 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_format_version));
11014 0 : if (PyLong_Check(value)) {
11015 0 : unsigned long long test_var;
11016 0 : test_var = PyLong_AsUnsignedLongLong(value);
11017 0 : if (PyErr_Occurred() != NULL) {
11018 0 : return -1;
11019 : }
11020 0 : if (test_var > uint_max) {
11021 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11022 : PyLong_Type.tp_name, uint_max, test_var);
11023 0 : return -1;
11024 : }
11025 0 : object->message_format_version = test_var;
11026 : } else {
11027 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11028 : PyLong_Type.tp_name);
11029 0 : return -1;
11030 : }
11031 : }
11032 0 : return 0;
11033 : }
11034 :
11035 0 : static PyObject *py_NETLOGON_DB_CHANGE_get_message_token(PyObject *obj, void *closure)
11036 : {
11037 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(obj);
11038 0 : PyObject *py_message_token;
11039 0 : py_message_token = PyLong_FromUnsignedLongLong((uint32_t)(object->message_token));
11040 0 : return py_message_token;
11041 : }
11042 :
11043 0 : static int py_NETLOGON_DB_CHANGE_set_message_token(PyObject *py_obj, PyObject *value, void *closure)
11044 : {
11045 0 : struct NETLOGON_DB_CHANGE *object = pytalloc_get_ptr(py_obj);
11046 0 : if (value == NULL) {
11047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->message_token");
11048 0 : return -1;
11049 : }
11050 : {
11051 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_token));
11052 0 : if (PyLong_Check(value)) {
11053 0 : unsigned long long test_var;
11054 0 : test_var = PyLong_AsUnsignedLongLong(value);
11055 0 : if (PyErr_Occurred() != NULL) {
11056 0 : return -1;
11057 : }
11058 0 : if (test_var > uint_max) {
11059 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11060 : PyLong_Type.tp_name, uint_max, test_var);
11061 0 : return -1;
11062 : }
11063 0 : object->message_token = test_var;
11064 : } else {
11065 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11066 : PyLong_Type.tp_name);
11067 0 : return -1;
11068 : }
11069 : }
11070 0 : return 0;
11071 : }
11072 :
11073 : static PyGetSetDef py_NETLOGON_DB_CHANGE_getsetters[] = {
11074 : {
11075 : .name = discard_const_p(char, "serial_lo"),
11076 : .get = py_NETLOGON_DB_CHANGE_get_serial_lo,
11077 : .set = py_NETLOGON_DB_CHANGE_set_serial_lo,
11078 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11079 : },
11080 : {
11081 : .name = discard_const_p(char, "timestamp"),
11082 : .get = py_NETLOGON_DB_CHANGE_get_timestamp,
11083 : .set = py_NETLOGON_DB_CHANGE_set_timestamp,
11084 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
11085 : },
11086 : {
11087 : .name = discard_const_p(char, "pulse"),
11088 : .get = py_NETLOGON_DB_CHANGE_get_pulse,
11089 : .set = py_NETLOGON_DB_CHANGE_set_pulse,
11090 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11091 : },
11092 : {
11093 : .name = discard_const_p(char, "random"),
11094 : .get = py_NETLOGON_DB_CHANGE_get_random,
11095 : .set = py_NETLOGON_DB_CHANGE_set_random,
11096 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11097 : },
11098 : {
11099 : .name = discard_const_p(char, "pdc_name"),
11100 : .get = py_NETLOGON_DB_CHANGE_get_pdc_name,
11101 : .set = py_NETLOGON_DB_CHANGE_set_pdc_name,
11102 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11103 : },
11104 : {
11105 : .name = discard_const_p(char, "domain"),
11106 : .get = py_NETLOGON_DB_CHANGE_get_domain,
11107 : .set = py_NETLOGON_DB_CHANGE_set_domain,
11108 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11109 : },
11110 : {
11111 : .name = discard_const_p(char, "_pad"),
11112 : .get = py_NETLOGON_DB_CHANGE_get__pad,
11113 : .set = py_NETLOGON_DB_CHANGE_set__pad,
11114 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
11115 : },
11116 : {
11117 : .name = discard_const_p(char, "unicode_pdc_name"),
11118 : .get = py_NETLOGON_DB_CHANGE_get_unicode_pdc_name,
11119 : .set = py_NETLOGON_DB_CHANGE_set_unicode_pdc_name,
11120 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11121 : },
11122 : {
11123 : .name = discard_const_p(char, "unicode_domain"),
11124 : .get = py_NETLOGON_DB_CHANGE_get_unicode_domain,
11125 : .set = py_NETLOGON_DB_CHANGE_set_unicode_domain,
11126 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11127 : },
11128 : {
11129 : .name = discard_const_p(char, "db_count"),
11130 : .get = py_NETLOGON_DB_CHANGE_get_db_count,
11131 : .set = py_NETLOGON_DB_CHANGE_set_db_count,
11132 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11133 : },
11134 : {
11135 : .name = discard_const_p(char, "dbchange"),
11136 : .get = py_NETLOGON_DB_CHANGE_get_dbchange,
11137 : .set = py_NETLOGON_DB_CHANGE_set_dbchange,
11138 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_db_change_info")
11139 : },
11140 : {
11141 : .name = discard_const_p(char, "sid_size"),
11142 : .get = py_NETLOGON_DB_CHANGE_get_sid_size,
11143 : .set = py_NETLOGON_DB_CHANGE_set_sid_size,
11144 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11145 : },
11146 : {
11147 : .name = discard_const_p(char, "sid"),
11148 : .get = py_NETLOGON_DB_CHANGE_get_sid,
11149 : .set = py_NETLOGON_DB_CHANGE_set_sid,
11150 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
11151 : },
11152 : {
11153 : .name = discard_const_p(char, "message_format_version"),
11154 : .get = py_NETLOGON_DB_CHANGE_get_message_format_version,
11155 : .set = py_NETLOGON_DB_CHANGE_set_message_format_version,
11156 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11157 : },
11158 : {
11159 : .name = discard_const_p(char, "message_token"),
11160 : .get = py_NETLOGON_DB_CHANGE_get_message_token,
11161 : .set = py_NETLOGON_DB_CHANGE_set_message_token,
11162 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11163 : },
11164 : { .name = NULL }
11165 : };
11166 :
11167 0 : static PyObject *py_NETLOGON_DB_CHANGE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11168 : {
11169 0 : return pytalloc_new(struct NETLOGON_DB_CHANGE, type);
11170 : }
11171 :
11172 :
11173 : static PyTypeObject NETLOGON_DB_CHANGE_Type = {
11174 : PyVarObject_HEAD_INIT(NULL, 0)
11175 : .tp_name = "nbt.NETLOGON_DB_CHANGE",
11176 : .tp_getset = py_NETLOGON_DB_CHANGE_getsetters,
11177 : .tp_methods = NULL,
11178 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11179 : .tp_new = py_NETLOGON_DB_CHANGE_new,
11180 : };
11181 :
11182 0 : static PyObject *py_import_nbt_netlogon_request(TALLOC_CTX *mem_ctx, int level, union nbt_netlogon_request *in)
11183 : {
11184 0 : PyObject *ret;
11185 :
11186 0 : switch (level) {
11187 0 : case LOGON_REQUEST:
11188 0 : ret = pytalloc_reference_ex(&NETLOGON_LOGON_REQUEST_Type, mem_ctx, &in->logon0);
11189 0 : return ret;
11190 :
11191 0 : case LOGON_SAM_LOGON_REQUEST:
11192 0 : ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_REQUEST_Type, mem_ctx, &in->logon);
11193 0 : return ret;
11194 :
11195 0 : case LOGON_PRIMARY_QUERY:
11196 0 : ret = pytalloc_reference_ex(&nbt_netlogon_query_for_pdc_Type, mem_ctx, &in->pdc);
11197 0 : return ret;
11198 :
11199 0 : case NETLOGON_ANNOUNCE_UAS:
11200 0 : ret = pytalloc_reference_ex(&NETLOGON_DB_CHANGE_Type, mem_ctx, &in->uas);
11201 0 : return ret;
11202 :
11203 : }
11204 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11205 0 : return NULL;
11206 : }
11207 :
11208 0 : static union nbt_netlogon_request *py_export_nbt_netlogon_request(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11209 : {
11210 0 : union nbt_netlogon_request *ret = talloc_zero(mem_ctx, union nbt_netlogon_request);
11211 0 : switch (level) {
11212 0 : case LOGON_REQUEST:
11213 0 : if (in == NULL) {
11214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->logon0");
11215 0 : talloc_free(ret); return NULL;
11216 : }
11217 0 : PY_CHECK_TYPE(&NETLOGON_LOGON_REQUEST_Type, in, talloc_free(ret); return NULL;);
11218 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11219 0 : PyErr_NoMemory();
11220 0 : talloc_free(ret); return NULL;
11221 : }
11222 0 : ret->logon0 = *(struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(in);
11223 0 : break;
11224 :
11225 0 : case LOGON_SAM_LOGON_REQUEST:
11226 0 : if (in == NULL) {
11227 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->logon");
11228 0 : talloc_free(ret); return NULL;
11229 : }
11230 0 : PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_REQUEST_Type, in, talloc_free(ret); return NULL;);
11231 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11232 0 : PyErr_NoMemory();
11233 0 : talloc_free(ret); return NULL;
11234 : }
11235 0 : ret->logon = *(struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(in);
11236 0 : break;
11237 :
11238 0 : case LOGON_PRIMARY_QUERY:
11239 0 : if (in == NULL) {
11240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->pdc");
11241 0 : talloc_free(ret); return NULL;
11242 : }
11243 0 : PY_CHECK_TYPE(&nbt_netlogon_query_for_pdc_Type, in, talloc_free(ret); return NULL;);
11244 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11245 0 : PyErr_NoMemory();
11246 0 : talloc_free(ret); return NULL;
11247 : }
11248 0 : ret->pdc = *(struct nbt_netlogon_query_for_pdc *)pytalloc_get_ptr(in);
11249 0 : break;
11250 :
11251 0 : case NETLOGON_ANNOUNCE_UAS:
11252 0 : if (in == NULL) {
11253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->uas");
11254 0 : talloc_free(ret); return NULL;
11255 : }
11256 0 : PY_CHECK_TYPE(&NETLOGON_DB_CHANGE_Type, in, talloc_free(ret); return NULL;);
11257 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11258 0 : PyErr_NoMemory();
11259 0 : talloc_free(ret); return NULL;
11260 : }
11261 0 : ret->uas = *(struct NETLOGON_DB_CHANGE *)pytalloc_get_ptr(in);
11262 0 : break;
11263 :
11264 0 : default:
11265 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
11266 0 : talloc_free(ret);
11267 0 : ret = NULL;
11268 : }
11269 :
11270 0 : return ret;
11271 : }
11272 :
11273 0 : static PyObject *py_nbt_netlogon_request_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11274 : {
11275 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11276 0 : PyObject *mem_ctx_obj = NULL;
11277 0 : TALLOC_CTX *mem_ctx = NULL;
11278 0 : int level = 0;
11279 0 : PyObject *in_obj = NULL;
11280 0 : union nbt_netlogon_request *in = NULL;
11281 :
11282 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11283 : discard_const_p(char *, kwnames),
11284 : &mem_ctx_obj,
11285 : &level,
11286 : &in_obj)) {
11287 0 : return NULL;
11288 : }
11289 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11290 0 : if (mem_ctx == NULL) {
11291 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11292 0 : return NULL;
11293 : }
11294 0 : in = (union nbt_netlogon_request *)pytalloc_get_ptr(in_obj);
11295 0 : if (in == NULL) {
11296 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_netlogon_request!");
11297 0 : return NULL;
11298 : }
11299 :
11300 0 : return py_import_nbt_netlogon_request(mem_ctx, level, in);
11301 : }
11302 :
11303 0 : static PyObject *py_nbt_netlogon_request_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11304 : {
11305 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11306 0 : PyObject *mem_ctx_obj = NULL;
11307 0 : TALLOC_CTX *mem_ctx = NULL;
11308 0 : int level = 0;
11309 0 : PyObject *in = NULL;
11310 0 : union nbt_netlogon_request *out = NULL;
11311 :
11312 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11313 : discard_const_p(char *, kwnames),
11314 : &mem_ctx_obj,
11315 : &level,
11316 : &in)) {
11317 0 : return NULL;
11318 : }
11319 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11320 0 : if (mem_ctx == NULL) {
11321 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11322 0 : return NULL;
11323 : }
11324 :
11325 0 : out = py_export_nbt_netlogon_request(mem_ctx, level, in);
11326 0 : if (out == NULL) {
11327 0 : return NULL;
11328 : }
11329 :
11330 0 : return pytalloc_GenericObject_reference(out);
11331 : }
11332 :
11333 : static PyMethodDef py_nbt_netlogon_request_methods[] = {
11334 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_request_import),
11335 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11336 : "T.__import__(mem_ctx, level, in) => ret." },
11337 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_netlogon_request_export),
11338 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11339 : "T.__export__(mem_ctx, level, in) => ret." },
11340 : { NULL, NULL, 0, NULL }
11341 : };
11342 :
11343 0 : static PyObject *py_nbt_netlogon_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11344 : {
11345 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
11346 0 : return NULL;
11347 : }
11348 :
11349 :
11350 : static PyTypeObject nbt_netlogon_request_Type = {
11351 : PyVarObject_HEAD_INIT(NULL, 0)
11352 : .tp_name = "nbt.netlogon_request",
11353 : .tp_getset = NULL,
11354 : .tp_methods = py_nbt_netlogon_request_methods,
11355 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11356 : .tp_new = py_nbt_netlogon_request_new,
11357 : };
11358 :
11359 :
11360 0 : static PyObject *py_nbt_netlogon_packet_get_command(PyObject *obj, void *closure)
11361 : {
11362 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(obj);
11363 0 : PyObject *py_command;
11364 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
11365 0 : return py_command;
11366 : }
11367 :
11368 0 : static int py_nbt_netlogon_packet_set_command(PyObject *py_obj, PyObject *value, void *closure)
11369 : {
11370 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(py_obj);
11371 0 : if (value == NULL) {
11372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
11373 0 : return -1;
11374 : }
11375 : {
11376 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
11377 0 : if (PyLong_Check(value)) {
11378 0 : unsigned long long test_var;
11379 0 : test_var = PyLong_AsUnsignedLongLong(value);
11380 0 : if (PyErr_Occurred() != NULL) {
11381 0 : return -1;
11382 : }
11383 0 : if (test_var > uint_max) {
11384 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11385 : PyLong_Type.tp_name, uint_max, test_var);
11386 0 : return -1;
11387 : }
11388 0 : object->command = test_var;
11389 : } else {
11390 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11391 : PyLong_Type.tp_name);
11392 0 : return -1;
11393 : }
11394 : }
11395 0 : return 0;
11396 : }
11397 :
11398 0 : static PyObject *py_nbt_netlogon_packet_get_req(PyObject *obj, void *closure)
11399 : {
11400 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(obj);
11401 0 : PyObject *py_req;
11402 0 : py_req = pyrpc_import_union(&nbt_netlogon_request_Type, pytalloc_get_mem_ctx(obj), object->command, &object->req, "union nbt_netlogon_request");
11403 0 : if (py_req == NULL) {
11404 0 : return NULL;
11405 : }
11406 0 : return py_req;
11407 : }
11408 :
11409 0 : static int py_nbt_netlogon_packet_set_req(PyObject *py_obj, PyObject *value, void *closure)
11410 : {
11411 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(py_obj);
11412 0 : if (value == NULL) {
11413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->req");
11414 0 : return -1;
11415 : }
11416 : {
11417 0 : union nbt_netlogon_request *req_switch_0;
11418 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");
11419 0 : if (req_switch_0 == NULL) {
11420 0 : return -1;
11421 : }
11422 0 : object->req = *req_switch_0;
11423 : }
11424 0 : return 0;
11425 : }
11426 :
11427 : static PyGetSetDef py_nbt_netlogon_packet_getsetters[] = {
11428 : {
11429 : .name = discard_const_p(char, "command"),
11430 : .get = py_nbt_netlogon_packet_get_command,
11431 : .set = py_nbt_netlogon_packet_set_command,
11432 : .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
11433 : },
11434 : {
11435 : .name = discard_const_p(char, "req"),
11436 : .get = py_nbt_netlogon_packet_get_req,
11437 : .set = py_nbt_netlogon_packet_set_req,
11438 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_netlogon_request")
11439 : },
11440 : { .name = NULL }
11441 : };
11442 :
11443 0 : static PyObject *py_nbt_netlogon_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11444 : {
11445 0 : return pytalloc_new(struct nbt_netlogon_packet, type);
11446 : }
11447 :
11448 0 : static PyObject *py_nbt_netlogon_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11449 : {
11450 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(py_obj);
11451 0 : PyObject *ret = NULL;
11452 0 : DATA_BLOB blob;
11453 0 : enum ndr_err_code err;
11454 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11455 0 : if (tmp_ctx == NULL) {
11456 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11457 0 : return NULL;
11458 : }
11459 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet);
11460 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11461 0 : TALLOC_FREE(tmp_ctx);
11462 0 : PyErr_SetNdrError(err);
11463 0 : return NULL;
11464 : }
11465 :
11466 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11467 0 : TALLOC_FREE(tmp_ctx);
11468 0 : return ret;
11469 : }
11470 :
11471 0 : static PyObject *py_nbt_netlogon_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11472 : {
11473 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(py_obj);
11474 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11475 0 : Py_ssize_t blob_length = 0;
11476 0 : enum ndr_err_code err;
11477 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11478 0 : PyObject *allow_remaining_obj = NULL;
11479 0 : bool allow_remaining = false;
11480 :
11481 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11482 : discard_const_p(char *, kwnames),
11483 : &blob.data, &blob_length,
11484 : &allow_remaining_obj)) {
11485 0 : return NULL;
11486 : }
11487 0 : blob.length = blob_length;
11488 :
11489 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11490 0 : allow_remaining = true;
11491 : }
11492 :
11493 0 : if (allow_remaining) {
11494 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
11495 : } else {
11496 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);
11497 : }
11498 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11499 0 : PyErr_SetNdrError(err);
11500 0 : return NULL;
11501 : }
11502 :
11503 0 : Py_RETURN_NONE;
11504 : }
11505 :
11506 0 : static PyObject *py_nbt_netlogon_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11507 : {
11508 0 : struct nbt_netlogon_packet *object = pytalloc_get_ptr(py_obj);
11509 0 : PyObject *ret;
11510 0 : char *retstr;
11511 :
11512 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);
11513 0 : ret = PyUnicode_FromString(retstr);
11514 0 : talloc_free(retstr);
11515 :
11516 0 : return ret;
11517 : }
11518 :
11519 : static PyMethodDef py_nbt_netlogon_packet_methods[] = {
11520 : { "__ndr_pack__", (PyCFunction)py_nbt_netlogon_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11521 : { "__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" },
11522 : { "__ndr_print__", (PyCFunction)py_nbt_netlogon_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11523 : { NULL, NULL, 0, NULL }
11524 : };
11525 :
11526 :
11527 : static PyTypeObject nbt_netlogon_packet_Type = {
11528 : PyVarObject_HEAD_INIT(NULL, 0)
11529 : .tp_name = "nbt.netlogon_packet",
11530 : .tp_getset = py_nbt_netlogon_packet_getsetters,
11531 : .tp_methods = py_nbt_netlogon_packet_methods,
11532 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11533 : .tp_new = py_nbt_netlogon_packet_new,
11534 : };
11535 :
11536 :
11537 0 : static PyObject *py_nbt_browse_host_announcement_get_UpdateCount(PyObject *obj, void *closure)
11538 : {
11539 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11540 0 : PyObject *py_UpdateCount;
11541 0 : py_UpdateCount = PyLong_FromLong((uint16_t)(object->UpdateCount));
11542 0 : return py_UpdateCount;
11543 : }
11544 :
11545 0 : static int py_nbt_browse_host_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
11546 : {
11547 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11548 0 : if (value == NULL) {
11549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->UpdateCount");
11550 0 : return -1;
11551 : }
11552 : {
11553 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
11554 0 : if (PyLong_Check(value)) {
11555 0 : unsigned long long test_var;
11556 0 : test_var = PyLong_AsUnsignedLongLong(value);
11557 0 : if (PyErr_Occurred() != NULL) {
11558 0 : return -1;
11559 : }
11560 0 : if (test_var > uint_max) {
11561 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11562 : PyLong_Type.tp_name, uint_max, test_var);
11563 0 : return -1;
11564 : }
11565 0 : object->UpdateCount = test_var;
11566 : } else {
11567 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11568 : PyLong_Type.tp_name);
11569 0 : return -1;
11570 : }
11571 : }
11572 0 : return 0;
11573 : }
11574 :
11575 0 : static PyObject *py_nbt_browse_host_announcement_get_Periodicity(PyObject *obj, void *closure)
11576 : {
11577 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11578 0 : PyObject *py_Periodicity;
11579 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)(object->Periodicity));
11580 0 : return py_Periodicity;
11581 : }
11582 :
11583 0 : static int py_nbt_browse_host_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
11584 : {
11585 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11586 0 : if (value == NULL) {
11587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Periodicity");
11588 0 : return -1;
11589 : }
11590 : {
11591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
11592 0 : if (PyLong_Check(value)) {
11593 0 : unsigned long long test_var;
11594 0 : test_var = PyLong_AsUnsignedLongLong(value);
11595 0 : if (PyErr_Occurred() != NULL) {
11596 0 : return -1;
11597 : }
11598 0 : if (test_var > uint_max) {
11599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11600 : PyLong_Type.tp_name, uint_max, test_var);
11601 0 : return -1;
11602 : }
11603 0 : object->Periodicity = test_var;
11604 : } else {
11605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11606 : PyLong_Type.tp_name);
11607 0 : return -1;
11608 : }
11609 : }
11610 0 : return 0;
11611 : }
11612 :
11613 0 : static PyObject *py_nbt_browse_host_announcement_get_ServerName(PyObject *obj, void *closure)
11614 : {
11615 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11616 0 : PyObject *py_ServerName;
11617 0 : if (object->ServerName == NULL) {
11618 0 : py_ServerName = Py_None;
11619 0 : Py_INCREF(py_ServerName);
11620 : } else {
11621 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
11622 : }
11623 0 : return py_ServerName;
11624 : }
11625 :
11626 0 : static int py_nbt_browse_host_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
11627 : {
11628 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11629 0 : if (value == NULL) {
11630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerName");
11631 0 : return -1;
11632 : }
11633 : {
11634 0 : const char *test_str;
11635 0 : const char *talloc_str;
11636 0 : PyObject *unicode = NULL;
11637 0 : if (PyUnicode_Check(value)) {
11638 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11639 0 : if (unicode == NULL) {
11640 0 : return -1;
11641 : }
11642 0 : test_str = PyBytes_AS_STRING(unicode);
11643 0 : } else if (PyBytes_Check(value)) {
11644 0 : test_str = PyBytes_AS_STRING(value);
11645 : } else {
11646 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11647 0 : return -1;
11648 : }
11649 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11650 0 : if (unicode != NULL) {
11651 0 : Py_DECREF(unicode);
11652 : }
11653 0 : if (talloc_str == NULL) {
11654 0 : PyErr_NoMemory();
11655 0 : return -1;
11656 : }
11657 0 : object->ServerName = talloc_str;
11658 : }
11659 0 : return 0;
11660 : }
11661 :
11662 0 : static PyObject *py_nbt_browse_host_announcement_get_OSMajor(PyObject *obj, void *closure)
11663 : {
11664 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11665 0 : PyObject *py_OSMajor;
11666 0 : py_OSMajor = PyLong_FromLong((uint16_t)(object->OSMajor));
11667 0 : return py_OSMajor;
11668 : }
11669 :
11670 0 : static int py_nbt_browse_host_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
11671 : {
11672 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11673 0 : if (value == NULL) {
11674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->OSMajor");
11675 0 : return -1;
11676 : }
11677 : {
11678 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
11679 0 : if (PyLong_Check(value)) {
11680 0 : unsigned long long test_var;
11681 0 : test_var = PyLong_AsUnsignedLongLong(value);
11682 0 : if (PyErr_Occurred() != NULL) {
11683 0 : return -1;
11684 : }
11685 0 : if (test_var > uint_max) {
11686 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11687 : PyLong_Type.tp_name, uint_max, test_var);
11688 0 : return -1;
11689 : }
11690 0 : object->OSMajor = test_var;
11691 : } else {
11692 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11693 : PyLong_Type.tp_name);
11694 0 : return -1;
11695 : }
11696 : }
11697 0 : return 0;
11698 : }
11699 :
11700 0 : static PyObject *py_nbt_browse_host_announcement_get_OSMinor(PyObject *obj, void *closure)
11701 : {
11702 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11703 0 : PyObject *py_OSMinor;
11704 0 : py_OSMinor = PyLong_FromLong((uint16_t)(object->OSMinor));
11705 0 : return py_OSMinor;
11706 : }
11707 :
11708 0 : static int py_nbt_browse_host_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
11709 : {
11710 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11711 0 : if (value == NULL) {
11712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->OSMinor");
11713 0 : return -1;
11714 : }
11715 : {
11716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
11717 0 : if (PyLong_Check(value)) {
11718 0 : unsigned long long test_var;
11719 0 : test_var = PyLong_AsUnsignedLongLong(value);
11720 0 : if (PyErr_Occurred() != NULL) {
11721 0 : return -1;
11722 : }
11723 0 : if (test_var > uint_max) {
11724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11725 : PyLong_Type.tp_name, uint_max, test_var);
11726 0 : return -1;
11727 : }
11728 0 : object->OSMinor = test_var;
11729 : } else {
11730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11731 : PyLong_Type.tp_name);
11732 0 : return -1;
11733 : }
11734 : }
11735 0 : return 0;
11736 : }
11737 :
11738 0 : static PyObject *py_nbt_browse_host_announcement_get_ServerType(PyObject *obj, void *closure)
11739 : {
11740 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11741 0 : PyObject *py_ServerType;
11742 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)(object->ServerType));
11743 0 : return py_ServerType;
11744 : }
11745 :
11746 0 : static int py_nbt_browse_host_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
11747 : {
11748 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11749 0 : if (value == NULL) {
11750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerType");
11751 0 : return -1;
11752 : }
11753 : {
11754 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
11755 0 : if (PyLong_Check(value)) {
11756 0 : unsigned long long test_var;
11757 0 : test_var = PyLong_AsUnsignedLongLong(value);
11758 0 : if (PyErr_Occurred() != NULL) {
11759 0 : return -1;
11760 : }
11761 0 : if (test_var > uint_max) {
11762 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11763 : PyLong_Type.tp_name, uint_max, test_var);
11764 0 : return -1;
11765 : }
11766 0 : object->ServerType = test_var;
11767 : } else {
11768 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11769 : PyLong_Type.tp_name);
11770 0 : return -1;
11771 : }
11772 : }
11773 0 : return 0;
11774 : }
11775 :
11776 0 : static PyObject *py_nbt_browse_host_announcement_get_BroMajorVer(PyObject *obj, void *closure)
11777 : {
11778 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11779 0 : PyObject *py_BroMajorVer;
11780 0 : py_BroMajorVer = PyLong_FromLong((uint16_t)(object->BroMajorVer));
11781 0 : return py_BroMajorVer;
11782 : }
11783 :
11784 0 : static int py_nbt_browse_host_announcement_set_BroMajorVer(PyObject *py_obj, PyObject *value, void *closure)
11785 : {
11786 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11787 0 : if (value == NULL) {
11788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BroMajorVer");
11789 0 : return -1;
11790 : }
11791 : {
11792 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMajorVer));
11793 0 : if (PyLong_Check(value)) {
11794 0 : unsigned long long test_var;
11795 0 : test_var = PyLong_AsUnsignedLongLong(value);
11796 0 : if (PyErr_Occurred() != NULL) {
11797 0 : return -1;
11798 : }
11799 0 : if (test_var > uint_max) {
11800 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11801 : PyLong_Type.tp_name, uint_max, test_var);
11802 0 : return -1;
11803 : }
11804 0 : object->BroMajorVer = test_var;
11805 : } else {
11806 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11807 : PyLong_Type.tp_name);
11808 0 : return -1;
11809 : }
11810 : }
11811 0 : return 0;
11812 : }
11813 :
11814 0 : static PyObject *py_nbt_browse_host_announcement_get_BroMinorVer(PyObject *obj, void *closure)
11815 : {
11816 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11817 0 : PyObject *py_BroMinorVer;
11818 0 : py_BroMinorVer = PyLong_FromLong((uint16_t)(object->BroMinorVer));
11819 0 : return py_BroMinorVer;
11820 : }
11821 :
11822 0 : static int py_nbt_browse_host_announcement_set_BroMinorVer(PyObject *py_obj, PyObject *value, void *closure)
11823 : {
11824 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11825 0 : if (value == NULL) {
11826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BroMinorVer");
11827 0 : return -1;
11828 : }
11829 : {
11830 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMinorVer));
11831 0 : if (PyLong_Check(value)) {
11832 0 : unsigned long long test_var;
11833 0 : test_var = PyLong_AsUnsignedLongLong(value);
11834 0 : if (PyErr_Occurred() != NULL) {
11835 0 : return -1;
11836 : }
11837 0 : if (test_var > uint_max) {
11838 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11839 : PyLong_Type.tp_name, uint_max, test_var);
11840 0 : return -1;
11841 : }
11842 0 : object->BroMinorVer = test_var;
11843 : } else {
11844 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11845 : PyLong_Type.tp_name);
11846 0 : return -1;
11847 : }
11848 : }
11849 0 : return 0;
11850 : }
11851 :
11852 0 : static PyObject *py_nbt_browse_host_announcement_get_Signature(PyObject *obj, void *closure)
11853 : {
11854 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11855 0 : PyObject *py_Signature;
11856 0 : py_Signature = PyLong_FromLong((uint16_t)(object->Signature));
11857 0 : return py_Signature;
11858 : }
11859 :
11860 0 : static int py_nbt_browse_host_announcement_set_Signature(PyObject *py_obj, PyObject *value, void *closure)
11861 : {
11862 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11863 0 : if (value == NULL) {
11864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Signature");
11865 0 : return -1;
11866 : }
11867 : {
11868 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Signature));
11869 0 : if (PyLong_Check(value)) {
11870 0 : unsigned long long test_var;
11871 0 : test_var = PyLong_AsUnsignedLongLong(value);
11872 0 : if (PyErr_Occurred() != NULL) {
11873 0 : return -1;
11874 : }
11875 0 : if (test_var > uint_max) {
11876 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11877 : PyLong_Type.tp_name, uint_max, test_var);
11878 0 : return -1;
11879 : }
11880 0 : object->Signature = test_var;
11881 : } else {
11882 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11883 : PyLong_Type.tp_name);
11884 0 : return -1;
11885 : }
11886 : }
11887 0 : return 0;
11888 : }
11889 :
11890 0 : static PyObject *py_nbt_browse_host_announcement_get_Comment(PyObject *obj, void *closure)
11891 : {
11892 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(obj);
11893 0 : PyObject *py_Comment;
11894 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
11895 0 : return py_Comment;
11896 : }
11897 :
11898 0 : static int py_nbt_browse_host_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
11899 : {
11900 0 : struct nbt_browse_host_announcement *object = pytalloc_get_ptr(py_obj);
11901 0 : if (value == NULL) {
11902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Comment");
11903 0 : return -1;
11904 : }
11905 : {
11906 0 : const char *test_str;
11907 0 : const char *talloc_str;
11908 0 : PyObject *unicode = NULL;
11909 0 : if (PyUnicode_Check(value)) {
11910 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11911 0 : if (unicode == NULL) {
11912 0 : return -1;
11913 : }
11914 0 : test_str = PyBytes_AS_STRING(unicode);
11915 0 : } else if (PyBytes_Check(value)) {
11916 0 : test_str = PyBytes_AS_STRING(value);
11917 : } else {
11918 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11919 0 : return -1;
11920 : }
11921 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11922 0 : if (unicode != NULL) {
11923 0 : Py_DECREF(unicode);
11924 : }
11925 0 : if (talloc_str == NULL) {
11926 0 : PyErr_NoMemory();
11927 0 : return -1;
11928 : }
11929 0 : object->Comment = talloc_str;
11930 : }
11931 0 : return 0;
11932 : }
11933 :
11934 : static PyGetSetDef py_nbt_browse_host_announcement_getsetters[] = {
11935 : {
11936 : .name = discard_const_p(char, "UpdateCount"),
11937 : .get = py_nbt_browse_host_announcement_get_UpdateCount,
11938 : .set = py_nbt_browse_host_announcement_set_UpdateCount,
11939 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11940 : },
11941 : {
11942 : .name = discard_const_p(char, "Periodicity"),
11943 : .get = py_nbt_browse_host_announcement_get_Periodicity,
11944 : .set = py_nbt_browse_host_announcement_set_Periodicity,
11945 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11946 : },
11947 : {
11948 : .name = discard_const_p(char, "ServerName"),
11949 : .get = py_nbt_browse_host_announcement_get_ServerName,
11950 : .set = py_nbt_browse_host_announcement_set_ServerName,
11951 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11952 : },
11953 : {
11954 : .name = discard_const_p(char, "OSMajor"),
11955 : .get = py_nbt_browse_host_announcement_get_OSMajor,
11956 : .set = py_nbt_browse_host_announcement_set_OSMajor,
11957 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11958 : },
11959 : {
11960 : .name = discard_const_p(char, "OSMinor"),
11961 : .get = py_nbt_browse_host_announcement_get_OSMinor,
11962 : .set = py_nbt_browse_host_announcement_set_OSMinor,
11963 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11964 : },
11965 : {
11966 : .name = discard_const_p(char, "ServerType"),
11967 : .get = py_nbt_browse_host_announcement_get_ServerType,
11968 : .set = py_nbt_browse_host_announcement_set_ServerType,
11969 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
11970 : },
11971 : {
11972 : .name = discard_const_p(char, "BroMajorVer"),
11973 : .get = py_nbt_browse_host_announcement_get_BroMajorVer,
11974 : .set = py_nbt_browse_host_announcement_set_BroMajorVer,
11975 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11976 : },
11977 : {
11978 : .name = discard_const_p(char, "BroMinorVer"),
11979 : .get = py_nbt_browse_host_announcement_get_BroMinorVer,
11980 : .set = py_nbt_browse_host_announcement_set_BroMinorVer,
11981 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11982 : },
11983 : {
11984 : .name = discard_const_p(char, "Signature"),
11985 : .get = py_nbt_browse_host_announcement_get_Signature,
11986 : .set = py_nbt_browse_host_announcement_set_Signature,
11987 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11988 : },
11989 : {
11990 : .name = discard_const_p(char, "Comment"),
11991 : .get = py_nbt_browse_host_announcement_get_Comment,
11992 : .set = py_nbt_browse_host_announcement_set_Comment,
11993 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
11994 : },
11995 : { .name = NULL }
11996 : };
11997 :
11998 0 : static PyObject *py_nbt_browse_host_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11999 : {
12000 0 : return pytalloc_new(struct nbt_browse_host_announcement, type);
12001 : }
12002 :
12003 :
12004 : static PyTypeObject nbt_browse_host_announcement_Type = {
12005 : PyVarObject_HEAD_INIT(NULL, 0)
12006 : .tp_name = "nbt.browse_host_announcement",
12007 : .tp_getset = py_nbt_browse_host_announcement_getsetters,
12008 : .tp_methods = NULL,
12009 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12010 : .tp_new = py_nbt_browse_host_announcement_new,
12011 : };
12012 :
12013 :
12014 0 : static PyObject *py_nbt_browse_announcement_request_get_Unused(PyObject *obj, void *closure)
12015 : {
12016 0 : struct nbt_browse_announcement_request *object = pytalloc_get_ptr(obj);
12017 0 : PyObject *py_Unused;
12018 0 : py_Unused = PyLong_FromLong((uint16_t)(object->Unused));
12019 0 : return py_Unused;
12020 : }
12021 :
12022 0 : static int py_nbt_browse_announcement_request_set_Unused(PyObject *py_obj, PyObject *value, void *closure)
12023 : {
12024 0 : struct nbt_browse_announcement_request *object = pytalloc_get_ptr(py_obj);
12025 0 : if (value == NULL) {
12026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Unused");
12027 0 : return -1;
12028 : }
12029 : {
12030 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Unused));
12031 0 : if (PyLong_Check(value)) {
12032 0 : unsigned long long test_var;
12033 0 : test_var = PyLong_AsUnsignedLongLong(value);
12034 0 : if (PyErr_Occurred() != NULL) {
12035 0 : return -1;
12036 : }
12037 0 : if (test_var > uint_max) {
12038 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12039 : PyLong_Type.tp_name, uint_max, test_var);
12040 0 : return -1;
12041 : }
12042 0 : object->Unused = test_var;
12043 : } else {
12044 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12045 : PyLong_Type.tp_name);
12046 0 : return -1;
12047 : }
12048 : }
12049 0 : return 0;
12050 : }
12051 :
12052 0 : static PyObject *py_nbt_browse_announcement_request_get_ResponseName(PyObject *obj, void *closure)
12053 : {
12054 0 : struct nbt_browse_announcement_request *object = pytalloc_get_ptr(obj);
12055 0 : PyObject *py_ResponseName;
12056 0 : py_ResponseName = PyString_FromStringOrNULL(object->ResponseName);
12057 0 : return py_ResponseName;
12058 : }
12059 :
12060 0 : static int py_nbt_browse_announcement_request_set_ResponseName(PyObject *py_obj, PyObject *value, void *closure)
12061 : {
12062 0 : struct nbt_browse_announcement_request *object = pytalloc_get_ptr(py_obj);
12063 0 : if (value == NULL) {
12064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ResponseName");
12065 0 : return -1;
12066 : }
12067 : {
12068 0 : const char *test_str;
12069 0 : const char *talloc_str;
12070 0 : PyObject *unicode = NULL;
12071 0 : if (PyUnicode_Check(value)) {
12072 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12073 0 : if (unicode == NULL) {
12074 0 : return -1;
12075 : }
12076 0 : test_str = PyBytes_AS_STRING(unicode);
12077 0 : } else if (PyBytes_Check(value)) {
12078 0 : test_str = PyBytes_AS_STRING(value);
12079 : } else {
12080 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12081 0 : return -1;
12082 : }
12083 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12084 0 : if (unicode != NULL) {
12085 0 : Py_DECREF(unicode);
12086 : }
12087 0 : if (talloc_str == NULL) {
12088 0 : PyErr_NoMemory();
12089 0 : return -1;
12090 : }
12091 0 : object->ResponseName = talloc_str;
12092 : }
12093 0 : return 0;
12094 : }
12095 :
12096 : static PyGetSetDef py_nbt_browse_announcement_request_getsetters[] = {
12097 : {
12098 : .name = discard_const_p(char, "Unused"),
12099 : .get = py_nbt_browse_announcement_request_get_Unused,
12100 : .set = py_nbt_browse_announcement_request_set_Unused,
12101 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12102 : },
12103 : {
12104 : .name = discard_const_p(char, "ResponseName"),
12105 : .get = py_nbt_browse_announcement_request_get_ResponseName,
12106 : .set = py_nbt_browse_announcement_request_set_ResponseName,
12107 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12108 : },
12109 : { .name = NULL }
12110 : };
12111 :
12112 0 : static PyObject *py_nbt_browse_announcement_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12113 : {
12114 0 : return pytalloc_new(struct nbt_browse_announcement_request, type);
12115 : }
12116 :
12117 :
12118 : static PyTypeObject nbt_browse_announcement_request_Type = {
12119 : PyVarObject_HEAD_INIT(NULL, 0)
12120 : .tp_name = "nbt.browse_announcement_request",
12121 : .tp_getset = py_nbt_browse_announcement_request_getsetters,
12122 : .tp_methods = NULL,
12123 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12124 : .tp_new = py_nbt_browse_announcement_request_new,
12125 : };
12126 :
12127 :
12128 0 : static PyObject *py_nbt_browse_election_request_get_Version(PyObject *obj, void *closure)
12129 : {
12130 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(obj);
12131 0 : PyObject *py_Version;
12132 0 : py_Version = PyLong_FromLong((uint16_t)(object->Version));
12133 0 : return py_Version;
12134 : }
12135 :
12136 0 : static int py_nbt_browse_election_request_set_Version(PyObject *py_obj, PyObject *value, void *closure)
12137 : {
12138 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(py_obj);
12139 0 : if (value == NULL) {
12140 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Version");
12141 0 : return -1;
12142 : }
12143 : {
12144 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
12145 0 : if (PyLong_Check(value)) {
12146 0 : unsigned long long test_var;
12147 0 : test_var = PyLong_AsUnsignedLongLong(value);
12148 0 : if (PyErr_Occurred() != NULL) {
12149 0 : return -1;
12150 : }
12151 0 : if (test_var > uint_max) {
12152 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12153 : PyLong_Type.tp_name, uint_max, test_var);
12154 0 : return -1;
12155 : }
12156 0 : object->Version = test_var;
12157 : } else {
12158 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12159 : PyLong_Type.tp_name);
12160 0 : return -1;
12161 : }
12162 : }
12163 0 : return 0;
12164 : }
12165 :
12166 0 : static PyObject *py_nbt_browse_election_request_get_Criteria(PyObject *obj, void *closure)
12167 : {
12168 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(obj);
12169 0 : PyObject *py_Criteria;
12170 0 : py_Criteria = PyLong_FromUnsignedLongLong((uint32_t)(object->Criteria));
12171 0 : return py_Criteria;
12172 : }
12173 :
12174 0 : static int py_nbt_browse_election_request_set_Criteria(PyObject *py_obj, PyObject *value, void *closure)
12175 : {
12176 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(py_obj);
12177 0 : if (value == NULL) {
12178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Criteria");
12179 0 : return -1;
12180 : }
12181 : {
12182 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Criteria));
12183 0 : if (PyLong_Check(value)) {
12184 0 : unsigned long long test_var;
12185 0 : test_var = PyLong_AsUnsignedLongLong(value);
12186 0 : if (PyErr_Occurred() != NULL) {
12187 0 : return -1;
12188 : }
12189 0 : if (test_var > uint_max) {
12190 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12191 : PyLong_Type.tp_name, uint_max, test_var);
12192 0 : return -1;
12193 : }
12194 0 : object->Criteria = test_var;
12195 : } else {
12196 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12197 : PyLong_Type.tp_name);
12198 0 : return -1;
12199 : }
12200 : }
12201 0 : return 0;
12202 : }
12203 :
12204 0 : static PyObject *py_nbt_browse_election_request_get_UpTime(PyObject *obj, void *closure)
12205 : {
12206 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(obj);
12207 0 : PyObject *py_UpTime;
12208 0 : py_UpTime = PyLong_FromUnsignedLongLong((uint32_t)(object->UpTime));
12209 0 : return py_UpTime;
12210 : }
12211 :
12212 0 : static int py_nbt_browse_election_request_set_UpTime(PyObject *py_obj, PyObject *value, void *closure)
12213 : {
12214 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(py_obj);
12215 0 : if (value == NULL) {
12216 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->UpTime");
12217 0 : return -1;
12218 : }
12219 : {
12220 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpTime));
12221 0 : if (PyLong_Check(value)) {
12222 0 : unsigned long long test_var;
12223 0 : test_var = PyLong_AsUnsignedLongLong(value);
12224 0 : if (PyErr_Occurred() != NULL) {
12225 0 : return -1;
12226 : }
12227 0 : if (test_var > uint_max) {
12228 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12229 : PyLong_Type.tp_name, uint_max, test_var);
12230 0 : return -1;
12231 : }
12232 0 : object->UpTime = test_var;
12233 : } else {
12234 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12235 : PyLong_Type.tp_name);
12236 0 : return -1;
12237 : }
12238 : }
12239 0 : return 0;
12240 : }
12241 :
12242 0 : static PyObject *py_nbt_browse_election_request_get_Reserved(PyObject *obj, void *closure)
12243 : {
12244 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(obj);
12245 0 : PyObject *py_Reserved;
12246 0 : py_Reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->Reserved));
12247 0 : return py_Reserved;
12248 : }
12249 :
12250 0 : static int py_nbt_browse_election_request_set_Reserved(PyObject *py_obj, PyObject *value, void *closure)
12251 : {
12252 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(py_obj);
12253 0 : if (value == NULL) {
12254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Reserved");
12255 0 : return -1;
12256 : }
12257 : {
12258 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved));
12259 0 : if (PyLong_Check(value)) {
12260 0 : unsigned long long test_var;
12261 0 : test_var = PyLong_AsUnsignedLongLong(value);
12262 0 : if (PyErr_Occurred() != NULL) {
12263 0 : return -1;
12264 : }
12265 0 : if (test_var > uint_max) {
12266 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12267 : PyLong_Type.tp_name, uint_max, test_var);
12268 0 : return -1;
12269 : }
12270 0 : object->Reserved = test_var;
12271 : } else {
12272 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12273 : PyLong_Type.tp_name);
12274 0 : return -1;
12275 : }
12276 : }
12277 0 : return 0;
12278 : }
12279 :
12280 0 : static PyObject *py_nbt_browse_election_request_get_ServerName(PyObject *obj, void *closure)
12281 : {
12282 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(obj);
12283 0 : PyObject *py_ServerName;
12284 0 : py_ServerName = PyString_FromStringOrNULL(object->ServerName);
12285 0 : return py_ServerName;
12286 : }
12287 :
12288 0 : static int py_nbt_browse_election_request_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
12289 : {
12290 0 : struct nbt_browse_election_request *object = pytalloc_get_ptr(py_obj);
12291 0 : if (value == NULL) {
12292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerName");
12293 0 : return -1;
12294 : }
12295 : {
12296 0 : const char *test_str;
12297 0 : const char *talloc_str;
12298 0 : PyObject *unicode = NULL;
12299 0 : if (PyUnicode_Check(value)) {
12300 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12301 0 : if (unicode == NULL) {
12302 0 : return -1;
12303 : }
12304 0 : test_str = PyBytes_AS_STRING(unicode);
12305 0 : } else if (PyBytes_Check(value)) {
12306 0 : test_str = PyBytes_AS_STRING(value);
12307 : } else {
12308 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12309 0 : return -1;
12310 : }
12311 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12312 0 : if (unicode != NULL) {
12313 0 : Py_DECREF(unicode);
12314 : }
12315 0 : if (talloc_str == NULL) {
12316 0 : PyErr_NoMemory();
12317 0 : return -1;
12318 : }
12319 0 : object->ServerName = talloc_str;
12320 : }
12321 0 : return 0;
12322 : }
12323 :
12324 : static PyGetSetDef py_nbt_browse_election_request_getsetters[] = {
12325 : {
12326 : .name = discard_const_p(char, "Version"),
12327 : .get = py_nbt_browse_election_request_get_Version,
12328 : .set = py_nbt_browse_election_request_set_Version,
12329 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12330 : },
12331 : {
12332 : .name = discard_const_p(char, "Criteria"),
12333 : .get = py_nbt_browse_election_request_get_Criteria,
12334 : .set = py_nbt_browse_election_request_set_Criteria,
12335 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12336 : },
12337 : {
12338 : .name = discard_const_p(char, "UpTime"),
12339 : .get = py_nbt_browse_election_request_get_UpTime,
12340 : .set = py_nbt_browse_election_request_set_UpTime,
12341 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12342 : },
12343 : {
12344 : .name = discard_const_p(char, "Reserved"),
12345 : .get = py_nbt_browse_election_request_get_Reserved,
12346 : .set = py_nbt_browse_election_request_set_Reserved,
12347 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12348 : },
12349 : {
12350 : .name = discard_const_p(char, "ServerName"),
12351 : .get = py_nbt_browse_election_request_get_ServerName,
12352 : .set = py_nbt_browse_election_request_set_ServerName,
12353 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12354 : },
12355 : { .name = NULL }
12356 : };
12357 :
12358 0 : static PyObject *py_nbt_browse_election_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12359 : {
12360 0 : return pytalloc_new(struct nbt_browse_election_request, type);
12361 : }
12362 :
12363 :
12364 : static PyTypeObject nbt_browse_election_request_Type = {
12365 : PyVarObject_HEAD_INIT(NULL, 0)
12366 : .tp_name = "nbt.browse_election_request",
12367 : .tp_getset = py_nbt_browse_election_request_getsetters,
12368 : .tp_methods = NULL,
12369 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12370 : .tp_new = py_nbt_browse_election_request_new,
12371 : };
12372 :
12373 :
12374 0 : static PyObject *py_nbt_browse_backup_list_request_get_ReqCount(PyObject *obj, void *closure)
12375 : {
12376 0 : struct nbt_browse_backup_list_request *object = pytalloc_get_ptr(obj);
12377 0 : PyObject *py_ReqCount;
12378 0 : py_ReqCount = PyLong_FromLong((uint16_t)(object->ReqCount));
12379 0 : return py_ReqCount;
12380 : }
12381 :
12382 0 : static int py_nbt_browse_backup_list_request_set_ReqCount(PyObject *py_obj, PyObject *value, void *closure)
12383 : {
12384 0 : struct nbt_browse_backup_list_request *object = pytalloc_get_ptr(py_obj);
12385 0 : if (value == NULL) {
12386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ReqCount");
12387 0 : return -1;
12388 : }
12389 : {
12390 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReqCount));
12391 0 : if (PyLong_Check(value)) {
12392 0 : unsigned long long test_var;
12393 0 : test_var = PyLong_AsUnsignedLongLong(value);
12394 0 : if (PyErr_Occurred() != NULL) {
12395 0 : return -1;
12396 : }
12397 0 : if (test_var > uint_max) {
12398 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12399 : PyLong_Type.tp_name, uint_max, test_var);
12400 0 : return -1;
12401 : }
12402 0 : object->ReqCount = test_var;
12403 : } else {
12404 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12405 : PyLong_Type.tp_name);
12406 0 : return -1;
12407 : }
12408 : }
12409 0 : return 0;
12410 : }
12411 :
12412 0 : static PyObject *py_nbt_browse_backup_list_request_get_Token(PyObject *obj, void *closure)
12413 : {
12414 0 : struct nbt_browse_backup_list_request *object = pytalloc_get_ptr(obj);
12415 0 : PyObject *py_Token;
12416 0 : py_Token = PyLong_FromUnsignedLongLong((uint32_t)(object->Token));
12417 0 : return py_Token;
12418 : }
12419 :
12420 0 : static int py_nbt_browse_backup_list_request_set_Token(PyObject *py_obj, PyObject *value, void *closure)
12421 : {
12422 0 : struct nbt_browse_backup_list_request *object = pytalloc_get_ptr(py_obj);
12423 0 : if (value == NULL) {
12424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Token");
12425 0 : return -1;
12426 : }
12427 : {
12428 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Token));
12429 0 : if (PyLong_Check(value)) {
12430 0 : unsigned long long test_var;
12431 0 : test_var = PyLong_AsUnsignedLongLong(value);
12432 0 : if (PyErr_Occurred() != NULL) {
12433 0 : return -1;
12434 : }
12435 0 : if (test_var > uint_max) {
12436 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12437 : PyLong_Type.tp_name, uint_max, test_var);
12438 0 : return -1;
12439 : }
12440 0 : object->Token = test_var;
12441 : } else {
12442 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12443 : PyLong_Type.tp_name);
12444 0 : return -1;
12445 : }
12446 : }
12447 0 : return 0;
12448 : }
12449 :
12450 : static PyGetSetDef py_nbt_browse_backup_list_request_getsetters[] = {
12451 : {
12452 : .name = discard_const_p(char, "ReqCount"),
12453 : .get = py_nbt_browse_backup_list_request_get_ReqCount,
12454 : .set = py_nbt_browse_backup_list_request_set_ReqCount,
12455 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12456 : },
12457 : {
12458 : .name = discard_const_p(char, "Token"),
12459 : .get = py_nbt_browse_backup_list_request_get_Token,
12460 : .set = py_nbt_browse_backup_list_request_set_Token,
12461 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12462 : },
12463 : { .name = NULL }
12464 : };
12465 :
12466 0 : static PyObject *py_nbt_browse_backup_list_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12467 : {
12468 0 : return pytalloc_new(struct nbt_browse_backup_list_request, type);
12469 : }
12470 :
12471 :
12472 : static PyTypeObject nbt_browse_backup_list_request_Type = {
12473 : PyVarObject_HEAD_INIT(NULL, 0)
12474 : .tp_name = "nbt.browse_backup_list_request",
12475 : .tp_getset = py_nbt_browse_backup_list_request_getsetters,
12476 : .tp_methods = NULL,
12477 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12478 : .tp_new = py_nbt_browse_backup_list_request_new,
12479 : };
12480 :
12481 :
12482 0 : static PyObject *py_nbt_browse_backup_list_response_get_BackupCount(PyObject *obj, void *closure)
12483 : {
12484 0 : struct nbt_browse_backup_list_response *object = pytalloc_get_ptr(obj);
12485 0 : PyObject *py_BackupCount;
12486 0 : py_BackupCount = PyLong_FromLong((uint16_t)(object->BackupCount));
12487 0 : return py_BackupCount;
12488 : }
12489 :
12490 0 : static int py_nbt_browse_backup_list_response_set_BackupCount(PyObject *py_obj, PyObject *value, void *closure)
12491 : {
12492 0 : struct nbt_browse_backup_list_response *object = pytalloc_get_ptr(py_obj);
12493 0 : if (value == NULL) {
12494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BackupCount");
12495 0 : return -1;
12496 : }
12497 : {
12498 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BackupCount));
12499 0 : if (PyLong_Check(value)) {
12500 0 : unsigned long long test_var;
12501 0 : test_var = PyLong_AsUnsignedLongLong(value);
12502 0 : if (PyErr_Occurred() != NULL) {
12503 0 : return -1;
12504 : }
12505 0 : if (test_var > uint_max) {
12506 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12507 : PyLong_Type.tp_name, uint_max, test_var);
12508 0 : return -1;
12509 : }
12510 0 : object->BackupCount = test_var;
12511 : } else {
12512 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12513 : PyLong_Type.tp_name);
12514 0 : return -1;
12515 : }
12516 : }
12517 0 : return 0;
12518 : }
12519 :
12520 0 : static PyObject *py_nbt_browse_backup_list_response_get_Token(PyObject *obj, void *closure)
12521 : {
12522 0 : struct nbt_browse_backup_list_response *object = pytalloc_get_ptr(obj);
12523 0 : PyObject *py_Token;
12524 0 : py_Token = PyLong_FromUnsignedLongLong((uint32_t)(object->Token));
12525 0 : return py_Token;
12526 : }
12527 :
12528 0 : static int py_nbt_browse_backup_list_response_set_Token(PyObject *py_obj, PyObject *value, void *closure)
12529 : {
12530 0 : struct nbt_browse_backup_list_response *object = pytalloc_get_ptr(py_obj);
12531 0 : if (value == NULL) {
12532 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Token");
12533 0 : return -1;
12534 : }
12535 : {
12536 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Token));
12537 0 : if (PyLong_Check(value)) {
12538 0 : unsigned long long test_var;
12539 0 : test_var = PyLong_AsUnsignedLongLong(value);
12540 0 : if (PyErr_Occurred() != NULL) {
12541 0 : return -1;
12542 : }
12543 0 : if (test_var > uint_max) {
12544 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12545 : PyLong_Type.tp_name, uint_max, test_var);
12546 0 : return -1;
12547 : }
12548 0 : object->Token = test_var;
12549 : } else {
12550 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12551 : PyLong_Type.tp_name);
12552 0 : return -1;
12553 : }
12554 : }
12555 0 : return 0;
12556 : }
12557 :
12558 0 : static PyObject *py_nbt_browse_backup_list_response_get_BackupServerList(PyObject *obj, void *closure)
12559 : {
12560 0 : struct nbt_browse_backup_list_response *object = pytalloc_get_ptr(obj);
12561 0 : PyObject *py_BackupServerList;
12562 0 : py_BackupServerList = PyList_New(object->BackupCount);
12563 0 : if (py_BackupServerList == NULL) {
12564 0 : return NULL;
12565 : }
12566 : {
12567 : int BackupServerList_cntr_0;
12568 0 : for (BackupServerList_cntr_0 = 0; BackupServerList_cntr_0 < (object->BackupCount); BackupServerList_cntr_0++) {
12569 0 : PyObject *py_BackupServerList_0;
12570 0 : py_BackupServerList_0 = pytalloc_reference_ex(&nbt_name_Type, object->BackupServerList, &(object->BackupServerList)[BackupServerList_cntr_0]);
12571 0 : PyList_SetItem(py_BackupServerList, BackupServerList_cntr_0, py_BackupServerList_0);
12572 : }
12573 : }
12574 0 : return py_BackupServerList;
12575 : }
12576 :
12577 0 : static int py_nbt_browse_backup_list_response_set_BackupServerList(PyObject *py_obj, PyObject *value, void *closure)
12578 : {
12579 0 : struct nbt_browse_backup_list_response *object = pytalloc_get_ptr(py_obj);
12580 0 : if (value == NULL) {
12581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BackupServerList");
12582 0 : return -1;
12583 : }
12584 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12585 : {
12586 0 : int BackupServerList_cntr_0;
12587 0 : object->BackupServerList = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->BackupServerList, PyList_GET_SIZE(value));
12588 0 : if (!object->BackupServerList) { return -1; }
12589 0 : talloc_set_name_const(object->BackupServerList, "ARRAY: object->BackupServerList");
12590 0 : for (BackupServerList_cntr_0 = 0; BackupServerList_cntr_0 < PyList_GET_SIZE(value); BackupServerList_cntr_0++) {
12591 0 : if (PyList_GET_ITEM(value, BackupServerList_cntr_0) == NULL) {
12592 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->BackupServerList)[BackupServerList_cntr_0]");
12593 0 : return -1;
12594 : }
12595 0 : PY_CHECK_TYPE(&nbt_name_Type, PyList_GET_ITEM(value, BackupServerList_cntr_0), return -1;);
12596 0 : if (talloc_reference(object->BackupServerList, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, BackupServerList_cntr_0))) == NULL) {
12597 0 : PyErr_NoMemory();
12598 0 : return -1;
12599 : }
12600 0 : (object->BackupServerList)[BackupServerList_cntr_0] = *(struct nbt_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, BackupServerList_cntr_0));
12601 : }
12602 : }
12603 0 : return 0;
12604 : }
12605 :
12606 : static PyGetSetDef py_nbt_browse_backup_list_response_getsetters[] = {
12607 : {
12608 : .name = discard_const_p(char, "BackupCount"),
12609 : .get = py_nbt_browse_backup_list_response_get_BackupCount,
12610 : .set = py_nbt_browse_backup_list_response_set_BackupCount,
12611 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12612 : },
12613 : {
12614 : .name = discard_const_p(char, "Token"),
12615 : .get = py_nbt_browse_backup_list_response_get_Token,
12616 : .set = py_nbt_browse_backup_list_response_set_Token,
12617 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12618 : },
12619 : {
12620 : .name = discard_const_p(char, "BackupServerList"),
12621 : .get = py_nbt_browse_backup_list_response_get_BackupServerList,
12622 : .set = py_nbt_browse_backup_list_response_set_BackupServerList,
12623 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
12624 : },
12625 : { .name = NULL }
12626 : };
12627 :
12628 0 : static PyObject *py_nbt_browse_backup_list_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12629 : {
12630 0 : return pytalloc_new(struct nbt_browse_backup_list_response, type);
12631 : }
12632 :
12633 :
12634 : static PyTypeObject nbt_browse_backup_list_response_Type = {
12635 : PyVarObject_HEAD_INIT(NULL, 0)
12636 : .tp_name = "nbt.browse_backup_list_response",
12637 : .tp_getset = py_nbt_browse_backup_list_response_getsetters,
12638 : .tp_methods = NULL,
12639 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12640 : .tp_new = py_nbt_browse_backup_list_response_new,
12641 : };
12642 :
12643 :
12644 0 : static PyObject *py_nbt_browse_become_backup_get_BrowserName(PyObject *obj, void *closure)
12645 : {
12646 0 : struct nbt_browse_become_backup *object = pytalloc_get_ptr(obj);
12647 0 : PyObject *py_BrowserName;
12648 0 : py_BrowserName = PyString_FromStringOrNULL(object->BrowserName);
12649 0 : return py_BrowserName;
12650 : }
12651 :
12652 0 : static int py_nbt_browse_become_backup_set_BrowserName(PyObject *py_obj, PyObject *value, void *closure)
12653 : {
12654 0 : struct nbt_browse_become_backup *object = pytalloc_get_ptr(py_obj);
12655 0 : if (value == NULL) {
12656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BrowserName");
12657 0 : return -1;
12658 : }
12659 : {
12660 0 : const char *test_str;
12661 0 : const char *talloc_str;
12662 0 : PyObject *unicode = NULL;
12663 0 : if (PyUnicode_Check(value)) {
12664 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12665 0 : if (unicode == NULL) {
12666 0 : return -1;
12667 : }
12668 0 : test_str = PyBytes_AS_STRING(unicode);
12669 0 : } else if (PyBytes_Check(value)) {
12670 0 : test_str = PyBytes_AS_STRING(value);
12671 : } else {
12672 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12673 0 : return -1;
12674 : }
12675 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12676 0 : if (unicode != NULL) {
12677 0 : Py_DECREF(unicode);
12678 : }
12679 0 : if (talloc_str == NULL) {
12680 0 : PyErr_NoMemory();
12681 0 : return -1;
12682 : }
12683 0 : object->BrowserName = talloc_str;
12684 : }
12685 0 : return 0;
12686 : }
12687 :
12688 : static PyGetSetDef py_nbt_browse_become_backup_getsetters[] = {
12689 : {
12690 : .name = discard_const_p(char, "BrowserName"),
12691 : .get = py_nbt_browse_become_backup_get_BrowserName,
12692 : .set = py_nbt_browse_become_backup_set_BrowserName,
12693 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
12694 : },
12695 : { .name = NULL }
12696 : };
12697 :
12698 0 : static PyObject *py_nbt_browse_become_backup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12699 : {
12700 0 : return pytalloc_new(struct nbt_browse_become_backup, type);
12701 : }
12702 :
12703 :
12704 : static PyTypeObject nbt_browse_become_backup_Type = {
12705 : PyVarObject_HEAD_INIT(NULL, 0)
12706 : .tp_name = "nbt.browse_become_backup",
12707 : .tp_getset = py_nbt_browse_become_backup_getsetters,
12708 : .tp_methods = NULL,
12709 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12710 : .tp_new = py_nbt_browse_become_backup_new,
12711 : };
12712 :
12713 :
12714 0 : static PyObject *py_nbt_browse_domain_announcement_get_UpdateCount(PyObject *obj, void *closure)
12715 : {
12716 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12717 0 : PyObject *py_UpdateCount;
12718 0 : py_UpdateCount = PyLong_FromLong((uint16_t)(object->UpdateCount));
12719 0 : return py_UpdateCount;
12720 : }
12721 :
12722 0 : static int py_nbt_browse_domain_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
12723 : {
12724 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12725 0 : if (value == NULL) {
12726 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->UpdateCount");
12727 0 : return -1;
12728 : }
12729 : {
12730 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
12731 0 : if (PyLong_Check(value)) {
12732 0 : unsigned long long test_var;
12733 0 : test_var = PyLong_AsUnsignedLongLong(value);
12734 0 : if (PyErr_Occurred() != NULL) {
12735 0 : return -1;
12736 : }
12737 0 : if (test_var > uint_max) {
12738 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12739 : PyLong_Type.tp_name, uint_max, test_var);
12740 0 : return -1;
12741 : }
12742 0 : object->UpdateCount = test_var;
12743 : } else {
12744 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12745 : PyLong_Type.tp_name);
12746 0 : return -1;
12747 : }
12748 : }
12749 0 : return 0;
12750 : }
12751 :
12752 0 : static PyObject *py_nbt_browse_domain_announcement_get_Periodicity(PyObject *obj, void *closure)
12753 : {
12754 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12755 0 : PyObject *py_Periodicity;
12756 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)(object->Periodicity));
12757 0 : return py_Periodicity;
12758 : }
12759 :
12760 0 : static int py_nbt_browse_domain_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
12761 : {
12762 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12763 0 : if (value == NULL) {
12764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Periodicity");
12765 0 : return -1;
12766 : }
12767 : {
12768 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
12769 0 : if (PyLong_Check(value)) {
12770 0 : unsigned long long test_var;
12771 0 : test_var = PyLong_AsUnsignedLongLong(value);
12772 0 : if (PyErr_Occurred() != NULL) {
12773 0 : return -1;
12774 : }
12775 0 : if (test_var > uint_max) {
12776 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12777 : PyLong_Type.tp_name, uint_max, test_var);
12778 0 : return -1;
12779 : }
12780 0 : object->Periodicity = test_var;
12781 : } else {
12782 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12783 : PyLong_Type.tp_name);
12784 0 : return -1;
12785 : }
12786 : }
12787 0 : return 0;
12788 : }
12789 :
12790 0 : static PyObject *py_nbt_browse_domain_announcement_get_ServerName(PyObject *obj, void *closure)
12791 : {
12792 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12793 0 : PyObject *py_ServerName;
12794 0 : if (object->ServerName == NULL) {
12795 0 : py_ServerName = Py_None;
12796 0 : Py_INCREF(py_ServerName);
12797 : } else {
12798 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
12799 : }
12800 0 : return py_ServerName;
12801 : }
12802 :
12803 0 : static int py_nbt_browse_domain_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
12804 : {
12805 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12806 0 : if (value == NULL) {
12807 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerName");
12808 0 : return -1;
12809 : }
12810 : {
12811 0 : const char *test_str;
12812 0 : const char *talloc_str;
12813 0 : PyObject *unicode = NULL;
12814 0 : if (PyUnicode_Check(value)) {
12815 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12816 0 : if (unicode == NULL) {
12817 0 : return -1;
12818 : }
12819 0 : test_str = PyBytes_AS_STRING(unicode);
12820 0 : } else if (PyBytes_Check(value)) {
12821 0 : test_str = PyBytes_AS_STRING(value);
12822 : } else {
12823 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12824 0 : return -1;
12825 : }
12826 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12827 0 : if (unicode != NULL) {
12828 0 : Py_DECREF(unicode);
12829 : }
12830 0 : if (talloc_str == NULL) {
12831 0 : PyErr_NoMemory();
12832 0 : return -1;
12833 : }
12834 0 : object->ServerName = talloc_str;
12835 : }
12836 0 : return 0;
12837 : }
12838 :
12839 0 : static PyObject *py_nbt_browse_domain_announcement_get_OSMajor(PyObject *obj, void *closure)
12840 : {
12841 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12842 0 : PyObject *py_OSMajor;
12843 0 : py_OSMajor = PyLong_FromLong((uint16_t)(object->OSMajor));
12844 0 : return py_OSMajor;
12845 : }
12846 :
12847 0 : static int py_nbt_browse_domain_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
12848 : {
12849 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12850 0 : if (value == NULL) {
12851 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->OSMajor");
12852 0 : return -1;
12853 : }
12854 : {
12855 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
12856 0 : if (PyLong_Check(value)) {
12857 0 : unsigned long long test_var;
12858 0 : test_var = PyLong_AsUnsignedLongLong(value);
12859 0 : if (PyErr_Occurred() != NULL) {
12860 0 : return -1;
12861 : }
12862 0 : if (test_var > uint_max) {
12863 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12864 : PyLong_Type.tp_name, uint_max, test_var);
12865 0 : return -1;
12866 : }
12867 0 : object->OSMajor = test_var;
12868 : } else {
12869 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12870 : PyLong_Type.tp_name);
12871 0 : return -1;
12872 : }
12873 : }
12874 0 : return 0;
12875 : }
12876 :
12877 0 : static PyObject *py_nbt_browse_domain_announcement_get_OSMinor(PyObject *obj, void *closure)
12878 : {
12879 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12880 0 : PyObject *py_OSMinor;
12881 0 : py_OSMinor = PyLong_FromLong((uint16_t)(object->OSMinor));
12882 0 : return py_OSMinor;
12883 : }
12884 :
12885 0 : static int py_nbt_browse_domain_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
12886 : {
12887 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12888 0 : if (value == NULL) {
12889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->OSMinor");
12890 0 : return -1;
12891 : }
12892 : {
12893 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
12894 0 : if (PyLong_Check(value)) {
12895 0 : unsigned long long test_var;
12896 0 : test_var = PyLong_AsUnsignedLongLong(value);
12897 0 : if (PyErr_Occurred() != NULL) {
12898 0 : return -1;
12899 : }
12900 0 : if (test_var > uint_max) {
12901 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12902 : PyLong_Type.tp_name, uint_max, test_var);
12903 0 : return -1;
12904 : }
12905 0 : object->OSMinor = test_var;
12906 : } else {
12907 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12908 : PyLong_Type.tp_name);
12909 0 : return -1;
12910 : }
12911 : }
12912 0 : return 0;
12913 : }
12914 :
12915 0 : static PyObject *py_nbt_browse_domain_announcement_get_ServerType(PyObject *obj, void *closure)
12916 : {
12917 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12918 0 : PyObject *py_ServerType;
12919 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)(object->ServerType));
12920 0 : return py_ServerType;
12921 : }
12922 :
12923 0 : static int py_nbt_browse_domain_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
12924 : {
12925 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12926 0 : if (value == NULL) {
12927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerType");
12928 0 : return -1;
12929 : }
12930 : {
12931 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
12932 0 : if (PyLong_Check(value)) {
12933 0 : unsigned long long test_var;
12934 0 : test_var = PyLong_AsUnsignedLongLong(value);
12935 0 : if (PyErr_Occurred() != NULL) {
12936 0 : return -1;
12937 : }
12938 0 : if (test_var > uint_max) {
12939 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12940 : PyLong_Type.tp_name, uint_max, test_var);
12941 0 : return -1;
12942 : }
12943 0 : object->ServerType = test_var;
12944 : } else {
12945 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12946 : PyLong_Type.tp_name);
12947 0 : return -1;
12948 : }
12949 : }
12950 0 : return 0;
12951 : }
12952 :
12953 0 : static PyObject *py_nbt_browse_domain_announcement_get_MysteriousField(PyObject *obj, void *closure)
12954 : {
12955 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12956 0 : PyObject *py_MysteriousField;
12957 0 : py_MysteriousField = PyLong_FromUnsignedLongLong((uint32_t)(object->MysteriousField));
12958 0 : return py_MysteriousField;
12959 : }
12960 :
12961 0 : static int py_nbt_browse_domain_announcement_set_MysteriousField(PyObject *py_obj, PyObject *value, void *closure)
12962 : {
12963 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
12964 0 : if (value == NULL) {
12965 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->MysteriousField");
12966 0 : return -1;
12967 : }
12968 : {
12969 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MysteriousField));
12970 0 : if (PyLong_Check(value)) {
12971 0 : unsigned long long test_var;
12972 0 : test_var = PyLong_AsUnsignedLongLong(value);
12973 0 : if (PyErr_Occurred() != NULL) {
12974 0 : return -1;
12975 : }
12976 0 : if (test_var > uint_max) {
12977 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12978 : PyLong_Type.tp_name, uint_max, test_var);
12979 0 : return -1;
12980 : }
12981 0 : object->MysteriousField = test_var;
12982 : } else {
12983 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12984 : PyLong_Type.tp_name);
12985 0 : return -1;
12986 : }
12987 : }
12988 0 : return 0;
12989 : }
12990 :
12991 0 : static PyObject *py_nbt_browse_domain_announcement_get_Comment(PyObject *obj, void *closure)
12992 : {
12993 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(obj);
12994 0 : PyObject *py_Comment;
12995 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
12996 0 : return py_Comment;
12997 : }
12998 :
12999 0 : static int py_nbt_browse_domain_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
13000 : {
13001 0 : struct nbt_browse_domain_announcement *object = pytalloc_get_ptr(py_obj);
13002 0 : if (value == NULL) {
13003 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Comment");
13004 0 : return -1;
13005 : }
13006 : {
13007 0 : const char *test_str;
13008 0 : const char *talloc_str;
13009 0 : PyObject *unicode = NULL;
13010 0 : if (PyUnicode_Check(value)) {
13011 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13012 0 : if (unicode == NULL) {
13013 0 : return -1;
13014 : }
13015 0 : test_str = PyBytes_AS_STRING(unicode);
13016 0 : } else if (PyBytes_Check(value)) {
13017 0 : test_str = PyBytes_AS_STRING(value);
13018 : } else {
13019 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13020 0 : return -1;
13021 : }
13022 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13023 0 : if (unicode != NULL) {
13024 0 : Py_DECREF(unicode);
13025 : }
13026 0 : if (talloc_str == NULL) {
13027 0 : PyErr_NoMemory();
13028 0 : return -1;
13029 : }
13030 0 : object->Comment = talloc_str;
13031 : }
13032 0 : return 0;
13033 : }
13034 :
13035 : static PyGetSetDef py_nbt_browse_domain_announcement_getsetters[] = {
13036 : {
13037 : .name = discard_const_p(char, "UpdateCount"),
13038 : .get = py_nbt_browse_domain_announcement_get_UpdateCount,
13039 : .set = py_nbt_browse_domain_announcement_set_UpdateCount,
13040 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13041 : },
13042 : {
13043 : .name = discard_const_p(char, "Periodicity"),
13044 : .get = py_nbt_browse_domain_announcement_get_Periodicity,
13045 : .set = py_nbt_browse_domain_announcement_set_Periodicity,
13046 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13047 : },
13048 : {
13049 : .name = discard_const_p(char, "ServerName"),
13050 : .get = py_nbt_browse_domain_announcement_get_ServerName,
13051 : .set = py_nbt_browse_domain_announcement_set_ServerName,
13052 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13053 : },
13054 : {
13055 : .name = discard_const_p(char, "OSMajor"),
13056 : .get = py_nbt_browse_domain_announcement_get_OSMajor,
13057 : .set = py_nbt_browse_domain_announcement_set_OSMajor,
13058 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13059 : },
13060 : {
13061 : .name = discard_const_p(char, "OSMinor"),
13062 : .get = py_nbt_browse_domain_announcement_get_OSMinor,
13063 : .set = py_nbt_browse_domain_announcement_set_OSMinor,
13064 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13065 : },
13066 : {
13067 : .name = discard_const_p(char, "ServerType"),
13068 : .get = py_nbt_browse_domain_announcement_get_ServerType,
13069 : .set = py_nbt_browse_domain_announcement_set_ServerType,
13070 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
13071 : },
13072 : {
13073 : .name = discard_const_p(char, "MysteriousField"),
13074 : .get = py_nbt_browse_domain_announcement_get_MysteriousField,
13075 : .set = py_nbt_browse_domain_announcement_set_MysteriousField,
13076 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13077 : },
13078 : {
13079 : .name = discard_const_p(char, "Comment"),
13080 : .get = py_nbt_browse_domain_announcement_get_Comment,
13081 : .set = py_nbt_browse_domain_announcement_set_Comment,
13082 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13083 : },
13084 : { .name = NULL }
13085 : };
13086 :
13087 0 : static PyObject *py_nbt_browse_domain_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13088 : {
13089 0 : return pytalloc_new(struct nbt_browse_domain_announcement, type);
13090 : }
13091 :
13092 :
13093 : static PyTypeObject nbt_browse_domain_announcement_Type = {
13094 : PyVarObject_HEAD_INIT(NULL, 0)
13095 : .tp_name = "nbt.browse_domain_announcement",
13096 : .tp_getset = py_nbt_browse_domain_announcement_getsetters,
13097 : .tp_methods = NULL,
13098 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13099 : .tp_new = py_nbt_browse_domain_announcement_new,
13100 : };
13101 :
13102 :
13103 0 : static PyObject *py_nbt_browse_master_announcement_get_ServerName(PyObject *obj, void *closure)
13104 : {
13105 0 : struct nbt_browse_master_announcement *object = pytalloc_get_ptr(obj);
13106 0 : PyObject *py_ServerName;
13107 0 : py_ServerName = PyString_FromStringOrNULL(object->ServerName);
13108 0 : return py_ServerName;
13109 : }
13110 :
13111 0 : static int py_nbt_browse_master_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
13112 : {
13113 0 : struct nbt_browse_master_announcement *object = pytalloc_get_ptr(py_obj);
13114 0 : if (value == NULL) {
13115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerName");
13116 0 : return -1;
13117 : }
13118 : {
13119 0 : const char *test_str;
13120 0 : const char *talloc_str;
13121 0 : PyObject *unicode = NULL;
13122 0 : if (PyUnicode_Check(value)) {
13123 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13124 0 : if (unicode == NULL) {
13125 0 : return -1;
13126 : }
13127 0 : test_str = PyBytes_AS_STRING(unicode);
13128 0 : } else if (PyBytes_Check(value)) {
13129 0 : test_str = PyBytes_AS_STRING(value);
13130 : } else {
13131 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13132 0 : return -1;
13133 : }
13134 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13135 0 : if (unicode != NULL) {
13136 0 : Py_DECREF(unicode);
13137 : }
13138 0 : if (talloc_str == NULL) {
13139 0 : PyErr_NoMemory();
13140 0 : return -1;
13141 : }
13142 0 : object->ServerName = talloc_str;
13143 : }
13144 0 : return 0;
13145 : }
13146 :
13147 : static PyGetSetDef py_nbt_browse_master_announcement_getsetters[] = {
13148 : {
13149 : .name = discard_const_p(char, "ServerName"),
13150 : .get = py_nbt_browse_master_announcement_get_ServerName,
13151 : .set = py_nbt_browse_master_announcement_set_ServerName,
13152 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13153 : },
13154 : { .name = NULL }
13155 : };
13156 :
13157 0 : static PyObject *py_nbt_browse_master_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13158 : {
13159 0 : return pytalloc_new(struct nbt_browse_master_announcement, type);
13160 : }
13161 :
13162 :
13163 : static PyTypeObject nbt_browse_master_announcement_Type = {
13164 : PyVarObject_HEAD_INIT(NULL, 0)
13165 : .tp_name = "nbt.browse_master_announcement",
13166 : .tp_getset = py_nbt_browse_master_announcement_getsetters,
13167 : .tp_methods = NULL,
13168 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13169 : .tp_new = py_nbt_browse_master_announcement_new,
13170 : };
13171 :
13172 :
13173 0 : static PyObject *py_nbt_browse_reset_state_get_Command(PyObject *obj, void *closure)
13174 : {
13175 0 : struct nbt_browse_reset_state *object = pytalloc_get_ptr(obj);
13176 0 : PyObject *py_Command;
13177 0 : py_Command = PyLong_FromLong((uint16_t)(object->Command));
13178 0 : return py_Command;
13179 : }
13180 :
13181 0 : static int py_nbt_browse_reset_state_set_Command(PyObject *py_obj, PyObject *value, void *closure)
13182 : {
13183 0 : struct nbt_browse_reset_state *object = pytalloc_get_ptr(py_obj);
13184 0 : if (value == NULL) {
13185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Command");
13186 0 : return -1;
13187 : }
13188 : {
13189 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Command));
13190 0 : if (PyLong_Check(value)) {
13191 0 : unsigned long long test_var;
13192 0 : test_var = PyLong_AsUnsignedLongLong(value);
13193 0 : if (PyErr_Occurred() != NULL) {
13194 0 : return -1;
13195 : }
13196 0 : if (test_var > uint_max) {
13197 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13198 : PyLong_Type.tp_name, uint_max, test_var);
13199 0 : return -1;
13200 : }
13201 0 : object->Command = test_var;
13202 : } else {
13203 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13204 : PyLong_Type.tp_name);
13205 0 : return -1;
13206 : }
13207 : }
13208 0 : return 0;
13209 : }
13210 :
13211 : static PyGetSetDef py_nbt_browse_reset_state_getsetters[] = {
13212 : {
13213 : .name = discard_const_p(char, "Command"),
13214 : .get = py_nbt_browse_reset_state_get_Command,
13215 : .set = py_nbt_browse_reset_state_set_Command,
13216 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13217 : },
13218 : { .name = NULL }
13219 : };
13220 :
13221 0 : static PyObject *py_nbt_browse_reset_state_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13222 : {
13223 0 : return pytalloc_new(struct nbt_browse_reset_state, type);
13224 : }
13225 :
13226 :
13227 : static PyTypeObject nbt_browse_reset_state_Type = {
13228 : PyVarObject_HEAD_INIT(NULL, 0)
13229 : .tp_name = "nbt.browse_reset_state",
13230 : .tp_getset = py_nbt_browse_reset_state_getsetters,
13231 : .tp_methods = NULL,
13232 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13233 : .tp_new = py_nbt_browse_reset_state_new,
13234 : };
13235 :
13236 :
13237 0 : static PyObject *py_nbt_browse_local_master_announcement_get_UpdateCount(PyObject *obj, void *closure)
13238 : {
13239 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13240 0 : PyObject *py_UpdateCount;
13241 0 : py_UpdateCount = PyLong_FromLong((uint16_t)(object->UpdateCount));
13242 0 : return py_UpdateCount;
13243 : }
13244 :
13245 0 : static int py_nbt_browse_local_master_announcement_set_UpdateCount(PyObject *py_obj, PyObject *value, void *closure)
13246 : {
13247 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13248 0 : if (value == NULL) {
13249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->UpdateCount");
13250 0 : return -1;
13251 : }
13252 : {
13253 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->UpdateCount));
13254 0 : if (PyLong_Check(value)) {
13255 0 : unsigned long long test_var;
13256 0 : test_var = PyLong_AsUnsignedLongLong(value);
13257 0 : if (PyErr_Occurred() != NULL) {
13258 0 : return -1;
13259 : }
13260 0 : if (test_var > uint_max) {
13261 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13262 : PyLong_Type.tp_name, uint_max, test_var);
13263 0 : return -1;
13264 : }
13265 0 : object->UpdateCount = test_var;
13266 : } else {
13267 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13268 : PyLong_Type.tp_name);
13269 0 : return -1;
13270 : }
13271 : }
13272 0 : return 0;
13273 : }
13274 :
13275 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Periodicity(PyObject *obj, void *closure)
13276 : {
13277 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13278 0 : PyObject *py_Periodicity;
13279 0 : py_Periodicity = PyLong_FromUnsignedLongLong((uint32_t)(object->Periodicity));
13280 0 : return py_Periodicity;
13281 : }
13282 :
13283 0 : static int py_nbt_browse_local_master_announcement_set_Periodicity(PyObject *py_obj, PyObject *value, void *closure)
13284 : {
13285 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13286 0 : if (value == NULL) {
13287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Periodicity");
13288 0 : return -1;
13289 : }
13290 : {
13291 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Periodicity));
13292 0 : if (PyLong_Check(value)) {
13293 0 : unsigned long long test_var;
13294 0 : test_var = PyLong_AsUnsignedLongLong(value);
13295 0 : if (PyErr_Occurred() != NULL) {
13296 0 : return -1;
13297 : }
13298 0 : if (test_var > uint_max) {
13299 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13300 : PyLong_Type.tp_name, uint_max, test_var);
13301 0 : return -1;
13302 : }
13303 0 : object->Periodicity = test_var;
13304 : } else {
13305 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13306 : PyLong_Type.tp_name);
13307 0 : return -1;
13308 : }
13309 : }
13310 0 : return 0;
13311 : }
13312 :
13313 0 : static PyObject *py_nbt_browse_local_master_announcement_get_ServerName(PyObject *obj, void *closure)
13314 : {
13315 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13316 0 : PyObject *py_ServerName;
13317 0 : if (object->ServerName == NULL) {
13318 0 : py_ServerName = Py_None;
13319 0 : Py_INCREF(py_ServerName);
13320 : } else {
13321 0 : py_ServerName = PyUnicode_Decode(object->ServerName, strlen(object->ServerName), "utf-8", "ignore");
13322 : }
13323 0 : return py_ServerName;
13324 : }
13325 :
13326 0 : static int py_nbt_browse_local_master_announcement_set_ServerName(PyObject *py_obj, PyObject *value, void *closure)
13327 : {
13328 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13329 0 : if (value == NULL) {
13330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerName");
13331 0 : return -1;
13332 : }
13333 : {
13334 0 : const char *test_str;
13335 0 : const char *talloc_str;
13336 0 : PyObject *unicode = NULL;
13337 0 : if (PyUnicode_Check(value)) {
13338 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13339 0 : if (unicode == NULL) {
13340 0 : return -1;
13341 : }
13342 0 : test_str = PyBytes_AS_STRING(unicode);
13343 0 : } else if (PyBytes_Check(value)) {
13344 0 : test_str = PyBytes_AS_STRING(value);
13345 : } else {
13346 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13347 0 : return -1;
13348 : }
13349 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13350 0 : if (unicode != NULL) {
13351 0 : Py_DECREF(unicode);
13352 : }
13353 0 : if (talloc_str == NULL) {
13354 0 : PyErr_NoMemory();
13355 0 : return -1;
13356 : }
13357 0 : object->ServerName = talloc_str;
13358 : }
13359 0 : return 0;
13360 : }
13361 :
13362 0 : static PyObject *py_nbt_browse_local_master_announcement_get_OSMajor(PyObject *obj, void *closure)
13363 : {
13364 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13365 0 : PyObject *py_OSMajor;
13366 0 : py_OSMajor = PyLong_FromLong((uint16_t)(object->OSMajor));
13367 0 : return py_OSMajor;
13368 : }
13369 :
13370 0 : static int py_nbt_browse_local_master_announcement_set_OSMajor(PyObject *py_obj, PyObject *value, void *closure)
13371 : {
13372 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13373 0 : if (value == NULL) {
13374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->OSMajor");
13375 0 : return -1;
13376 : }
13377 : {
13378 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMajor));
13379 0 : if (PyLong_Check(value)) {
13380 0 : unsigned long long test_var;
13381 0 : test_var = PyLong_AsUnsignedLongLong(value);
13382 0 : if (PyErr_Occurred() != NULL) {
13383 0 : return -1;
13384 : }
13385 0 : if (test_var > uint_max) {
13386 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13387 : PyLong_Type.tp_name, uint_max, test_var);
13388 0 : return -1;
13389 : }
13390 0 : object->OSMajor = test_var;
13391 : } else {
13392 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13393 : PyLong_Type.tp_name);
13394 0 : return -1;
13395 : }
13396 : }
13397 0 : return 0;
13398 : }
13399 :
13400 0 : static PyObject *py_nbt_browse_local_master_announcement_get_OSMinor(PyObject *obj, void *closure)
13401 : {
13402 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13403 0 : PyObject *py_OSMinor;
13404 0 : py_OSMinor = PyLong_FromLong((uint16_t)(object->OSMinor));
13405 0 : return py_OSMinor;
13406 : }
13407 :
13408 0 : static int py_nbt_browse_local_master_announcement_set_OSMinor(PyObject *py_obj, PyObject *value, void *closure)
13409 : {
13410 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13411 0 : if (value == NULL) {
13412 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->OSMinor");
13413 0 : return -1;
13414 : }
13415 : {
13416 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSMinor));
13417 0 : if (PyLong_Check(value)) {
13418 0 : unsigned long long test_var;
13419 0 : test_var = PyLong_AsUnsignedLongLong(value);
13420 0 : if (PyErr_Occurred() != NULL) {
13421 0 : return -1;
13422 : }
13423 0 : if (test_var > uint_max) {
13424 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13425 : PyLong_Type.tp_name, uint_max, test_var);
13426 0 : return -1;
13427 : }
13428 0 : object->OSMinor = test_var;
13429 : } else {
13430 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13431 : PyLong_Type.tp_name);
13432 0 : return -1;
13433 : }
13434 : }
13435 0 : return 0;
13436 : }
13437 :
13438 0 : static PyObject *py_nbt_browse_local_master_announcement_get_ServerType(PyObject *obj, void *closure)
13439 : {
13440 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13441 0 : PyObject *py_ServerType;
13442 0 : py_ServerType = PyLong_FromUnsignedLongLong((uint32_t)(object->ServerType));
13443 0 : return py_ServerType;
13444 : }
13445 :
13446 0 : static int py_nbt_browse_local_master_announcement_set_ServerType(PyObject *py_obj, PyObject *value, void *closure)
13447 : {
13448 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13449 0 : if (value == NULL) {
13450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ServerType");
13451 0 : return -1;
13452 : }
13453 : {
13454 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServerType));
13455 0 : if (PyLong_Check(value)) {
13456 0 : unsigned long long test_var;
13457 0 : test_var = PyLong_AsUnsignedLongLong(value);
13458 0 : if (PyErr_Occurred() != NULL) {
13459 0 : return -1;
13460 : }
13461 0 : if (test_var > uint_max) {
13462 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13463 : PyLong_Type.tp_name, uint_max, test_var);
13464 0 : return -1;
13465 : }
13466 0 : object->ServerType = test_var;
13467 : } else {
13468 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13469 : PyLong_Type.tp_name);
13470 0 : return -1;
13471 : }
13472 : }
13473 0 : return 0;
13474 : }
13475 :
13476 0 : static PyObject *py_nbt_browse_local_master_announcement_get_BroMajorVer(PyObject *obj, void *closure)
13477 : {
13478 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13479 0 : PyObject *py_BroMajorVer;
13480 0 : py_BroMajorVer = PyLong_FromLong((uint16_t)(object->BroMajorVer));
13481 0 : return py_BroMajorVer;
13482 : }
13483 :
13484 0 : static int py_nbt_browse_local_master_announcement_set_BroMajorVer(PyObject *py_obj, PyObject *value, void *closure)
13485 : {
13486 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13487 0 : if (value == NULL) {
13488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BroMajorVer");
13489 0 : return -1;
13490 : }
13491 : {
13492 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMajorVer));
13493 0 : if (PyLong_Check(value)) {
13494 0 : unsigned long long test_var;
13495 0 : test_var = PyLong_AsUnsignedLongLong(value);
13496 0 : if (PyErr_Occurred() != NULL) {
13497 0 : return -1;
13498 : }
13499 0 : if (test_var > uint_max) {
13500 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13501 : PyLong_Type.tp_name, uint_max, test_var);
13502 0 : return -1;
13503 : }
13504 0 : object->BroMajorVer = test_var;
13505 : } else {
13506 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13507 : PyLong_Type.tp_name);
13508 0 : return -1;
13509 : }
13510 : }
13511 0 : return 0;
13512 : }
13513 :
13514 0 : static PyObject *py_nbt_browse_local_master_announcement_get_BroMinorVer(PyObject *obj, void *closure)
13515 : {
13516 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13517 0 : PyObject *py_BroMinorVer;
13518 0 : py_BroMinorVer = PyLong_FromLong((uint16_t)(object->BroMinorVer));
13519 0 : return py_BroMinorVer;
13520 : }
13521 :
13522 0 : static int py_nbt_browse_local_master_announcement_set_BroMinorVer(PyObject *py_obj, PyObject *value, void *closure)
13523 : {
13524 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13525 0 : if (value == NULL) {
13526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BroMinorVer");
13527 0 : return -1;
13528 : }
13529 : {
13530 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BroMinorVer));
13531 0 : if (PyLong_Check(value)) {
13532 0 : unsigned long long test_var;
13533 0 : test_var = PyLong_AsUnsignedLongLong(value);
13534 0 : if (PyErr_Occurred() != NULL) {
13535 0 : return -1;
13536 : }
13537 0 : if (test_var > uint_max) {
13538 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13539 : PyLong_Type.tp_name, uint_max, test_var);
13540 0 : return -1;
13541 : }
13542 0 : object->BroMinorVer = test_var;
13543 : } else {
13544 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13545 : PyLong_Type.tp_name);
13546 0 : return -1;
13547 : }
13548 : }
13549 0 : return 0;
13550 : }
13551 :
13552 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Signature(PyObject *obj, void *closure)
13553 : {
13554 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13555 0 : PyObject *py_Signature;
13556 0 : py_Signature = PyLong_FromLong((uint16_t)(object->Signature));
13557 0 : return py_Signature;
13558 : }
13559 :
13560 0 : static int py_nbt_browse_local_master_announcement_set_Signature(PyObject *py_obj, PyObject *value, void *closure)
13561 : {
13562 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13563 0 : if (value == NULL) {
13564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Signature");
13565 0 : return -1;
13566 : }
13567 : {
13568 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Signature));
13569 0 : if (PyLong_Check(value)) {
13570 0 : unsigned long long test_var;
13571 0 : test_var = PyLong_AsUnsignedLongLong(value);
13572 0 : if (PyErr_Occurred() != NULL) {
13573 0 : return -1;
13574 : }
13575 0 : if (test_var > uint_max) {
13576 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13577 : PyLong_Type.tp_name, uint_max, test_var);
13578 0 : return -1;
13579 : }
13580 0 : object->Signature = test_var;
13581 : } else {
13582 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13583 : PyLong_Type.tp_name);
13584 0 : return -1;
13585 : }
13586 : }
13587 0 : return 0;
13588 : }
13589 :
13590 0 : static PyObject *py_nbt_browse_local_master_announcement_get_Comment(PyObject *obj, void *closure)
13591 : {
13592 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(obj);
13593 0 : PyObject *py_Comment;
13594 0 : py_Comment = PyString_FromStringOrNULL(object->Comment);
13595 0 : return py_Comment;
13596 : }
13597 :
13598 0 : static int py_nbt_browse_local_master_announcement_set_Comment(PyObject *py_obj, PyObject *value, void *closure)
13599 : {
13600 0 : struct nbt_browse_local_master_announcement *object = pytalloc_get_ptr(py_obj);
13601 0 : if (value == NULL) {
13602 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Comment");
13603 0 : return -1;
13604 : }
13605 : {
13606 0 : const char *test_str;
13607 0 : const char *talloc_str;
13608 0 : PyObject *unicode = NULL;
13609 0 : if (PyUnicode_Check(value)) {
13610 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13611 0 : if (unicode == NULL) {
13612 0 : return -1;
13613 : }
13614 0 : test_str = PyBytes_AS_STRING(unicode);
13615 0 : } else if (PyBytes_Check(value)) {
13616 0 : test_str = PyBytes_AS_STRING(value);
13617 : } else {
13618 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13619 0 : return -1;
13620 : }
13621 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13622 0 : if (unicode != NULL) {
13623 0 : Py_DECREF(unicode);
13624 : }
13625 0 : if (talloc_str == NULL) {
13626 0 : PyErr_NoMemory();
13627 0 : return -1;
13628 : }
13629 0 : object->Comment = talloc_str;
13630 : }
13631 0 : return 0;
13632 : }
13633 :
13634 : static PyGetSetDef py_nbt_browse_local_master_announcement_getsetters[] = {
13635 : {
13636 : .name = discard_const_p(char, "UpdateCount"),
13637 : .get = py_nbt_browse_local_master_announcement_get_UpdateCount,
13638 : .set = py_nbt_browse_local_master_announcement_set_UpdateCount,
13639 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13640 : },
13641 : {
13642 : .name = discard_const_p(char, "Periodicity"),
13643 : .get = py_nbt_browse_local_master_announcement_get_Periodicity,
13644 : .set = py_nbt_browse_local_master_announcement_set_Periodicity,
13645 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13646 : },
13647 : {
13648 : .name = discard_const_p(char, "ServerName"),
13649 : .get = py_nbt_browse_local_master_announcement_get_ServerName,
13650 : .set = py_nbt_browse_local_master_announcement_set_ServerName,
13651 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13652 : },
13653 : {
13654 : .name = discard_const_p(char, "OSMajor"),
13655 : .get = py_nbt_browse_local_master_announcement_get_OSMajor,
13656 : .set = py_nbt_browse_local_master_announcement_set_OSMajor,
13657 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13658 : },
13659 : {
13660 : .name = discard_const_p(char, "OSMinor"),
13661 : .get = py_nbt_browse_local_master_announcement_get_OSMinor,
13662 : .set = py_nbt_browse_local_master_announcement_set_OSMinor,
13663 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13664 : },
13665 : {
13666 : .name = discard_const_p(char, "ServerType"),
13667 : .get = py_nbt_browse_local_master_announcement_get_ServerType,
13668 : .set = py_nbt_browse_local_master_announcement_set_ServerType,
13669 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServerType")
13670 : },
13671 : {
13672 : .name = discard_const_p(char, "BroMajorVer"),
13673 : .get = py_nbt_browse_local_master_announcement_get_BroMajorVer,
13674 : .set = py_nbt_browse_local_master_announcement_set_BroMajorVer,
13675 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13676 : },
13677 : {
13678 : .name = discard_const_p(char, "BroMinorVer"),
13679 : .get = py_nbt_browse_local_master_announcement_get_BroMinorVer,
13680 : .set = py_nbt_browse_local_master_announcement_set_BroMinorVer,
13681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13682 : },
13683 : {
13684 : .name = discard_const_p(char, "Signature"),
13685 : .get = py_nbt_browse_local_master_announcement_get_Signature,
13686 : .set = py_nbt_browse_local_master_announcement_set_Signature,
13687 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13688 : },
13689 : {
13690 : .name = discard_const_p(char, "Comment"),
13691 : .get = py_nbt_browse_local_master_announcement_get_Comment,
13692 : .set = py_nbt_browse_local_master_announcement_set_Comment,
13693 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
13694 : },
13695 : { .name = NULL }
13696 : };
13697 :
13698 0 : static PyObject *py_nbt_browse_local_master_announcement_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13699 : {
13700 0 : return pytalloc_new(struct nbt_browse_local_master_announcement, type);
13701 : }
13702 :
13703 :
13704 : static PyTypeObject nbt_browse_local_master_announcement_Type = {
13705 : PyVarObject_HEAD_INIT(NULL, 0)
13706 : .tp_name = "nbt.browse_local_master_announcement",
13707 : .tp_getset = py_nbt_browse_local_master_announcement_getsetters,
13708 : .tp_methods = NULL,
13709 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13710 : .tp_new = py_nbt_browse_local_master_announcement_new,
13711 : };
13712 :
13713 0 : static PyObject *py_import_nbt_browse_payload(TALLOC_CTX *mem_ctx, int level, union nbt_browse_payload *in)
13714 : {
13715 0 : PyObject *ret;
13716 :
13717 0 : switch (level) {
13718 0 : case HostAnnouncement:
13719 0 : ret = pytalloc_reference_ex(&nbt_browse_host_announcement_Type, mem_ctx, &in->host_annoucement);
13720 0 : return ret;
13721 :
13722 0 : case AnnouncementRequest:
13723 0 : ret = pytalloc_reference_ex(&nbt_browse_announcement_request_Type, mem_ctx, &in->announcement_request);
13724 0 : return ret;
13725 :
13726 0 : case Election:
13727 0 : ret = pytalloc_reference_ex(&nbt_browse_election_request_Type, mem_ctx, &in->election_request);
13728 0 : return ret;
13729 :
13730 0 : case GetBackupListReq:
13731 0 : ret = pytalloc_reference_ex(&nbt_browse_backup_list_request_Type, mem_ctx, &in->backup_list_request);
13732 0 : return ret;
13733 :
13734 0 : case GetBackupListResp:
13735 0 : ret = pytalloc_reference_ex(&nbt_browse_backup_list_response_Type, mem_ctx, &in->backup_list_response);
13736 0 : return ret;
13737 :
13738 0 : case BecomeBackup:
13739 0 : ret = pytalloc_reference_ex(&nbt_browse_become_backup_Type, mem_ctx, &in->become_backup);
13740 0 : return ret;
13741 :
13742 0 : case DomainAnnouncement:
13743 0 : ret = pytalloc_reference_ex(&nbt_browse_domain_announcement_Type, mem_ctx, &in->domain_announcement);
13744 0 : return ret;
13745 :
13746 0 : case MasterAnnouncement:
13747 0 : ret = pytalloc_reference_ex(&nbt_browse_master_announcement_Type, mem_ctx, &in->master_announcement);
13748 0 : return ret;
13749 :
13750 0 : case ResetBrowserState:
13751 0 : ret = pytalloc_reference_ex(&nbt_browse_reset_state_Type, mem_ctx, &in->reset_browser_state);
13752 0 : return ret;
13753 :
13754 0 : case LocalMasterAnnouncement:
13755 0 : ret = pytalloc_reference_ex(&nbt_browse_local_master_announcement_Type, mem_ctx, &in->local_master_announcement);
13756 0 : return ret;
13757 :
13758 : }
13759 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
13760 0 : return NULL;
13761 : }
13762 :
13763 0 : static union nbt_browse_payload *py_export_nbt_browse_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in)
13764 : {
13765 0 : union nbt_browse_payload *ret = talloc_zero(mem_ctx, union nbt_browse_payload);
13766 0 : switch (level) {
13767 0 : case HostAnnouncement:
13768 0 : if (in == NULL) {
13769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->host_annoucement");
13770 0 : talloc_free(ret); return NULL;
13771 : }
13772 0 : PY_CHECK_TYPE(&nbt_browse_host_announcement_Type, in, talloc_free(ret); return NULL;);
13773 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13774 0 : PyErr_NoMemory();
13775 0 : talloc_free(ret); return NULL;
13776 : }
13777 0 : ret->host_annoucement = *(struct nbt_browse_host_announcement *)pytalloc_get_ptr(in);
13778 0 : break;
13779 :
13780 0 : case AnnouncementRequest:
13781 0 : if (in == NULL) {
13782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->announcement_request");
13783 0 : talloc_free(ret); return NULL;
13784 : }
13785 0 : PY_CHECK_TYPE(&nbt_browse_announcement_request_Type, in, talloc_free(ret); return NULL;);
13786 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13787 0 : PyErr_NoMemory();
13788 0 : talloc_free(ret); return NULL;
13789 : }
13790 0 : ret->announcement_request = *(struct nbt_browse_announcement_request *)pytalloc_get_ptr(in);
13791 0 : break;
13792 :
13793 0 : case Election:
13794 0 : if (in == NULL) {
13795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->election_request");
13796 0 : talloc_free(ret); return NULL;
13797 : }
13798 0 : PY_CHECK_TYPE(&nbt_browse_election_request_Type, in, talloc_free(ret); return NULL;);
13799 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13800 0 : PyErr_NoMemory();
13801 0 : talloc_free(ret); return NULL;
13802 : }
13803 0 : ret->election_request = *(struct nbt_browse_election_request *)pytalloc_get_ptr(in);
13804 0 : break;
13805 :
13806 0 : case GetBackupListReq:
13807 0 : if (in == NULL) {
13808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->backup_list_request");
13809 0 : talloc_free(ret); return NULL;
13810 : }
13811 0 : PY_CHECK_TYPE(&nbt_browse_backup_list_request_Type, in, talloc_free(ret); return NULL;);
13812 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13813 0 : PyErr_NoMemory();
13814 0 : talloc_free(ret); return NULL;
13815 : }
13816 0 : ret->backup_list_request = *(struct nbt_browse_backup_list_request *)pytalloc_get_ptr(in);
13817 0 : break;
13818 :
13819 0 : case GetBackupListResp:
13820 0 : if (in == NULL) {
13821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->backup_list_response");
13822 0 : talloc_free(ret); return NULL;
13823 : }
13824 0 : PY_CHECK_TYPE(&nbt_browse_backup_list_response_Type, in, talloc_free(ret); return NULL;);
13825 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13826 0 : PyErr_NoMemory();
13827 0 : talloc_free(ret); return NULL;
13828 : }
13829 0 : ret->backup_list_response = *(struct nbt_browse_backup_list_response *)pytalloc_get_ptr(in);
13830 0 : break;
13831 :
13832 0 : case BecomeBackup:
13833 0 : if (in == NULL) {
13834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->become_backup");
13835 0 : talloc_free(ret); return NULL;
13836 : }
13837 0 : PY_CHECK_TYPE(&nbt_browse_become_backup_Type, in, talloc_free(ret); return NULL;);
13838 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13839 0 : PyErr_NoMemory();
13840 0 : talloc_free(ret); return NULL;
13841 : }
13842 0 : ret->become_backup = *(struct nbt_browse_become_backup *)pytalloc_get_ptr(in);
13843 0 : break;
13844 :
13845 0 : case DomainAnnouncement:
13846 0 : if (in == NULL) {
13847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->domain_announcement");
13848 0 : talloc_free(ret); return NULL;
13849 : }
13850 0 : PY_CHECK_TYPE(&nbt_browse_domain_announcement_Type, in, talloc_free(ret); return NULL;);
13851 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13852 0 : PyErr_NoMemory();
13853 0 : talloc_free(ret); return NULL;
13854 : }
13855 0 : ret->domain_announcement = *(struct nbt_browse_domain_announcement *)pytalloc_get_ptr(in);
13856 0 : break;
13857 :
13858 0 : case MasterAnnouncement:
13859 0 : if (in == NULL) {
13860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->master_announcement");
13861 0 : talloc_free(ret); return NULL;
13862 : }
13863 0 : PY_CHECK_TYPE(&nbt_browse_master_announcement_Type, in, talloc_free(ret); return NULL;);
13864 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13865 0 : PyErr_NoMemory();
13866 0 : talloc_free(ret); return NULL;
13867 : }
13868 0 : ret->master_announcement = *(struct nbt_browse_master_announcement *)pytalloc_get_ptr(in);
13869 0 : break;
13870 :
13871 0 : case ResetBrowserState:
13872 0 : if (in == NULL) {
13873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->reset_browser_state");
13874 0 : talloc_free(ret); return NULL;
13875 : }
13876 0 : PY_CHECK_TYPE(&nbt_browse_reset_state_Type, in, talloc_free(ret); return NULL;);
13877 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13878 0 : PyErr_NoMemory();
13879 0 : talloc_free(ret); return NULL;
13880 : }
13881 0 : ret->reset_browser_state = *(struct nbt_browse_reset_state *)pytalloc_get_ptr(in);
13882 0 : break;
13883 :
13884 0 : case LocalMasterAnnouncement:
13885 0 : if (in == NULL) {
13886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->local_master_announcement");
13887 0 : talloc_free(ret); return NULL;
13888 : }
13889 0 : PY_CHECK_TYPE(&nbt_browse_local_master_announcement_Type, in, talloc_free(ret); return NULL;);
13890 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13891 0 : PyErr_NoMemory();
13892 0 : talloc_free(ret); return NULL;
13893 : }
13894 0 : ret->local_master_announcement = *(struct nbt_browse_local_master_announcement *)pytalloc_get_ptr(in);
13895 0 : break;
13896 :
13897 0 : default:
13898 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
13899 0 : talloc_free(ret);
13900 0 : ret = NULL;
13901 : }
13902 :
13903 0 : return ret;
13904 : }
13905 :
13906 0 : static PyObject *py_nbt_browse_payload_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13907 : {
13908 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13909 0 : PyObject *mem_ctx_obj = NULL;
13910 0 : TALLOC_CTX *mem_ctx = NULL;
13911 0 : int level = 0;
13912 0 : PyObject *in_obj = NULL;
13913 0 : union nbt_browse_payload *in = NULL;
13914 :
13915 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
13916 : discard_const_p(char *, kwnames),
13917 : &mem_ctx_obj,
13918 : &level,
13919 : &in_obj)) {
13920 0 : return NULL;
13921 : }
13922 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13923 0 : if (mem_ctx == NULL) {
13924 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13925 0 : return NULL;
13926 : }
13927 0 : in = (union nbt_browse_payload *)pytalloc_get_ptr(in_obj);
13928 0 : if (in == NULL) {
13929 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_browse_payload!");
13930 0 : return NULL;
13931 : }
13932 :
13933 0 : return py_import_nbt_browse_payload(mem_ctx, level, in);
13934 : }
13935 :
13936 0 : static PyObject *py_nbt_browse_payload_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13937 : {
13938 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13939 0 : PyObject *mem_ctx_obj = NULL;
13940 0 : TALLOC_CTX *mem_ctx = NULL;
13941 0 : int level = 0;
13942 0 : PyObject *in = NULL;
13943 0 : union nbt_browse_payload *out = NULL;
13944 :
13945 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
13946 : discard_const_p(char *, kwnames),
13947 : &mem_ctx_obj,
13948 : &level,
13949 : &in)) {
13950 0 : return NULL;
13951 : }
13952 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13953 0 : if (mem_ctx == NULL) {
13954 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13955 0 : return NULL;
13956 : }
13957 :
13958 0 : out = py_export_nbt_browse_payload(mem_ctx, level, in);
13959 0 : if (out == NULL) {
13960 0 : return NULL;
13961 : }
13962 :
13963 0 : return pytalloc_GenericObject_reference(out);
13964 : }
13965 :
13966 : static PyMethodDef py_nbt_browse_payload_methods[] = {
13967 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_payload_import),
13968 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13969 : "T.__import__(mem_ctx, level, in) => ret." },
13970 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_browse_payload_export),
13971 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13972 : "T.__export__(mem_ctx, level, in) => ret." },
13973 : { NULL, NULL, 0, NULL }
13974 : };
13975 :
13976 0 : static PyObject *py_nbt_browse_payload_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13977 : {
13978 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
13979 0 : return NULL;
13980 : }
13981 :
13982 :
13983 : static PyTypeObject nbt_browse_payload_Type = {
13984 : PyVarObject_HEAD_INIT(NULL, 0)
13985 : .tp_name = "nbt.browse_payload",
13986 : .tp_getset = NULL,
13987 : .tp_methods = py_nbt_browse_payload_methods,
13988 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13989 : .tp_new = py_nbt_browse_payload_new,
13990 : };
13991 :
13992 :
13993 0 : static PyObject *py_nbt_browse_packet_get_opcode(PyObject *obj, void *closure)
13994 : {
13995 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(obj);
13996 0 : PyObject *py_opcode;
13997 0 : py_opcode = PyLong_FromLong((uint16_t)(object->opcode));
13998 0 : return py_opcode;
13999 : }
14000 :
14001 0 : static int py_nbt_browse_packet_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
14002 : {
14003 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(py_obj);
14004 0 : if (value == NULL) {
14005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->opcode");
14006 0 : return -1;
14007 : }
14008 : {
14009 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
14010 0 : if (PyLong_Check(value)) {
14011 0 : unsigned long long test_var;
14012 0 : test_var = PyLong_AsUnsignedLongLong(value);
14013 0 : if (PyErr_Occurred() != NULL) {
14014 0 : return -1;
14015 : }
14016 0 : if (test_var > uint_max) {
14017 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14018 : PyLong_Type.tp_name, uint_max, test_var);
14019 0 : return -1;
14020 : }
14021 0 : object->opcode = test_var;
14022 : } else {
14023 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14024 : PyLong_Type.tp_name);
14025 0 : return -1;
14026 : }
14027 : }
14028 0 : return 0;
14029 : }
14030 :
14031 0 : static PyObject *py_nbt_browse_packet_get_payload(PyObject *obj, void *closure)
14032 : {
14033 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(obj);
14034 0 : PyObject *py_payload;
14035 0 : py_payload = pyrpc_import_union(&nbt_browse_payload_Type, pytalloc_get_mem_ctx(obj), object->opcode, &object->payload, "union nbt_browse_payload");
14036 0 : if (py_payload == NULL) {
14037 0 : return NULL;
14038 : }
14039 0 : return py_payload;
14040 : }
14041 :
14042 0 : static int py_nbt_browse_packet_set_payload(PyObject *py_obj, PyObject *value, void *closure)
14043 : {
14044 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(py_obj);
14045 0 : if (value == NULL) {
14046 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->payload");
14047 0 : return -1;
14048 : }
14049 : {
14050 0 : union nbt_browse_payload *payload_switch_0;
14051 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");
14052 0 : if (payload_switch_0 == NULL) {
14053 0 : return -1;
14054 : }
14055 0 : object->payload = *payload_switch_0;
14056 : }
14057 0 : return 0;
14058 : }
14059 :
14060 : static PyGetSetDef py_nbt_browse_packet_getsetters[] = {
14061 : {
14062 : .name = discard_const_p(char, "opcode"),
14063 : .get = py_nbt_browse_packet_get_opcode,
14064 : .set = py_nbt_browse_packet_set_opcode,
14065 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_browse_opcode")
14066 : },
14067 : {
14068 : .name = discard_const_p(char, "payload"),
14069 : .get = py_nbt_browse_packet_get_payload,
14070 : .set = py_nbt_browse_packet_set_payload,
14071 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_browse_payload")
14072 : },
14073 : { .name = NULL }
14074 : };
14075 :
14076 0 : static PyObject *py_nbt_browse_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14077 : {
14078 0 : return pytalloc_new(struct nbt_browse_packet, type);
14079 : }
14080 :
14081 0 : static PyObject *py_nbt_browse_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14082 : {
14083 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(py_obj);
14084 0 : PyObject *ret = NULL;
14085 0 : DATA_BLOB blob;
14086 0 : enum ndr_err_code err;
14087 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
14088 0 : if (tmp_ctx == NULL) {
14089 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14090 0 : return NULL;
14091 : }
14092 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_browse_packet);
14093 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14094 0 : TALLOC_FREE(tmp_ctx);
14095 0 : PyErr_SetNdrError(err);
14096 0 : return NULL;
14097 : }
14098 :
14099 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14100 0 : TALLOC_FREE(tmp_ctx);
14101 0 : return ret;
14102 : }
14103 :
14104 0 : static PyObject *py_nbt_browse_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14105 : {
14106 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(py_obj);
14107 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
14108 0 : Py_ssize_t blob_length = 0;
14109 0 : enum ndr_err_code err;
14110 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
14111 0 : PyObject *allow_remaining_obj = NULL;
14112 0 : bool allow_remaining = false;
14113 :
14114 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
14115 : discard_const_p(char *, kwnames),
14116 : &blob.data, &blob_length,
14117 : &allow_remaining_obj)) {
14118 0 : return NULL;
14119 : }
14120 0 : blob.length = blob_length;
14121 :
14122 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14123 0 : allow_remaining = true;
14124 : }
14125 :
14126 0 : if (allow_remaining) {
14127 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_browse_packet);
14128 : } else {
14129 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);
14130 : }
14131 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14132 0 : PyErr_SetNdrError(err);
14133 0 : return NULL;
14134 : }
14135 :
14136 0 : Py_RETURN_NONE;
14137 : }
14138 :
14139 0 : static PyObject *py_nbt_browse_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14140 : {
14141 0 : struct nbt_browse_packet *object = pytalloc_get_ptr(py_obj);
14142 0 : PyObject *ret;
14143 0 : char *retstr;
14144 :
14145 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);
14146 0 : ret = PyUnicode_FromString(retstr);
14147 0 : talloc_free(retstr);
14148 :
14149 0 : return ret;
14150 : }
14151 :
14152 : static PyMethodDef py_nbt_browse_packet_methods[] = {
14153 : { "__ndr_pack__", (PyCFunction)py_nbt_browse_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
14154 : { "__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" },
14155 : { "__ndr_print__", (PyCFunction)py_nbt_browse_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
14156 : { NULL, NULL, 0, NULL }
14157 : };
14158 :
14159 :
14160 : static PyTypeObject nbt_browse_packet_Type = {
14161 : PyVarObject_HEAD_INIT(NULL, 0)
14162 : .tp_name = "nbt.browse_packet",
14163 : .tp_getset = py_nbt_browse_packet_getsetters,
14164 : .tp_methods = py_nbt_browse_packet_methods,
14165 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14166 : .tp_new = py_nbt_browse_packet_new,
14167 : };
14168 :
14169 :
14170 : const struct PyNdrRpcMethodDef py_ndr_nbt_methods[] = {
14171 : {0}
14172 : };
14173 :
14174 0 : static PyObject *interface_nbt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14175 : {
14176 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_nbt);
14177 : }
14178 :
14179 : #define PY_DOC_NBT "NBT messages"
14180 : static PyTypeObject nbt_InterfaceType = {
14181 : PyVarObject_HEAD_INIT(NULL, 0)
14182 : .tp_name = "nbt.nbt",
14183 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
14184 : .tp_doc = "nbt(binding, lp_ctx=None, credentials=None) -> connection\n"
14185 : "\n"
14186 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
14187 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
14188 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_NBT,
14189 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14190 : .tp_new = interface_nbt_new,
14191 : };
14192 :
14193 0 : static PyObject *syntax_nbt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14194 : {
14195 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_nbt.syntax_id);
14196 : }
14197 :
14198 : #define PY_DOC_NBT_SYNTAX "NBT messages"
14199 : static PyTypeObject nbt_SyntaxType = {
14200 : PyVarObject_HEAD_INIT(NULL, 0)
14201 : .tp_name = "nbt.nbt_abstract_syntax",
14202 : .tp_doc = "nbt_abstract_syntax()\n"PY_DOC_NBT_SYNTAX,
14203 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14204 : .tp_new = syntax_nbt_new,
14205 : };
14206 :
14207 : static PyMethodDef nbt_methods[] = {
14208 : { NULL, NULL, 0, NULL }
14209 : };
14210 :
14211 : static struct PyModuleDef moduledef = {
14212 : PyModuleDef_HEAD_INIT,
14213 : .m_name = "nbt",
14214 : .m_doc = "nbt DCE/RPC",
14215 : .m_size = -1,
14216 : .m_methods = nbt_methods,
14217 : };
14218 4710 : MODULE_INIT_FUNC(nbt)
14219 : {
14220 4710 : PyObject *m = NULL;
14221 4710 : PyObject *dep_samba_dcerpc_misc = NULL;
14222 4710 : PyObject *dep_samba_dcerpc_security = NULL;
14223 4710 : PyObject *dep_talloc = NULL;
14224 4710 : PyObject *dep_samba_dcerpc_base = NULL;
14225 :
14226 4710 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
14227 4710 : if (dep_samba_dcerpc_misc == NULL)
14228 0 : goto out;
14229 :
14230 4710 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
14231 4710 : if (dep_samba_dcerpc_security == NULL)
14232 0 : goto out;
14233 :
14234 4710 : dep_talloc = PyImport_ImportModule("talloc");
14235 4710 : if (dep_talloc == NULL)
14236 0 : goto out;
14237 :
14238 4710 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
14239 4710 : if (dep_samba_dcerpc_base == NULL)
14240 0 : goto out;
14241 :
14242 4710 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
14243 4710 : if (BaseObject_Type == NULL)
14244 0 : goto out;
14245 :
14246 4710 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
14247 4710 : if (dom_sid_Type == NULL)
14248 0 : goto out;
14249 :
14250 4710 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
14251 4710 : if (GUID_Type == NULL)
14252 0 : goto out;
14253 :
14254 4710 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
14255 4710 : if (ClientConnection_Type == NULL)
14256 0 : goto out;
14257 :
14258 4710 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
14259 4710 : if (ndr_syntax_id_Type == NULL)
14260 0 : goto out;
14261 :
14262 4710 : nbt_name_Type.tp_base = BaseObject_Type;
14263 4710 : nbt_name_Type.tp_basicsize = pytalloc_BaseObject_size();
14264 :
14265 4710 : nbt_name_question_Type.tp_base = BaseObject_Type;
14266 4710 : nbt_name_question_Type.tp_basicsize = pytalloc_BaseObject_size();
14267 :
14268 4710 : nbt_rdata_address_Type.tp_base = BaseObject_Type;
14269 4710 : nbt_rdata_address_Type.tp_basicsize = pytalloc_BaseObject_size();
14270 :
14271 4710 : nbt_rdata_netbios_Type.tp_base = BaseObject_Type;
14272 4710 : nbt_rdata_netbios_Type.tp_basicsize = pytalloc_BaseObject_size();
14273 :
14274 4710 : nbt_statistics_Type.tp_base = BaseObject_Type;
14275 4710 : nbt_statistics_Type.tp_basicsize = pytalloc_BaseObject_size();
14276 :
14277 4710 : nbt_status_name_Type.tp_base = BaseObject_Type;
14278 4710 : nbt_status_name_Type.tp_basicsize = pytalloc_BaseObject_size();
14279 :
14280 4710 : nbt_rdata_status_Type.tp_base = BaseObject_Type;
14281 4710 : nbt_rdata_status_Type.tp_basicsize = pytalloc_BaseObject_size();
14282 :
14283 4710 : nbt_rdata_data_Type.tp_base = BaseObject_Type;
14284 4710 : nbt_rdata_data_Type.tp_basicsize = pytalloc_BaseObject_size();
14285 :
14286 4710 : nbt_rdata_Type.tp_base = BaseObject_Type;
14287 4710 : nbt_rdata_Type.tp_basicsize = pytalloc_BaseObject_size();
14288 :
14289 4710 : nbt_res_rec_Type.tp_base = BaseObject_Type;
14290 4710 : nbt_res_rec_Type.tp_basicsize = pytalloc_BaseObject_size();
14291 :
14292 4710 : nbt_name_packet_Type.tp_base = BaseObject_Type;
14293 4710 : nbt_name_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14294 :
14295 4710 : smb_trans_body_Type.tp_base = BaseObject_Type;
14296 4710 : smb_trans_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14297 :
14298 4710 : smb_body_Type.tp_base = BaseObject_Type;
14299 4710 : smb_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14300 :
14301 4710 : dgram_smb_packet_Type.tp_base = BaseObject_Type;
14302 4710 : dgram_smb_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14303 :
14304 4710 : dgram_message_body_Type.tp_base = BaseObject_Type;
14305 4710 : dgram_message_body_Type.tp_basicsize = pytalloc_BaseObject_size();
14306 :
14307 4710 : dgram_message_Type.tp_base = BaseObject_Type;
14308 4710 : dgram_message_Type.tp_basicsize = pytalloc_BaseObject_size();
14309 :
14310 4710 : dgram_data_Type.tp_base = BaseObject_Type;
14311 4710 : dgram_data_Type.tp_basicsize = pytalloc_BaseObject_size();
14312 :
14313 4710 : nbt_dgram_packet_Type.tp_base = BaseObject_Type;
14314 4710 : nbt_dgram_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14315 :
14316 4710 : nbt_sockaddr_Type.tp_base = BaseObject_Type;
14317 4710 : nbt_sockaddr_Type.tp_basicsize = pytalloc_BaseObject_size();
14318 :
14319 4710 : NETLOGON_SAM_LOGON_REQUEST_Type.tp_base = BaseObject_Type;
14320 4710 : NETLOGON_SAM_LOGON_REQUEST_Type.tp_basicsize = pytalloc_BaseObject_size();
14321 :
14322 4710 : NETLOGON_LOGON_REQUEST_Type.tp_base = BaseObject_Type;
14323 4710 : NETLOGON_LOGON_REQUEST_Type.tp_basicsize = pytalloc_BaseObject_size();
14324 :
14325 4710 : NETLOGON_SAM_LOGON_RESPONSE_NT40_Type.tp_base = BaseObject_Type;
14326 4710 : NETLOGON_SAM_LOGON_RESPONSE_NT40_Type.tp_basicsize = pytalloc_BaseObject_size();
14327 :
14328 4710 : NETLOGON_SAM_LOGON_RESPONSE_Type.tp_base = BaseObject_Type;
14329 4710 : NETLOGON_SAM_LOGON_RESPONSE_Type.tp_basicsize = pytalloc_BaseObject_size();
14330 :
14331 4710 : NETLOGON_SAM_LOGON_RESPONSE_EX_Type.tp_base = BaseObject_Type;
14332 4710 : NETLOGON_SAM_LOGON_RESPONSE_EX_Type.tp_basicsize = pytalloc_BaseObject_size();
14333 :
14334 4710 : netlogon_samlogon_response_union_Type.tp_base = BaseObject_Type;
14335 4710 : netlogon_samlogon_response_union_Type.tp_basicsize = pytalloc_BaseObject_size();
14336 :
14337 4710 : netlogon_samlogon_response_Type.tp_base = BaseObject_Type;
14338 4710 : netlogon_samlogon_response_Type.tp_basicsize = pytalloc_BaseObject_size();
14339 :
14340 4710 : nbt_netlogon_query_for_pdc_Type.tp_base = BaseObject_Type;
14341 4710 : nbt_netlogon_query_for_pdc_Type.tp_basicsize = pytalloc_BaseObject_size();
14342 :
14343 4710 : nbt_netlogon_response_from_pdc_Type.tp_base = BaseObject_Type;
14344 4710 : nbt_netlogon_response_from_pdc_Type.tp_basicsize = pytalloc_BaseObject_size();
14345 :
14346 4710 : nbt_netlogon_response2_Type.tp_base = BaseObject_Type;
14347 4710 : nbt_netlogon_response2_Type.tp_basicsize = pytalloc_BaseObject_size();
14348 :
14349 4710 : nbt_db_change_info_Type.tp_base = BaseObject_Type;
14350 4710 : nbt_db_change_info_Type.tp_basicsize = pytalloc_BaseObject_size();
14351 :
14352 4710 : NETLOGON_DB_CHANGE_Type.tp_base = BaseObject_Type;
14353 4710 : NETLOGON_DB_CHANGE_Type.tp_basicsize = pytalloc_BaseObject_size();
14354 :
14355 4710 : nbt_netlogon_request_Type.tp_base = BaseObject_Type;
14356 4710 : nbt_netlogon_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14357 :
14358 4710 : nbt_netlogon_packet_Type.tp_base = BaseObject_Type;
14359 4710 : nbt_netlogon_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14360 :
14361 4710 : nbt_browse_host_announcement_Type.tp_base = BaseObject_Type;
14362 4710 : nbt_browse_host_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14363 :
14364 4710 : nbt_browse_announcement_request_Type.tp_base = BaseObject_Type;
14365 4710 : nbt_browse_announcement_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14366 :
14367 4710 : nbt_browse_election_request_Type.tp_base = BaseObject_Type;
14368 4710 : nbt_browse_election_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14369 :
14370 4710 : nbt_browse_backup_list_request_Type.tp_base = BaseObject_Type;
14371 4710 : nbt_browse_backup_list_request_Type.tp_basicsize = pytalloc_BaseObject_size();
14372 :
14373 4710 : nbt_browse_backup_list_response_Type.tp_base = BaseObject_Type;
14374 4710 : nbt_browse_backup_list_response_Type.tp_basicsize = pytalloc_BaseObject_size();
14375 :
14376 4710 : nbt_browse_become_backup_Type.tp_base = BaseObject_Type;
14377 4710 : nbt_browse_become_backup_Type.tp_basicsize = pytalloc_BaseObject_size();
14378 :
14379 4710 : nbt_browse_domain_announcement_Type.tp_base = BaseObject_Type;
14380 4710 : nbt_browse_domain_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14381 :
14382 4710 : nbt_browse_master_announcement_Type.tp_base = BaseObject_Type;
14383 4710 : nbt_browse_master_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14384 :
14385 4710 : nbt_browse_reset_state_Type.tp_base = BaseObject_Type;
14386 4710 : nbt_browse_reset_state_Type.tp_basicsize = pytalloc_BaseObject_size();
14387 :
14388 4710 : nbt_browse_local_master_announcement_Type.tp_base = BaseObject_Type;
14389 4710 : nbt_browse_local_master_announcement_Type.tp_basicsize = pytalloc_BaseObject_size();
14390 :
14391 4710 : nbt_browse_payload_Type.tp_base = BaseObject_Type;
14392 4710 : nbt_browse_payload_Type.tp_basicsize = pytalloc_BaseObject_size();
14393 :
14394 4710 : nbt_browse_packet_Type.tp_base = BaseObject_Type;
14395 4710 : nbt_browse_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
14396 :
14397 4710 : nbt_InterfaceType.tp_base = ClientConnection_Type;
14398 :
14399 4710 : nbt_SyntaxType.tp_base = ndr_syntax_id_Type;
14400 4710 : nbt_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
14401 :
14402 4710 : if (PyType_Ready(&nbt_name_Type) < 0)
14403 0 : goto out;
14404 4710 : if (PyType_Ready(&nbt_name_question_Type) < 0)
14405 0 : goto out;
14406 4710 : if (PyType_Ready(&nbt_rdata_address_Type) < 0)
14407 0 : goto out;
14408 4710 : if (PyType_Ready(&nbt_rdata_netbios_Type) < 0)
14409 0 : goto out;
14410 4710 : if (PyType_Ready(&nbt_statistics_Type) < 0)
14411 0 : goto out;
14412 4710 : if (PyType_Ready(&nbt_status_name_Type) < 0)
14413 0 : goto out;
14414 4710 : if (PyType_Ready(&nbt_rdata_status_Type) < 0)
14415 0 : goto out;
14416 4710 : if (PyType_Ready(&nbt_rdata_data_Type) < 0)
14417 0 : goto out;
14418 4710 : if (PyType_Ready(&nbt_rdata_Type) < 0)
14419 0 : goto out;
14420 4710 : if (PyType_Ready(&nbt_res_rec_Type) < 0)
14421 0 : goto out;
14422 4710 : if (PyType_Ready(&nbt_name_packet_Type) < 0)
14423 0 : goto out;
14424 4710 : if (PyType_Ready(&smb_trans_body_Type) < 0)
14425 0 : goto out;
14426 4710 : if (PyType_Ready(&smb_body_Type) < 0)
14427 0 : goto out;
14428 4710 : if (PyType_Ready(&dgram_smb_packet_Type) < 0)
14429 0 : goto out;
14430 4710 : if (PyType_Ready(&dgram_message_body_Type) < 0)
14431 0 : goto out;
14432 4710 : if (PyType_Ready(&dgram_message_Type) < 0)
14433 0 : goto out;
14434 4710 : if (PyType_Ready(&dgram_data_Type) < 0)
14435 0 : goto out;
14436 4710 : if (PyType_Ready(&nbt_dgram_packet_Type) < 0)
14437 0 : goto out;
14438 4710 : if (PyType_Ready(&nbt_sockaddr_Type) < 0)
14439 0 : goto out;
14440 4710 : if (PyType_Ready(&NETLOGON_SAM_LOGON_REQUEST_Type) < 0)
14441 0 : goto out;
14442 4710 : if (PyType_Ready(&NETLOGON_LOGON_REQUEST_Type) < 0)
14443 0 : goto out;
14444 4710 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type) < 0)
14445 0 : goto out;
14446 4710 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_Type) < 0)
14447 0 : goto out;
14448 4710 : if (PyType_Ready(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type) < 0)
14449 0 : goto out;
14450 4710 : if (PyType_Ready(&netlogon_samlogon_response_union_Type) < 0)
14451 0 : goto out;
14452 4710 : if (PyType_Ready(&netlogon_samlogon_response_Type) < 0)
14453 0 : goto out;
14454 4710 : if (PyType_Ready(&nbt_netlogon_query_for_pdc_Type) < 0)
14455 0 : goto out;
14456 4710 : if (PyType_Ready(&nbt_netlogon_response_from_pdc_Type) < 0)
14457 0 : goto out;
14458 4710 : if (PyType_Ready(&nbt_netlogon_response2_Type) < 0)
14459 0 : goto out;
14460 4710 : if (PyType_Ready(&nbt_db_change_info_Type) < 0)
14461 0 : goto out;
14462 4710 : if (PyType_Ready(&NETLOGON_DB_CHANGE_Type) < 0)
14463 0 : goto out;
14464 4710 : if (PyType_Ready(&nbt_netlogon_request_Type) < 0)
14465 0 : goto out;
14466 4710 : if (PyType_Ready(&nbt_netlogon_packet_Type) < 0)
14467 0 : goto out;
14468 4710 : if (PyType_Ready(&nbt_browse_host_announcement_Type) < 0)
14469 0 : goto out;
14470 4710 : if (PyType_Ready(&nbt_browse_announcement_request_Type) < 0)
14471 0 : goto out;
14472 4710 : if (PyType_Ready(&nbt_browse_election_request_Type) < 0)
14473 0 : goto out;
14474 4710 : if (PyType_Ready(&nbt_browse_backup_list_request_Type) < 0)
14475 0 : goto out;
14476 4710 : if (PyType_Ready(&nbt_browse_backup_list_response_Type) < 0)
14477 0 : goto out;
14478 4710 : if (PyType_Ready(&nbt_browse_become_backup_Type) < 0)
14479 0 : goto out;
14480 4710 : if (PyType_Ready(&nbt_browse_domain_announcement_Type) < 0)
14481 0 : goto out;
14482 4710 : if (PyType_Ready(&nbt_browse_master_announcement_Type) < 0)
14483 0 : goto out;
14484 4710 : if (PyType_Ready(&nbt_browse_reset_state_Type) < 0)
14485 0 : goto out;
14486 4710 : if (PyType_Ready(&nbt_browse_local_master_announcement_Type) < 0)
14487 0 : goto out;
14488 4710 : if (PyType_Ready(&nbt_browse_payload_Type) < 0)
14489 0 : goto out;
14490 4710 : if (PyType_Ready(&nbt_browse_packet_Type) < 0)
14491 0 : goto out;
14492 4710 : if (PyType_Ready(&nbt_InterfaceType) < 0)
14493 0 : goto out;
14494 4710 : if (PyType_Ready(&nbt_SyntaxType) < 0)
14495 0 : goto out;
14496 4710 : if (!PyInterface_AddNdrRpcMethods(&nbt_InterfaceType, py_ndr_nbt_methods))
14497 0 : return NULL;
14498 :
14499 : #ifdef PY_NAME_PATCH
14500 : PY_NAME_PATCH(&nbt_name_Type);
14501 : #endif
14502 : #ifdef PY_NAME_QUESTION_PATCH
14503 : PY_NAME_QUESTION_PATCH(&nbt_name_question_Type);
14504 : #endif
14505 : #ifdef PY_RDATA_ADDRESS_PATCH
14506 : PY_RDATA_ADDRESS_PATCH(&nbt_rdata_address_Type);
14507 : #endif
14508 : #ifdef PY_RDATA_NETBIOS_PATCH
14509 : PY_RDATA_NETBIOS_PATCH(&nbt_rdata_netbios_Type);
14510 : #endif
14511 : #ifdef PY_STATISTICS_PATCH
14512 : PY_STATISTICS_PATCH(&nbt_statistics_Type);
14513 : #endif
14514 : #ifdef PY_STATUS_NAME_PATCH
14515 : PY_STATUS_NAME_PATCH(&nbt_status_name_Type);
14516 : #endif
14517 : #ifdef PY_RDATA_STATUS_PATCH
14518 : PY_RDATA_STATUS_PATCH(&nbt_rdata_status_Type);
14519 : #endif
14520 : #ifdef PY_RDATA_DATA_PATCH
14521 : PY_RDATA_DATA_PATCH(&nbt_rdata_data_Type);
14522 : #endif
14523 : #ifdef PY_RDATA_PATCH
14524 : PY_RDATA_PATCH(&nbt_rdata_Type);
14525 : #endif
14526 : #ifdef PY_RES_REC_PATCH
14527 : PY_RES_REC_PATCH(&nbt_res_rec_Type);
14528 : #endif
14529 : #ifdef PY_NAME_PACKET_PATCH
14530 : PY_NAME_PACKET_PATCH(&nbt_name_packet_Type);
14531 : #endif
14532 : #ifdef PY_SMB_TRANS_BODY_PATCH
14533 : PY_SMB_TRANS_BODY_PATCH(&smb_trans_body_Type);
14534 : #endif
14535 : #ifdef PY_SMB_BODY_PATCH
14536 : PY_SMB_BODY_PATCH(&smb_body_Type);
14537 : #endif
14538 : #ifdef PY_DGRAM_SMB_PACKET_PATCH
14539 : PY_DGRAM_SMB_PACKET_PATCH(&dgram_smb_packet_Type);
14540 : #endif
14541 : #ifdef PY_DGRAM_MESSAGE_BODY_PATCH
14542 : PY_DGRAM_MESSAGE_BODY_PATCH(&dgram_message_body_Type);
14543 : #endif
14544 : #ifdef PY_DGRAM_MESSAGE_PATCH
14545 : PY_DGRAM_MESSAGE_PATCH(&dgram_message_Type);
14546 : #endif
14547 : #ifdef PY_DGRAM_DATA_PATCH
14548 : PY_DGRAM_DATA_PATCH(&dgram_data_Type);
14549 : #endif
14550 : #ifdef PY_DGRAM_PACKET_PATCH
14551 : PY_DGRAM_PACKET_PATCH(&nbt_dgram_packet_Type);
14552 : #endif
14553 : #ifdef PY_SOCKADDR_PATCH
14554 : PY_SOCKADDR_PATCH(&nbt_sockaddr_Type);
14555 : #endif
14556 : #ifdef PY_NETLOGON_SAM_LOGON_REQUEST_PATCH
14557 : PY_NETLOGON_SAM_LOGON_REQUEST_PATCH(&NETLOGON_SAM_LOGON_REQUEST_Type);
14558 : #endif
14559 : #ifdef PY_NETLOGON_LOGON_REQUEST_PATCH
14560 : PY_NETLOGON_LOGON_REQUEST_PATCH(&NETLOGON_LOGON_REQUEST_Type);
14561 : #endif
14562 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_NT40_PATCH
14563 : PY_NETLOGON_SAM_LOGON_RESPONSE_NT40_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14564 : #endif
14565 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_PATCH
14566 : PY_NETLOGON_SAM_LOGON_RESPONSE_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_Type);
14567 : #endif
14568 : #ifdef PY_NETLOGON_SAM_LOGON_RESPONSE_EX_PATCH
14569 : PY_NETLOGON_SAM_LOGON_RESPONSE_EX_PATCH(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14570 : #endif
14571 : #ifdef PY_NETLOGON_SAMLOGON_RESPONSE_UNION_PATCH
14572 : PY_NETLOGON_SAMLOGON_RESPONSE_UNION_PATCH(&netlogon_samlogon_response_union_Type);
14573 : #endif
14574 : #ifdef PY_NETLOGON_SAMLOGON_RESPONSE_PATCH
14575 : PY_NETLOGON_SAMLOGON_RESPONSE_PATCH(&netlogon_samlogon_response_Type);
14576 : #endif
14577 : #ifdef PY_NETLOGON_QUERY_FOR_PDC_PATCH
14578 : PY_NETLOGON_QUERY_FOR_PDC_PATCH(&nbt_netlogon_query_for_pdc_Type);
14579 : #endif
14580 : #ifdef PY_NETLOGON_RESPONSE_FROM_PDC_PATCH
14581 : PY_NETLOGON_RESPONSE_FROM_PDC_PATCH(&nbt_netlogon_response_from_pdc_Type);
14582 : #endif
14583 : #ifdef PY_NETLOGON_RESPONSE2_PATCH
14584 : PY_NETLOGON_RESPONSE2_PATCH(&nbt_netlogon_response2_Type);
14585 : #endif
14586 : #ifdef PY_DB_CHANGE_INFO_PATCH
14587 : PY_DB_CHANGE_INFO_PATCH(&nbt_db_change_info_Type);
14588 : #endif
14589 : #ifdef PY_NETLOGON_DB_CHANGE_PATCH
14590 : PY_NETLOGON_DB_CHANGE_PATCH(&NETLOGON_DB_CHANGE_Type);
14591 : #endif
14592 : #ifdef PY_NETLOGON_REQUEST_PATCH
14593 : PY_NETLOGON_REQUEST_PATCH(&nbt_netlogon_request_Type);
14594 : #endif
14595 : #ifdef PY_NETLOGON_PACKET_PATCH
14596 : PY_NETLOGON_PACKET_PATCH(&nbt_netlogon_packet_Type);
14597 : #endif
14598 : #ifdef PY_BROWSE_HOST_ANNOUNCEMENT_PATCH
14599 : PY_BROWSE_HOST_ANNOUNCEMENT_PATCH(&nbt_browse_host_announcement_Type);
14600 : #endif
14601 : #ifdef PY_BROWSE_ANNOUNCEMENT_REQUEST_PATCH
14602 : PY_BROWSE_ANNOUNCEMENT_REQUEST_PATCH(&nbt_browse_announcement_request_Type);
14603 : #endif
14604 : #ifdef PY_BROWSE_ELECTION_REQUEST_PATCH
14605 : PY_BROWSE_ELECTION_REQUEST_PATCH(&nbt_browse_election_request_Type);
14606 : #endif
14607 : #ifdef PY_BROWSE_BACKUP_LIST_REQUEST_PATCH
14608 : PY_BROWSE_BACKUP_LIST_REQUEST_PATCH(&nbt_browse_backup_list_request_Type);
14609 : #endif
14610 : #ifdef PY_BROWSE_BACKUP_LIST_RESPONSE_PATCH
14611 : PY_BROWSE_BACKUP_LIST_RESPONSE_PATCH(&nbt_browse_backup_list_response_Type);
14612 : #endif
14613 : #ifdef PY_BROWSE_BECOME_BACKUP_PATCH
14614 : PY_BROWSE_BECOME_BACKUP_PATCH(&nbt_browse_become_backup_Type);
14615 : #endif
14616 : #ifdef PY_BROWSE_DOMAIN_ANNOUNCEMENT_PATCH
14617 : PY_BROWSE_DOMAIN_ANNOUNCEMENT_PATCH(&nbt_browse_domain_announcement_Type);
14618 : #endif
14619 : #ifdef PY_BROWSE_MASTER_ANNOUNCEMENT_PATCH
14620 : PY_BROWSE_MASTER_ANNOUNCEMENT_PATCH(&nbt_browse_master_announcement_Type);
14621 : #endif
14622 : #ifdef PY_BROWSE_RESET_STATE_PATCH
14623 : PY_BROWSE_RESET_STATE_PATCH(&nbt_browse_reset_state_Type);
14624 : #endif
14625 : #ifdef PY_BROWSE_LOCAL_MASTER_ANNOUNCEMENT_PATCH
14626 : PY_BROWSE_LOCAL_MASTER_ANNOUNCEMENT_PATCH(&nbt_browse_local_master_announcement_Type);
14627 : #endif
14628 : #ifdef PY_BROWSE_PAYLOAD_PATCH
14629 : PY_BROWSE_PAYLOAD_PATCH(&nbt_browse_payload_Type);
14630 : #endif
14631 : #ifdef PY_BROWSE_PACKET_PATCH
14632 : PY_BROWSE_PACKET_PATCH(&nbt_browse_packet_Type);
14633 : #endif
14634 : #ifdef PY_NBT_PATCH
14635 : PY_NBT_PATCH(&nbt_InterfaceType);
14636 : #endif
14637 : #ifdef PY_NBT_ABSTRACT_SYNTAX_PATCH
14638 : PY_NBT_ABSTRACT_SYNTAX_PATCH(&nbt_SyntaxType);
14639 : #endif
14640 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
14641 : PY_ABSTRACT_SYNTAX_PATCH(&nbt_SyntaxType);
14642 : #endif
14643 :
14644 4710 : m = PyModule_Create(&moduledef);
14645 4710 : if (m == NULL)
14646 0 : goto out;
14647 :
14648 4710 : PyModule_AddObject(m, "NBT_NAME_SERVICE_PORT", PyLong_FromUnsignedLongLong(137));
14649 4710 : PyModule_AddObject(m, "NBT_DGRAM_SERVICE_PORT", PyLong_FromUnsignedLongLong(138));
14650 4710 : PyModule_AddObject(m, "NBT_MAILSLOT_NETLOGON", PyUnicode_FromString("\\MAILSLOT\\NET\\NETLOGON"));
14651 4710 : PyModule_AddObject(m, "NBT_MAILSLOT_NTLOGON", PyUnicode_FromString("\\MAILSLOT\\NET\\NTLOGON"));
14652 4710 : PyModule_AddObject(m, "NBT_MAILSLOT_GETDC", PyUnicode_FromString("\\MAILSLOT\\NET\\GETDC"));
14653 4710 : PyModule_AddObject(m, "NBT_MAILSLOT_BROWSE", PyUnicode_FromString("\\MAILSLOT\\BROWSE"));
14654 4710 : PyModule_AddObject(m, "DGRAM_SMB", PyLong_FromUnsignedLongLong(0xff534d42));
14655 4710 : PyModule_AddObject(m, "NBT_RCODE", PyLong_FromLong((uint16_t)(NBT_RCODE)));
14656 4710 : PyModule_AddObject(m, "NBT_FLAG_BROADCAST", PyLong_FromLong((uint16_t)(NBT_FLAG_BROADCAST)));
14657 4710 : PyModule_AddObject(m, "NBT_FLAG_RECURSION_AVAIL", PyLong_FromLong((uint16_t)(NBT_FLAG_RECURSION_AVAIL)));
14658 4710 : PyModule_AddObject(m, "NBT_FLAG_RECURSION_DESIRED", PyLong_FromLong((uint16_t)(NBT_FLAG_RECURSION_DESIRED)));
14659 4710 : PyModule_AddObject(m, "NBT_FLAG_TRUNCATION", PyLong_FromLong((uint16_t)(NBT_FLAG_TRUNCATION)));
14660 4710 : PyModule_AddObject(m, "NBT_FLAG_AUTHORITATIVE", PyLong_FromLong((uint16_t)(NBT_FLAG_AUTHORITATIVE)));
14661 4710 : PyModule_AddObject(m, "NBT_OPCODE", PyLong_FromLong((uint16_t)(NBT_OPCODE)));
14662 4710 : PyModule_AddObject(m, "NBT_FLAG_REPLY", PyLong_FromLong((uint16_t)(NBT_FLAG_REPLY)));
14663 4710 : PyModule_AddObject(m, "NBT_OPCODE_QUERY", PyLong_FromLong((uint16_t)(NBT_OPCODE_QUERY)));
14664 4710 : PyModule_AddObject(m, "NBT_OPCODE_REGISTER", PyLong_FromLong((uint16_t)(NBT_OPCODE_REGISTER)));
14665 4710 : PyModule_AddObject(m, "NBT_OPCODE_RELEASE", PyLong_FromLong((uint16_t)(NBT_OPCODE_RELEASE)));
14666 4710 : PyModule_AddObject(m, "NBT_OPCODE_WACK", PyLong_FromLong((uint16_t)(NBT_OPCODE_WACK)));
14667 4710 : PyModule_AddObject(m, "NBT_OPCODE_REFRESH", PyLong_FromLong((uint16_t)(NBT_OPCODE_REFRESH)));
14668 4710 : PyModule_AddObject(m, "NBT_OPCODE_REFRESH2", PyLong_FromLong((uint16_t)(NBT_OPCODE_REFRESH2)));
14669 4710 : PyModule_AddObject(m, "NBT_OPCODE_MULTI_HOME_REG", PyLong_FromLong((uint16_t)(NBT_OPCODE_MULTI_HOME_REG)));
14670 4710 : PyModule_AddObject(m, "NBT_RCODE_OK", PyLong_FromLong((uint16_t)(NBT_RCODE_OK)));
14671 4710 : PyModule_AddObject(m, "NBT_RCODE_FMT", PyLong_FromLong((uint16_t)(NBT_RCODE_FMT)));
14672 4710 : PyModule_AddObject(m, "NBT_RCODE_SVR", PyLong_FromLong((uint16_t)(NBT_RCODE_SVR)));
14673 4710 : PyModule_AddObject(m, "NBT_RCODE_NAM", PyLong_FromLong((uint16_t)(NBT_RCODE_NAM)));
14674 4710 : PyModule_AddObject(m, "NBT_RCODE_IMP", PyLong_FromLong((uint16_t)(NBT_RCODE_IMP)));
14675 4710 : PyModule_AddObject(m, "NBT_RCODE_RFS", PyLong_FromLong((uint16_t)(NBT_RCODE_RFS)));
14676 4710 : PyModule_AddObject(m, "NBT_RCODE_ACT", PyLong_FromLong((uint16_t)(NBT_RCODE_ACT)));
14677 4710 : PyModule_AddObject(m, "NBT_RCODE_CFT", PyLong_FromLong((uint16_t)(NBT_RCODE_CFT)));
14678 4710 : PyModule_AddObject(m, "NBT_NAME_CLIENT", PyLong_FromLong((uint16_t)(NBT_NAME_CLIENT)));
14679 4710 : PyModule_AddObject(m, "NBT_NAME_MS", PyLong_FromLong((uint16_t)(NBT_NAME_MS)));
14680 4710 : PyModule_AddObject(m, "NBT_NAME_USER", PyLong_FromLong((uint16_t)(NBT_NAME_USER)));
14681 4710 : PyModule_AddObject(m, "NBT_NAME_SERVER", PyLong_FromLong((uint16_t)(NBT_NAME_SERVER)));
14682 4710 : PyModule_AddObject(m, "NBT_NAME_PDC", PyLong_FromLong((uint16_t)(NBT_NAME_PDC)));
14683 4710 : PyModule_AddObject(m, "NBT_NAME_LOGON", PyLong_FromLong((uint16_t)(NBT_NAME_LOGON)));
14684 4710 : PyModule_AddObject(m, "NBT_NAME_MASTER", PyLong_FromLong((uint16_t)(NBT_NAME_MASTER)));
14685 4710 : PyModule_AddObject(m, "NBT_NAME_BROWSER", PyLong_FromLong((uint16_t)(NBT_NAME_BROWSER)));
14686 4710 : PyModule_AddObject(m, "NBT_QCLASS_IP", PyLong_FromLong((uint16_t)(NBT_QCLASS_IP)));
14687 4710 : PyModule_AddObject(m, "NBT_QTYPE_ADDRESS", PyLong_FromLong((uint16_t)(NBT_QTYPE_ADDRESS)));
14688 4710 : PyModule_AddObject(m, "NBT_QTYPE_NAMESERVICE", PyLong_FromLong((uint16_t)(NBT_QTYPE_NAMESERVICE)));
14689 4710 : PyModule_AddObject(m, "NBT_QTYPE_NULL", PyLong_FromLong((uint16_t)(NBT_QTYPE_NULL)));
14690 4710 : PyModule_AddObject(m, "NBT_QTYPE_NETBIOS", PyLong_FromLong((uint16_t)(NBT_QTYPE_NETBIOS)));
14691 4710 : PyModule_AddObject(m, "NBT_QTYPE_STATUS", PyLong_FromLong((uint16_t)(NBT_QTYPE_STATUS)));
14692 4710 : PyModule_AddObject(m, "NBT_QTYPE_WACK", PyLong_FromLong((uint16_t)(NBT_QTYPE_WACK)));
14693 4710 : PyModule_AddObject(m, "NBT_NODE_B", PyLong_FromLong((uint16_t)(NBT_NODE_B)));
14694 4710 : PyModule_AddObject(m, "NBT_NODE_P", PyLong_FromLong((uint16_t)(NBT_NODE_P)));
14695 4710 : PyModule_AddObject(m, "NBT_NODE_M", PyLong_FromLong((uint16_t)(NBT_NODE_M)));
14696 4710 : PyModule_AddObject(m, "NBT_NODE_H", PyLong_FromLong((uint16_t)(NBT_NODE_H)));
14697 4710 : PyModule_AddObject(m, "NBT_NM_PERMANENT", PyLong_FromLong((uint16_t)(NBT_NM_PERMANENT)));
14698 4710 : PyModule_AddObject(m, "NBT_NM_ACTIVE", PyLong_FromLong((uint16_t)(NBT_NM_ACTIVE)));
14699 4710 : PyModule_AddObject(m, "NBT_NM_CONFLICT", PyLong_FromLong((uint16_t)(NBT_NM_CONFLICT)));
14700 4710 : PyModule_AddObject(m, "NBT_NM_DEREGISTER", PyLong_FromLong((uint16_t)(NBT_NM_DEREGISTER)));
14701 4710 : PyModule_AddObject(m, "NBT_NM_OWNER_TYPE", PyLong_FromLong((uint16_t)(NBT_NM_OWNER_TYPE)));
14702 4710 : PyModule_AddObject(m, "NBT_NM_GROUP", PyLong_FromLong((uint16_t)(NBT_NM_GROUP)));
14703 4710 : PyModule_AddObject(m, "DGRAM_DIRECT_UNIQUE", PyLong_FromLong((uint16_t)(DGRAM_DIRECT_UNIQUE)));
14704 4710 : PyModule_AddObject(m, "DGRAM_DIRECT_GROUP", PyLong_FromLong((uint16_t)(DGRAM_DIRECT_GROUP)));
14705 4710 : PyModule_AddObject(m, "DGRAM_BCAST", PyLong_FromLong((uint16_t)(DGRAM_BCAST)));
14706 4710 : PyModule_AddObject(m, "DGRAM_ERROR", PyLong_FromLong((uint16_t)(DGRAM_ERROR)));
14707 4710 : PyModule_AddObject(m, "DGRAM_QUERY", PyLong_FromLong((uint16_t)(DGRAM_QUERY)));
14708 4710 : PyModule_AddObject(m, "DGRAM_QUERY_POSITIVE", PyLong_FromLong((uint16_t)(DGRAM_QUERY_POSITIVE)));
14709 4710 : PyModule_AddObject(m, "DGRAM_QUERY_NEGATIVE", PyLong_FromLong((uint16_t)(DGRAM_QUERY_NEGATIVE)));
14710 4710 : PyModule_AddObject(m, "DGRAM_FLAG_MORE", PyLong_FromLong((uint16_t)(DGRAM_FLAG_MORE)));
14711 4710 : PyModule_AddObject(m, "DGRAM_FLAG_FIRST", PyLong_FromLong((uint16_t)(DGRAM_FLAG_FIRST)));
14712 4710 : PyModule_AddObject(m, "DGRAM_FLAG_NODE_TYPE", PyLong_FromLong((uint16_t)(DGRAM_FLAG_NODE_TYPE)));
14713 4710 : PyModule_AddObject(m, "DGRAM_NODE_B", PyLong_FromLong((uint16_t)(DGRAM_NODE_B)));
14714 4710 : PyModule_AddObject(m, "DGRAM_NODE_P", PyLong_FromLong((uint16_t)(DGRAM_NODE_P)));
14715 4710 : PyModule_AddObject(m, "DGRAM_NODE_M", PyLong_FromLong((uint16_t)(DGRAM_NODE_M)));
14716 4710 : PyModule_AddObject(m, "DGRAM_NODE_NBDD", PyLong_FromLong((uint16_t)(DGRAM_NODE_NBDD)));
14717 4710 : PyModule_AddObject(m, "SMB_TRANSACTION", PyLong_FromLong((uint16_t)(SMB_TRANSACTION)));
14718 4710 : PyModule_AddObject(m, "DGRAM_ERROR_NAME_NOT_PRESENT", PyLong_FromLong((uint16_t)(DGRAM_ERROR_NAME_NOT_PRESENT)));
14719 4710 : PyModule_AddObject(m, "DGRAM_ERROR_INVALID_SOURCE", PyLong_FromLong((uint16_t)(DGRAM_ERROR_INVALID_SOURCE)));
14720 4710 : PyModule_AddObject(m, "DGRAM_ERROR_INVALID_DEST", PyLong_FromLong((uint16_t)(DGRAM_ERROR_INVALID_DEST)));
14721 4710 : PyModule_AddObject(m, "NBT_SERVER_PDC", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_PDC)));
14722 4710 : PyModule_AddObject(m, "NBT_SERVER_GC", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_GC)));
14723 4710 : PyModule_AddObject(m, "NBT_SERVER_LDAP", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_LDAP)));
14724 4710 : PyModule_AddObject(m, "NBT_SERVER_DS", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_DS)));
14725 4710 : PyModule_AddObject(m, "NBT_SERVER_KDC", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_KDC)));
14726 4710 : PyModule_AddObject(m, "NBT_SERVER_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_TIMESERV)));
14727 4710 : PyModule_AddObject(m, "NBT_SERVER_CLOSEST", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_CLOSEST)));
14728 4710 : PyModule_AddObject(m, "NBT_SERVER_WRITABLE", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_WRITABLE)));
14729 4710 : PyModule_AddObject(m, "NBT_SERVER_GOOD_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_GOOD_TIMESERV)));
14730 4710 : PyModule_AddObject(m, "NBT_SERVER_NDNC", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_NDNC)));
14731 4710 : PyModule_AddObject(m, "NBT_SERVER_SELECT_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_SELECT_SECRET_DOMAIN_6)));
14732 4710 : PyModule_AddObject(m, "NBT_SERVER_FULL_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_FULL_SECRET_DOMAIN_6)));
14733 4710 : PyModule_AddObject(m, "NBT_SERVER_ADS_WEB_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_ADS_WEB_SERVICE)));
14734 4710 : PyModule_AddObject(m, "NBT_SERVER_DS_8", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_DS_8)));
14735 4710 : PyModule_AddObject(m, "NBT_SERVER_DS_9", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_DS_9)));
14736 4710 : PyModule_AddObject(m, "NBT_SERVER_DS_10", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_DS_10)));
14737 4710 : PyModule_AddObject(m, "NBT_SERVER_HAS_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_HAS_DNS_NAME)));
14738 4710 : PyModule_AddObject(m, "NBT_SERVER_IS_DEFAULT_NC", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_IS_DEFAULT_NC)));
14739 4710 : PyModule_AddObject(m, "NBT_SERVER_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)(NBT_SERVER_FOREST_ROOT)));
14740 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_1", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_1)));
14741 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_5)));
14742 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5EX", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_5EX)));
14743 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_5EX_WITH_IP", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_5EX_WITH_IP)));
14744 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_WITH_CLOSEST_SITE)));
14745 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_AVOID_NT4EMUL", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_AVOID_NT4EMUL)));
14746 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_PDC", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_PDC)));
14747 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_IP", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_IP)));
14748 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_LOCAL)));
14749 4710 : PyModule_AddObject(m, "NETLOGON_NT_VERSION_GC", PyLong_FromUnsignedLongLong((uint32_t)(NETLOGON_NT_VERSION_GC)));
14750 4710 : PyModule_AddObject(m, "LOGON_REQUEST", PyLong_FromLong((uint16_t)(LOGON_REQUEST)));
14751 4710 : PyModule_AddObject(m, "LOGON_RESPONSE2", PyLong_FromLong((uint16_t)(LOGON_RESPONSE2)));
14752 4710 : PyModule_AddObject(m, "LOGON_PRIMARY_QUERY", PyLong_FromLong((uint16_t)(LOGON_PRIMARY_QUERY)));
14753 4710 : PyModule_AddObject(m, "NETLOGON_ANNOUNCE_UAS", PyLong_FromLong((uint16_t)(NETLOGON_ANNOUNCE_UAS)));
14754 4710 : PyModule_AddObject(m, "NETLOGON_RESPONSE_FROM_PDC", PyLong_FromLong((uint16_t)(NETLOGON_RESPONSE_FROM_PDC)));
14755 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_REQUEST", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_REQUEST)));
14756 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_RESPONSE", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_RESPONSE)));
14757 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_PAUSE_RESPONSE", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_PAUSE_RESPONSE)));
14758 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_USER_UNKNOWN", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_USER_UNKNOWN)));
14759 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_RESPONSE_EX", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_RESPONSE_EX)));
14760 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_PAUSE_RESPONSE_EX)));
14761 4710 : PyModule_AddObject(m, "LOGON_SAM_LOGON_USER_UNKNOWN_EX", PyLong_FromLong((uint16_t)(LOGON_SAM_LOGON_USER_UNKNOWN_EX)));
14762 4710 : PyModule_AddObject(m, "HostAnnouncement", PyLong_FromLong((uint16_t)(HostAnnouncement)));
14763 4710 : PyModule_AddObject(m, "AnnouncementRequest", PyLong_FromLong((uint16_t)(AnnouncementRequest)));
14764 4710 : PyModule_AddObject(m, "Election", PyLong_FromLong((uint16_t)(Election)));
14765 4710 : PyModule_AddObject(m, "GetBackupListReq", PyLong_FromLong((uint16_t)(GetBackupListReq)));
14766 4710 : PyModule_AddObject(m, "GetBackupListResp", PyLong_FromLong((uint16_t)(GetBackupListResp)));
14767 4710 : PyModule_AddObject(m, "BecomeBackup", PyLong_FromLong((uint16_t)(BecomeBackup)));
14768 4710 : PyModule_AddObject(m, "DomainAnnouncement", PyLong_FromLong((uint16_t)(DomainAnnouncement)));
14769 4710 : PyModule_AddObject(m, "MasterAnnouncement", PyLong_FromLong((uint16_t)(MasterAnnouncement)));
14770 4710 : PyModule_AddObject(m, "ResetBrowserState", PyLong_FromLong((uint16_t)(ResetBrowserState)));
14771 4710 : PyModule_AddObject(m, "LocalMasterAnnouncement", PyLong_FromLong((uint16_t)(LocalMasterAnnouncement)));
14772 3604 : Py_INCREF((PyObject *)(void *)&nbt_name_Type);
14773 4710 : PyModule_AddObject(m, "name", (PyObject *)(void *)&nbt_name_Type);
14774 3604 : Py_INCREF((PyObject *)(void *)&nbt_name_question_Type);
14775 4710 : PyModule_AddObject(m, "name_question", (PyObject *)(void *)&nbt_name_question_Type);
14776 3604 : Py_INCREF((PyObject *)(void *)&nbt_rdata_address_Type);
14777 4710 : PyModule_AddObject(m, "rdata_address", (PyObject *)(void *)&nbt_rdata_address_Type);
14778 3604 : Py_INCREF((PyObject *)(void *)&nbt_rdata_netbios_Type);
14779 4710 : PyModule_AddObject(m, "rdata_netbios", (PyObject *)(void *)&nbt_rdata_netbios_Type);
14780 3604 : Py_INCREF((PyObject *)(void *)&nbt_statistics_Type);
14781 4710 : PyModule_AddObject(m, "statistics", (PyObject *)(void *)&nbt_statistics_Type);
14782 3604 : Py_INCREF((PyObject *)(void *)&nbt_status_name_Type);
14783 4710 : PyModule_AddObject(m, "status_name", (PyObject *)(void *)&nbt_status_name_Type);
14784 3604 : Py_INCREF((PyObject *)(void *)&nbt_rdata_status_Type);
14785 4710 : PyModule_AddObject(m, "rdata_status", (PyObject *)(void *)&nbt_rdata_status_Type);
14786 3604 : Py_INCREF((PyObject *)(void *)&nbt_rdata_data_Type);
14787 4710 : PyModule_AddObject(m, "rdata_data", (PyObject *)(void *)&nbt_rdata_data_Type);
14788 3604 : Py_INCREF((PyObject *)(void *)&nbt_rdata_Type);
14789 4710 : PyModule_AddObject(m, "rdata", (PyObject *)(void *)&nbt_rdata_Type);
14790 3604 : Py_INCREF((PyObject *)(void *)&nbt_res_rec_Type);
14791 4710 : PyModule_AddObject(m, "res_rec", (PyObject *)(void *)&nbt_res_rec_Type);
14792 3604 : Py_INCREF((PyObject *)(void *)&nbt_name_packet_Type);
14793 4710 : PyModule_AddObject(m, "name_packet", (PyObject *)(void *)&nbt_name_packet_Type);
14794 3604 : Py_INCREF((PyObject *)(void *)&smb_trans_body_Type);
14795 4710 : PyModule_AddObject(m, "smb_trans_body", (PyObject *)(void *)&smb_trans_body_Type);
14796 3604 : Py_INCREF((PyObject *)(void *)&smb_body_Type);
14797 4710 : PyModule_AddObject(m, "smb_body", (PyObject *)(void *)&smb_body_Type);
14798 3604 : Py_INCREF((PyObject *)(void *)&dgram_smb_packet_Type);
14799 4710 : PyModule_AddObject(m, "dgram_smb_packet", (PyObject *)(void *)&dgram_smb_packet_Type);
14800 3604 : Py_INCREF((PyObject *)(void *)&dgram_message_body_Type);
14801 4710 : PyModule_AddObject(m, "dgram_message_body", (PyObject *)(void *)&dgram_message_body_Type);
14802 3604 : Py_INCREF((PyObject *)(void *)&dgram_message_Type);
14803 4710 : PyModule_AddObject(m, "dgram_message", (PyObject *)(void *)&dgram_message_Type);
14804 3604 : Py_INCREF((PyObject *)(void *)&dgram_data_Type);
14805 4710 : PyModule_AddObject(m, "dgram_data", (PyObject *)(void *)&dgram_data_Type);
14806 3604 : Py_INCREF((PyObject *)(void *)&nbt_dgram_packet_Type);
14807 4710 : PyModule_AddObject(m, "dgram_packet", (PyObject *)(void *)&nbt_dgram_packet_Type);
14808 3604 : Py_INCREF((PyObject *)(void *)&nbt_sockaddr_Type);
14809 4710 : PyModule_AddObject(m, "sockaddr", (PyObject *)(void *)&nbt_sockaddr_Type);
14810 3604 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_REQUEST_Type);
14811 4710 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_REQUEST", (PyObject *)(void *)&NETLOGON_SAM_LOGON_REQUEST_Type);
14812 3604 : Py_INCREF((PyObject *)(void *)&NETLOGON_LOGON_REQUEST_Type);
14813 4710 : PyModule_AddObject(m, "NETLOGON_LOGON_REQUEST", (PyObject *)(void *)&NETLOGON_LOGON_REQUEST_Type);
14814 3604 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14815 4710 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE_NT40", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type);
14816 3604 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_Type);
14817 4710 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_Type);
14818 3604 : Py_INCREF((PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14819 4710 : PyModule_AddObject(m, "NETLOGON_SAM_LOGON_RESPONSE_EX", (PyObject *)(void *)&NETLOGON_SAM_LOGON_RESPONSE_EX_Type);
14820 3604 : Py_INCREF((PyObject *)(void *)&netlogon_samlogon_response_union_Type);
14821 4710 : PyModule_AddObject(m, "netlogon_samlogon_response_union", (PyObject *)(void *)&netlogon_samlogon_response_union_Type);
14822 3604 : Py_INCREF((PyObject *)(void *)&netlogon_samlogon_response_Type);
14823 4710 : PyModule_AddObject(m, "netlogon_samlogon_response", (PyObject *)(void *)&netlogon_samlogon_response_Type);
14824 3604 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_query_for_pdc_Type);
14825 4710 : PyModule_AddObject(m, "netlogon_query_for_pdc", (PyObject *)(void *)&nbt_netlogon_query_for_pdc_Type);
14826 3604 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_response_from_pdc_Type);
14827 4710 : PyModule_AddObject(m, "netlogon_response_from_pdc", (PyObject *)(void *)&nbt_netlogon_response_from_pdc_Type);
14828 3604 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_response2_Type);
14829 4710 : PyModule_AddObject(m, "netlogon_response2", (PyObject *)(void *)&nbt_netlogon_response2_Type);
14830 3604 : Py_INCREF((PyObject *)(void *)&nbt_db_change_info_Type);
14831 4710 : PyModule_AddObject(m, "db_change_info", (PyObject *)(void *)&nbt_db_change_info_Type);
14832 3604 : Py_INCREF((PyObject *)(void *)&NETLOGON_DB_CHANGE_Type);
14833 4710 : PyModule_AddObject(m, "NETLOGON_DB_CHANGE", (PyObject *)(void *)&NETLOGON_DB_CHANGE_Type);
14834 3604 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_request_Type);
14835 4710 : PyModule_AddObject(m, "netlogon_request", (PyObject *)(void *)&nbt_netlogon_request_Type);
14836 3604 : Py_INCREF((PyObject *)(void *)&nbt_netlogon_packet_Type);
14837 4710 : PyModule_AddObject(m, "netlogon_packet", (PyObject *)(void *)&nbt_netlogon_packet_Type);
14838 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_host_announcement_Type);
14839 4710 : PyModule_AddObject(m, "browse_host_announcement", (PyObject *)(void *)&nbt_browse_host_announcement_Type);
14840 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_announcement_request_Type);
14841 4710 : PyModule_AddObject(m, "browse_announcement_request", (PyObject *)(void *)&nbt_browse_announcement_request_Type);
14842 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_election_request_Type);
14843 4710 : PyModule_AddObject(m, "browse_election_request", (PyObject *)(void *)&nbt_browse_election_request_Type);
14844 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_backup_list_request_Type);
14845 4710 : PyModule_AddObject(m, "browse_backup_list_request", (PyObject *)(void *)&nbt_browse_backup_list_request_Type);
14846 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_backup_list_response_Type);
14847 4710 : PyModule_AddObject(m, "browse_backup_list_response", (PyObject *)(void *)&nbt_browse_backup_list_response_Type);
14848 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_become_backup_Type);
14849 4710 : PyModule_AddObject(m, "browse_become_backup", (PyObject *)(void *)&nbt_browse_become_backup_Type);
14850 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_domain_announcement_Type);
14851 4710 : PyModule_AddObject(m, "browse_domain_announcement", (PyObject *)(void *)&nbt_browse_domain_announcement_Type);
14852 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_master_announcement_Type);
14853 4710 : PyModule_AddObject(m, "browse_master_announcement", (PyObject *)(void *)&nbt_browse_master_announcement_Type);
14854 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_reset_state_Type);
14855 4710 : PyModule_AddObject(m, "browse_reset_state", (PyObject *)(void *)&nbt_browse_reset_state_Type);
14856 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_local_master_announcement_Type);
14857 4710 : PyModule_AddObject(m, "browse_local_master_announcement", (PyObject *)(void *)&nbt_browse_local_master_announcement_Type);
14858 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_payload_Type);
14859 4710 : PyModule_AddObject(m, "browse_payload", (PyObject *)(void *)&nbt_browse_payload_Type);
14860 3604 : Py_INCREF((PyObject *)(void *)&nbt_browse_packet_Type);
14861 4710 : PyModule_AddObject(m, "browse_packet", (PyObject *)(void *)&nbt_browse_packet_Type);
14862 3604 : Py_INCREF((PyObject *)(void *)&nbt_InterfaceType);
14863 4710 : PyModule_AddObject(m, "nbt", (PyObject *)(void *)&nbt_InterfaceType);
14864 3604 : Py_INCREF((PyObject *)(void *)&nbt_SyntaxType);
14865 4710 : PyModule_AddObject(m, "nbt_abstract_syntax", (PyObject *)(void *)&nbt_SyntaxType);
14866 3604 : Py_INCREF((PyObject *)(void *)&nbt_SyntaxType);
14867 4710 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&nbt_SyntaxType);
14868 : #ifdef PY_MOD_NBT_PATCH
14869 : PY_MOD_NBT_PATCH(m);
14870 : #endif
14871 4710 : out:
14872 4710 : Py_XDECREF(dep_samba_dcerpc_misc);
14873 4710 : Py_XDECREF(dep_samba_dcerpc_security);
14874 4710 : Py_XDECREF(dep_talloc);
14875 4710 : Py_XDECREF(dep_samba_dcerpc_base);
14876 4580 : return m;
14877 :
14878 : }
|