LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_nbt.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 422 7252 5.8 %
Date: 2021-09-23 10:06:22 Functions: 9 608 1.5 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_nbt.h"
      12             : 
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32           0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34           0 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37           0 :         case 4:
      38           0 :                 return UINT32_MAX;
      39           0 :         case 2:
      40           0 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48           0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50           0 :         switch (var_size) {
      51           0 :         case 8:
      52           0 :                 return INT64_MAX;
      53           0 :         case 4:
      54           0 :                 return INT32_MAX;
      55           0 :         case 2:
      56           0 :                 return INT16_MAX;
      57           0 :         case 1:
      58           0 :                 return INT8_MAX;
      59             :         }
      60             : 
      61           0 :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/misc.h"
      65             : #include "librpc/gen_ndr/security.h"
      66             : static PyTypeObject nbt_name_Type;
      67             : static PyTypeObject nbt_name_question_Type;
      68             : static PyTypeObject nbt_rdata_address_Type;
      69             : static PyTypeObject nbt_rdata_netbios_Type;
      70             : static PyTypeObject nbt_statistics_Type;
      71             : static PyTypeObject nbt_status_name_Type;
      72             : static PyTypeObject nbt_rdata_status_Type;
      73             : static PyTypeObject nbt_rdata_data_Type;
      74             : static PyTypeObject nbt_rdata_Type;
      75             : static PyTypeObject nbt_res_rec_Type;
      76             : static PyTypeObject nbt_name_packet_Type;
      77             : static PyTypeObject smb_trans_body_Type;
      78             : static PyTypeObject smb_body_Type;
      79             : static PyTypeObject dgram_smb_packet_Type;
      80             : static PyTypeObject dgram_message_body_Type;
      81             : static PyTypeObject dgram_message_Type;
      82             : static PyTypeObject dgram_data_Type;
      83             : static PyTypeObject nbt_dgram_packet_Type;
      84             : static PyTypeObject nbt_sockaddr_Type;
      85             : static PyTypeObject NETLOGON_SAM_LOGON_REQUEST_Type;
      86             : static PyTypeObject NETLOGON_LOGON_REQUEST_Type;
      87             : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_NT40_Type;
      88             : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_Type;
      89             : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_EX_Type;
      90             : static PyTypeObject netlogon_samlogon_response_union_Type;
      91             : static PyTypeObject netlogon_samlogon_response_Type;
      92             : static PyTypeObject nbt_netlogon_query_for_pdc_Type;
      93             : static PyTypeObject nbt_netlogon_response_from_pdc_Type;
      94             : static PyTypeObject nbt_netlogon_response2_Type;
      95             : static PyTypeObject nbt_db_change_info_Type;
      96             : static PyTypeObject NETLOGON_DB_CHANGE_Type;
      97             : static PyTypeObject nbt_netlogon_request_Type;
      98             : static PyTypeObject nbt_netlogon_packet_Type;
      99             : static PyTypeObject nbt_browse_host_announcement_Type;
     100             : static PyTypeObject nbt_browse_announcement_request_Type;
     101             : static PyTypeObject nbt_browse_election_request_Type;
     102             : static PyTypeObject nbt_browse_backup_list_request_Type;
     103             : static PyTypeObject nbt_browse_backup_list_response_Type;
     104             : static PyTypeObject nbt_browse_become_backup_Type;
     105             : static PyTypeObject nbt_browse_domain_announcement_Type;
     106             : static PyTypeObject nbt_browse_master_announcement_Type;
     107             : static PyTypeObject nbt_browse_reset_state_Type;
     108             : static PyTypeObject nbt_browse_local_master_announcement_Type;
     109             : static PyTypeObject nbt_browse_payload_Type;
     110             : static PyTypeObject nbt_browse_packet_Type;
     111             : static PyTypeObject nbt_InterfaceType;
     112             : 
     113             : static PyTypeObject *BaseObject_Type;
     114             : static PyTypeObject *dom_sid_Type;
     115             : static PyTypeObject *GUID_Type;
     116             : static PyTypeObject *ClientConnection_Type;
     117             : static PyTypeObject *ndr_syntax_id_Type;
     118             : 
     119           0 : static PyObject *py_nbt_name_get_name(PyObject *obj, void *closure)
     120             : {
     121           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
     122             :         PyObject *py_name;
     123           0 :         py_name = PyString_FromStringOrNULL(object->name);
     124           0 :         return py_name;
     125             : }
     126             : 
     127           0 : static int py_nbt_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
     128             : {
     129           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
     130           0 :         if (value == NULL) {
     131           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
     132           0 :                 return -1;
     133             :         }
     134             :         {
     135             :                 const char *test_str;
     136             :                 const char *talloc_str;
     137           0 :                 PyObject *unicode = NULL;
     138           0 :                 if (PyUnicode_Check(value)) {
     139           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     140           0 :                         if (unicode == NULL) {
     141           0 :                                 PyErr_NoMemory();
     142           0 :                                 return -1;
     143             :                         }
     144           0 :                         test_str = PyBytes_AS_STRING(unicode);
     145           0 :                 } else if (PyBytes_Check(value)) {
     146           0 :                         test_str = PyBytes_AS_STRING(value);
     147             :                 } else {
     148           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     149           0 :                         return -1;
     150             :                 }
     151           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     152           0 :                 if (unicode != NULL) {
     153           0 :                         Py_DECREF(unicode);
     154             :                 }
     155           0 :                 if (talloc_str == NULL) {
     156           0 :                         PyErr_NoMemory();
     157           0 :                         return -1;
     158             :                 }
     159           0 :                 object->name = talloc_str;
     160             :         }
     161           0 :         return 0;
     162             : }
     163             : 
     164           0 : static PyObject *py_nbt_name_get_scope(PyObject *obj, void *closure)
     165             : {
     166           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
     167             :         PyObject *py_scope;
     168           0 :         py_scope = PyString_FromStringOrNULL(object->scope);
     169           0 :         return py_scope;
     170             : }
     171             : 
     172           0 : static int py_nbt_name_set_scope(PyObject *py_obj, PyObject *value, void *closure)
     173             : {
     174           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
     175           0 :         if (value == NULL) {
     176           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->scope");
     177           0 :                 return -1;
     178             :         }
     179             :         {
     180             :                 const char *test_str;
     181             :                 const char *talloc_str;
     182           0 :                 PyObject *unicode = NULL;
     183           0 :                 if (PyUnicode_Check(value)) {
     184           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     185           0 :                         if (unicode == NULL) {
     186           0 :                                 PyErr_NoMemory();
     187           0 :                                 return -1;
     188             :                         }
     189           0 :                         test_str = PyBytes_AS_STRING(unicode);
     190           0 :                 } else if (PyBytes_Check(value)) {
     191           0 :                         test_str = PyBytes_AS_STRING(value);
     192             :                 } else {
     193           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     194           0 :                         return -1;
     195             :                 }
     196           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     197           0 :                 if (unicode != NULL) {
     198           0 :                         Py_DECREF(unicode);
     199             :                 }
     200           0 :                 if (talloc_str == NULL) {
     201           0 :                         PyErr_NoMemory();
     202           0 :                         return -1;
     203             :                 }
     204           0 :                 object->scope = talloc_str;
     205             :         }
     206           0 :         return 0;
     207             : }
     208             : 
     209           0 : static PyObject *py_nbt_name_get_type(PyObject *obj, void *closure)
     210             : {
     211           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(obj);
     212             :         PyObject *py_type;
     213           0 :         py_type = PyLong_FromLong((uint16_t)object->type);
     214           0 :         return py_type;
     215             : }
     216             : 
     217           0 : static int py_nbt_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
     218             : {
     219           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
     220           0 :         if (value == NULL) {
     221           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
     222           0 :                 return -1;
     223             :         }
     224             :         {
     225           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
     226           0 :                 if (PyLong_Check(value)) {
     227             :                         unsigned long long test_var;
     228           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     229           0 :                         if (PyErr_Occurred() != NULL) {
     230           0 :                                 return -1;
     231             :                         }
     232           0 :                         if (test_var > uint_max) {
     233           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     234             :                                   PyLong_Type.tp_name, uint_max, test_var);
     235           0 :                                 return -1;
     236             :                         }
     237           0 :                         object->type = test_var;
     238             :                 } else {
     239           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     240             :                           PyLong_Type.tp_name);
     241           0 :                         return -1;
     242             :                 }
     243             :         }
     244           0 :         return 0;
     245             : }
     246             : 
     247             : static PyGetSetDef py_nbt_name_getsetters[] = {
     248             :         {
     249             :                 .name = discard_const_p(char, "name"),
     250             :                 .get = py_nbt_name_get_name,
     251             :                 .set = py_nbt_name_set_name,
     252             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     253             :         },
     254             :         {
     255             :                 .name = discard_const_p(char, "scope"),
     256             :                 .get = py_nbt_name_get_scope,
     257             :                 .set = py_nbt_name_set_scope,
     258             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     259             :         },
     260             :         {
     261             :                 .name = discard_const_p(char, "type"),
     262             :                 .get = py_nbt_name_get_type,
     263             :                 .set = py_nbt_name_set_type,
     264             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
     265             :         },
     266             :         { .name = NULL }
     267             : };
     268             : 
     269           0 : static PyObject *py_nbt_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     270             : {
     271           0 :         return pytalloc_new(struct nbt_name, type);
     272             : }
     273             : 
     274           0 : static PyObject *py_nbt_name_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     275             : {
     276           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
     277           0 :         PyObject *ret = NULL;
     278             :         DATA_BLOB blob;
     279             :         enum ndr_err_code err;
     280           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     281           0 :         if (tmp_ctx == NULL) {
     282           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     283           0 :                 return NULL;
     284             :         }
     285           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name);
     286           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     287           0 :                 TALLOC_FREE(tmp_ctx);
     288           0 :                 PyErr_SetNdrError(err);
     289           0 :                 return NULL;
     290             :         }
     291             : 
     292           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     293           0 :         TALLOC_FREE(tmp_ctx);
     294           0 :         return ret;
     295             : }
     296             : 
     297           0 : static PyObject *py_nbt_name_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     298             : {
     299           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
     300           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     301           0 :         Py_ssize_t blob_length = 0;
     302             :         enum ndr_err_code err;
     303           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     304           0 :         PyObject *allow_remaining_obj = NULL;
     305           0 :         bool allow_remaining = false;
     306             : 
     307           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     308             :                 discard_const_p(char *, kwnames),
     309             :                 &blob.data, &blob_length,
     310             :                 &allow_remaining_obj)) {
     311           0 :                 return NULL;
     312             :         }
     313           0 :         blob.length = blob_length;
     314             : 
     315           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     316           0 :                 allow_remaining = true;
     317             :         }
     318             : 
     319           0 :         if (allow_remaining) {
     320           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
     321             :         } else {
     322           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
     323             :         }
     324           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     325           0 :                 PyErr_SetNdrError(err);
     326           0 :                 return NULL;
     327             :         }
     328             : 
     329           0 :         Py_RETURN_NONE;
     330             : }
     331             : 
     332           0 : static PyObject *py_nbt_name_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     333             : {
     334           0 :         struct nbt_name *object = (struct nbt_name *)pytalloc_get_ptr(py_obj);
     335             :         PyObject *ret;
     336             :         char *retstr;
     337             : 
     338           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name, "nbt_name", object);
     339           0 :         ret = PyUnicode_FromString(retstr);
     340           0 :         talloc_free(retstr);
     341             : 
     342           0 :         return ret;
     343             : }
     344             : 
     345             : static PyMethodDef py_nbt_name_methods[] = {
     346             :         { "__ndr_pack__", (PyCFunction)py_nbt_name_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     347             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_name_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     348             :         { "__ndr_print__", (PyCFunction)py_nbt_name_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     349             :         { NULL, NULL, 0, NULL }
     350             : };
     351             : 
     352             : 
     353             : static PyTypeObject nbt_name_Type = {
     354             :         PyVarObject_HEAD_INIT(NULL, 0)
     355             :         .tp_name = "nbt.name",
     356             :         .tp_getset = py_nbt_name_getsetters,
     357             :         .tp_methods = py_nbt_name_methods,
     358             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     359             :         .tp_new = py_nbt_name_new,
     360             : };
     361             : 
     362             : 
     363           0 : static PyObject *py_nbt_name_question_get_name(PyObject *obj, void *closure)
     364             : {
     365           0 :         struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
     366             :         PyObject *py_name;
     367           0 :         py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
     368           0 :         return py_name;
     369             : }
     370             : 
     371           0 : static int py_nbt_name_question_set_name(PyObject *py_obj, PyObject *value, void *closure)
     372             : {
     373           0 :         struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
     374           0 :         if (value == NULL) {
     375           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
     376           0 :                 return -1;
     377             :         }
     378           0 :         PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
     379           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     380           0 :                 PyErr_NoMemory();
     381           0 :                 return -1;
     382             :         }
     383           0 :         object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
     384           0 :         return 0;
     385             : }
     386             : 
     387           0 : static PyObject *py_nbt_name_question_get_question_type(PyObject *obj, void *closure)
     388             : {
     389           0 :         struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
     390             :         PyObject *py_question_type;
     391           0 :         py_question_type = PyLong_FromLong((uint16_t)object->question_type);
     392           0 :         return py_question_type;
     393             : }
     394             : 
     395           0 : static int py_nbt_name_question_set_question_type(PyObject *py_obj, PyObject *value, void *closure)
     396             : {
     397           0 :         struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
     398           0 :         if (value == NULL) {
     399           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->question_type");
     400           0 :                 return -1;
     401             :         }
     402             :         {
     403           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_type));
     404           0 :                 if (PyLong_Check(value)) {
     405             :                         unsigned long long test_var;
     406           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     407           0 :                         if (PyErr_Occurred() != NULL) {
     408           0 :                                 return -1;
     409             :                         }
     410           0 :                         if (test_var > uint_max) {
     411           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     412             :                                   PyLong_Type.tp_name, uint_max, test_var);
     413           0 :                                 return -1;
     414             :                         }
     415           0 :                         object->question_type = test_var;
     416             :                 } else {
     417           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     418             :                           PyLong_Type.tp_name);
     419           0 :                         return -1;
     420             :                 }
     421             :         }
     422           0 :         return 0;
     423             : }
     424             : 
     425           0 : static PyObject *py_nbt_name_question_get_question_class(PyObject *obj, void *closure)
     426             : {
     427           0 :         struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(obj);
     428             :         PyObject *py_question_class;
     429           0 :         py_question_class = PyLong_FromLong((uint16_t)object->question_class);
     430           0 :         return py_question_class;
     431             : }
     432             : 
     433           0 : static int py_nbt_name_question_set_question_class(PyObject *py_obj, PyObject *value, void *closure)
     434             : {
     435           0 :         struct nbt_name_question *object = (struct nbt_name_question *)pytalloc_get_ptr(py_obj);
     436           0 :         if (value == NULL) {
     437           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->question_class");
     438           0 :                 return -1;
     439             :         }
     440             :         {
     441           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->question_class));
     442           0 :                 if (PyLong_Check(value)) {
     443             :                         unsigned long long test_var;
     444           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     445           0 :                         if (PyErr_Occurred() != NULL) {
     446           0 :                                 return -1;
     447             :                         }
     448           0 :                         if (test_var > uint_max) {
     449           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     450             :                                   PyLong_Type.tp_name, uint_max, test_var);
     451           0 :                                 return -1;
     452             :                         }
     453           0 :                         object->question_class = test_var;
     454             :                 } else {
     455           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     456             :                           PyLong_Type.tp_name);
     457           0 :                         return -1;
     458             :                 }
     459             :         }
     460           0 :         return 0;
     461             : }
     462             : 
     463             : static PyGetSetDef py_nbt_name_question_getsetters[] = {
     464             :         {
     465             :                 .name = discard_const_p(char, "name"),
     466             :                 .get = py_nbt_name_question_get_name,
     467             :                 .set = py_nbt_name_question_set_name,
     468             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
     469             :         },
     470             :         {
     471             :                 .name = discard_const_p(char, "question_type"),
     472             :                 .get = py_nbt_name_question_get_question_type,
     473             :                 .set = py_nbt_name_question_set_question_type,
     474             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
     475             :         },
     476             :         {
     477             :                 .name = discard_const_p(char, "question_class"),
     478             :                 .get = py_nbt_name_question_get_question_class,
     479             :                 .set = py_nbt_name_question_set_question_class,
     480             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
     481             :         },
     482             :         { .name = NULL }
     483             : };
     484             : 
     485           0 : static PyObject *py_nbt_name_question_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     486             : {
     487           0 :         return pytalloc_new(struct nbt_name_question, type);
     488             : }
     489             : 
     490             : 
     491             : static PyTypeObject nbt_name_question_Type = {
     492             :         PyVarObject_HEAD_INIT(NULL, 0)
     493             :         .tp_name = "nbt.name_question",
     494             :         .tp_getset = py_nbt_name_question_getsetters,
     495             :         .tp_methods = NULL,
     496             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     497             :         .tp_new = py_nbt_name_question_new,
     498             : };
     499             : 
     500             : 
     501           0 : static PyObject *py_nbt_rdata_address_get_nb_flags(PyObject *obj, void *closure)
     502             : {
     503           0 :         struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(obj);
     504             :         PyObject *py_nb_flags;
     505           0 :         py_nb_flags = PyLong_FromLong((uint16_t)object->nb_flags);
     506           0 :         return py_nb_flags;
     507             : }
     508             : 
     509           0 : static int py_nbt_rdata_address_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
     510             : {
     511           0 :         struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(py_obj);
     512           0 :         if (value == NULL) {
     513           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nb_flags");
     514           0 :                 return -1;
     515             :         }
     516             :         {
     517           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
     518           0 :                 if (PyLong_Check(value)) {
     519             :                         unsigned long long test_var;
     520           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     521           0 :                         if (PyErr_Occurred() != NULL) {
     522           0 :                                 return -1;
     523             :                         }
     524           0 :                         if (test_var > uint_max) {
     525           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     526             :                                   PyLong_Type.tp_name, uint_max, test_var);
     527           0 :                                 return -1;
     528             :                         }
     529           0 :                         object->nb_flags = test_var;
     530             :                 } else {
     531           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     532             :                           PyLong_Type.tp_name);
     533           0 :                         return -1;
     534             :                 }
     535             :         }
     536           0 :         return 0;
     537             : }
     538             : 
     539           0 : static PyObject *py_nbt_rdata_address_get_ipaddr(PyObject *obj, void *closure)
     540             : {
     541           0 :         struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(obj);
     542             :         PyObject *py_ipaddr;
     543           0 :         py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
     544           0 :         return py_ipaddr;
     545             : }
     546             : 
     547           0 : static int py_nbt_rdata_address_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
     548             : {
     549           0 :         struct nbt_rdata_address *object = (struct nbt_rdata_address *)pytalloc_get_ptr(py_obj);
     550           0 :         if (value == NULL) {
     551           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipaddr");
     552           0 :                 return -1;
     553             :         }
     554             :         {
     555             :                 const char *test_str;
     556             :                 const char *talloc_str;
     557           0 :                 PyObject *unicode = NULL;
     558           0 :                 if (PyUnicode_Check(value)) {
     559           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     560           0 :                         if (unicode == NULL) {
     561           0 :                                 PyErr_NoMemory();
     562           0 :                                 return -1;
     563             :                         }
     564           0 :                         test_str = PyBytes_AS_STRING(unicode);
     565           0 :                 } else if (PyBytes_Check(value)) {
     566           0 :                         test_str = PyBytes_AS_STRING(value);
     567             :                 } else {
     568           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     569           0 :                         return -1;
     570             :                 }
     571           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     572           0 :                 if (unicode != NULL) {
     573           0 :                         Py_DECREF(unicode);
     574             :                 }
     575           0 :                 if (talloc_str == NULL) {
     576           0 :                         PyErr_NoMemory();
     577           0 :                         return -1;
     578             :                 }
     579           0 :                 object->ipaddr = talloc_str;
     580             :         }
     581           0 :         return 0;
     582             : }
     583             : 
     584             : static PyGetSetDef py_nbt_rdata_address_getsetters[] = {
     585             :         {
     586             :                 .name = discard_const_p(char, "nb_flags"),
     587             :                 .get = py_nbt_rdata_address_get_nb_flags,
     588             :                 .set = py_nbt_rdata_address_set_nb_flags,
     589             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
     590             :         },
     591             :         {
     592             :                 .name = discard_const_p(char, "ipaddr"),
     593             :                 .get = py_nbt_rdata_address_get_ipaddr,
     594             :                 .set = py_nbt_rdata_address_set_ipaddr,
     595             :                 .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
     596             :         },
     597             :         { .name = NULL }
     598             : };
     599             : 
     600           0 : static PyObject *py_nbt_rdata_address_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     601             : {
     602           0 :         return pytalloc_new(struct nbt_rdata_address, type);
     603             : }
     604             : 
     605             : 
     606             : static PyTypeObject nbt_rdata_address_Type = {
     607             :         PyVarObject_HEAD_INIT(NULL, 0)
     608             :         .tp_name = "nbt.rdata_address",
     609             :         .tp_getset = py_nbt_rdata_address_getsetters,
     610             :         .tp_methods = NULL,
     611             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     612             :         .tp_new = py_nbt_rdata_address_new,
     613             : };
     614             : 
     615             : 
     616           0 : static PyObject *py_nbt_rdata_netbios_get_length(PyObject *obj, void *closure)
     617             : {
     618           0 :         struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(obj);
     619             :         PyObject *py_length;
     620           0 :         py_length = PyLong_FromLong((uint16_t)object->length);
     621           0 :         return py_length;
     622             : }
     623             : 
     624           0 : static int py_nbt_rdata_netbios_set_length(PyObject *py_obj, PyObject *value, void *closure)
     625             : {
     626           0 :         struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(py_obj);
     627           0 :         if (value == NULL) {
     628           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
     629           0 :                 return -1;
     630             :         }
     631             :         {
     632           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
     633           0 :                 if (PyLong_Check(value)) {
     634             :                         unsigned long long test_var;
     635           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     636           0 :                         if (PyErr_Occurred() != NULL) {
     637           0 :                                 return -1;
     638             :                         }
     639           0 :                         if (test_var > uint_max) {
     640           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     641             :                                   PyLong_Type.tp_name, uint_max, test_var);
     642           0 :                                 return -1;
     643             :                         }
     644           0 :                         object->length = test_var;
     645             :                 } else {
     646           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     647             :                           PyLong_Type.tp_name);
     648           0 :                         return -1;
     649             :                 }
     650             :         }
     651           0 :         return 0;
     652             : }
     653             : 
     654           0 : static PyObject *py_nbt_rdata_netbios_get_addresses(PyObject *obj, void *closure)
     655             : {
     656           0 :         struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(obj);
     657             :         PyObject *py_addresses;
     658           0 :         py_addresses = PyList_New(object->length / 6);
     659           0 :         if (py_addresses == NULL) {
     660           0 :                 return NULL;
     661             :         }
     662             :         {
     663             :                 int addresses_cntr_0;
     664           0 :                 for (addresses_cntr_0 = 0; addresses_cntr_0 < (object->length / 6); addresses_cntr_0++) {
     665             :                         PyObject *py_addresses_0;
     666           0 :                         py_addresses_0 = pytalloc_reference_ex(&nbt_rdata_address_Type, object->addresses, &object->addresses[addresses_cntr_0]);
     667           0 :                         PyList_SetItem(py_addresses, addresses_cntr_0, py_addresses_0);
     668             :                 }
     669             :         }
     670           0 :         return py_addresses;
     671             : }
     672             : 
     673           0 : static int py_nbt_rdata_netbios_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
     674             : {
     675           0 :         struct nbt_rdata_netbios *object = (struct nbt_rdata_netbios *)pytalloc_get_ptr(py_obj);
     676           0 :         if (value == NULL) {
     677           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses");
     678           0 :                 return -1;
     679             :         }
     680           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     681             :         {
     682             :                 int addresses_cntr_0;
     683           0 :                 object->addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addresses, PyList_GET_SIZE(value));
     684           0 :                 if (!object->addresses) { return -1;; }
     685           0 :                 talloc_set_name_const(object->addresses, "ARRAY: object->addresses");
     686           0 :                 for (addresses_cntr_0 = 0; addresses_cntr_0 < PyList_GET_SIZE(value); addresses_cntr_0++) {
     687           0 :                         if (PyList_GET_ITEM(value, addresses_cntr_0) == NULL) {
     688           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addresses[addresses_cntr_0]");
     689           0 :                                 return -1;
     690             :                         }
     691           0 :                         PY_CHECK_TYPE(&nbt_rdata_address_Type, PyList_GET_ITEM(value, addresses_cntr_0), return -1;);
     692           0 :                         if (talloc_reference(object->addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_0))) == NULL) {
     693           0 :                                 PyErr_NoMemory();
     694           0 :                                 return -1;
     695             :                         }
     696           0 :                         object->addresses[addresses_cntr_0] = *(struct nbt_rdata_address *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_0));
     697             :                 }
     698             :         }
     699           0 :         return 0;
     700             : }
     701             : 
     702             : static PyGetSetDef py_nbt_rdata_netbios_getsetters[] = {
     703             :         {
     704             :                 .name = discard_const_p(char, "length"),
     705             :                 .get = py_nbt_rdata_netbios_get_length,
     706             :                 .set = py_nbt_rdata_netbios_set_length,
     707             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     708             :         },
     709             :         {
     710             :                 .name = discard_const_p(char, "addresses"),
     711             :                 .get = py_nbt_rdata_netbios_get_addresses,
     712             :                 .set = py_nbt_rdata_netbios_set_addresses,
     713             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata_address")
     714             :         },
     715             :         { .name = NULL }
     716             : };
     717             : 
     718           0 : static PyObject *py_nbt_rdata_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     719             : {
     720           0 :         return pytalloc_new(struct nbt_rdata_netbios, type);
     721             : }
     722             : 
     723             : 
     724             : static PyTypeObject nbt_rdata_netbios_Type = {
     725             :         PyVarObject_HEAD_INIT(NULL, 0)
     726             :         .tp_name = "nbt.rdata_netbios",
     727             :         .tp_getset = py_nbt_rdata_netbios_getsetters,
     728             :         .tp_methods = NULL,
     729             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     730             :         .tp_new = py_nbt_rdata_netbios_new,
     731             : };
     732             : 
     733             : 
     734           0 : static PyObject *py_nbt_statistics_get_unit_id(PyObject *obj, void *closure)
     735             : {
     736           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     737             :         PyObject *py_unit_id;
     738           0 :         py_unit_id = PyList_New(6);
     739           0 :         if (py_unit_id == NULL) {
     740           0 :                 return NULL;
     741             :         }
     742             :         {
     743             :                 int unit_id_cntr_0;
     744           0 :                 for (unit_id_cntr_0 = 0; unit_id_cntr_0 < (6); unit_id_cntr_0++) {
     745             :                         PyObject *py_unit_id_0;
     746           0 :                         py_unit_id_0 = PyLong_FromLong((uint16_t)object->unit_id[unit_id_cntr_0]);
     747           0 :                         PyList_SetItem(py_unit_id, unit_id_cntr_0, py_unit_id_0);
     748             :                 }
     749             :         }
     750           0 :         return py_unit_id;
     751             : }
     752             : 
     753           0 : static int py_nbt_statistics_set_unit_id(PyObject *py_obj, PyObject *value, void *closure)
     754             : {
     755           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     756           0 :         if (value == NULL) {
     757           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unit_id");
     758           0 :                 return -1;
     759             :         }
     760           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     761             :         {
     762             :                 int unit_id_cntr_0;
     763           0 :                 if (ARRAY_SIZE(object->unit_id) != PyList_GET_SIZE(value)) {
     764           0 :                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unit_id),  PyList_GET_SIZE(value));
     765           0 :                         return -1;
     766             :                 }
     767           0 :                 for (unit_id_cntr_0 = 0; unit_id_cntr_0 < PyList_GET_SIZE(value); unit_id_cntr_0++) {
     768           0 :                         if (PyList_GET_ITEM(value, unit_id_cntr_0) == NULL) {
     769           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unit_id[unit_id_cntr_0]");
     770           0 :                                 return -1;
     771             :                         }
     772             :                         {
     773           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unit_id[unit_id_cntr_0]));
     774           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, unit_id_cntr_0))) {
     775             :                                         unsigned long long test_var;
     776           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unit_id_cntr_0));
     777           0 :                                         if (PyErr_Occurred() != NULL) {
     778           0 :                                                 return -1;
     779             :                                         }
     780           0 :                                         if (test_var > uint_max) {
     781           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     782             :                                                   PyLong_Type.tp_name, uint_max, test_var);
     783           0 :                                                 return -1;
     784             :                                         }
     785           0 :                                         object->unit_id[unit_id_cntr_0] = test_var;
     786             :                                 } else {
     787           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     788             :                                           PyLong_Type.tp_name);
     789           0 :                                         return -1;
     790             :                                 }
     791             :                         }
     792             :                 }
     793             :         }
     794           0 :         return 0;
     795             : }
     796             : 
     797           0 : static PyObject *py_nbt_statistics_get_jumpers(PyObject *obj, void *closure)
     798             : {
     799           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     800             :         PyObject *py_jumpers;
     801           0 :         py_jumpers = PyLong_FromLong((uint16_t)object->jumpers);
     802           0 :         return py_jumpers;
     803             : }
     804             : 
     805           0 : static int py_nbt_statistics_set_jumpers(PyObject *py_obj, PyObject *value, void *closure)
     806             : {
     807           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     808           0 :         if (value == NULL) {
     809           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->jumpers");
     810           0 :                 return -1;
     811             :         }
     812             :         {
     813           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->jumpers));
     814           0 :                 if (PyLong_Check(value)) {
     815             :                         unsigned long long test_var;
     816           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     817           0 :                         if (PyErr_Occurred() != NULL) {
     818           0 :                                 return -1;
     819             :                         }
     820           0 :                         if (test_var > uint_max) {
     821           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     822             :                                   PyLong_Type.tp_name, uint_max, test_var);
     823           0 :                                 return -1;
     824             :                         }
     825           0 :                         object->jumpers = test_var;
     826             :                 } else {
     827           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     828             :                           PyLong_Type.tp_name);
     829           0 :                         return -1;
     830             :                 }
     831             :         }
     832           0 :         return 0;
     833             : }
     834             : 
     835           0 : static PyObject *py_nbt_statistics_get_test_result(PyObject *obj, void *closure)
     836             : {
     837           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     838             :         PyObject *py_test_result;
     839           0 :         py_test_result = PyLong_FromLong((uint16_t)object->test_result);
     840           0 :         return py_test_result;
     841             : }
     842             : 
     843           0 : static int py_nbt_statistics_set_test_result(PyObject *py_obj, PyObject *value, void *closure)
     844             : {
     845           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     846           0 :         if (value == NULL) {
     847           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->test_result");
     848           0 :                 return -1;
     849             :         }
     850             :         {
     851           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->test_result));
     852           0 :                 if (PyLong_Check(value)) {
     853             :                         unsigned long long test_var;
     854           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     855           0 :                         if (PyErr_Occurred() != NULL) {
     856           0 :                                 return -1;
     857             :                         }
     858           0 :                         if (test_var > uint_max) {
     859           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     860             :                                   PyLong_Type.tp_name, uint_max, test_var);
     861           0 :                                 return -1;
     862             :                         }
     863           0 :                         object->test_result = test_var;
     864             :                 } else {
     865           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     866             :                           PyLong_Type.tp_name);
     867           0 :                         return -1;
     868             :                 }
     869             :         }
     870           0 :         return 0;
     871             : }
     872             : 
     873           0 : static PyObject *py_nbt_statistics_get_version_number(PyObject *obj, void *closure)
     874             : {
     875           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     876             :         PyObject *py_version_number;
     877           0 :         py_version_number = PyLong_FromLong((uint16_t)object->version_number);
     878           0 :         return py_version_number;
     879             : }
     880             : 
     881           0 : static int py_nbt_statistics_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
     882             : {
     883           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     884           0 :         if (value == NULL) {
     885           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version_number");
     886           0 :                 return -1;
     887             :         }
     888             :         {
     889           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_number));
     890           0 :                 if (PyLong_Check(value)) {
     891             :                         unsigned long long test_var;
     892           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     893           0 :                         if (PyErr_Occurred() != NULL) {
     894           0 :                                 return -1;
     895             :                         }
     896           0 :                         if (test_var > uint_max) {
     897           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     898             :                                   PyLong_Type.tp_name, uint_max, test_var);
     899           0 :                                 return -1;
     900             :                         }
     901           0 :                         object->version_number = test_var;
     902             :                 } else {
     903           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     904             :                           PyLong_Type.tp_name);
     905           0 :                         return -1;
     906             :                 }
     907             :         }
     908           0 :         return 0;
     909             : }
     910             : 
     911           0 : static PyObject *py_nbt_statistics_get_period_of_statistics(PyObject *obj, void *closure)
     912             : {
     913           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     914             :         PyObject *py_period_of_statistics;
     915           0 :         py_period_of_statistics = PyLong_FromLong((uint16_t)object->period_of_statistics);
     916           0 :         return py_period_of_statistics;
     917             : }
     918             : 
     919           0 : static int py_nbt_statistics_set_period_of_statistics(PyObject *py_obj, PyObject *value, void *closure)
     920             : {
     921           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     922           0 :         if (value == NULL) {
     923           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->period_of_statistics");
     924           0 :                 return -1;
     925             :         }
     926             :         {
     927           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->period_of_statistics));
     928           0 :                 if (PyLong_Check(value)) {
     929             :                         unsigned long long test_var;
     930           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     931           0 :                         if (PyErr_Occurred() != NULL) {
     932           0 :                                 return -1;
     933             :                         }
     934           0 :                         if (test_var > uint_max) {
     935           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     936             :                                   PyLong_Type.tp_name, uint_max, test_var);
     937           0 :                                 return -1;
     938             :                         }
     939           0 :                         object->period_of_statistics = test_var;
     940             :                 } else {
     941           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     942             :                           PyLong_Type.tp_name);
     943           0 :                         return -1;
     944             :                 }
     945             :         }
     946           0 :         return 0;
     947             : }
     948             : 
     949           0 : static PyObject *py_nbt_statistics_get_number_of_crcs(PyObject *obj, void *closure)
     950             : {
     951           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     952             :         PyObject *py_number_of_crcs;
     953           0 :         py_number_of_crcs = PyLong_FromLong((uint16_t)object->number_of_crcs);
     954           0 :         return py_number_of_crcs;
     955             : }
     956             : 
     957           0 : static int py_nbt_statistics_set_number_of_crcs(PyObject *py_obj, PyObject *value, void *closure)
     958             : {
     959           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     960           0 :         if (value == NULL) {
     961           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_of_crcs");
     962           0 :                 return -1;
     963             :         }
     964             :         {
     965           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_crcs));
     966           0 :                 if (PyLong_Check(value)) {
     967             :                         unsigned long long test_var;
     968           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     969           0 :                         if (PyErr_Occurred() != NULL) {
     970           0 :                                 return -1;
     971             :                         }
     972           0 :                         if (test_var > uint_max) {
     973           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     974             :                                   PyLong_Type.tp_name, uint_max, test_var);
     975           0 :                                 return -1;
     976             :                         }
     977           0 :                         object->number_of_crcs = test_var;
     978             :                 } else {
     979           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     980             :                           PyLong_Type.tp_name);
     981           0 :                         return -1;
     982             :                 }
     983             :         }
     984           0 :         return 0;
     985             : }
     986             : 
     987           0 : static PyObject *py_nbt_statistics_get_number_alignment_errors(PyObject *obj, void *closure)
     988             : {
     989           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
     990             :         PyObject *py_number_alignment_errors;
     991           0 :         py_number_alignment_errors = PyLong_FromLong((uint16_t)object->number_alignment_errors);
     992           0 :         return py_number_alignment_errors;
     993             : }
     994             : 
     995           0 : static int py_nbt_statistics_set_number_alignment_errors(PyObject *py_obj, PyObject *value, void *closure)
     996             : {
     997           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
     998           0 :         if (value == NULL) {
     999           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_alignment_errors");
    1000           0 :                 return -1;
    1001             :         }
    1002             :         {
    1003           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_alignment_errors));
    1004           0 :                 if (PyLong_Check(value)) {
    1005             :                         unsigned long long test_var;
    1006           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1007           0 :                         if (PyErr_Occurred() != NULL) {
    1008           0 :                                 return -1;
    1009             :                         }
    1010           0 :                         if (test_var > uint_max) {
    1011           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1012             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1013           0 :                                 return -1;
    1014             :                         }
    1015           0 :                         object->number_alignment_errors = test_var;
    1016             :                 } else {
    1017           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1018             :                           PyLong_Type.tp_name);
    1019           0 :                         return -1;
    1020             :                 }
    1021             :         }
    1022           0 :         return 0;
    1023             : }
    1024             : 
    1025           0 : static PyObject *py_nbt_statistics_get_number_of_collisions(PyObject *obj, void *closure)
    1026             : {
    1027           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1028             :         PyObject *py_number_of_collisions;
    1029           0 :         py_number_of_collisions = PyLong_FromLong((uint16_t)object->number_of_collisions);
    1030           0 :         return py_number_of_collisions;
    1031             : }
    1032             : 
    1033           0 : static int py_nbt_statistics_set_number_of_collisions(PyObject *py_obj, PyObject *value, void *closure)
    1034             : {
    1035           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1036           0 :         if (value == NULL) {
    1037           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_of_collisions");
    1038           0 :                 return -1;
    1039             :         }
    1040             :         {
    1041           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_collisions));
    1042           0 :                 if (PyLong_Check(value)) {
    1043             :                         unsigned long long test_var;
    1044           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1045           0 :                         if (PyErr_Occurred() != NULL) {
    1046           0 :                                 return -1;
    1047             :                         }
    1048           0 :                         if (test_var > uint_max) {
    1049           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1050             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1051           0 :                                 return -1;
    1052             :                         }
    1053           0 :                         object->number_of_collisions = test_var;
    1054             :                 } else {
    1055           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1056             :                           PyLong_Type.tp_name);
    1057           0 :                         return -1;
    1058             :                 }
    1059             :         }
    1060           0 :         return 0;
    1061             : }
    1062             : 
    1063           0 : static PyObject *py_nbt_statistics_get_number_send_aborts(PyObject *obj, void *closure)
    1064             : {
    1065           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1066             :         PyObject *py_number_send_aborts;
    1067           0 :         py_number_send_aborts = PyLong_FromLong((uint16_t)object->number_send_aborts);
    1068           0 :         return py_number_send_aborts;
    1069             : }
    1070             : 
    1071           0 : static int py_nbt_statistics_set_number_send_aborts(PyObject *py_obj, PyObject *value, void *closure)
    1072             : {
    1073           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1074           0 :         if (value == NULL) {
    1075           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_send_aborts");
    1076           0 :                 return -1;
    1077             :         }
    1078             :         {
    1079           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_send_aborts));
    1080           0 :                 if (PyLong_Check(value)) {
    1081             :                         unsigned long long test_var;
    1082           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1083           0 :                         if (PyErr_Occurred() != NULL) {
    1084           0 :                                 return -1;
    1085             :                         }
    1086           0 :                         if (test_var > uint_max) {
    1087           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1088             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1089           0 :                                 return -1;
    1090             :                         }
    1091           0 :                         object->number_send_aborts = test_var;
    1092             :                 } else {
    1093           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1094             :                           PyLong_Type.tp_name);
    1095           0 :                         return -1;
    1096             :                 }
    1097             :         }
    1098           0 :         return 0;
    1099             : }
    1100             : 
    1101           0 : static PyObject *py_nbt_statistics_get_number_good_sends(PyObject *obj, void *closure)
    1102             : {
    1103           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1104             :         PyObject *py_number_good_sends;
    1105           0 :         py_number_good_sends = PyLong_FromUnsignedLongLong((uint32_t)object->number_good_sends);
    1106           0 :         return py_number_good_sends;
    1107             : }
    1108             : 
    1109           0 : static int py_nbt_statistics_set_number_good_sends(PyObject *py_obj, PyObject *value, void *closure)
    1110             : {
    1111           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1112           0 :         if (value == NULL) {
    1113           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_good_sends");
    1114           0 :                 return -1;
    1115             :         }
    1116             :         {
    1117           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_sends));
    1118           0 :                 if (PyLong_Check(value)) {
    1119             :                         unsigned long long test_var;
    1120           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1121           0 :                         if (PyErr_Occurred() != NULL) {
    1122           0 :                                 return -1;
    1123             :                         }
    1124           0 :                         if (test_var > uint_max) {
    1125           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1126             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1127           0 :                                 return -1;
    1128             :                         }
    1129           0 :                         object->number_good_sends = test_var;
    1130             :                 } else {
    1131           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1132             :                           PyLong_Type.tp_name);
    1133           0 :                         return -1;
    1134             :                 }
    1135             :         }
    1136           0 :         return 0;
    1137             : }
    1138             : 
    1139           0 : static PyObject *py_nbt_statistics_get_number_good_receives(PyObject *obj, void *closure)
    1140             : {
    1141           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1142             :         PyObject *py_number_good_receives;
    1143           0 :         py_number_good_receives = PyLong_FromUnsignedLongLong((uint32_t)object->number_good_receives);
    1144           0 :         return py_number_good_receives;
    1145             : }
    1146             : 
    1147           0 : static int py_nbt_statistics_set_number_good_receives(PyObject *py_obj, PyObject *value, void *closure)
    1148             : {
    1149           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1150           0 :         if (value == NULL) {
    1151           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_good_receives");
    1152           0 :                 return -1;
    1153             :         }
    1154             :         {
    1155           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_good_receives));
    1156           0 :                 if (PyLong_Check(value)) {
    1157             :                         unsigned long long test_var;
    1158           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1159           0 :                         if (PyErr_Occurred() != NULL) {
    1160           0 :                                 return -1;
    1161             :                         }
    1162           0 :                         if (test_var > uint_max) {
    1163           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1164             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1165           0 :                                 return -1;
    1166             :                         }
    1167           0 :                         object->number_good_receives = test_var;
    1168             :                 } else {
    1169           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1170             :                           PyLong_Type.tp_name);
    1171           0 :                         return -1;
    1172             :                 }
    1173             :         }
    1174           0 :         return 0;
    1175             : }
    1176             : 
    1177           0 : static PyObject *py_nbt_statistics_get_number_retransmits(PyObject *obj, void *closure)
    1178             : {
    1179           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1180             :         PyObject *py_number_retransmits;
    1181           0 :         py_number_retransmits = PyLong_FromLong((uint16_t)object->number_retransmits);
    1182           0 :         return py_number_retransmits;
    1183             : }
    1184             : 
    1185           0 : static int py_nbt_statistics_set_number_retransmits(PyObject *py_obj, PyObject *value, void *closure)
    1186             : {
    1187           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1188           0 :         if (value == NULL) {
    1189           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_retransmits");
    1190           0 :                 return -1;
    1191             :         }
    1192             :         {
    1193           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_retransmits));
    1194           0 :                 if (PyLong_Check(value)) {
    1195             :                         unsigned long long test_var;
    1196           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1197           0 :                         if (PyErr_Occurred() != NULL) {
    1198           0 :                                 return -1;
    1199             :                         }
    1200           0 :                         if (test_var > uint_max) {
    1201           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1202             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1203           0 :                                 return -1;
    1204             :                         }
    1205           0 :                         object->number_retransmits = test_var;
    1206             :                 } else {
    1207           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1208             :                           PyLong_Type.tp_name);
    1209           0 :                         return -1;
    1210             :                 }
    1211             :         }
    1212           0 :         return 0;
    1213             : }
    1214             : 
    1215           0 : static PyObject *py_nbt_statistics_get_number_no_resource_conditions(PyObject *obj, void *closure)
    1216             : {
    1217           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1218             :         PyObject *py_number_no_resource_conditions;
    1219           0 :         py_number_no_resource_conditions = PyLong_FromLong((uint16_t)object->number_no_resource_conditions);
    1220           0 :         return py_number_no_resource_conditions;
    1221             : }
    1222             : 
    1223           0 : static int py_nbt_statistics_set_number_no_resource_conditions(PyObject *py_obj, PyObject *value, void *closure)
    1224             : {
    1225           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1226           0 :         if (value == NULL) {
    1227           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_no_resource_conditions");
    1228           0 :                 return -1;
    1229             :         }
    1230             :         {
    1231           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_no_resource_conditions));
    1232           0 :                 if (PyLong_Check(value)) {
    1233             :                         unsigned long long test_var;
    1234           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1235           0 :                         if (PyErr_Occurred() != NULL) {
    1236           0 :                                 return -1;
    1237             :                         }
    1238           0 :                         if (test_var > uint_max) {
    1239           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1240             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1241           0 :                                 return -1;
    1242             :                         }
    1243           0 :                         object->number_no_resource_conditions = test_var;
    1244             :                 } else {
    1245           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1246             :                           PyLong_Type.tp_name);
    1247           0 :                         return -1;
    1248             :                 }
    1249             :         }
    1250           0 :         return 0;
    1251             : }
    1252             : 
    1253           0 : static PyObject *py_nbt_statistics_get_number_free_command_blocks(PyObject *obj, void *closure)
    1254             : {
    1255           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1256             :         PyObject *py_number_free_command_blocks;
    1257           0 :         py_number_free_command_blocks = PyLong_FromLong((uint16_t)object->number_free_command_blocks);
    1258           0 :         return py_number_free_command_blocks;
    1259             : }
    1260             : 
    1261           0 : static int py_nbt_statistics_set_number_free_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
    1262             : {
    1263           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1264           0 :         if (value == NULL) {
    1265           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_free_command_blocks");
    1266           0 :                 return -1;
    1267             :         }
    1268             :         {
    1269           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_free_command_blocks));
    1270           0 :                 if (PyLong_Check(value)) {
    1271             :                         unsigned long long test_var;
    1272           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1273           0 :                         if (PyErr_Occurred() != NULL) {
    1274           0 :                                 return -1;
    1275             :                         }
    1276           0 :                         if (test_var > uint_max) {
    1277           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1278             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1279           0 :                                 return -1;
    1280             :                         }
    1281           0 :                         object->number_free_command_blocks = test_var;
    1282             :                 } else {
    1283           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1284             :                           PyLong_Type.tp_name);
    1285           0 :                         return -1;
    1286             :                 }
    1287             :         }
    1288           0 :         return 0;
    1289             : }
    1290             : 
    1291           0 : static PyObject *py_nbt_statistics_get_total_number_command_blocks(PyObject *obj, void *closure)
    1292             : {
    1293           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1294             :         PyObject *py_total_number_command_blocks;
    1295           0 :         py_total_number_command_blocks = PyLong_FromLong((uint16_t)object->total_number_command_blocks);
    1296           0 :         return py_total_number_command_blocks;
    1297             : }
    1298             : 
    1299           0 : static int py_nbt_statistics_set_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
    1300             : {
    1301           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1302           0 :         if (value == NULL) {
    1303           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_number_command_blocks");
    1304           0 :                 return -1;
    1305             :         }
    1306             :         {
    1307           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_number_command_blocks));
    1308           0 :                 if (PyLong_Check(value)) {
    1309             :                         unsigned long long test_var;
    1310           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1311           0 :                         if (PyErr_Occurred() != NULL) {
    1312           0 :                                 return -1;
    1313             :                         }
    1314           0 :                         if (test_var > uint_max) {
    1315           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1316             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1317           0 :                                 return -1;
    1318             :                         }
    1319           0 :                         object->total_number_command_blocks = test_var;
    1320             :                 } else {
    1321           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1322             :                           PyLong_Type.tp_name);
    1323           0 :                         return -1;
    1324             :                 }
    1325             :         }
    1326           0 :         return 0;
    1327             : }
    1328             : 
    1329           0 : static PyObject *py_nbt_statistics_get_max_total_number_command_blocks(PyObject *obj, void *closure)
    1330             : {
    1331           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1332             :         PyObject *py_max_total_number_command_blocks;
    1333           0 :         py_max_total_number_command_blocks = PyLong_FromLong((uint16_t)object->max_total_number_command_blocks);
    1334           0 :         return py_max_total_number_command_blocks;
    1335             : }
    1336             : 
    1337           0 : static int py_nbt_statistics_set_max_total_number_command_blocks(PyObject *py_obj, PyObject *value, void *closure)
    1338             : {
    1339           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1340           0 :         if (value == NULL) {
    1341           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_total_number_command_blocks");
    1342           0 :                 return -1;
    1343             :         }
    1344             :         {
    1345           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_number_command_blocks));
    1346           0 :                 if (PyLong_Check(value)) {
    1347             :                         unsigned long long test_var;
    1348           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1349           0 :                         if (PyErr_Occurred() != NULL) {
    1350           0 :                                 return -1;
    1351             :                         }
    1352           0 :                         if (test_var > uint_max) {
    1353           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1354             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1355           0 :                                 return -1;
    1356             :                         }
    1357           0 :                         object->max_total_number_command_blocks = test_var;
    1358             :                 } else {
    1359           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1360             :                           PyLong_Type.tp_name);
    1361           0 :                         return -1;
    1362             :                 }
    1363             :         }
    1364           0 :         return 0;
    1365             : }
    1366             : 
    1367           0 : static PyObject *py_nbt_statistics_get_number_pending_sessions(PyObject *obj, void *closure)
    1368             : {
    1369           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1370             :         PyObject *py_number_pending_sessions;
    1371           0 :         py_number_pending_sessions = PyLong_FromLong((uint16_t)object->number_pending_sessions);
    1372           0 :         return py_number_pending_sessions;
    1373             : }
    1374             : 
    1375           0 : static int py_nbt_statistics_set_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
    1376             : {
    1377           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1378           0 :         if (value == NULL) {
    1379           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->number_pending_sessions");
    1380           0 :                 return -1;
    1381             :         }
    1382             :         {
    1383           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_pending_sessions));
    1384           0 :                 if (PyLong_Check(value)) {
    1385             :                         unsigned long long test_var;
    1386           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1387           0 :                         if (PyErr_Occurred() != NULL) {
    1388           0 :                                 return -1;
    1389             :                         }
    1390           0 :                         if (test_var > uint_max) {
    1391           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1392             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1393           0 :                                 return -1;
    1394             :                         }
    1395           0 :                         object->number_pending_sessions = test_var;
    1396             :                 } else {
    1397           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1398             :                           PyLong_Type.tp_name);
    1399           0 :                         return -1;
    1400             :                 }
    1401             :         }
    1402           0 :         return 0;
    1403             : }
    1404             : 
    1405           0 : static PyObject *py_nbt_statistics_get_max_number_pending_sessions(PyObject *obj, void *closure)
    1406             : {
    1407           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1408             :         PyObject *py_max_number_pending_sessions;
    1409           0 :         py_max_number_pending_sessions = PyLong_FromLong((uint16_t)object->max_number_pending_sessions);
    1410           0 :         return py_max_number_pending_sessions;
    1411             : }
    1412             : 
    1413           0 : static int py_nbt_statistics_set_max_number_pending_sessions(PyObject *py_obj, PyObject *value, void *closure)
    1414             : {
    1415           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1416           0 :         if (value == NULL) {
    1417           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_number_pending_sessions");
    1418           0 :                 return -1;
    1419             :         }
    1420             :         {
    1421           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_number_pending_sessions));
    1422           0 :                 if (PyLong_Check(value)) {
    1423             :                         unsigned long long test_var;
    1424           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1425           0 :                         if (PyErr_Occurred() != NULL) {
    1426           0 :                                 return -1;
    1427             :                         }
    1428           0 :                         if (test_var > uint_max) {
    1429           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1430             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1431           0 :                                 return -1;
    1432             :                         }
    1433           0 :                         object->max_number_pending_sessions = test_var;
    1434             :                 } else {
    1435           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1436             :                           PyLong_Type.tp_name);
    1437           0 :                         return -1;
    1438             :                 }
    1439             :         }
    1440           0 :         return 0;
    1441             : }
    1442             : 
    1443           0 : static PyObject *py_nbt_statistics_get_max_total_sessions_possible(PyObject *obj, void *closure)
    1444             : {
    1445           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1446             :         PyObject *py_max_total_sessions_possible;
    1447           0 :         py_max_total_sessions_possible = PyLong_FromLong((uint16_t)object->max_total_sessions_possible);
    1448           0 :         return py_max_total_sessions_possible;
    1449             : }
    1450             : 
    1451           0 : static int py_nbt_statistics_set_max_total_sessions_possible(PyObject *py_obj, PyObject *value, void *closure)
    1452             : {
    1453           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1454           0 :         if (value == NULL) {
    1455           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_total_sessions_possible");
    1456           0 :                 return -1;
    1457             :         }
    1458             :         {
    1459           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_total_sessions_possible));
    1460           0 :                 if (PyLong_Check(value)) {
    1461             :                         unsigned long long test_var;
    1462           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1463           0 :                         if (PyErr_Occurred() != NULL) {
    1464           0 :                                 return -1;
    1465             :                         }
    1466           0 :                         if (test_var > uint_max) {
    1467           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1468             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1469           0 :                                 return -1;
    1470             :                         }
    1471           0 :                         object->max_total_sessions_possible = test_var;
    1472             :                 } else {
    1473           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1474             :                           PyLong_Type.tp_name);
    1475           0 :                         return -1;
    1476             :                 }
    1477             :         }
    1478           0 :         return 0;
    1479             : }
    1480             : 
    1481           0 : static PyObject *py_nbt_statistics_get_session_data_packet_size(PyObject *obj, void *closure)
    1482             : {
    1483           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(obj);
    1484             :         PyObject *py_session_data_packet_size;
    1485           0 :         py_session_data_packet_size = PyLong_FromLong((uint16_t)object->session_data_packet_size);
    1486           0 :         return py_session_data_packet_size;
    1487             : }
    1488             : 
    1489           0 : static int py_nbt_statistics_set_session_data_packet_size(PyObject *py_obj, PyObject *value, void *closure)
    1490             : {
    1491           0 :         struct nbt_statistics *object = (struct nbt_statistics *)pytalloc_get_ptr(py_obj);
    1492           0 :         if (value == NULL) {
    1493           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->session_data_packet_size");
    1494           0 :                 return -1;
    1495             :         }
    1496             :         {
    1497           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->session_data_packet_size));
    1498           0 :                 if (PyLong_Check(value)) {
    1499             :                         unsigned long long test_var;
    1500           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1501           0 :                         if (PyErr_Occurred() != NULL) {
    1502           0 :                                 return -1;
    1503             :                         }
    1504           0 :                         if (test_var > uint_max) {
    1505           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1506             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1507           0 :                                 return -1;
    1508             :                         }
    1509           0 :                         object->session_data_packet_size = test_var;
    1510             :                 } else {
    1511           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1512             :                           PyLong_Type.tp_name);
    1513           0 :                         return -1;
    1514             :                 }
    1515             :         }
    1516           0 :         return 0;
    1517             : }
    1518             : 
    1519             : static PyGetSetDef py_nbt_statistics_getsetters[] = {
    1520             :         {
    1521             :                 .name = discard_const_p(char, "unit_id"),
    1522             :                 .get = py_nbt_statistics_get_unit_id,
    1523             :                 .set = py_nbt_statistics_set_unit_id,
    1524             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1525             :         },
    1526             :         {
    1527             :                 .name = discard_const_p(char, "jumpers"),
    1528             :                 .get = py_nbt_statistics_get_jumpers,
    1529             :                 .set = py_nbt_statistics_set_jumpers,
    1530             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1531             :         },
    1532             :         {
    1533             :                 .name = discard_const_p(char, "test_result"),
    1534             :                 .get = py_nbt_statistics_get_test_result,
    1535             :                 .set = py_nbt_statistics_set_test_result,
    1536             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1537             :         },
    1538             :         {
    1539             :                 .name = discard_const_p(char, "version_number"),
    1540             :                 .get = py_nbt_statistics_get_version_number,
    1541             :                 .set = py_nbt_statistics_set_version_number,
    1542             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1543             :         },
    1544             :         {
    1545             :                 .name = discard_const_p(char, "period_of_statistics"),
    1546             :                 .get = py_nbt_statistics_get_period_of_statistics,
    1547             :                 .set = py_nbt_statistics_set_period_of_statistics,
    1548             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1549             :         },
    1550             :         {
    1551             :                 .name = discard_const_p(char, "number_of_crcs"),
    1552             :                 .get = py_nbt_statistics_get_number_of_crcs,
    1553             :                 .set = py_nbt_statistics_set_number_of_crcs,
    1554             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1555             :         },
    1556             :         {
    1557             :                 .name = discard_const_p(char, "number_alignment_errors"),
    1558             :                 .get = py_nbt_statistics_get_number_alignment_errors,
    1559             :                 .set = py_nbt_statistics_set_number_alignment_errors,
    1560             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1561             :         },
    1562             :         {
    1563             :                 .name = discard_const_p(char, "number_of_collisions"),
    1564             :                 .get = py_nbt_statistics_get_number_of_collisions,
    1565             :                 .set = py_nbt_statistics_set_number_of_collisions,
    1566             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1567             :         },
    1568             :         {
    1569             :                 .name = discard_const_p(char, "number_send_aborts"),
    1570             :                 .get = py_nbt_statistics_get_number_send_aborts,
    1571             :                 .set = py_nbt_statistics_set_number_send_aborts,
    1572             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1573             :         },
    1574             :         {
    1575             :                 .name = discard_const_p(char, "number_good_sends"),
    1576             :                 .get = py_nbt_statistics_get_number_good_sends,
    1577             :                 .set = py_nbt_statistics_set_number_good_sends,
    1578             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1579             :         },
    1580             :         {
    1581             :                 .name = discard_const_p(char, "number_good_receives"),
    1582             :                 .get = py_nbt_statistics_get_number_good_receives,
    1583             :                 .set = py_nbt_statistics_set_number_good_receives,
    1584             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1585             :         },
    1586             :         {
    1587             :                 .name = discard_const_p(char, "number_retransmits"),
    1588             :                 .get = py_nbt_statistics_get_number_retransmits,
    1589             :                 .set = py_nbt_statistics_set_number_retransmits,
    1590             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1591             :         },
    1592             :         {
    1593             :                 .name = discard_const_p(char, "number_no_resource_conditions"),
    1594             :                 .get = py_nbt_statistics_get_number_no_resource_conditions,
    1595             :                 .set = py_nbt_statistics_set_number_no_resource_conditions,
    1596             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1597             :         },
    1598             :         {
    1599             :                 .name = discard_const_p(char, "number_free_command_blocks"),
    1600             :                 .get = py_nbt_statistics_get_number_free_command_blocks,
    1601             :                 .set = py_nbt_statistics_set_number_free_command_blocks,
    1602             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1603             :         },
    1604             :         {
    1605             :                 .name = discard_const_p(char, "total_number_command_blocks"),
    1606             :                 .get = py_nbt_statistics_get_total_number_command_blocks,
    1607             :                 .set = py_nbt_statistics_set_total_number_command_blocks,
    1608             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1609             :         },
    1610             :         {
    1611             :                 .name = discard_const_p(char, "max_total_number_command_blocks"),
    1612             :                 .get = py_nbt_statistics_get_max_total_number_command_blocks,
    1613             :                 .set = py_nbt_statistics_set_max_total_number_command_blocks,
    1614             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1615             :         },
    1616             :         {
    1617             :                 .name = discard_const_p(char, "number_pending_sessions"),
    1618             :                 .get = py_nbt_statistics_get_number_pending_sessions,
    1619             :                 .set = py_nbt_statistics_set_number_pending_sessions,
    1620             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1621             :         },
    1622             :         {
    1623             :                 .name = discard_const_p(char, "max_number_pending_sessions"),
    1624             :                 .get = py_nbt_statistics_get_max_number_pending_sessions,
    1625             :                 .set = py_nbt_statistics_set_max_number_pending_sessions,
    1626             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1627             :         },
    1628             :         {
    1629             :                 .name = discard_const_p(char, "max_total_sessions_possible"),
    1630             :                 .get = py_nbt_statistics_get_max_total_sessions_possible,
    1631             :                 .set = py_nbt_statistics_set_max_total_sessions_possible,
    1632             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1633             :         },
    1634             :         {
    1635             :                 .name = discard_const_p(char, "session_data_packet_size"),
    1636             :                 .get = py_nbt_statistics_get_session_data_packet_size,
    1637             :                 .set = py_nbt_statistics_set_session_data_packet_size,
    1638             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1639             :         },
    1640             :         { .name = NULL }
    1641             : };
    1642             : 
    1643           0 : static PyObject *py_nbt_statistics_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1644             : {
    1645           0 :         return pytalloc_new(struct nbt_statistics, type);
    1646             : }
    1647             : 
    1648             : 
    1649             : static PyTypeObject nbt_statistics_Type = {
    1650             :         PyVarObject_HEAD_INIT(NULL, 0)
    1651             :         .tp_name = "nbt.statistics",
    1652             :         .tp_getset = py_nbt_statistics_getsetters,
    1653             :         .tp_methods = NULL,
    1654             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1655             :         .tp_new = py_nbt_statistics_new,
    1656             : };
    1657             : 
    1658             : 
    1659           0 : static PyObject *py_nbt_status_name_get_name(PyObject *obj, void *closure)
    1660             : {
    1661           0 :         struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
    1662             :         PyObject *py_name;
    1663           0 :         if (object->name == NULL) {
    1664           0 :                 py_name = Py_None;
    1665           0 :                 Py_INCREF(py_name);
    1666             :         } else {
    1667           0 :                 py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    1668             :         }
    1669           0 :         return py_name;
    1670             : }
    1671             : 
    1672           0 : static int py_nbt_status_name_set_name(PyObject *py_obj, PyObject *value, void *closure)
    1673             : {
    1674           0 :         struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
    1675           0 :         if (value == NULL) {
    1676           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    1677           0 :                 return -1;
    1678             :         }
    1679             :         {
    1680             :                 const char *test_str;
    1681             :                 const char *talloc_str;
    1682           0 :                 PyObject *unicode = NULL;
    1683           0 :                 if (PyUnicode_Check(value)) {
    1684           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1685           0 :                         if (unicode == NULL) {
    1686           0 :                                 PyErr_NoMemory();
    1687           0 :                                 return -1;
    1688             :                         }
    1689           0 :                         test_str = PyBytes_AS_STRING(unicode);
    1690           0 :                 } else if (PyBytes_Check(value)) {
    1691           0 :                         test_str = PyBytes_AS_STRING(value);
    1692             :                 } else {
    1693           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1694           0 :                         return -1;
    1695             :                 }
    1696           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1697           0 :                 if (unicode != NULL) {
    1698           0 :                         Py_DECREF(unicode);
    1699             :                 }
    1700           0 :                 if (talloc_str == NULL) {
    1701           0 :                         PyErr_NoMemory();
    1702           0 :                         return -1;
    1703             :                 }
    1704           0 :                 object->name = talloc_str;
    1705             :         }
    1706           0 :         return 0;
    1707             : }
    1708             : 
    1709           0 : static PyObject *py_nbt_status_name_get_type(PyObject *obj, void *closure)
    1710             : {
    1711           0 :         struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
    1712             :         PyObject *py_type;
    1713           0 :         py_type = PyLong_FromLong((uint16_t)object->type);
    1714           0 :         return py_type;
    1715             : }
    1716             : 
    1717           0 : static int py_nbt_status_name_set_type(PyObject *py_obj, PyObject *value, void *closure)
    1718             : {
    1719           0 :         struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
    1720           0 :         if (value == NULL) {
    1721           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    1722           0 :                 return -1;
    1723             :         }
    1724             :         {
    1725           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    1726           0 :                 if (PyLong_Check(value)) {
    1727             :                         unsigned long long test_var;
    1728           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1729           0 :                         if (PyErr_Occurred() != NULL) {
    1730           0 :                                 return -1;
    1731             :                         }
    1732           0 :                         if (test_var > uint_max) {
    1733           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1734             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1735           0 :                                 return -1;
    1736             :                         }
    1737           0 :                         object->type = test_var;
    1738             :                 } else {
    1739           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1740             :                           PyLong_Type.tp_name);
    1741           0 :                         return -1;
    1742             :                 }
    1743             :         }
    1744           0 :         return 0;
    1745             : }
    1746             : 
    1747           0 : static PyObject *py_nbt_status_name_get_nb_flags(PyObject *obj, void *closure)
    1748             : {
    1749           0 :         struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(obj);
    1750             :         PyObject *py_nb_flags;
    1751           0 :         py_nb_flags = PyLong_FromLong((uint16_t)object->nb_flags);
    1752           0 :         return py_nb_flags;
    1753             : }
    1754             : 
    1755           0 : static int py_nbt_status_name_set_nb_flags(PyObject *py_obj, PyObject *value, void *closure)
    1756             : {
    1757           0 :         struct nbt_status_name *object = (struct nbt_status_name *)pytalloc_get_ptr(py_obj);
    1758           0 :         if (value == NULL) {
    1759           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nb_flags");
    1760           0 :                 return -1;
    1761             :         }
    1762             :         {
    1763           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nb_flags));
    1764           0 :                 if (PyLong_Check(value)) {
    1765             :                         unsigned long long test_var;
    1766           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1767           0 :                         if (PyErr_Occurred() != NULL) {
    1768           0 :                                 return -1;
    1769             :                         }
    1770           0 :                         if (test_var > uint_max) {
    1771           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1772             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1773           0 :                                 return -1;
    1774             :                         }
    1775           0 :                         object->nb_flags = test_var;
    1776             :                 } else {
    1777           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1778             :                           PyLong_Type.tp_name);
    1779           0 :                         return -1;
    1780             :                 }
    1781             :         }
    1782           0 :         return 0;
    1783             : }
    1784             : 
    1785             : static PyGetSetDef py_nbt_status_name_getsetters[] = {
    1786             :         {
    1787             :                 .name = discard_const_p(char, "name"),
    1788             :                 .get = py_nbt_status_name_get_name,
    1789             :                 .set = py_nbt_status_name_set_name,
    1790             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1791             :         },
    1792             :         {
    1793             :                 .name = discard_const_p(char, "type"),
    1794             :                 .get = py_nbt_status_name_get_type,
    1795             :                 .set = py_nbt_status_name_set_type,
    1796             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_type")
    1797             :         },
    1798             :         {
    1799             :                 .name = discard_const_p(char, "nb_flags"),
    1800             :                 .get = py_nbt_status_name_get_nb_flags,
    1801             :                 .set = py_nbt_status_name_set_nb_flags,
    1802             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nb_flags")
    1803             :         },
    1804             :         { .name = NULL }
    1805             : };
    1806             : 
    1807           0 : static PyObject *py_nbt_status_name_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1808             : {
    1809           0 :         return pytalloc_new(struct nbt_status_name, type);
    1810             : }
    1811             : 
    1812             : 
    1813             : static PyTypeObject nbt_status_name_Type = {
    1814             :         PyVarObject_HEAD_INIT(NULL, 0)
    1815             :         .tp_name = "nbt.status_name",
    1816             :         .tp_getset = py_nbt_status_name_getsetters,
    1817             :         .tp_methods = NULL,
    1818             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1819             :         .tp_new = py_nbt_status_name_new,
    1820             : };
    1821             : 
    1822             : 
    1823           0 : static PyObject *py_nbt_rdata_status_get_length(PyObject *obj, void *closure)
    1824             : {
    1825           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
    1826             :         PyObject *py_length;
    1827           0 :         py_length = PyLong_FromLong((uint16_t)object->length);
    1828           0 :         return py_length;
    1829             : }
    1830             : 
    1831           0 : static int py_nbt_rdata_status_set_length(PyObject *py_obj, PyObject *value, void *closure)
    1832             : {
    1833           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
    1834           0 :         if (value == NULL) {
    1835           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
    1836           0 :                 return -1;
    1837             :         }
    1838             :         {
    1839           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
    1840           0 :                 if (PyLong_Check(value)) {
    1841             :                         unsigned long long test_var;
    1842           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1843           0 :                         if (PyErr_Occurred() != NULL) {
    1844           0 :                                 return -1;
    1845             :                         }
    1846           0 :                         if (test_var > uint_max) {
    1847           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1848             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1849           0 :                                 return -1;
    1850             :                         }
    1851           0 :                         object->length = test_var;
    1852             :                 } else {
    1853           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1854             :                           PyLong_Type.tp_name);
    1855           0 :                         return -1;
    1856             :                 }
    1857             :         }
    1858           0 :         return 0;
    1859             : }
    1860             : 
    1861           0 : static PyObject *py_nbt_rdata_status_get_num_names(PyObject *obj, void *closure)
    1862             : {
    1863           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
    1864             :         PyObject *py_num_names;
    1865           0 :         py_num_names = PyLong_FromLong((uint16_t)object->num_names);
    1866           0 :         return py_num_names;
    1867             : }
    1868             : 
    1869           0 : static int py_nbt_rdata_status_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
    1870             : {
    1871           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
    1872           0 :         if (value == NULL) {
    1873           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_names");
    1874           0 :                 return -1;
    1875             :         }
    1876             :         {
    1877           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_names));
    1878           0 :                 if (PyLong_Check(value)) {
    1879             :                         unsigned long long test_var;
    1880           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1881           0 :                         if (PyErr_Occurred() != NULL) {
    1882           0 :                                 return -1;
    1883             :                         }
    1884           0 :                         if (test_var > uint_max) {
    1885           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1886             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1887           0 :                                 return -1;
    1888             :                         }
    1889           0 :                         object->num_names = test_var;
    1890             :                 } else {
    1891           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1892             :                           PyLong_Type.tp_name);
    1893           0 :                         return -1;
    1894             :                 }
    1895             :         }
    1896           0 :         return 0;
    1897             : }
    1898             : 
    1899           0 : static PyObject *py_nbt_rdata_status_get_names(PyObject *obj, void *closure)
    1900             : {
    1901           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
    1902             :         PyObject *py_names;
    1903           0 :         py_names = PyList_New(object->num_names);
    1904           0 :         if (py_names == NULL) {
    1905           0 :                 return NULL;
    1906             :         }
    1907             :         {
    1908             :                 int names_cntr_0;
    1909           0 :                 for (names_cntr_0 = 0; names_cntr_0 < (object->num_names); names_cntr_0++) {
    1910             :                         PyObject *py_names_0;
    1911           0 :                         py_names_0 = pytalloc_reference_ex(&nbt_status_name_Type, object->names, &object->names[names_cntr_0]);
    1912           0 :                         PyList_SetItem(py_names, names_cntr_0, py_names_0);
    1913             :                 }
    1914             :         }
    1915           0 :         return py_names;
    1916             : }
    1917             : 
    1918           0 : static int py_nbt_rdata_status_set_names(PyObject *py_obj, PyObject *value, void *closure)
    1919             : {
    1920           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
    1921           0 :         if (value == NULL) {
    1922           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
    1923           0 :                 return -1;
    1924             :         }
    1925           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1926             :         {
    1927             :                 int names_cntr_0;
    1928           0 :                 object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
    1929           0 :                 if (!object->names) { return -1;; }
    1930           0 :                 talloc_set_name_const(object->names, "ARRAY: object->names");
    1931           0 :                 for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
    1932           0 :                         if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
    1933           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_0]");
    1934           0 :                                 return -1;
    1935             :                         }
    1936           0 :                         PY_CHECK_TYPE(&nbt_status_name_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
    1937           0 :                         if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
    1938           0 :                                 PyErr_NoMemory();
    1939           0 :                                 return -1;
    1940             :                         }
    1941           0 :                         object->names[names_cntr_0] = *(struct nbt_status_name *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
    1942             :                 }
    1943             :         }
    1944           0 :         return 0;
    1945             : }
    1946             : 
    1947           0 : static PyObject *py_nbt_rdata_status_get_statistics(PyObject *obj, void *closure)
    1948             : {
    1949           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(obj);
    1950             :         PyObject *py_statistics;
    1951           0 :         py_statistics = pytalloc_reference_ex(&nbt_statistics_Type, pytalloc_get_mem_ctx(obj), &object->statistics);
    1952           0 :         return py_statistics;
    1953             : }
    1954             : 
    1955           0 : static int py_nbt_rdata_status_set_statistics(PyObject *py_obj, PyObject *value, void *closure)
    1956             : {
    1957           0 :         struct nbt_rdata_status *object = (struct nbt_rdata_status *)pytalloc_get_ptr(py_obj);
    1958           0 :         if (value == NULL) {
    1959           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->statistics");
    1960           0 :                 return -1;
    1961             :         }
    1962           0 :         PY_CHECK_TYPE(&nbt_statistics_Type, value, return -1;);
    1963           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1964           0 :                 PyErr_NoMemory();
    1965           0 :                 return -1;
    1966             :         }
    1967           0 :         object->statistics = *(struct nbt_statistics *)pytalloc_get_ptr(value);
    1968           0 :         return 0;
    1969             : }
    1970             : 
    1971             : static PyGetSetDef py_nbt_rdata_status_getsetters[] = {
    1972             :         {
    1973             :                 .name = discard_const_p(char, "length"),
    1974             :                 .get = py_nbt_rdata_status_get_length,
    1975             :                 .set = py_nbt_rdata_status_set_length,
    1976             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1977             :         },
    1978             :         {
    1979             :                 .name = discard_const_p(char, "num_names"),
    1980             :                 .get = py_nbt_rdata_status_get_num_names,
    1981             :                 .set = py_nbt_rdata_status_set_num_names,
    1982             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1983             :         },
    1984             :         {
    1985             :                 .name = discard_const_p(char, "names"),
    1986             :                 .get = py_nbt_rdata_status_get_names,
    1987             :                 .set = py_nbt_rdata_status_set_names,
    1988             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_status_name")
    1989             :         },
    1990             :         {
    1991             :                 .name = discard_const_p(char, "statistics"),
    1992             :                 .get = py_nbt_rdata_status_get_statistics,
    1993             :                 .set = py_nbt_rdata_status_set_statistics,
    1994             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_statistics")
    1995             :         },
    1996             :         { .name = NULL }
    1997             : };
    1998             : 
    1999           0 : static PyObject *py_nbt_rdata_status_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2000             : {
    2001           0 :         return pytalloc_new(struct nbt_rdata_status, type);
    2002             : }
    2003             : 
    2004             : 
    2005             : static PyTypeObject nbt_rdata_status_Type = {
    2006             :         PyVarObject_HEAD_INIT(NULL, 0)
    2007             :         .tp_name = "nbt.rdata_status",
    2008             :         .tp_getset = py_nbt_rdata_status_getsetters,
    2009             :         .tp_methods = NULL,
    2010             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2011             :         .tp_new = py_nbt_rdata_status_new,
    2012             : };
    2013             : 
    2014             : 
    2015           0 : static PyObject *py_nbt_rdata_data_get_length(PyObject *obj, void *closure)
    2016             : {
    2017           0 :         struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(obj);
    2018             :         PyObject *py_length;
    2019           0 :         py_length = PyLong_FromLong((uint16_t)object->length);
    2020           0 :         return py_length;
    2021             : }
    2022             : 
    2023           0 : static int py_nbt_rdata_data_set_length(PyObject *py_obj, PyObject *value, void *closure)
    2024             : {
    2025           0 :         struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(py_obj);
    2026           0 :         if (value == NULL) {
    2027           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
    2028           0 :                 return -1;
    2029             :         }
    2030             :         {
    2031           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
    2032           0 :                 if (PyLong_Check(value)) {
    2033             :                         unsigned long long test_var;
    2034           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2035           0 :                         if (PyErr_Occurred() != NULL) {
    2036           0 :                                 return -1;
    2037             :                         }
    2038           0 :                         if (test_var > uint_max) {
    2039           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2040             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2041           0 :                                 return -1;
    2042             :                         }
    2043           0 :                         object->length = test_var;
    2044             :                 } else {
    2045           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2046             :                           PyLong_Type.tp_name);
    2047           0 :                         return -1;
    2048             :                 }
    2049             :         }
    2050           0 :         return 0;
    2051             : }
    2052             : 
    2053           0 : static PyObject *py_nbt_rdata_data_get_data(PyObject *obj, void *closure)
    2054             : {
    2055           0 :         struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(obj);
    2056             :         PyObject *py_data;
    2057           0 :         py_data = PyList_New(object->length);
    2058           0 :         if (py_data == NULL) {
    2059           0 :                 return NULL;
    2060             :         }
    2061             :         {
    2062             :                 int data_cntr_0;
    2063           0 :                 for (data_cntr_0 = 0; data_cntr_0 < (object->length); data_cntr_0++) {
    2064             :                         PyObject *py_data_0;
    2065           0 :                         py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
    2066           0 :                         PyList_SetItem(py_data, data_cntr_0, py_data_0);
    2067             :                 }
    2068             :         }
    2069           0 :         return py_data;
    2070             : }
    2071             : 
    2072           0 : static int py_nbt_rdata_data_set_data(PyObject *py_obj, PyObject *value, void *closure)
    2073             : {
    2074           0 :         struct nbt_rdata_data *object = (struct nbt_rdata_data *)pytalloc_get_ptr(py_obj);
    2075           0 :         if (value == NULL) {
    2076           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
    2077           0 :                 return -1;
    2078             :         }
    2079           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2080             :         {
    2081             :                 int data_cntr_0;
    2082           0 :                 object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
    2083           0 :                 if (!object->data) { return -1;; }
    2084           0 :                 talloc_set_name_const(object->data, "ARRAY: object->data");
    2085           0 :                 for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
    2086           0 :                         if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
    2087           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
    2088           0 :                                 return -1;
    2089             :                         }
    2090             :                         {
    2091           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
    2092           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
    2093             :                                         unsigned long long test_var;
    2094           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
    2095           0 :                                         if (PyErr_Occurred() != NULL) {
    2096           0 :                                                 return -1;
    2097             :                                         }
    2098           0 :                                         if (test_var > uint_max) {
    2099           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2100             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    2101           0 :                                                 return -1;
    2102             :                                         }
    2103           0 :                                         object->data[data_cntr_0] = test_var;
    2104             :                                 } else {
    2105           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2106             :                                           PyLong_Type.tp_name);
    2107           0 :                                         return -1;
    2108             :                                 }
    2109             :                         }
    2110             :                 }
    2111             :         }
    2112           0 :         return 0;
    2113             : }
    2114             : 
    2115             : static PyGetSetDef py_nbt_rdata_data_getsetters[] = {
    2116             :         {
    2117             :                 .name = discard_const_p(char, "length"),
    2118             :                 .get = py_nbt_rdata_data_get_length,
    2119             :                 .set = py_nbt_rdata_data_set_length,
    2120             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2121             :         },
    2122             :         {
    2123             :                 .name = discard_const_p(char, "data"),
    2124             :                 .get = py_nbt_rdata_data_get_data,
    2125             :                 .set = py_nbt_rdata_data_set_data,
    2126             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2127             :         },
    2128             :         { .name = NULL }
    2129             : };
    2130             : 
    2131           0 : static PyObject *py_nbt_rdata_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2132             : {
    2133           0 :         return pytalloc_new(struct nbt_rdata_data, type);
    2134             : }
    2135             : 
    2136             : 
    2137             : static PyTypeObject nbt_rdata_data_Type = {
    2138             :         PyVarObject_HEAD_INIT(NULL, 0)
    2139             :         .tp_name = "nbt.rdata_data",
    2140             :         .tp_getset = py_nbt_rdata_data_getsetters,
    2141             :         .tp_methods = NULL,
    2142             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2143             :         .tp_new = py_nbt_rdata_data_new,
    2144             : };
    2145             : 
    2146           0 : static PyObject *py_import_nbt_rdata(TALLOC_CTX *mem_ctx, int level, union nbt_rdata *in)
    2147             : {
    2148             :         PyObject *ret;
    2149             : 
    2150           0 :         switch (level) {
    2151           0 :                 case NBT_QTYPE_NETBIOS:
    2152           0 :                         ret = pytalloc_reference_ex(&nbt_rdata_netbios_Type, mem_ctx, &in->netbios);
    2153           0 :                         return ret;
    2154             : 
    2155           0 :                 case NBT_QTYPE_STATUS:
    2156           0 :                         ret = pytalloc_reference_ex(&nbt_rdata_status_Type, mem_ctx, &in->status);
    2157           0 :                         return ret;
    2158             : 
    2159           0 :                 default:
    2160           0 :                         ret = pytalloc_reference_ex(&nbt_rdata_data_Type, mem_ctx, &in->data);
    2161           0 :                         return ret;
    2162             : 
    2163             :         }
    2164             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    2165             :         return NULL;
    2166             : }
    2167             : 
    2168           0 : static union nbt_rdata *py_export_nbt_rdata(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    2169             : {
    2170           0 :         union nbt_rdata *ret = talloc_zero(mem_ctx, union nbt_rdata);
    2171           0 :         switch (level) {
    2172           0 :                 case NBT_QTYPE_NETBIOS:
    2173           0 :                         if (in == NULL) {
    2174           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->netbios");
    2175           0 :                                 talloc_free(ret); return NULL;
    2176             :                         }
    2177           0 :                         PY_CHECK_TYPE(&nbt_rdata_netbios_Type, in, talloc_free(ret); return NULL;);
    2178           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2179           0 :                                 PyErr_NoMemory();
    2180           0 :                                 talloc_free(ret); return NULL;
    2181             :                         }
    2182           0 :                         ret->netbios = *(struct nbt_rdata_netbios *)pytalloc_get_ptr(in);
    2183           0 :                         break;
    2184             : 
    2185           0 :                 case NBT_QTYPE_STATUS:
    2186           0 :                         if (in == NULL) {
    2187           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->status");
    2188           0 :                                 talloc_free(ret); return NULL;
    2189             :                         }
    2190           0 :                         PY_CHECK_TYPE(&nbt_rdata_status_Type, in, talloc_free(ret); return NULL;);
    2191           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2192           0 :                                 PyErr_NoMemory();
    2193           0 :                                 talloc_free(ret); return NULL;
    2194             :                         }
    2195           0 :                         ret->status = *(struct nbt_rdata_status *)pytalloc_get_ptr(in);
    2196           0 :                         break;
    2197             : 
    2198           0 :                 default:
    2199           0 :                         if (in == NULL) {
    2200           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
    2201           0 :                                 talloc_free(ret); return NULL;
    2202             :                         }
    2203           0 :                         PY_CHECK_TYPE(&nbt_rdata_data_Type, in, talloc_free(ret); return NULL;);
    2204           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2205           0 :                                 PyErr_NoMemory();
    2206           0 :                                 talloc_free(ret); return NULL;
    2207             :                         }
    2208           0 :                         ret->data = *(struct nbt_rdata_data *)pytalloc_get_ptr(in);
    2209           0 :                         break;
    2210             : 
    2211             :         }
    2212             : 
    2213           0 :         return ret;
    2214             : }
    2215             : 
    2216           0 : static PyObject *py_nbt_rdata_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2217             : {
    2218           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2219           0 :         PyObject *mem_ctx_obj = NULL;
    2220           0 :         TALLOC_CTX *mem_ctx = NULL;
    2221           0 :         int level = 0;
    2222           0 :         PyObject *in_obj = NULL;
    2223           0 :         union nbt_rdata *in = NULL;
    2224             : 
    2225           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    2226             :                 discard_const_p(char *, kwnames),
    2227             :                 &mem_ctx_obj,
    2228             :                 &level,
    2229             :                 &in_obj)) {
    2230           0 :                 return NULL;
    2231             :         }
    2232           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2233           0 :         if (mem_ctx == NULL) {
    2234           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2235           0 :                 return NULL;
    2236             :         }
    2237           0 :         in = (union nbt_rdata *)pytalloc_get_ptr(in_obj);
    2238           0 :         if (in == NULL) {
    2239           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbt_rdata!");
    2240           0 :                 return NULL;
    2241             :         }
    2242             : 
    2243           0 :         return py_import_nbt_rdata(mem_ctx, level, in);
    2244             : }
    2245             : 
    2246           0 : static PyObject *py_nbt_rdata_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2247             : {
    2248           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2249           0 :         PyObject *mem_ctx_obj = NULL;
    2250           0 :         TALLOC_CTX *mem_ctx = NULL;
    2251           0 :         int level = 0;
    2252           0 :         PyObject *in = NULL;
    2253           0 :         union nbt_rdata *out = NULL;
    2254             : 
    2255           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    2256             :                 discard_const_p(char *, kwnames),
    2257             :                 &mem_ctx_obj,
    2258             :                 &level,
    2259             :                 &in)) {
    2260           0 :                 return NULL;
    2261             :         }
    2262           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2263           0 :         if (mem_ctx == NULL) {
    2264           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2265           0 :                 return NULL;
    2266             :         }
    2267             : 
    2268           0 :         out = py_export_nbt_rdata(mem_ctx, level, in);
    2269           0 :         if (out == NULL) {
    2270           0 :                 return NULL;
    2271             :         }
    2272             : 
    2273           0 :         return pytalloc_GenericObject_reference(out);
    2274             : }
    2275             : 
    2276             : static PyMethodDef py_nbt_rdata_methods[] = {
    2277             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_import),
    2278             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2279             :                 "T.__import__(mem_ctx, level, in) => ret." },
    2280             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_rdata_export),
    2281             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2282             :                 "T.__export__(mem_ctx, level, in) => ret." },
    2283             :         { NULL, NULL, 0, NULL }
    2284             : };
    2285             : 
    2286           0 : static PyObject *py_nbt_rdata_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2287             : {
    2288           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    2289           0 :         return NULL;
    2290             : }
    2291             : 
    2292             : 
    2293             : static PyTypeObject nbt_rdata_Type = {
    2294             :         PyVarObject_HEAD_INIT(NULL, 0)
    2295             :         .tp_name = "nbt.rdata",
    2296             :         .tp_getset = NULL,
    2297             :         .tp_methods = py_nbt_rdata_methods,
    2298             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2299             :         .tp_new = py_nbt_rdata_new,
    2300             : };
    2301             : 
    2302             : 
    2303           0 : static PyObject *py_nbt_res_rec_get_name(PyObject *obj, void *closure)
    2304             : {
    2305           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
    2306             :         PyObject *py_name;
    2307           0 :         py_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->name);
    2308           0 :         return py_name;
    2309             : }
    2310             : 
    2311           0 : static int py_nbt_res_rec_set_name(PyObject *py_obj, PyObject *value, void *closure)
    2312             : {
    2313           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
    2314           0 :         if (value == NULL) {
    2315           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    2316           0 :                 return -1;
    2317             :         }
    2318           0 :         PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
    2319           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2320           0 :                 PyErr_NoMemory();
    2321           0 :                 return -1;
    2322             :         }
    2323           0 :         object->name = *(struct nbt_name *)pytalloc_get_ptr(value);
    2324           0 :         return 0;
    2325             : }
    2326             : 
    2327           0 : static PyObject *py_nbt_res_rec_get_rr_type(PyObject *obj, void *closure)
    2328             : {
    2329           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
    2330             :         PyObject *py_rr_type;
    2331           0 :         py_rr_type = PyLong_FromLong((uint16_t)object->rr_type);
    2332           0 :         return py_rr_type;
    2333             : }
    2334             : 
    2335           0 : static int py_nbt_res_rec_set_rr_type(PyObject *py_obj, PyObject *value, void *closure)
    2336             : {
    2337           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
    2338           0 :         if (value == NULL) {
    2339           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rr_type");
    2340           0 :                 return -1;
    2341             :         }
    2342             :         {
    2343           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_type));
    2344           0 :                 if (PyLong_Check(value)) {
    2345             :                         unsigned long long test_var;
    2346           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2347           0 :                         if (PyErr_Occurred() != NULL) {
    2348           0 :                                 return -1;
    2349             :                         }
    2350           0 :                         if (test_var > uint_max) {
    2351           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2352             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2353           0 :                                 return -1;
    2354             :                         }
    2355           0 :                         object->rr_type = test_var;
    2356             :                 } else {
    2357           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2358             :                           PyLong_Type.tp_name);
    2359           0 :                         return -1;
    2360             :                 }
    2361             :         }
    2362           0 :         return 0;
    2363             : }
    2364             : 
    2365           0 : static PyObject *py_nbt_res_rec_get_rr_class(PyObject *obj, void *closure)
    2366             : {
    2367           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
    2368             :         PyObject *py_rr_class;
    2369           0 :         py_rr_class = PyLong_FromLong((uint16_t)object->rr_class);
    2370           0 :         return py_rr_class;
    2371             : }
    2372             : 
    2373           0 : static int py_nbt_res_rec_set_rr_class(PyObject *py_obj, PyObject *value, void *closure)
    2374             : {
    2375           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
    2376           0 :         if (value == NULL) {
    2377           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rr_class");
    2378           0 :                 return -1;
    2379             :         }
    2380             :         {
    2381           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rr_class));
    2382           0 :                 if (PyLong_Check(value)) {
    2383             :                         unsigned long long test_var;
    2384           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2385           0 :                         if (PyErr_Occurred() != NULL) {
    2386           0 :                                 return -1;
    2387             :                         }
    2388           0 :                         if (test_var > uint_max) {
    2389           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2390             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2391           0 :                                 return -1;
    2392             :                         }
    2393           0 :                         object->rr_class = test_var;
    2394             :                 } else {
    2395           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2396             :                           PyLong_Type.tp_name);
    2397           0 :                         return -1;
    2398             :                 }
    2399             :         }
    2400           0 :         return 0;
    2401             : }
    2402             : 
    2403           0 : static PyObject *py_nbt_res_rec_get_ttl(PyObject *obj, void *closure)
    2404             : {
    2405           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
    2406             :         PyObject *py_ttl;
    2407           0 :         py_ttl = PyLong_FromUnsignedLongLong((uint32_t)object->ttl);
    2408           0 :         return py_ttl;
    2409             : }
    2410             : 
    2411           0 : static int py_nbt_res_rec_set_ttl(PyObject *py_obj, PyObject *value, void *closure)
    2412             : {
    2413           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
    2414           0 :         if (value == NULL) {
    2415           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ttl");
    2416           0 :                 return -1;
    2417             :         }
    2418             :         {
    2419           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ttl));
    2420           0 :                 if (PyLong_Check(value)) {
    2421             :                         unsigned long long test_var;
    2422           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2423           0 :                         if (PyErr_Occurred() != NULL) {
    2424           0 :                                 return -1;
    2425             :                         }
    2426           0 :                         if (test_var > uint_max) {
    2427           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2428             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2429           0 :                                 return -1;
    2430             :                         }
    2431           0 :                         object->ttl = test_var;
    2432             :                 } else {
    2433           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2434             :                           PyLong_Type.tp_name);
    2435           0 :                         return -1;
    2436             :                 }
    2437             :         }
    2438           0 :         return 0;
    2439             : }
    2440             : 
    2441           0 : static PyObject *py_nbt_res_rec_get_rdata(PyObject *obj, void *closure)
    2442             : {
    2443           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(obj);
    2444             :         PyObject *py_rdata;
    2445           0 :         py_rdata = pyrpc_import_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(obj), object->rr_type, &object->rdata, "union nbt_rdata");
    2446           0 :         if (py_rdata == NULL) {
    2447           0 :                 return NULL;
    2448             :         }
    2449           0 :         return py_rdata;
    2450             : }
    2451             : 
    2452           0 : static int py_nbt_res_rec_set_rdata(PyObject *py_obj, PyObject *value, void *closure)
    2453             : {
    2454           0 :         struct nbt_res_rec *object = (struct nbt_res_rec *)pytalloc_get_ptr(py_obj);
    2455           0 :         if (value == NULL) {
    2456           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rdata");
    2457           0 :                 return -1;
    2458             :         }
    2459             :         {
    2460             :                 union nbt_rdata *rdata_switch_0;
    2461           0 :                 rdata_switch_0 = (union nbt_rdata *)pyrpc_export_union(&nbt_rdata_Type, pytalloc_get_mem_ctx(py_obj), object->rr_type, value, "union nbt_rdata");
    2462           0 :                 if (rdata_switch_0 == NULL) {
    2463           0 :                         return -1;
    2464             :                 }
    2465           0 :                 object->rdata = *rdata_switch_0;
    2466             :         }
    2467           0 :         return 0;
    2468             : }
    2469             : 
    2470             : static PyGetSetDef py_nbt_res_rec_getsetters[] = {
    2471             :         {
    2472             :                 .name = discard_const_p(char, "name"),
    2473             :                 .get = py_nbt_res_rec_get_name,
    2474             :                 .set = py_nbt_res_rec_set_name,
    2475             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
    2476             :         },
    2477             :         {
    2478             :                 .name = discard_const_p(char, "rr_type"),
    2479             :                 .get = py_nbt_res_rec_get_rr_type,
    2480             :                 .set = py_nbt_res_rec_set_rr_type,
    2481             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qtype")
    2482             :         },
    2483             :         {
    2484             :                 .name = discard_const_p(char, "rr_class"),
    2485             :                 .get = py_nbt_res_rec_get_rr_class,
    2486             :                 .set = py_nbt_res_rec_set_rr_class,
    2487             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_qclass")
    2488             :         },
    2489             :         {
    2490             :                 .name = discard_const_p(char, "ttl"),
    2491             :                 .get = py_nbt_res_rec_get_ttl,
    2492             :                 .set = py_nbt_res_rec_set_ttl,
    2493             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2494             :         },
    2495             :         {
    2496             :                 .name = discard_const_p(char, "rdata"),
    2497             :                 .get = py_nbt_res_rec_get_rdata,
    2498             :                 .set = py_nbt_res_rec_set_rdata,
    2499             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_rdata")
    2500             :         },
    2501             :         { .name = NULL }
    2502             : };
    2503             : 
    2504           0 : static PyObject *py_nbt_res_rec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2505             : {
    2506           0 :         return pytalloc_new(struct nbt_res_rec, type);
    2507             : }
    2508             : 
    2509             : 
    2510             : static PyTypeObject nbt_res_rec_Type = {
    2511             :         PyVarObject_HEAD_INIT(NULL, 0)
    2512             :         .tp_name = "nbt.res_rec",
    2513             :         .tp_getset = py_nbt_res_rec_getsetters,
    2514             :         .tp_methods = NULL,
    2515             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2516             :         .tp_new = py_nbt_res_rec_new,
    2517             : };
    2518             : 
    2519             : 
    2520           0 : static PyObject *py_nbt_name_packet_get_name_trn_id(PyObject *obj, void *closure)
    2521             : {
    2522           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2523             :         PyObject *py_name_trn_id;
    2524           0 :         py_name_trn_id = PyLong_FromLong((uint16_t)object->name_trn_id);
    2525           0 :         return py_name_trn_id;
    2526             : }
    2527             : 
    2528           0 : static int py_nbt_name_packet_set_name_trn_id(PyObject *py_obj, PyObject *value, void *closure)
    2529             : {
    2530           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2531           0 :         if (value == NULL) {
    2532           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name_trn_id");
    2533           0 :                 return -1;
    2534             :         }
    2535             :         {
    2536           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_trn_id));
    2537           0 :                 if (PyLong_Check(value)) {
    2538             :                         unsigned long long test_var;
    2539           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2540           0 :                         if (PyErr_Occurred() != NULL) {
    2541           0 :                                 return -1;
    2542             :                         }
    2543           0 :                         if (test_var > uint_max) {
    2544           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2545             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2546           0 :                                 return -1;
    2547             :                         }
    2548           0 :                         object->name_trn_id = test_var;
    2549             :                 } else {
    2550           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2551             :                           PyLong_Type.tp_name);
    2552           0 :                         return -1;
    2553             :                 }
    2554             :         }
    2555           0 :         return 0;
    2556             : }
    2557             : 
    2558           0 : static PyObject *py_nbt_name_packet_get_operation(PyObject *obj, void *closure)
    2559             : {
    2560           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2561             :         PyObject *py_operation;
    2562           0 :         py_operation = PyLong_FromLong((uint16_t)object->operation);
    2563           0 :         return py_operation;
    2564             : }
    2565             : 
    2566           0 : static int py_nbt_name_packet_set_operation(PyObject *py_obj, PyObject *value, void *closure)
    2567             : {
    2568           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2569           0 :         if (value == NULL) {
    2570           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->operation");
    2571           0 :                 return -1;
    2572             :         }
    2573             :         {
    2574           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->operation));
    2575           0 :                 if (PyLong_Check(value)) {
    2576             :                         unsigned long long test_var;
    2577           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2578           0 :                         if (PyErr_Occurred() != NULL) {
    2579           0 :                                 return -1;
    2580             :                         }
    2581           0 :                         if (test_var > uint_max) {
    2582           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2583             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2584           0 :                                 return -1;
    2585             :                         }
    2586           0 :                         object->operation = test_var;
    2587             :                 } else {
    2588           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2589             :                           PyLong_Type.tp_name);
    2590           0 :                         return -1;
    2591             :                 }
    2592             :         }
    2593           0 :         return 0;
    2594             : }
    2595             : 
    2596           0 : static PyObject *py_nbt_name_packet_get_qdcount(PyObject *obj, void *closure)
    2597             : {
    2598           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2599             :         PyObject *py_qdcount;
    2600           0 :         py_qdcount = PyLong_FromLong((uint16_t)object->qdcount);
    2601           0 :         return py_qdcount;
    2602             : }
    2603             : 
    2604           0 : static int py_nbt_name_packet_set_qdcount(PyObject *py_obj, PyObject *value, void *closure)
    2605             : {
    2606           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2607           0 :         if (value == NULL) {
    2608           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->qdcount");
    2609           0 :                 return -1;
    2610             :         }
    2611             :         {
    2612           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->qdcount));
    2613           0 :                 if (PyLong_Check(value)) {
    2614             :                         unsigned long long test_var;
    2615           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2616           0 :                         if (PyErr_Occurred() != NULL) {
    2617           0 :                                 return -1;
    2618             :                         }
    2619           0 :                         if (test_var > uint_max) {
    2620           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2621             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2622           0 :                                 return -1;
    2623             :                         }
    2624           0 :                         object->qdcount = test_var;
    2625             :                 } else {
    2626           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2627             :                           PyLong_Type.tp_name);
    2628           0 :                         return -1;
    2629             :                 }
    2630             :         }
    2631           0 :         return 0;
    2632             : }
    2633             : 
    2634           0 : static PyObject *py_nbt_name_packet_get_ancount(PyObject *obj, void *closure)
    2635             : {
    2636           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2637             :         PyObject *py_ancount;
    2638           0 :         py_ancount = PyLong_FromLong((uint16_t)object->ancount);
    2639           0 :         return py_ancount;
    2640             : }
    2641             : 
    2642           0 : static int py_nbt_name_packet_set_ancount(PyObject *py_obj, PyObject *value, void *closure)
    2643             : {
    2644           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2645           0 :         if (value == NULL) {
    2646           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ancount");
    2647           0 :                 return -1;
    2648             :         }
    2649             :         {
    2650           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ancount));
    2651           0 :                 if (PyLong_Check(value)) {
    2652             :                         unsigned long long test_var;
    2653           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2654           0 :                         if (PyErr_Occurred() != NULL) {
    2655           0 :                                 return -1;
    2656             :                         }
    2657           0 :                         if (test_var > uint_max) {
    2658           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2659             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2660           0 :                                 return -1;
    2661             :                         }
    2662           0 :                         object->ancount = test_var;
    2663             :                 } else {
    2664           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2665             :                           PyLong_Type.tp_name);
    2666           0 :                         return -1;
    2667             :                 }
    2668             :         }
    2669           0 :         return 0;
    2670             : }
    2671             : 
    2672           0 : static PyObject *py_nbt_name_packet_get_nscount(PyObject *obj, void *closure)
    2673             : {
    2674           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2675             :         PyObject *py_nscount;
    2676           0 :         py_nscount = PyLong_FromLong((uint16_t)object->nscount);
    2677           0 :         return py_nscount;
    2678             : }
    2679             : 
    2680           0 : static int py_nbt_name_packet_set_nscount(PyObject *py_obj, PyObject *value, void *closure)
    2681             : {
    2682           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2683           0 :         if (value == NULL) {
    2684           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nscount");
    2685           0 :                 return -1;
    2686             :         }
    2687             :         {
    2688           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nscount));
    2689           0 :                 if (PyLong_Check(value)) {
    2690             :                         unsigned long long test_var;
    2691           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2692           0 :                         if (PyErr_Occurred() != NULL) {
    2693           0 :                                 return -1;
    2694             :                         }
    2695           0 :                         if (test_var > uint_max) {
    2696           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2697             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2698           0 :                                 return -1;
    2699             :                         }
    2700           0 :                         object->nscount = test_var;
    2701             :                 } else {
    2702           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2703             :                           PyLong_Type.tp_name);
    2704           0 :                         return -1;
    2705             :                 }
    2706             :         }
    2707           0 :         return 0;
    2708             : }
    2709             : 
    2710           0 : static PyObject *py_nbt_name_packet_get_arcount(PyObject *obj, void *closure)
    2711             : {
    2712           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2713             :         PyObject *py_arcount;
    2714           0 :         py_arcount = PyLong_FromLong((uint16_t)object->arcount);
    2715           0 :         return py_arcount;
    2716             : }
    2717             : 
    2718           0 : static int py_nbt_name_packet_set_arcount(PyObject *py_obj, PyObject *value, void *closure)
    2719             : {
    2720           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2721           0 :         if (value == NULL) {
    2722           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->arcount");
    2723           0 :                 return -1;
    2724             :         }
    2725             :         {
    2726           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->arcount));
    2727           0 :                 if (PyLong_Check(value)) {
    2728             :                         unsigned long long test_var;
    2729           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2730           0 :                         if (PyErr_Occurred() != NULL) {
    2731           0 :                                 return -1;
    2732             :                         }
    2733           0 :                         if (test_var > uint_max) {
    2734           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2735             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2736           0 :                                 return -1;
    2737             :                         }
    2738           0 :                         object->arcount = test_var;
    2739             :                 } else {
    2740           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2741             :                           PyLong_Type.tp_name);
    2742           0 :                         return -1;
    2743             :                 }
    2744             :         }
    2745           0 :         return 0;
    2746             : }
    2747             : 
    2748           0 : static PyObject *py_nbt_name_packet_get_questions(PyObject *obj, void *closure)
    2749             : {
    2750           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2751             :         PyObject *py_questions;
    2752           0 :         py_questions = PyList_New(object->qdcount);
    2753           0 :         if (py_questions == NULL) {
    2754           0 :                 return NULL;
    2755             :         }
    2756             :         {
    2757             :                 int questions_cntr_0;
    2758           0 :                 for (questions_cntr_0 = 0; questions_cntr_0 < (object->qdcount); questions_cntr_0++) {
    2759             :                         PyObject *py_questions_0;
    2760           0 :                         py_questions_0 = pytalloc_reference_ex(&nbt_name_question_Type, object->questions, &object->questions[questions_cntr_0]);
    2761           0 :                         PyList_SetItem(py_questions, questions_cntr_0, py_questions_0);
    2762             :                 }
    2763             :         }
    2764           0 :         return py_questions;
    2765             : }
    2766             : 
    2767           0 : static int py_nbt_name_packet_set_questions(PyObject *py_obj, PyObject *value, void *closure)
    2768             : {
    2769           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2770           0 :         if (value == NULL) {
    2771           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->questions");
    2772           0 :                 return -1;
    2773             :         }
    2774           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2775             :         {
    2776             :                 int questions_cntr_0;
    2777           0 :                 object->questions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->questions, PyList_GET_SIZE(value));
    2778           0 :                 if (!object->questions) { return -1;; }
    2779           0 :                 talloc_set_name_const(object->questions, "ARRAY: object->questions");
    2780           0 :                 for (questions_cntr_0 = 0; questions_cntr_0 < PyList_GET_SIZE(value); questions_cntr_0++) {
    2781           0 :                         if (PyList_GET_ITEM(value, questions_cntr_0) == NULL) {
    2782           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->questions[questions_cntr_0]");
    2783           0 :                                 return -1;
    2784             :                         }
    2785           0 :                         PY_CHECK_TYPE(&nbt_name_question_Type, PyList_GET_ITEM(value, questions_cntr_0), return -1;);
    2786           0 :                         if (talloc_reference(object->questions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, questions_cntr_0))) == NULL) {
    2787           0 :                                 PyErr_NoMemory();
    2788           0 :                                 return -1;
    2789             :                         }
    2790           0 :                         object->questions[questions_cntr_0] = *(struct nbt_name_question *)pytalloc_get_ptr(PyList_GET_ITEM(value, questions_cntr_0));
    2791             :                 }
    2792             :         }
    2793           0 :         return 0;
    2794             : }
    2795             : 
    2796           0 : static PyObject *py_nbt_name_packet_get_answers(PyObject *obj, void *closure)
    2797             : {
    2798           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2799             :         PyObject *py_answers;
    2800           0 :         py_answers = PyList_New(object->ancount);
    2801           0 :         if (py_answers == NULL) {
    2802           0 :                 return NULL;
    2803             :         }
    2804             :         {
    2805             :                 int answers_cntr_0;
    2806           0 :                 for (answers_cntr_0 = 0; answers_cntr_0 < (object->ancount); answers_cntr_0++) {
    2807             :                         PyObject *py_answers_0;
    2808           0 :                         py_answers_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->answers, &object->answers[answers_cntr_0]);
    2809           0 :                         PyList_SetItem(py_answers, answers_cntr_0, py_answers_0);
    2810             :                 }
    2811             :         }
    2812           0 :         return py_answers;
    2813             : }
    2814             : 
    2815           0 : static int py_nbt_name_packet_set_answers(PyObject *py_obj, PyObject *value, void *closure)
    2816             : {
    2817           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2818           0 :         if (value == NULL) {
    2819           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->answers");
    2820           0 :                 return -1;
    2821             :         }
    2822           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2823             :         {
    2824             :                 int answers_cntr_0;
    2825           0 :                 object->answers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->answers, PyList_GET_SIZE(value));
    2826           0 :                 if (!object->answers) { return -1;; }
    2827           0 :                 talloc_set_name_const(object->answers, "ARRAY: object->answers");
    2828           0 :                 for (answers_cntr_0 = 0; answers_cntr_0 < PyList_GET_SIZE(value); answers_cntr_0++) {
    2829           0 :                         if (PyList_GET_ITEM(value, answers_cntr_0) == NULL) {
    2830           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->answers[answers_cntr_0]");
    2831           0 :                                 return -1;
    2832             :                         }
    2833           0 :                         PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, answers_cntr_0), return -1;);
    2834           0 :                         if (talloc_reference(object->answers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, answers_cntr_0))) == NULL) {
    2835           0 :                                 PyErr_NoMemory();
    2836           0 :                                 return -1;
    2837             :                         }
    2838           0 :                         object->answers[answers_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, answers_cntr_0));
    2839             :                 }
    2840             :         }
    2841           0 :         return 0;
    2842             : }
    2843             : 
    2844           0 : static PyObject *py_nbt_name_packet_get_nsrecs(PyObject *obj, void *closure)
    2845             : {
    2846           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2847             :         PyObject *py_nsrecs;
    2848           0 :         py_nsrecs = PyList_New(object->nscount);
    2849           0 :         if (py_nsrecs == NULL) {
    2850           0 :                 return NULL;
    2851             :         }
    2852             :         {
    2853             :                 int nsrecs_cntr_0;
    2854           0 :                 for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < (object->nscount); nsrecs_cntr_0++) {
    2855             :                         PyObject *py_nsrecs_0;
    2856           0 :                         py_nsrecs_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->nsrecs, &object->nsrecs[nsrecs_cntr_0]);
    2857           0 :                         PyList_SetItem(py_nsrecs, nsrecs_cntr_0, py_nsrecs_0);
    2858             :                 }
    2859             :         }
    2860           0 :         return py_nsrecs;
    2861             : }
    2862             : 
    2863           0 : static int py_nbt_name_packet_set_nsrecs(PyObject *py_obj, PyObject *value, void *closure)
    2864             : {
    2865           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2866           0 :         if (value == NULL) {
    2867           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nsrecs");
    2868           0 :                 return -1;
    2869             :         }
    2870           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2871             :         {
    2872             :                 int nsrecs_cntr_0;
    2873           0 :                 object->nsrecs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nsrecs, PyList_GET_SIZE(value));
    2874           0 :                 if (!object->nsrecs) { return -1;; }
    2875           0 :                 talloc_set_name_const(object->nsrecs, "ARRAY: object->nsrecs");
    2876           0 :                 for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < PyList_GET_SIZE(value); nsrecs_cntr_0++) {
    2877           0 :                         if (PyList_GET_ITEM(value, nsrecs_cntr_0) == NULL) {
    2878           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nsrecs[nsrecs_cntr_0]");
    2879           0 :                                 return -1;
    2880             :                         }
    2881           0 :                         PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, nsrecs_cntr_0), return -1;);
    2882           0 :                         if (talloc_reference(object->nsrecs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, nsrecs_cntr_0))) == NULL) {
    2883           0 :                                 PyErr_NoMemory();
    2884           0 :                                 return -1;
    2885             :                         }
    2886           0 :                         object->nsrecs[nsrecs_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, nsrecs_cntr_0));
    2887             :                 }
    2888             :         }
    2889           0 :         return 0;
    2890             : }
    2891             : 
    2892           0 : static PyObject *py_nbt_name_packet_get_additional(PyObject *obj, void *closure)
    2893             : {
    2894           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2895             :         PyObject *py_additional;
    2896           0 :         py_additional = PyList_New(object->arcount);
    2897           0 :         if (py_additional == NULL) {
    2898           0 :                 return NULL;
    2899             :         }
    2900             :         {
    2901             :                 int additional_cntr_0;
    2902           0 :                 for (additional_cntr_0 = 0; additional_cntr_0 < (object->arcount); additional_cntr_0++) {
    2903             :                         PyObject *py_additional_0;
    2904           0 :                         py_additional_0 = pytalloc_reference_ex(&nbt_res_rec_Type, object->additional, &object->additional[additional_cntr_0]);
    2905           0 :                         PyList_SetItem(py_additional, additional_cntr_0, py_additional_0);
    2906             :                 }
    2907             :         }
    2908           0 :         return py_additional;
    2909             : }
    2910             : 
    2911           0 : static int py_nbt_name_packet_set_additional(PyObject *py_obj, PyObject *value, void *closure)
    2912             : {
    2913           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2914           0 :         if (value == NULL) {
    2915           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->additional");
    2916           0 :                 return -1;
    2917             :         }
    2918           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2919             :         {
    2920             :                 int additional_cntr_0;
    2921           0 :                 object->additional = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->additional, PyList_GET_SIZE(value));
    2922           0 :                 if (!object->additional) { return -1;; }
    2923           0 :                 talloc_set_name_const(object->additional, "ARRAY: object->additional");
    2924           0 :                 for (additional_cntr_0 = 0; additional_cntr_0 < PyList_GET_SIZE(value); additional_cntr_0++) {
    2925           0 :                         if (PyList_GET_ITEM(value, additional_cntr_0) == NULL) {
    2926           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->additional[additional_cntr_0]");
    2927           0 :                                 return -1;
    2928             :                         }
    2929           0 :                         PY_CHECK_TYPE(&nbt_res_rec_Type, PyList_GET_ITEM(value, additional_cntr_0), return -1;);
    2930           0 :                         if (talloc_reference(object->additional, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, additional_cntr_0))) == NULL) {
    2931           0 :                                 PyErr_NoMemory();
    2932           0 :                                 return -1;
    2933             :                         }
    2934           0 :                         object->additional[additional_cntr_0] = *(struct nbt_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, additional_cntr_0));
    2935             :                 }
    2936             :         }
    2937           0 :         return 0;
    2938             : }
    2939             : 
    2940           0 : static PyObject *py_nbt_name_packet_get_padding(PyObject *obj, void *closure)
    2941             : {
    2942           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(obj);
    2943             :         PyObject *py_padding;
    2944           0 :         py_padding = PyBytes_FromStringAndSize((char *)(object->padding).data, (object->padding).length);
    2945           0 :         return py_padding;
    2946             : }
    2947             : 
    2948           0 : static int py_nbt_name_packet_set_padding(PyObject *py_obj, PyObject *value, void *closure)
    2949             : {
    2950           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    2951           0 :         if (value == NULL) {
    2952           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->padding");
    2953           0 :                 return -1;
    2954             :         }
    2955           0 :         object->padding = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    2956           0 :         return 0;
    2957             : }
    2958             : 
    2959             : static PyGetSetDef py_nbt_name_packet_getsetters[] = {
    2960             :         {
    2961             :                 .name = discard_const_p(char, "name_trn_id"),
    2962             :                 .get = py_nbt_name_packet_get_name_trn_id,
    2963             :                 .set = py_nbt_name_packet_set_name_trn_id,
    2964             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2965             :         },
    2966             :         {
    2967             :                 .name = discard_const_p(char, "operation"),
    2968             :                 .get = py_nbt_name_packet_get_operation,
    2969             :                 .set = py_nbt_name_packet_set_operation,
    2970             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_operation")
    2971             :         },
    2972             :         {
    2973             :                 .name = discard_const_p(char, "qdcount"),
    2974             :                 .get = py_nbt_name_packet_get_qdcount,
    2975             :                 .set = py_nbt_name_packet_set_qdcount,
    2976             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2977             :         },
    2978             :         {
    2979             :                 .name = discard_const_p(char, "ancount"),
    2980             :                 .get = py_nbt_name_packet_get_ancount,
    2981             :                 .set = py_nbt_name_packet_set_ancount,
    2982             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2983             :         },
    2984             :         {
    2985             :                 .name = discard_const_p(char, "nscount"),
    2986             :                 .get = py_nbt_name_packet_get_nscount,
    2987             :                 .set = py_nbt_name_packet_set_nscount,
    2988             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2989             :         },
    2990             :         {
    2991             :                 .name = discard_const_p(char, "arcount"),
    2992             :                 .get = py_nbt_name_packet_get_arcount,
    2993             :                 .set = py_nbt_name_packet_set_arcount,
    2994             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2995             :         },
    2996             :         {
    2997             :                 .name = discard_const_p(char, "questions"),
    2998             :                 .get = py_nbt_name_packet_get_questions,
    2999             :                 .set = py_nbt_name_packet_set_questions,
    3000             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name_question")
    3001             :         },
    3002             :         {
    3003             :                 .name = discard_const_p(char, "answers"),
    3004             :                 .get = py_nbt_name_packet_get_answers,
    3005             :                 .set = py_nbt_name_packet_set_answers,
    3006             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
    3007             :         },
    3008             :         {
    3009             :                 .name = discard_const_p(char, "nsrecs"),
    3010             :                 .get = py_nbt_name_packet_get_nsrecs,
    3011             :                 .set = py_nbt_name_packet_set_nsrecs,
    3012             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
    3013             :         },
    3014             :         {
    3015             :                 .name = discard_const_p(char, "additional"),
    3016             :                 .get = py_nbt_name_packet_get_additional,
    3017             :                 .set = py_nbt_name_packet_set_additional,
    3018             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_res_rec")
    3019             :         },
    3020             :         {
    3021             :                 .name = discard_const_p(char, "padding"),
    3022             :                 .get = py_nbt_name_packet_get_padding,
    3023             :                 .set = py_nbt_name_packet_set_padding,
    3024             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    3025             :         },
    3026             :         { .name = NULL }
    3027             : };
    3028             : 
    3029           0 : static PyObject *py_nbt_name_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3030             : {
    3031           0 :         return pytalloc_new(struct nbt_name_packet, type);
    3032             : }
    3033             : 
    3034           0 : static PyObject *py_nbt_name_packet_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    3035             : {
    3036           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    3037           0 :         PyObject *ret = NULL;
    3038             :         DATA_BLOB blob;
    3039             :         enum ndr_err_code err;
    3040           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    3041           0 :         if (tmp_ctx == NULL) {
    3042           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3043           0 :                 return NULL;
    3044             :         }
    3045           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_name_packet);
    3046           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3047           0 :                 TALLOC_FREE(tmp_ctx);
    3048           0 :                 PyErr_SetNdrError(err);
    3049           0 :                 return NULL;
    3050             :         }
    3051             : 
    3052           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3053           0 :         TALLOC_FREE(tmp_ctx);
    3054           0 :         return ret;
    3055             : }
    3056             : 
    3057           0 : static PyObject *py_nbt_name_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3058             : {
    3059           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    3060           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    3061           0 :         Py_ssize_t blob_length = 0;
    3062             :         enum ndr_err_code err;
    3063           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    3064           0 :         PyObject *allow_remaining_obj = NULL;
    3065           0 :         bool allow_remaining = false;
    3066             : 
    3067           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    3068             :                 discard_const_p(char *, kwnames),
    3069             :                 &blob.data, &blob_length,
    3070             :                 &allow_remaining_obj)) {
    3071           0 :                 return NULL;
    3072             :         }
    3073           0 :         blob.length = blob_length;
    3074             : 
    3075           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3076           0 :                 allow_remaining = true;
    3077             :         }
    3078             : 
    3079           0 :         if (allow_remaining) {
    3080           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
    3081             :         } else {
    3082           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet);
    3083             :         }
    3084           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3085           0 :                 PyErr_SetNdrError(err);
    3086           0 :                 return NULL;
    3087             :         }
    3088             : 
    3089           0 :         Py_RETURN_NONE;
    3090             : }
    3091             : 
    3092           0 : static PyObject *py_nbt_name_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3093             : {
    3094           0 :         struct nbt_name_packet *object = (struct nbt_name_packet *)pytalloc_get_ptr(py_obj);
    3095             :         PyObject *ret;
    3096             :         char *retstr;
    3097             : 
    3098           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_name_packet, "nbt_name_packet", object);
    3099           0 :         ret = PyUnicode_FromString(retstr);
    3100           0 :         talloc_free(retstr);
    3101             : 
    3102           0 :         return ret;
    3103             : }
    3104             : 
    3105             : static PyMethodDef py_nbt_name_packet_methods[] = {
    3106             :         { "__ndr_pack__", (PyCFunction)py_nbt_name_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    3107             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_name_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    3108             :         { "__ndr_print__", (PyCFunction)py_nbt_name_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    3109             :         { NULL, NULL, 0, NULL }
    3110             : };
    3111             : 
    3112             : 
    3113             : static PyTypeObject nbt_name_packet_Type = {
    3114             :         PyVarObject_HEAD_INIT(NULL, 0)
    3115             :         .tp_name = "nbt.name_packet",
    3116             :         .tp_getset = py_nbt_name_packet_getsetters,
    3117             :         .tp_methods = py_nbt_name_packet_methods,
    3118             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3119             :         .tp_new = py_nbt_name_packet_new,
    3120             : };
    3121             : 
    3122             : 
    3123           0 : static PyObject *py_smb_trans_body_get_wct(PyObject *obj, void *closure)
    3124             : {
    3125           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3126             :         PyObject *py_wct;
    3127           0 :         py_wct = PyLong_FromLong((uint16_t)object->wct);
    3128           0 :         return py_wct;
    3129             : }
    3130             : 
    3131           0 : static int py_smb_trans_body_set_wct(PyObject *py_obj, PyObject *value, void *closure)
    3132             : {
    3133           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3134           0 :         if (value == NULL) {
    3135           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->wct");
    3136           0 :                 return -1;
    3137             :         }
    3138             :         {
    3139           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wct));
    3140           0 :                 if (PyLong_Check(value)) {
    3141             :                         unsigned long long test_var;
    3142           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3143           0 :                         if (PyErr_Occurred() != NULL) {
    3144           0 :                                 return -1;
    3145             :                         }
    3146           0 :                         if (test_var > uint_max) {
    3147           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3148             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3149           0 :                                 return -1;
    3150             :                         }
    3151           0 :                         object->wct = test_var;
    3152             :                 } else {
    3153           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3154             :                           PyLong_Type.tp_name);
    3155           0 :                         return -1;
    3156             :                 }
    3157             :         }
    3158           0 :         return 0;
    3159             : }
    3160             : 
    3161           0 : static PyObject *py_smb_trans_body_get_total_param_count(PyObject *obj, void *closure)
    3162             : {
    3163           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3164             :         PyObject *py_total_param_count;
    3165           0 :         py_total_param_count = PyLong_FromLong((uint16_t)object->total_param_count);
    3166           0 :         return py_total_param_count;
    3167             : }
    3168             : 
    3169           0 : static int py_smb_trans_body_set_total_param_count(PyObject *py_obj, PyObject *value, void *closure)
    3170             : {
    3171           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3172           0 :         if (value == NULL) {
    3173           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_param_count");
    3174           0 :                 return -1;
    3175             :         }
    3176             :         {
    3177           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_param_count));
    3178           0 :                 if (PyLong_Check(value)) {
    3179             :                         unsigned long long test_var;
    3180           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3181           0 :                         if (PyErr_Occurred() != NULL) {
    3182           0 :                                 return -1;
    3183             :                         }
    3184           0 :                         if (test_var > uint_max) {
    3185           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3186             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3187           0 :                                 return -1;
    3188             :                         }
    3189           0 :                         object->total_param_count = test_var;
    3190             :                 } else {
    3191           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3192             :                           PyLong_Type.tp_name);
    3193           0 :                         return -1;
    3194             :                 }
    3195             :         }
    3196           0 :         return 0;
    3197             : }
    3198             : 
    3199           0 : static PyObject *py_smb_trans_body_get_total_data_count(PyObject *obj, void *closure)
    3200             : {
    3201           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3202             :         PyObject *py_total_data_count;
    3203           0 :         py_total_data_count = PyLong_FromLong((uint16_t)object->total_data_count);
    3204           0 :         return py_total_data_count;
    3205             : }
    3206             : 
    3207           0 : static int py_smb_trans_body_set_total_data_count(PyObject *py_obj, PyObject *value, void *closure)
    3208             : {
    3209           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3210           0 :         if (value == NULL) {
    3211           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->total_data_count");
    3212           0 :                 return -1;
    3213             :         }
    3214             :         {
    3215           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_data_count));
    3216           0 :                 if (PyLong_Check(value)) {
    3217             :                         unsigned long long test_var;
    3218           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3219           0 :                         if (PyErr_Occurred() != NULL) {
    3220           0 :                                 return -1;
    3221             :                         }
    3222           0 :                         if (test_var > uint_max) {
    3223           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3224             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3225           0 :                                 return -1;
    3226             :                         }
    3227           0 :                         object->total_data_count = test_var;
    3228             :                 } else {
    3229           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3230             :                           PyLong_Type.tp_name);
    3231           0 :                         return -1;
    3232             :                 }
    3233             :         }
    3234           0 :         return 0;
    3235             : }
    3236             : 
    3237           0 : static PyObject *py_smb_trans_body_get_max_param_count(PyObject *obj, void *closure)
    3238             : {
    3239           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3240             :         PyObject *py_max_param_count;
    3241           0 :         py_max_param_count = PyLong_FromLong((uint16_t)object->max_param_count);
    3242           0 :         return py_max_param_count;
    3243             : }
    3244             : 
    3245           0 : static int py_smb_trans_body_set_max_param_count(PyObject *py_obj, PyObject *value, void *closure)
    3246             : {
    3247           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3248           0 :         if (value == NULL) {
    3249           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_param_count");
    3250           0 :                 return -1;
    3251             :         }
    3252             :         {
    3253           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_param_count));
    3254           0 :                 if (PyLong_Check(value)) {
    3255             :                         unsigned long long test_var;
    3256           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3257           0 :                         if (PyErr_Occurred() != NULL) {
    3258           0 :                                 return -1;
    3259             :                         }
    3260           0 :                         if (test_var > uint_max) {
    3261           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3262             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3263           0 :                                 return -1;
    3264             :                         }
    3265           0 :                         object->max_param_count = test_var;
    3266             :                 } else {
    3267           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3268             :                           PyLong_Type.tp_name);
    3269           0 :                         return -1;
    3270             :                 }
    3271             :         }
    3272           0 :         return 0;
    3273             : }
    3274             : 
    3275           0 : static PyObject *py_smb_trans_body_get_max_data_count(PyObject *obj, void *closure)
    3276             : {
    3277           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3278             :         PyObject *py_max_data_count;
    3279           0 :         py_max_data_count = PyLong_FromLong((uint16_t)object->max_data_count);
    3280           0 :         return py_max_data_count;
    3281             : }
    3282             : 
    3283           0 : static int py_smb_trans_body_set_max_data_count(PyObject *py_obj, PyObject *value, void *closure)
    3284             : {
    3285           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3286           0 :         if (value == NULL) {
    3287           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_data_count");
    3288           0 :                 return -1;
    3289             :         }
    3290             :         {
    3291           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_data_count));
    3292           0 :                 if (PyLong_Check(value)) {
    3293             :                         unsigned long long test_var;
    3294           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3295           0 :                         if (PyErr_Occurred() != NULL) {
    3296           0 :                                 return -1;
    3297             :                         }
    3298           0 :                         if (test_var > uint_max) {
    3299           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3300             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3301           0 :                                 return -1;
    3302             :                         }
    3303           0 :                         object->max_data_count = test_var;
    3304             :                 } else {
    3305           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3306             :                           PyLong_Type.tp_name);
    3307           0 :                         return -1;
    3308             :                 }
    3309             :         }
    3310           0 :         return 0;
    3311             : }
    3312             : 
    3313           0 : static PyObject *py_smb_trans_body_get_max_setup_count(PyObject *obj, void *closure)
    3314             : {
    3315           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3316             :         PyObject *py_max_setup_count;
    3317           0 :         py_max_setup_count = PyLong_FromLong((uint16_t)object->max_setup_count);
    3318           0 :         return py_max_setup_count;
    3319             : }
    3320             : 
    3321           0 : static int py_smb_trans_body_set_max_setup_count(PyObject *py_obj, PyObject *value, void *closure)
    3322             : {
    3323           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3324           0 :         if (value == NULL) {
    3325           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_setup_count");
    3326           0 :                 return -1;
    3327             :         }
    3328             :         {
    3329           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_setup_count));
    3330           0 :                 if (PyLong_Check(value)) {
    3331             :                         unsigned long long test_var;
    3332           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3333           0 :                         if (PyErr_Occurred() != NULL) {
    3334           0 :                                 return -1;
    3335             :                         }
    3336           0 :                         if (test_var > uint_max) {
    3337           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3338             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3339           0 :                                 return -1;
    3340             :                         }
    3341           0 :                         object->max_setup_count = test_var;
    3342             :                 } else {
    3343           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3344             :                           PyLong_Type.tp_name);
    3345           0 :                         return -1;
    3346             :                 }
    3347             :         }
    3348           0 :         return 0;
    3349             : }
    3350             : 
    3351           0 : static PyObject *py_smb_trans_body_get_pad(PyObject *obj, void *closure)
    3352             : {
    3353           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3354             :         PyObject *py_pad;
    3355           0 :         py_pad = PyLong_FromLong((uint16_t)object->pad);
    3356           0 :         return py_pad;
    3357             : }
    3358             : 
    3359           0 : static int py_smb_trans_body_set_pad(PyObject *py_obj, PyObject *value, void *closure)
    3360             : {
    3361           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3362           0 :         if (value == NULL) {
    3363           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad");
    3364           0 :                 return -1;
    3365             :         }
    3366             :         {
    3367           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
    3368           0 :                 if (PyLong_Check(value)) {
    3369             :                         unsigned long long test_var;
    3370           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3371           0 :                         if (PyErr_Occurred() != NULL) {
    3372           0 :                                 return -1;
    3373             :                         }
    3374           0 :                         if (test_var > uint_max) {
    3375           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3376             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3377           0 :                                 return -1;
    3378             :                         }
    3379           0 :                         object->pad = test_var;
    3380             :                 } else {
    3381           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3382             :                           PyLong_Type.tp_name);
    3383           0 :                         return -1;
    3384             :                 }
    3385             :         }
    3386           0 :         return 0;
    3387             : }
    3388             : 
    3389           0 : static PyObject *py_smb_trans_body_get_trans_flags(PyObject *obj, void *closure)
    3390             : {
    3391           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3392             :         PyObject *py_trans_flags;
    3393           0 :         py_trans_flags = PyLong_FromLong((uint16_t)object->trans_flags);
    3394           0 :         return py_trans_flags;
    3395             : }
    3396             : 
    3397           0 : static int py_smb_trans_body_set_trans_flags(PyObject *py_obj, PyObject *value, void *closure)
    3398             : {
    3399           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3400           0 :         if (value == NULL) {
    3401           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trans_flags");
    3402           0 :                 return -1;
    3403             :         }
    3404             :         {
    3405           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trans_flags));
    3406           0 :                 if (PyLong_Check(value)) {
    3407             :                         unsigned long long test_var;
    3408           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3409           0 :                         if (PyErr_Occurred() != NULL) {
    3410           0 :                                 return -1;
    3411             :                         }
    3412           0 :                         if (test_var > uint_max) {
    3413           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3414             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3415           0 :                                 return -1;
    3416             :                         }
    3417           0 :                         object->trans_flags = test_var;
    3418             :                 } else {
    3419           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3420             :                           PyLong_Type.tp_name);
    3421           0 :                         return -1;
    3422             :                 }
    3423             :         }
    3424           0 :         return 0;
    3425             : }
    3426             : 
    3427           0 : static PyObject *py_smb_trans_body_get_timeout(PyObject *obj, void *closure)
    3428             : {
    3429           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3430             :         PyObject *py_timeout;
    3431           0 :         py_timeout = PyLong_FromUnsignedLongLong((uint32_t)object->timeout);
    3432           0 :         return py_timeout;
    3433             : }
    3434             : 
    3435           0 : static int py_smb_trans_body_set_timeout(PyObject *py_obj, PyObject *value, void *closure)
    3436             : {
    3437           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3438           0 :         if (value == NULL) {
    3439           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timeout");
    3440           0 :                 return -1;
    3441             :         }
    3442             :         {
    3443           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timeout));
    3444           0 :                 if (PyLong_Check(value)) {
    3445             :                         unsigned long long test_var;
    3446           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3447           0 :                         if (PyErr_Occurred() != NULL) {
    3448           0 :                                 return -1;
    3449             :                         }
    3450           0 :                         if (test_var > uint_max) {
    3451           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3452             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3453           0 :                                 return -1;
    3454             :                         }
    3455           0 :                         object->timeout = test_var;
    3456             :                 } else {
    3457           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3458             :                           PyLong_Type.tp_name);
    3459           0 :                         return -1;
    3460             :                 }
    3461             :         }
    3462           0 :         return 0;
    3463             : }
    3464             : 
    3465           0 : static PyObject *py_smb_trans_body_get_reserved(PyObject *obj, void *closure)
    3466             : {
    3467           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3468             :         PyObject *py_reserved;
    3469           0 :         py_reserved = PyLong_FromLong((uint16_t)object->reserved);
    3470           0 :         return py_reserved;
    3471             : }
    3472             : 
    3473           0 : static int py_smb_trans_body_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
    3474             : {
    3475           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3476           0 :         if (value == NULL) {
    3477           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
    3478           0 :                 return -1;
    3479             :         }
    3480             :         {
    3481           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
    3482           0 :                 if (PyLong_Check(value)) {
    3483             :                         unsigned long long test_var;
    3484           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3485           0 :                         if (PyErr_Occurred() != NULL) {
    3486           0 :                                 return -1;
    3487             :                         }
    3488           0 :                         if (test_var > uint_max) {
    3489           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3490             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3491           0 :                                 return -1;
    3492             :                         }
    3493           0 :                         object->reserved = test_var;
    3494             :                 } else {
    3495           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3496             :                           PyLong_Type.tp_name);
    3497           0 :                         return -1;
    3498             :                 }
    3499             :         }
    3500           0 :         return 0;
    3501             : }
    3502             : 
    3503           0 : static PyObject *py_smb_trans_body_get_param_count(PyObject *obj, void *closure)
    3504             : {
    3505           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3506             :         PyObject *py_param_count;
    3507           0 :         py_param_count = PyLong_FromLong((uint16_t)object->param_count);
    3508           0 :         return py_param_count;
    3509             : }
    3510             : 
    3511           0 : static int py_smb_trans_body_set_param_count(PyObject *py_obj, PyObject *value, void *closure)
    3512             : {
    3513           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3514           0 :         if (value == NULL) {
    3515           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->param_count");
    3516           0 :                 return -1;
    3517             :         }
    3518             :         {
    3519           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_count));
    3520           0 :                 if (PyLong_Check(value)) {
    3521             :                         unsigned long long test_var;
    3522           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3523           0 :                         if (PyErr_Occurred() != NULL) {
    3524           0 :                                 return -1;
    3525             :                         }
    3526           0 :                         if (test_var > uint_max) {
    3527           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3528             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3529           0 :                                 return -1;
    3530             :                         }
    3531           0 :                         object->param_count = test_var;
    3532             :                 } else {
    3533           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3534             :                           PyLong_Type.tp_name);
    3535           0 :                         return -1;
    3536             :                 }
    3537             :         }
    3538           0 :         return 0;
    3539             : }
    3540             : 
    3541           0 : static PyObject *py_smb_trans_body_get_param_offset(PyObject *obj, void *closure)
    3542             : {
    3543           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3544             :         PyObject *py_param_offset;
    3545           0 :         py_param_offset = PyLong_FromLong((uint16_t)object->param_offset);
    3546           0 :         return py_param_offset;
    3547             : }
    3548             : 
    3549           0 : static int py_smb_trans_body_set_param_offset(PyObject *py_obj, PyObject *value, void *closure)
    3550             : {
    3551           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3552           0 :         if (value == NULL) {
    3553           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->param_offset");
    3554           0 :                 return -1;
    3555             :         }
    3556             :         {
    3557           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->param_offset));
    3558           0 :                 if (PyLong_Check(value)) {
    3559             :                         unsigned long long test_var;
    3560           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3561           0 :                         if (PyErr_Occurred() != NULL) {
    3562           0 :                                 return -1;
    3563             :                         }
    3564           0 :                         if (test_var > uint_max) {
    3565           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3566             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3567           0 :                                 return -1;
    3568             :                         }
    3569           0 :                         object->param_offset = test_var;
    3570             :                 } else {
    3571           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3572             :                           PyLong_Type.tp_name);
    3573           0 :                         return -1;
    3574             :                 }
    3575             :         }
    3576           0 :         return 0;
    3577             : }
    3578             : 
    3579           0 : static PyObject *py_smb_trans_body_get_data_count(PyObject *obj, void *closure)
    3580             : {
    3581           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3582             :         PyObject *py_data_count;
    3583           0 :         py_data_count = PyLong_FromLong((uint16_t)object->data_count);
    3584           0 :         return py_data_count;
    3585             : }
    3586             : 
    3587           0 : static int py_smb_trans_body_set_data_count(PyObject *py_obj, PyObject *value, void *closure)
    3588             : {
    3589           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3590           0 :         if (value == NULL) {
    3591           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_count");
    3592           0 :                 return -1;
    3593             :         }
    3594             :         {
    3595           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_count));
    3596           0 :                 if (PyLong_Check(value)) {
    3597             :                         unsigned long long test_var;
    3598           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3599           0 :                         if (PyErr_Occurred() != NULL) {
    3600           0 :                                 return -1;
    3601             :                         }
    3602           0 :                         if (test_var > uint_max) {
    3603           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3604             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3605           0 :                                 return -1;
    3606             :                         }
    3607           0 :                         object->data_count = test_var;
    3608             :                 } else {
    3609           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3610             :                           PyLong_Type.tp_name);
    3611           0 :                         return -1;
    3612             :                 }
    3613             :         }
    3614           0 :         return 0;
    3615             : }
    3616             : 
    3617           0 : static PyObject *py_smb_trans_body_get_data_offset(PyObject *obj, void *closure)
    3618             : {
    3619           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3620             :         PyObject *py_data_offset;
    3621           0 :         py_data_offset = PyLong_FromLong((uint16_t)object->data_offset);
    3622           0 :         return py_data_offset;
    3623             : }
    3624             : 
    3625           0 : static int py_smb_trans_body_set_data_offset(PyObject *py_obj, PyObject *value, void *closure)
    3626             : {
    3627           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3628           0 :         if (value == NULL) {
    3629           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data_offset");
    3630           0 :                 return -1;
    3631             :         }
    3632             :         {
    3633           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_offset));
    3634           0 :                 if (PyLong_Check(value)) {
    3635             :                         unsigned long long test_var;
    3636           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3637           0 :                         if (PyErr_Occurred() != NULL) {
    3638           0 :                                 return -1;
    3639             :                         }
    3640           0 :                         if (test_var > uint_max) {
    3641           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3642             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3643           0 :                                 return -1;
    3644             :                         }
    3645           0 :                         object->data_offset = test_var;
    3646             :                 } else {
    3647           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3648             :                           PyLong_Type.tp_name);
    3649           0 :                         return -1;
    3650             :                 }
    3651             :         }
    3652           0 :         return 0;
    3653             : }
    3654             : 
    3655           0 : static PyObject *py_smb_trans_body_get_setup_count(PyObject *obj, void *closure)
    3656             : {
    3657           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3658             :         PyObject *py_setup_count;
    3659           0 :         py_setup_count = PyLong_FromLong((uint16_t)object->setup_count);
    3660           0 :         return py_setup_count;
    3661             : }
    3662             : 
    3663           0 : static int py_smb_trans_body_set_setup_count(PyObject *py_obj, PyObject *value, void *closure)
    3664             : {
    3665           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3666           0 :         if (value == NULL) {
    3667           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->setup_count");
    3668           0 :                 return -1;
    3669             :         }
    3670             :         {
    3671           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->setup_count));
    3672           0 :                 if (PyLong_Check(value)) {
    3673             :                         unsigned long long test_var;
    3674           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3675           0 :                         if (PyErr_Occurred() != NULL) {
    3676           0 :                                 return -1;
    3677             :                         }
    3678           0 :                         if (test_var > uint_max) {
    3679           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3680             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3681           0 :                                 return -1;
    3682             :                         }
    3683           0 :                         object->setup_count = test_var;
    3684             :                 } else {
    3685           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3686             :                           PyLong_Type.tp_name);
    3687           0 :                         return -1;
    3688             :                 }
    3689             :         }
    3690           0 :         return 0;
    3691             : }
    3692             : 
    3693           0 : static PyObject *py_smb_trans_body_get_pad2(PyObject *obj, void *closure)
    3694             : {
    3695           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3696             :         PyObject *py_pad2;
    3697           0 :         py_pad2 = PyLong_FromLong((uint16_t)object->pad2);
    3698           0 :         return py_pad2;
    3699             : }
    3700             : 
    3701           0 : static int py_smb_trans_body_set_pad2(PyObject *py_obj, PyObject *value, void *closure)
    3702             : {
    3703           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3704           0 :         if (value == NULL) {
    3705           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad2");
    3706           0 :                 return -1;
    3707             :         }
    3708             :         {
    3709           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad2));
    3710           0 :                 if (PyLong_Check(value)) {
    3711             :                         unsigned long long test_var;
    3712           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3713           0 :                         if (PyErr_Occurred() != NULL) {
    3714           0 :                                 return -1;
    3715             :                         }
    3716           0 :                         if (test_var > uint_max) {
    3717           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3718             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3719           0 :                                 return -1;
    3720             :                         }
    3721           0 :                         object->pad2 = test_var;
    3722             :                 } else {
    3723           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3724             :                           PyLong_Type.tp_name);
    3725           0 :                         return -1;
    3726             :                 }
    3727             :         }
    3728           0 :         return 0;
    3729             : }
    3730             : 
    3731           0 : static PyObject *py_smb_trans_body_get_opcode(PyObject *obj, void *closure)
    3732             : {
    3733           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3734             :         PyObject *py_opcode;
    3735           0 :         py_opcode = PyLong_FromLong((uint16_t)object->opcode);
    3736           0 :         return py_opcode;
    3737             : }
    3738             : 
    3739           0 : static int py_smb_trans_body_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
    3740             : {
    3741           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3742           0 :         if (value == NULL) {
    3743           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->opcode");
    3744           0 :                 return -1;
    3745             :         }
    3746             :         {
    3747           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
    3748           0 :                 if (PyLong_Check(value)) {
    3749             :                         unsigned long long test_var;
    3750           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3751           0 :                         if (PyErr_Occurred() != NULL) {
    3752           0 :                                 return -1;
    3753             :                         }
    3754           0 :                         if (test_var > uint_max) {
    3755           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3756             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3757           0 :                                 return -1;
    3758             :                         }
    3759           0 :                         object->opcode = test_var;
    3760             :                 } else {
    3761           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3762             :                           PyLong_Type.tp_name);
    3763           0 :                         return -1;
    3764             :                 }
    3765             :         }
    3766           0 :         return 0;
    3767             : }
    3768             : 
    3769           0 : static PyObject *py_smb_trans_body_get_priority(PyObject *obj, void *closure)
    3770             : {
    3771           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3772             :         PyObject *py_priority;
    3773           0 :         py_priority = PyLong_FromLong((uint16_t)object->priority);
    3774           0 :         return py_priority;
    3775             : }
    3776             : 
    3777           0 : static int py_smb_trans_body_set_priority(PyObject *py_obj, PyObject *value, void *closure)
    3778             : {
    3779           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3780           0 :         if (value == NULL) {
    3781           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priority");
    3782           0 :                 return -1;
    3783             :         }
    3784             :         {
    3785           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
    3786           0 :                 if (PyLong_Check(value)) {
    3787             :                         unsigned long long test_var;
    3788           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3789           0 :                         if (PyErr_Occurred() != NULL) {
    3790           0 :                                 return -1;
    3791             :                         }
    3792           0 :                         if (test_var > uint_max) {
    3793           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3794             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3795           0 :                                 return -1;
    3796             :                         }
    3797           0 :                         object->priority = test_var;
    3798             :                 } else {
    3799           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3800             :                           PyLong_Type.tp_name);
    3801           0 :                         return -1;
    3802             :                 }
    3803             :         }
    3804           0 :         return 0;
    3805             : }
    3806             : 
    3807           0 : static PyObject *py_smb_trans_body_get__class(PyObject *obj, void *closure)
    3808             : {
    3809           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3810             :         PyObject *py__class;
    3811           0 :         py__class = PyLong_FromLong((uint16_t)object->_class);
    3812           0 :         return py__class;
    3813             : }
    3814             : 
    3815           0 : static int py_smb_trans_body_set__class(PyObject *py_obj, PyObject *value, void *closure)
    3816             : {
    3817           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3818           0 :         if (value == NULL) {
    3819           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_class");
    3820           0 :                 return -1;
    3821             :         }
    3822             :         {
    3823           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_class));
    3824           0 :                 if (PyLong_Check(value)) {
    3825             :                         unsigned long long test_var;
    3826           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3827           0 :                         if (PyErr_Occurred() != NULL) {
    3828           0 :                                 return -1;
    3829             :                         }
    3830           0 :                         if (test_var > uint_max) {
    3831           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3832             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3833           0 :                                 return -1;
    3834             :                         }
    3835           0 :                         object->_class = test_var;
    3836             :                 } else {
    3837           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3838             :                           PyLong_Type.tp_name);
    3839           0 :                         return -1;
    3840             :                 }
    3841             :         }
    3842           0 :         return 0;
    3843             : }
    3844             : 
    3845           0 : static PyObject *py_smb_trans_body_get_byte_count(PyObject *obj, void *closure)
    3846             : {
    3847           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3848             :         PyObject *py_byte_count;
    3849           0 :         py_byte_count = PyLong_FromLong((uint16_t)object->byte_count);
    3850           0 :         return py_byte_count;
    3851             : }
    3852             : 
    3853           0 : static int py_smb_trans_body_set_byte_count(PyObject *py_obj, PyObject *value, void *closure)
    3854             : {
    3855           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3856           0 :         if (value == NULL) {
    3857           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->byte_count");
    3858           0 :                 return -1;
    3859             :         }
    3860             :         {
    3861           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->byte_count));
    3862           0 :                 if (PyLong_Check(value)) {
    3863             :                         unsigned long long test_var;
    3864           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3865           0 :                         if (PyErr_Occurred() != NULL) {
    3866           0 :                                 return -1;
    3867             :                         }
    3868           0 :                         if (test_var > uint_max) {
    3869           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3870             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3871           0 :                                 return -1;
    3872             :                         }
    3873           0 :                         object->byte_count = test_var;
    3874             :                 } else {
    3875           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3876             :                           PyLong_Type.tp_name);
    3877           0 :                         return -1;
    3878             :                 }
    3879             :         }
    3880           0 :         return 0;
    3881             : }
    3882             : 
    3883           0 : static PyObject *py_smb_trans_body_get_mailslot_name(PyObject *obj, void *closure)
    3884             : {
    3885           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3886             :         PyObject *py_mailslot_name;
    3887           0 :         py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
    3888           0 :         return py_mailslot_name;
    3889             : }
    3890             : 
    3891           0 : static int py_smb_trans_body_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
    3892             : {
    3893           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3894           0 :         if (value == NULL) {
    3895           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
    3896           0 :                 return -1;
    3897             :         }
    3898             :         {
    3899             :                 const char *test_str;
    3900             :                 const char *talloc_str;
    3901           0 :                 PyObject *unicode = NULL;
    3902           0 :                 if (PyUnicode_Check(value)) {
    3903           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3904           0 :                         if (unicode == NULL) {
    3905           0 :                                 PyErr_NoMemory();
    3906           0 :                                 return -1;
    3907             :                         }
    3908           0 :                         test_str = PyBytes_AS_STRING(unicode);
    3909           0 :                 } else if (PyBytes_Check(value)) {
    3910           0 :                         test_str = PyBytes_AS_STRING(value);
    3911             :                 } else {
    3912           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3913           0 :                         return -1;
    3914             :                 }
    3915           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3916           0 :                 if (unicode != NULL) {
    3917           0 :                         Py_DECREF(unicode);
    3918             :                 }
    3919           0 :                 if (talloc_str == NULL) {
    3920           0 :                         PyErr_NoMemory();
    3921           0 :                         return -1;
    3922             :                 }
    3923           0 :                 object->mailslot_name = talloc_str;
    3924             :         }
    3925           0 :         return 0;
    3926             : }
    3927             : 
    3928           0 : static PyObject *py_smb_trans_body_get_data(PyObject *obj, void *closure)
    3929             : {
    3930           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(obj);
    3931             :         PyObject *py_data;
    3932           0 :         py_data = PyBytes_FromStringAndSize((char *)(object->data).data, (object->data).length);
    3933           0 :         return py_data;
    3934             : }
    3935             : 
    3936           0 : static int py_smb_trans_body_set_data(PyObject *py_obj, PyObject *value, void *closure)
    3937             : {
    3938           0 :         struct smb_trans_body *object = (struct smb_trans_body *)pytalloc_get_ptr(py_obj);
    3939           0 :         if (value == NULL) {
    3940           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
    3941           0 :                 return -1;
    3942             :         }
    3943           0 :         object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    3944           0 :         return 0;
    3945             : }
    3946             : 
    3947             : static PyGetSetDef py_smb_trans_body_getsetters[] = {
    3948             :         {
    3949             :                 .name = discard_const_p(char, "wct"),
    3950             :                 .get = py_smb_trans_body_get_wct,
    3951             :                 .set = py_smb_trans_body_set_wct,
    3952             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3953             :         },
    3954             :         {
    3955             :                 .name = discard_const_p(char, "total_param_count"),
    3956             :                 .get = py_smb_trans_body_get_total_param_count,
    3957             :                 .set = py_smb_trans_body_set_total_param_count,
    3958             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3959             :         },
    3960             :         {
    3961             :                 .name = discard_const_p(char, "total_data_count"),
    3962             :                 .get = py_smb_trans_body_get_total_data_count,
    3963             :                 .set = py_smb_trans_body_set_total_data_count,
    3964             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3965             :         },
    3966             :         {
    3967             :                 .name = discard_const_p(char, "max_param_count"),
    3968             :                 .get = py_smb_trans_body_get_max_param_count,
    3969             :                 .set = py_smb_trans_body_set_max_param_count,
    3970             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3971             :         },
    3972             :         {
    3973             :                 .name = discard_const_p(char, "max_data_count"),
    3974             :                 .get = py_smb_trans_body_get_max_data_count,
    3975             :                 .set = py_smb_trans_body_set_max_data_count,
    3976             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3977             :         },
    3978             :         {
    3979             :                 .name = discard_const_p(char, "max_setup_count"),
    3980             :                 .get = py_smb_trans_body_get_max_setup_count,
    3981             :                 .set = py_smb_trans_body_set_max_setup_count,
    3982             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3983             :         },
    3984             :         {
    3985             :                 .name = discard_const_p(char, "pad"),
    3986             :                 .get = py_smb_trans_body_get_pad,
    3987             :                 .set = py_smb_trans_body_set_pad,
    3988             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3989             :         },
    3990             :         {
    3991             :                 .name = discard_const_p(char, "trans_flags"),
    3992             :                 .get = py_smb_trans_body_get_trans_flags,
    3993             :                 .set = py_smb_trans_body_set_trans_flags,
    3994             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3995             :         },
    3996             :         {
    3997             :                 .name = discard_const_p(char, "timeout"),
    3998             :                 .get = py_smb_trans_body_get_timeout,
    3999             :                 .set = py_smb_trans_body_set_timeout,
    4000             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4001             :         },
    4002             :         {
    4003             :                 .name = discard_const_p(char, "reserved"),
    4004             :                 .get = py_smb_trans_body_get_reserved,
    4005             :                 .set = py_smb_trans_body_set_reserved,
    4006             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4007             :         },
    4008             :         {
    4009             :                 .name = discard_const_p(char, "param_count"),
    4010             :                 .get = py_smb_trans_body_get_param_count,
    4011             :                 .set = py_smb_trans_body_set_param_count,
    4012             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4013             :         },
    4014             :         {
    4015             :                 .name = discard_const_p(char, "param_offset"),
    4016             :                 .get = py_smb_trans_body_get_param_offset,
    4017             :                 .set = py_smb_trans_body_set_param_offset,
    4018             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4019             :         },
    4020             :         {
    4021             :                 .name = discard_const_p(char, "data_count"),
    4022             :                 .get = py_smb_trans_body_get_data_count,
    4023             :                 .set = py_smb_trans_body_set_data_count,
    4024             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4025             :         },
    4026             :         {
    4027             :                 .name = discard_const_p(char, "data_offset"),
    4028             :                 .get = py_smb_trans_body_get_data_offset,
    4029             :                 .set = py_smb_trans_body_set_data_offset,
    4030             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4031             :         },
    4032             :         {
    4033             :                 .name = discard_const_p(char, "setup_count"),
    4034             :                 .get = py_smb_trans_body_get_setup_count,
    4035             :                 .set = py_smb_trans_body_set_setup_count,
    4036             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4037             :         },
    4038             :         {
    4039             :                 .name = discard_const_p(char, "pad2"),
    4040             :                 .get = py_smb_trans_body_get_pad2,
    4041             :                 .set = py_smb_trans_body_set_pad2,
    4042             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4043             :         },
    4044             :         {
    4045             :                 .name = discard_const_p(char, "opcode"),
    4046             :                 .get = py_smb_trans_body_get_opcode,
    4047             :                 .set = py_smb_trans_body_set_opcode,
    4048             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4049             :         },
    4050             :         {
    4051             :                 .name = discard_const_p(char, "priority"),
    4052             :                 .get = py_smb_trans_body_get_priority,
    4053             :                 .set = py_smb_trans_body_set_priority,
    4054             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4055             :         },
    4056             :         {
    4057             :                 .name = discard_const_p(char, "_class"),
    4058             :                 .get = py_smb_trans_body_get__class,
    4059             :                 .set = py_smb_trans_body_set__class,
    4060             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4061             :         },
    4062             :         {
    4063             :                 .name = discard_const_p(char, "byte_count"),
    4064             :                 .get = py_smb_trans_body_get_byte_count,
    4065             :                 .set = py_smb_trans_body_set_byte_count,
    4066             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4067             :         },
    4068             :         {
    4069             :                 .name = discard_const_p(char, "mailslot_name"),
    4070             :                 .get = py_smb_trans_body_get_mailslot_name,
    4071             :                 .set = py_smb_trans_body_set_mailslot_name,
    4072             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    4073             :         },
    4074             :         {
    4075             :                 .name = discard_const_p(char, "data"),
    4076             :                 .get = py_smb_trans_body_get_data,
    4077             :                 .set = py_smb_trans_body_set_data,
    4078             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    4079             :         },
    4080             :         { .name = NULL }
    4081             : };
    4082             : 
    4083           0 : static PyObject *py_smb_trans_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4084             : {
    4085           0 :         return pytalloc_new(struct smb_trans_body, type);
    4086             : }
    4087             : 
    4088             : 
    4089             : static PyTypeObject smb_trans_body_Type = {
    4090             :         PyVarObject_HEAD_INIT(NULL, 0)
    4091             :         .tp_name = "nbt.smb_trans_body",
    4092             :         .tp_getset = py_smb_trans_body_getsetters,
    4093             :         .tp_methods = NULL,
    4094             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4095             :         .tp_new = py_smb_trans_body_new,
    4096             : };
    4097             : 
    4098           0 : static PyObject *py_import_smb_body(TALLOC_CTX *mem_ctx, int level, union smb_body *in)
    4099             : {
    4100             :         PyObject *ret;
    4101             : 
    4102           0 :         switch (level) {
    4103           0 :                 case SMB_TRANSACTION:
    4104           0 :                         ret = pytalloc_reference_ex(&smb_trans_body_Type, mem_ctx, &in->trans);
    4105           0 :                         return ret;
    4106             : 
    4107             :         }
    4108           0 :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    4109           0 :         return NULL;
    4110             : }
    4111             : 
    4112           0 : static union smb_body *py_export_smb_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    4113             : {
    4114           0 :         union smb_body *ret = talloc_zero(mem_ctx, union smb_body);
    4115           0 :         switch (level) {
    4116           0 :                 case SMB_TRANSACTION:
    4117           0 :                         if (in == NULL) {
    4118           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->trans");
    4119           0 :                                 talloc_free(ret); return NULL;
    4120             :                         }
    4121           0 :                         PY_CHECK_TYPE(&smb_trans_body_Type, in, talloc_free(ret); return NULL;);
    4122           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    4123           0 :                                 PyErr_NoMemory();
    4124           0 :                                 talloc_free(ret); return NULL;
    4125             :                         }
    4126           0 :                         ret->trans = *(struct smb_trans_body *)pytalloc_get_ptr(in);
    4127           0 :                         break;
    4128             : 
    4129           0 :                 default:
    4130           0 :                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
    4131           0 :                         talloc_free(ret);
    4132           0 :                         ret = NULL;
    4133             :         }
    4134             : 
    4135           0 :         return ret;
    4136             : }
    4137             : 
    4138           0 : static PyObject *py_smb_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4139             : {
    4140           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4141           0 :         PyObject *mem_ctx_obj = NULL;
    4142           0 :         TALLOC_CTX *mem_ctx = NULL;
    4143           0 :         int level = 0;
    4144           0 :         PyObject *in_obj = NULL;
    4145           0 :         union smb_body *in = NULL;
    4146             : 
    4147           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    4148             :                 discard_const_p(char *, kwnames),
    4149             :                 &mem_ctx_obj,
    4150             :                 &level,
    4151             :                 &in_obj)) {
    4152           0 :                 return NULL;
    4153             :         }
    4154           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    4155           0 :         if (mem_ctx == NULL) {
    4156           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    4157           0 :                 return NULL;
    4158             :         }
    4159           0 :         in = (union smb_body *)pytalloc_get_ptr(in_obj);
    4160           0 :         if (in == NULL) {
    4161           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union smb_body!");
    4162           0 :                 return NULL;
    4163             :         }
    4164             : 
    4165           0 :         return py_import_smb_body(mem_ctx, level, in);
    4166             : }
    4167             : 
    4168           0 : static PyObject *py_smb_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4169             : {
    4170           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4171           0 :         PyObject *mem_ctx_obj = NULL;
    4172           0 :         TALLOC_CTX *mem_ctx = NULL;
    4173           0 :         int level = 0;
    4174           0 :         PyObject *in = NULL;
    4175           0 :         union smb_body *out = NULL;
    4176             : 
    4177           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    4178             :                 discard_const_p(char *, kwnames),
    4179             :                 &mem_ctx_obj,
    4180             :                 &level,
    4181             :                 &in)) {
    4182           0 :                 return NULL;
    4183             :         }
    4184           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    4185           0 :         if (mem_ctx == NULL) {
    4186           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    4187           0 :                 return NULL;
    4188             :         }
    4189             : 
    4190           0 :         out = py_export_smb_body(mem_ctx, level, in);
    4191           0 :         if (out == NULL) {
    4192           0 :                 return NULL;
    4193             :         }
    4194             : 
    4195           0 :         return pytalloc_GenericObject_reference(out);
    4196             : }
    4197             : 
    4198             : static PyMethodDef py_smb_body_methods[] = {
    4199             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_import),
    4200             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    4201             :                 "T.__import__(mem_ctx, level, in) => ret." },
    4202             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smb_body_export),
    4203             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    4204             :                 "T.__export__(mem_ctx, level, in) => ret." },
    4205             :         { NULL, NULL, 0, NULL }
    4206             : };
    4207             : 
    4208           0 : static PyObject *py_smb_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4209             : {
    4210           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    4211           0 :         return NULL;
    4212             : }
    4213             : 
    4214             : 
    4215             : static PyTypeObject smb_body_Type = {
    4216             :         PyVarObject_HEAD_INIT(NULL, 0)
    4217             :         .tp_name = "nbt.smb_body",
    4218             :         .tp_getset = NULL,
    4219             :         .tp_methods = py_smb_body_methods,
    4220             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4221             :         .tp_new = py_smb_body_new,
    4222             : };
    4223             : 
    4224             : 
    4225           0 : static PyObject *py_dgram_smb_packet_get_smb_command(PyObject *obj, void *closure)
    4226             : {
    4227           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4228             :         PyObject *py_smb_command;
    4229           0 :         py_smb_command = PyLong_FromLong((uint16_t)object->smb_command);
    4230           0 :         return py_smb_command;
    4231             : }
    4232             : 
    4233           0 : static int py_dgram_smb_packet_set_smb_command(PyObject *py_obj, PyObject *value, void *closure)
    4234             : {
    4235           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4236           0 :         if (value == NULL) {
    4237           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->smb_command");
    4238           0 :                 return -1;
    4239             :         }
    4240             :         {
    4241           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->smb_command));
    4242           0 :                 if (PyLong_Check(value)) {
    4243             :                         unsigned long long test_var;
    4244           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4245           0 :                         if (PyErr_Occurred() != NULL) {
    4246           0 :                                 return -1;
    4247             :                         }
    4248           0 :                         if (test_var > uint_max) {
    4249           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4250             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4251           0 :                                 return -1;
    4252             :                         }
    4253           0 :                         object->smb_command = test_var;
    4254             :                 } else {
    4255           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4256             :                           PyLong_Type.tp_name);
    4257           0 :                         return -1;
    4258             :                 }
    4259             :         }
    4260           0 :         return 0;
    4261             : }
    4262             : 
    4263           0 : static PyObject *py_dgram_smb_packet_get_err_class(PyObject *obj, void *closure)
    4264             : {
    4265           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4266             :         PyObject *py_err_class;
    4267           0 :         py_err_class = PyLong_FromLong((uint16_t)object->err_class);
    4268           0 :         return py_err_class;
    4269             : }
    4270             : 
    4271           0 : static int py_dgram_smb_packet_set_err_class(PyObject *py_obj, PyObject *value, void *closure)
    4272             : {
    4273           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4274           0 :         if (value == NULL) {
    4275           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->err_class");
    4276           0 :                 return -1;
    4277             :         }
    4278             :         {
    4279           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_class));
    4280           0 :                 if (PyLong_Check(value)) {
    4281             :                         unsigned long long test_var;
    4282           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4283           0 :                         if (PyErr_Occurred() != NULL) {
    4284           0 :                                 return -1;
    4285             :                         }
    4286           0 :                         if (test_var > uint_max) {
    4287           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4288             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4289           0 :                                 return -1;
    4290             :                         }
    4291           0 :                         object->err_class = test_var;
    4292             :                 } else {
    4293           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4294             :                           PyLong_Type.tp_name);
    4295           0 :                         return -1;
    4296             :                 }
    4297             :         }
    4298           0 :         return 0;
    4299             : }
    4300             : 
    4301           0 : static PyObject *py_dgram_smb_packet_get_pad(PyObject *obj, void *closure)
    4302             : {
    4303           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4304             :         PyObject *py_pad;
    4305           0 :         py_pad = PyLong_FromLong((uint16_t)object->pad);
    4306           0 :         return py_pad;
    4307             : }
    4308             : 
    4309           0 : static int py_dgram_smb_packet_set_pad(PyObject *py_obj, PyObject *value, void *closure)
    4310             : {
    4311           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4312           0 :         if (value == NULL) {
    4313           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pad");
    4314           0 :                 return -1;
    4315             :         }
    4316             :         {
    4317           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pad));
    4318           0 :                 if (PyLong_Check(value)) {
    4319             :                         unsigned long long test_var;
    4320           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4321           0 :                         if (PyErr_Occurred() != NULL) {
    4322           0 :                                 return -1;
    4323             :                         }
    4324           0 :                         if (test_var > uint_max) {
    4325           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4326             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4327           0 :                                 return -1;
    4328             :                         }
    4329           0 :                         object->pad = test_var;
    4330             :                 } else {
    4331           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4332             :                           PyLong_Type.tp_name);
    4333           0 :                         return -1;
    4334             :                 }
    4335             :         }
    4336           0 :         return 0;
    4337             : }
    4338             : 
    4339           0 : static PyObject *py_dgram_smb_packet_get_err_code(PyObject *obj, void *closure)
    4340             : {
    4341           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4342             :         PyObject *py_err_code;
    4343           0 :         py_err_code = PyLong_FromLong((uint16_t)object->err_code);
    4344           0 :         return py_err_code;
    4345             : }
    4346             : 
    4347           0 : static int py_dgram_smb_packet_set_err_code(PyObject *py_obj, PyObject *value, void *closure)
    4348             : {
    4349           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4350           0 :         if (value == NULL) {
    4351           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->err_code");
    4352           0 :                 return -1;
    4353             :         }
    4354             :         {
    4355           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->err_code));
    4356           0 :                 if (PyLong_Check(value)) {
    4357             :                         unsigned long long test_var;
    4358           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4359           0 :                         if (PyErr_Occurred() != NULL) {
    4360           0 :                                 return -1;
    4361             :                         }
    4362           0 :                         if (test_var > uint_max) {
    4363           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4364             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4365           0 :                                 return -1;
    4366             :                         }
    4367           0 :                         object->err_code = test_var;
    4368             :                 } else {
    4369           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4370             :                           PyLong_Type.tp_name);
    4371           0 :                         return -1;
    4372             :                 }
    4373             :         }
    4374           0 :         return 0;
    4375             : }
    4376             : 
    4377           0 : static PyObject *py_dgram_smb_packet_get_flags(PyObject *obj, void *closure)
    4378             : {
    4379           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4380             :         PyObject *py_flags;
    4381           0 :         py_flags = PyLong_FromLong((uint16_t)object->flags);
    4382           0 :         return py_flags;
    4383             : }
    4384             : 
    4385           0 : static int py_dgram_smb_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    4386             : {
    4387           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4388           0 :         if (value == NULL) {
    4389           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
    4390           0 :                 return -1;
    4391             :         }
    4392             :         {
    4393           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
    4394           0 :                 if (PyLong_Check(value)) {
    4395             :                         unsigned long long test_var;
    4396           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4397           0 :                         if (PyErr_Occurred() != NULL) {
    4398           0 :                                 return -1;
    4399             :                         }
    4400           0 :                         if (test_var > uint_max) {
    4401           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4402             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4403           0 :                                 return -1;
    4404             :                         }
    4405           0 :                         object->flags = test_var;
    4406             :                 } else {
    4407           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4408             :                           PyLong_Type.tp_name);
    4409           0 :                         return -1;
    4410             :                 }
    4411             :         }
    4412           0 :         return 0;
    4413             : }
    4414             : 
    4415           0 : static PyObject *py_dgram_smb_packet_get_flags2(PyObject *obj, void *closure)
    4416             : {
    4417           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4418             :         PyObject *py_flags2;
    4419           0 :         py_flags2 = PyLong_FromLong((uint16_t)object->flags2);
    4420           0 :         return py_flags2;
    4421             : }
    4422             : 
    4423           0 : static int py_dgram_smb_packet_set_flags2(PyObject *py_obj, PyObject *value, void *closure)
    4424             : {
    4425           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4426           0 :         if (value == NULL) {
    4427           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags2");
    4428           0 :                 return -1;
    4429             :         }
    4430             :         {
    4431           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags2));
    4432           0 :                 if (PyLong_Check(value)) {
    4433             :                         unsigned long long test_var;
    4434           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4435           0 :                         if (PyErr_Occurred() != NULL) {
    4436           0 :                                 return -1;
    4437             :                         }
    4438           0 :                         if (test_var > uint_max) {
    4439           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4440             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4441           0 :                                 return -1;
    4442             :                         }
    4443           0 :                         object->flags2 = test_var;
    4444             :                 } else {
    4445           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4446             :                           PyLong_Type.tp_name);
    4447           0 :                         return -1;
    4448             :                 }
    4449             :         }
    4450           0 :         return 0;
    4451             : }
    4452             : 
    4453           0 : static PyObject *py_dgram_smb_packet_get_pid_high(PyObject *obj, void *closure)
    4454             : {
    4455           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4456             :         PyObject *py_pid_high;
    4457           0 :         py_pid_high = PyLong_FromLong((uint16_t)object->pid_high);
    4458           0 :         return py_pid_high;
    4459             : }
    4460             : 
    4461           0 : static int py_dgram_smb_packet_set_pid_high(PyObject *py_obj, PyObject *value, void *closure)
    4462             : {
    4463           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4464           0 :         if (value == NULL) {
    4465           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid_high");
    4466           0 :                 return -1;
    4467             :         }
    4468             :         {
    4469           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid_high));
    4470           0 :                 if (PyLong_Check(value)) {
    4471             :                         unsigned long long test_var;
    4472           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4473           0 :                         if (PyErr_Occurred() != NULL) {
    4474           0 :                                 return -1;
    4475             :                         }
    4476           0 :                         if (test_var > uint_max) {
    4477           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4478             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4479           0 :                                 return -1;
    4480             :                         }
    4481           0 :                         object->pid_high = test_var;
    4482             :                 } else {
    4483           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4484             :                           PyLong_Type.tp_name);
    4485           0 :                         return -1;
    4486             :                 }
    4487             :         }
    4488           0 :         return 0;
    4489             : }
    4490             : 
    4491           0 : static PyObject *py_dgram_smb_packet_get_signature(PyObject *obj, void *closure)
    4492             : {
    4493           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4494             :         PyObject *py_signature;
    4495           0 :         py_signature = PyList_New(8);
    4496           0 :         if (py_signature == NULL) {
    4497           0 :                 return NULL;
    4498             :         }
    4499             :         {
    4500             :                 int signature_cntr_0;
    4501           0 :                 for (signature_cntr_0 = 0; signature_cntr_0 < (8); signature_cntr_0++) {
    4502             :                         PyObject *py_signature_0;
    4503           0 :                         py_signature_0 = PyLong_FromLong((uint16_t)object->signature[signature_cntr_0]);
    4504           0 :                         PyList_SetItem(py_signature, signature_cntr_0, py_signature_0);
    4505             :                 }
    4506             :         }
    4507           0 :         return py_signature;
    4508             : }
    4509             : 
    4510           0 : static int py_dgram_smb_packet_set_signature(PyObject *py_obj, PyObject *value, void *closure)
    4511             : {
    4512           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4513           0 :         if (value == NULL) {
    4514           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature");
    4515           0 :                 return -1;
    4516             :         }
    4517           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4518             :         {
    4519             :                 int signature_cntr_0;
    4520           0 :                 if (ARRAY_SIZE(object->signature) != PyList_GET_SIZE(value)) {
    4521           0 :                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->signature),  PyList_GET_SIZE(value));
    4522           0 :                         return -1;
    4523             :                 }
    4524           0 :                 for (signature_cntr_0 = 0; signature_cntr_0 < PyList_GET_SIZE(value); signature_cntr_0++) {
    4525           0 :                         if (PyList_GET_ITEM(value, signature_cntr_0) == NULL) {
    4526           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature[signature_cntr_0]");
    4527           0 :                                 return -1;
    4528             :                         }
    4529             :                         {
    4530           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->signature[signature_cntr_0]));
    4531           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, signature_cntr_0))) {
    4532             :                                         unsigned long long test_var;
    4533           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, signature_cntr_0));
    4534           0 :                                         if (PyErr_Occurred() != NULL) {
    4535           0 :                                                 return -1;
    4536             :                                         }
    4537           0 :                                         if (test_var > uint_max) {
    4538           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4539             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    4540           0 :                                                 return -1;
    4541             :                                         }
    4542           0 :                                         object->signature[signature_cntr_0] = test_var;
    4543             :                                 } else {
    4544           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4545             :                                           PyLong_Type.tp_name);
    4546           0 :                                         return -1;
    4547             :                                 }
    4548             :                         }
    4549             :                 }
    4550             :         }
    4551           0 :         return 0;
    4552             : }
    4553             : 
    4554           0 : static PyObject *py_dgram_smb_packet_get_reserved(PyObject *obj, void *closure)
    4555             : {
    4556           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4557             :         PyObject *py_reserved;
    4558           0 :         py_reserved = PyLong_FromLong((uint16_t)object->reserved);
    4559           0 :         return py_reserved;
    4560             : }
    4561             : 
    4562           0 : static int py_dgram_smb_packet_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
    4563             : {
    4564           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4565           0 :         if (value == NULL) {
    4566           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
    4567           0 :                 return -1;
    4568             :         }
    4569             :         {
    4570           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
    4571           0 :                 if (PyLong_Check(value)) {
    4572             :                         unsigned long long test_var;
    4573           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4574           0 :                         if (PyErr_Occurred() != NULL) {
    4575           0 :                                 return -1;
    4576             :                         }
    4577           0 :                         if (test_var > uint_max) {
    4578           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4579             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4580           0 :                                 return -1;
    4581             :                         }
    4582           0 :                         object->reserved = test_var;
    4583             :                 } else {
    4584           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4585             :                           PyLong_Type.tp_name);
    4586           0 :                         return -1;
    4587             :                 }
    4588             :         }
    4589           0 :         return 0;
    4590             : }
    4591             : 
    4592           0 : static PyObject *py_dgram_smb_packet_get_tid(PyObject *obj, void *closure)
    4593             : {
    4594           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4595             :         PyObject *py_tid;
    4596           0 :         py_tid = PyLong_FromLong((uint16_t)object->tid);
    4597           0 :         return py_tid;
    4598             : }
    4599             : 
    4600           0 : static int py_dgram_smb_packet_set_tid(PyObject *py_obj, PyObject *value, void *closure)
    4601             : {
    4602           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4603           0 :         if (value == NULL) {
    4604           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tid");
    4605           0 :                 return -1;
    4606             :         }
    4607             :         {
    4608           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tid));
    4609           0 :                 if (PyLong_Check(value)) {
    4610             :                         unsigned long long test_var;
    4611           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4612           0 :                         if (PyErr_Occurred() != NULL) {
    4613           0 :                                 return -1;
    4614             :                         }
    4615           0 :                         if (test_var > uint_max) {
    4616           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4617             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4618           0 :                                 return -1;
    4619             :                         }
    4620           0 :                         object->tid = test_var;
    4621             :                 } else {
    4622           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4623             :                           PyLong_Type.tp_name);
    4624           0 :                         return -1;
    4625             :                 }
    4626             :         }
    4627           0 :         return 0;
    4628             : }
    4629             : 
    4630           0 : static PyObject *py_dgram_smb_packet_get_pid(PyObject *obj, void *closure)
    4631             : {
    4632           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4633             :         PyObject *py_pid;
    4634           0 :         py_pid = PyLong_FromLong((uint16_t)object->pid);
    4635           0 :         return py_pid;
    4636             : }
    4637             : 
    4638           0 : static int py_dgram_smb_packet_set_pid(PyObject *py_obj, PyObject *value, void *closure)
    4639             : {
    4640           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4641           0 :         if (value == NULL) {
    4642           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pid");
    4643           0 :                 return -1;
    4644             :         }
    4645             :         {
    4646           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pid));
    4647           0 :                 if (PyLong_Check(value)) {
    4648             :                         unsigned long long test_var;
    4649           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4650           0 :                         if (PyErr_Occurred() != NULL) {
    4651           0 :                                 return -1;
    4652             :                         }
    4653           0 :                         if (test_var > uint_max) {
    4654           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4655             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4656           0 :                                 return -1;
    4657             :                         }
    4658           0 :                         object->pid = test_var;
    4659             :                 } else {
    4660           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4661             :                           PyLong_Type.tp_name);
    4662           0 :                         return -1;
    4663             :                 }
    4664             :         }
    4665           0 :         return 0;
    4666             : }
    4667             : 
    4668           0 : static PyObject *py_dgram_smb_packet_get_vuid(PyObject *obj, void *closure)
    4669             : {
    4670           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4671             :         PyObject *py_vuid;
    4672           0 :         py_vuid = PyLong_FromLong((uint16_t)object->vuid);
    4673           0 :         return py_vuid;
    4674             : }
    4675             : 
    4676           0 : static int py_dgram_smb_packet_set_vuid(PyObject *py_obj, PyObject *value, void *closure)
    4677             : {
    4678           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4679           0 :         if (value == NULL) {
    4680           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->vuid");
    4681           0 :                 return -1;
    4682             :         }
    4683             :         {
    4684           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vuid));
    4685           0 :                 if (PyLong_Check(value)) {
    4686             :                         unsigned long long test_var;
    4687           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4688           0 :                         if (PyErr_Occurred() != NULL) {
    4689           0 :                                 return -1;
    4690             :                         }
    4691           0 :                         if (test_var > uint_max) {
    4692           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4693             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4694           0 :                                 return -1;
    4695             :                         }
    4696           0 :                         object->vuid = test_var;
    4697             :                 } else {
    4698           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4699             :                           PyLong_Type.tp_name);
    4700           0 :                         return -1;
    4701             :                 }
    4702             :         }
    4703           0 :         return 0;
    4704             : }
    4705             : 
    4706           0 : static PyObject *py_dgram_smb_packet_get_mid(PyObject *obj, void *closure)
    4707             : {
    4708           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4709             :         PyObject *py_mid;
    4710           0 :         py_mid = PyLong_FromLong((uint16_t)object->mid);
    4711           0 :         return py_mid;
    4712             : }
    4713             : 
    4714           0 : static int py_dgram_smb_packet_set_mid(PyObject *py_obj, PyObject *value, void *closure)
    4715             : {
    4716           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4717           0 :         if (value == NULL) {
    4718           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mid");
    4719           0 :                 return -1;
    4720             :         }
    4721             :         {
    4722           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mid));
    4723           0 :                 if (PyLong_Check(value)) {
    4724             :                         unsigned long long test_var;
    4725           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4726           0 :                         if (PyErr_Occurred() != NULL) {
    4727           0 :                                 return -1;
    4728             :                         }
    4729           0 :                         if (test_var > uint_max) {
    4730           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4731             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4732           0 :                                 return -1;
    4733             :                         }
    4734           0 :                         object->mid = test_var;
    4735             :                 } else {
    4736           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4737             :                           PyLong_Type.tp_name);
    4738           0 :                         return -1;
    4739             :                 }
    4740             :         }
    4741           0 :         return 0;
    4742             : }
    4743             : 
    4744           0 : static PyObject *py_dgram_smb_packet_get_body(PyObject *obj, void *closure)
    4745             : {
    4746           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(obj);
    4747             :         PyObject *py_body;
    4748           0 :         py_body = pyrpc_import_union(&smb_body_Type, pytalloc_get_mem_ctx(obj), object->smb_command, &object->body, "union smb_body");
    4749           0 :         if (py_body == NULL) {
    4750           0 :                 return NULL;
    4751             :         }
    4752           0 :         return py_body;
    4753             : }
    4754             : 
    4755           0 : static int py_dgram_smb_packet_set_body(PyObject *py_obj, PyObject *value, void *closure)
    4756             : {
    4757           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4758           0 :         if (value == NULL) {
    4759           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->body");
    4760           0 :                 return -1;
    4761             :         }
    4762             :         {
    4763             :                 union smb_body *body_switch_0;
    4764           0 :                 body_switch_0 = (union smb_body *)pyrpc_export_union(&smb_body_Type, pytalloc_get_mem_ctx(py_obj), object->smb_command, value, "union smb_body");
    4765           0 :                 if (body_switch_0 == NULL) {
    4766           0 :                         return -1;
    4767             :                 }
    4768           0 :                 object->body = *body_switch_0;
    4769             :         }
    4770           0 :         return 0;
    4771             : }
    4772             : 
    4773             : static PyGetSetDef py_dgram_smb_packet_getsetters[] = {
    4774             :         {
    4775             :                 .name = discard_const_p(char, "smb_command"),
    4776             :                 .get = py_dgram_smb_packet_get_smb_command,
    4777             :                 .set = py_dgram_smb_packet_set_smb_command,
    4778             :                 .doc = discard_const_p(char, "PIDL-generated element of base type smb_command")
    4779             :         },
    4780             :         {
    4781             :                 .name = discard_const_p(char, "err_class"),
    4782             :                 .get = py_dgram_smb_packet_get_err_class,
    4783             :                 .set = py_dgram_smb_packet_set_err_class,
    4784             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4785             :         },
    4786             :         {
    4787             :                 .name = discard_const_p(char, "pad"),
    4788             :                 .get = py_dgram_smb_packet_get_pad,
    4789             :                 .set = py_dgram_smb_packet_set_pad,
    4790             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4791             :         },
    4792             :         {
    4793             :                 .name = discard_const_p(char, "err_code"),
    4794             :                 .get = py_dgram_smb_packet_get_err_code,
    4795             :                 .set = py_dgram_smb_packet_set_err_code,
    4796             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4797             :         },
    4798             :         {
    4799             :                 .name = discard_const_p(char, "flags"),
    4800             :                 .get = py_dgram_smb_packet_get_flags,
    4801             :                 .set = py_dgram_smb_packet_set_flags,
    4802             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4803             :         },
    4804             :         {
    4805             :                 .name = discard_const_p(char, "flags2"),
    4806             :                 .get = py_dgram_smb_packet_get_flags2,
    4807             :                 .set = py_dgram_smb_packet_set_flags2,
    4808             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4809             :         },
    4810             :         {
    4811             :                 .name = discard_const_p(char, "pid_high"),
    4812             :                 .get = py_dgram_smb_packet_get_pid_high,
    4813             :                 .set = py_dgram_smb_packet_set_pid_high,
    4814             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4815             :         },
    4816             :         {
    4817             :                 .name = discard_const_p(char, "signature"),
    4818             :                 .get = py_dgram_smb_packet_get_signature,
    4819             :                 .set = py_dgram_smb_packet_set_signature,
    4820             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4821             :         },
    4822             :         {
    4823             :                 .name = discard_const_p(char, "reserved"),
    4824             :                 .get = py_dgram_smb_packet_get_reserved,
    4825             :                 .set = py_dgram_smb_packet_set_reserved,
    4826             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4827             :         },
    4828             :         {
    4829             :                 .name = discard_const_p(char, "tid"),
    4830             :                 .get = py_dgram_smb_packet_get_tid,
    4831             :                 .set = py_dgram_smb_packet_set_tid,
    4832             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4833             :         },
    4834             :         {
    4835             :                 .name = discard_const_p(char, "pid"),
    4836             :                 .get = py_dgram_smb_packet_get_pid,
    4837             :                 .set = py_dgram_smb_packet_set_pid,
    4838             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4839             :         },
    4840             :         {
    4841             :                 .name = discard_const_p(char, "vuid"),
    4842             :                 .get = py_dgram_smb_packet_get_vuid,
    4843             :                 .set = py_dgram_smb_packet_set_vuid,
    4844             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4845             :         },
    4846             :         {
    4847             :                 .name = discard_const_p(char, "mid"),
    4848             :                 .get = py_dgram_smb_packet_get_mid,
    4849             :                 .set = py_dgram_smb_packet_set_mid,
    4850             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4851             :         },
    4852             :         {
    4853             :                 .name = discard_const_p(char, "body"),
    4854             :                 .get = py_dgram_smb_packet_get_body,
    4855             :                 .set = py_dgram_smb_packet_set_body,
    4856             :                 .doc = discard_const_p(char, "PIDL-generated element of base type smb_body")
    4857             :         },
    4858             :         { .name = NULL }
    4859             : };
    4860             : 
    4861           0 : static PyObject *py_dgram_smb_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4862             : {
    4863           0 :         return pytalloc_new(struct dgram_smb_packet, type);
    4864             : }
    4865             : 
    4866           0 : static PyObject *py_dgram_smb_packet_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4867             : {
    4868           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4869           0 :         PyObject *ret = NULL;
    4870             :         DATA_BLOB blob;
    4871             :         enum ndr_err_code err;
    4872           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4873           0 :         if (tmp_ctx == NULL) {
    4874           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4875           0 :                 return NULL;
    4876             :         }
    4877           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dgram_smb_packet);
    4878           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4879           0 :                 TALLOC_FREE(tmp_ctx);
    4880           0 :                 PyErr_SetNdrError(err);
    4881           0 :                 return NULL;
    4882             :         }
    4883             : 
    4884           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4885           0 :         TALLOC_FREE(tmp_ctx);
    4886           0 :         return ret;
    4887             : }
    4888             : 
    4889           0 : static PyObject *py_dgram_smb_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4890             : {
    4891           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4892           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4893           0 :         Py_ssize_t blob_length = 0;
    4894             :         enum ndr_err_code err;
    4895           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4896           0 :         PyObject *allow_remaining_obj = NULL;
    4897           0 :         bool allow_remaining = false;
    4898             : 
    4899           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4900             :                 discard_const_p(char *, kwnames),
    4901             :                 &blob.data, &blob_length,
    4902             :                 &allow_remaining_obj)) {
    4903           0 :                 return NULL;
    4904             :         }
    4905           0 :         blob.length = blob_length;
    4906             : 
    4907           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4908           0 :                 allow_remaining = true;
    4909             :         }
    4910             : 
    4911           0 :         if (allow_remaining) {
    4912           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
    4913             :         } else {
    4914           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
    4915             :         }
    4916           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4917           0 :                 PyErr_SetNdrError(err);
    4918           0 :                 return NULL;
    4919             :         }
    4920             : 
    4921           0 :         Py_RETURN_NONE;
    4922             : }
    4923             : 
    4924           0 : static PyObject *py_dgram_smb_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4925             : {
    4926           0 :         struct dgram_smb_packet *object = (struct dgram_smb_packet *)pytalloc_get_ptr(py_obj);
    4927             :         PyObject *ret;
    4928             :         char *retstr;
    4929             : 
    4930           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dgram_smb_packet, "dgram_smb_packet", object);
    4931           0 :         ret = PyUnicode_FromString(retstr);
    4932           0 :         talloc_free(retstr);
    4933             : 
    4934           0 :         return ret;
    4935             : }
    4936             : 
    4937             : static PyMethodDef py_dgram_smb_packet_methods[] = {
    4938             :         { "__ndr_pack__", (PyCFunction)py_dgram_smb_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4939             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_smb_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4940             :         { "__ndr_print__", (PyCFunction)py_dgram_smb_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4941             :         { NULL, NULL, 0, NULL }
    4942             : };
    4943             : 
    4944             : 
    4945             : static PyTypeObject dgram_smb_packet_Type = {
    4946             :         PyVarObject_HEAD_INIT(NULL, 0)
    4947             :         .tp_name = "nbt.dgram_smb_packet",
    4948             :         .tp_getset = py_dgram_smb_packet_getsetters,
    4949             :         .tp_methods = py_dgram_smb_packet_methods,
    4950             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4951             :         .tp_new = py_dgram_smb_packet_new,
    4952             : };
    4953             : 
    4954           0 : static PyObject *py_import_dgram_message_body(TALLOC_CTX *mem_ctx, int level, union dgram_message_body *in)
    4955             : {
    4956             :         PyObject *ret;
    4957             : 
    4958           0 :         switch (level) {
    4959           0 :                 case DGRAM_SMB:
    4960           0 :                         ret = pytalloc_reference_ex(&dgram_smb_packet_Type, mem_ctx, &in->smb);
    4961           0 :                         return ret;
    4962             : 
    4963             :         }
    4964           0 :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    4965           0 :         return NULL;
    4966             : }
    4967             : 
    4968           0 : static union dgram_message_body *py_export_dgram_message_body(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    4969             : {
    4970           0 :         union dgram_message_body *ret = talloc_zero(mem_ctx, union dgram_message_body);
    4971           0 :         switch (level) {
    4972           0 :                 case DGRAM_SMB:
    4973           0 :                         if (in == NULL) {
    4974           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->smb");
    4975           0 :                                 talloc_free(ret); return NULL;
    4976             :                         }
    4977           0 :                         PY_CHECK_TYPE(&dgram_smb_packet_Type, in, talloc_free(ret); return NULL;);
    4978           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    4979           0 :                                 PyErr_NoMemory();
    4980           0 :                                 talloc_free(ret); return NULL;
    4981             :                         }
    4982           0 :                         ret->smb = *(struct dgram_smb_packet *)pytalloc_get_ptr(in);
    4983           0 :                         break;
    4984             : 
    4985           0 :                 default:
    4986           0 :                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
    4987           0 :                         talloc_free(ret);
    4988           0 :                         ret = NULL;
    4989             :         }
    4990             : 
    4991           0 :         return ret;
    4992             : }
    4993             : 
    4994           0 : static PyObject *py_dgram_message_body_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4995             : {
    4996           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4997           0 :         PyObject *mem_ctx_obj = NULL;
    4998           0 :         TALLOC_CTX *mem_ctx = NULL;
    4999           0 :         int level = 0;
    5000           0 :         PyObject *in_obj = NULL;
    5001           0 :         union dgram_message_body *in = NULL;
    5002             : 
    5003           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    5004             :                 discard_const_p(char *, kwnames),
    5005             :                 &mem_ctx_obj,
    5006             :                 &level,
    5007             :                 &in_obj)) {
    5008           0 :                 return NULL;
    5009             :         }
    5010           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    5011           0 :         if (mem_ctx == NULL) {
    5012           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    5013           0 :                 return NULL;
    5014             :         }
    5015           0 :         in = (union dgram_message_body *)pytalloc_get_ptr(in_obj);
    5016           0 :         if (in == NULL) {
    5017           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_message_body!");
    5018           0 :                 return NULL;
    5019             :         }
    5020             : 
    5021           0 :         return py_import_dgram_message_body(mem_ctx, level, in);
    5022             : }
    5023             : 
    5024           0 : static PyObject *py_dgram_message_body_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5025             : {
    5026           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    5027           0 :         PyObject *mem_ctx_obj = NULL;
    5028           0 :         TALLOC_CTX *mem_ctx = NULL;
    5029           0 :         int level = 0;
    5030           0 :         PyObject *in = NULL;
    5031           0 :         union dgram_message_body *out = NULL;
    5032             : 
    5033           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    5034             :                 discard_const_p(char *, kwnames),
    5035             :                 &mem_ctx_obj,
    5036             :                 &level,
    5037             :                 &in)) {
    5038           0 :                 return NULL;
    5039             :         }
    5040           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    5041           0 :         if (mem_ctx == NULL) {
    5042           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    5043           0 :                 return NULL;
    5044             :         }
    5045             : 
    5046           0 :         out = py_export_dgram_message_body(mem_ctx, level, in);
    5047           0 :         if (out == NULL) {
    5048           0 :                 return NULL;
    5049             :         }
    5050             : 
    5051           0 :         return pytalloc_GenericObject_reference(out);
    5052             : }
    5053             : 
    5054             : static PyMethodDef py_dgram_message_body_methods[] = {
    5055             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_import),
    5056             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    5057             :                 "T.__import__(mem_ctx, level, in) => ret." },
    5058             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_message_body_export),
    5059             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    5060             :                 "T.__export__(mem_ctx, level, in) => ret." },
    5061             :         { NULL, NULL, 0, NULL }
    5062             : };
    5063             : 
    5064           0 : static PyObject *py_dgram_message_body_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5065             : {
    5066           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    5067           0 :         return NULL;
    5068             : }
    5069             : 
    5070             : 
    5071             : static PyTypeObject dgram_message_body_Type = {
    5072             :         PyVarObject_HEAD_INIT(NULL, 0)
    5073             :         .tp_name = "nbt.dgram_message_body",
    5074             :         .tp_getset = NULL,
    5075             :         .tp_methods = py_dgram_message_body_methods,
    5076             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5077             :         .tp_new = py_dgram_message_body_new,
    5078             : };
    5079             : 
    5080             : 
    5081           0 : static PyObject *py_dgram_message_get_length(PyObject *obj, void *closure)
    5082             : {
    5083           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
    5084             :         PyObject *py_length;
    5085           0 :         py_length = PyLong_FromLong((uint16_t)object->length);
    5086           0 :         return py_length;
    5087             : }
    5088             : 
    5089           0 : static int py_dgram_message_set_length(PyObject *py_obj, PyObject *value, void *closure)
    5090             : {
    5091           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
    5092           0 :         if (value == NULL) {
    5093           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
    5094           0 :                 return -1;
    5095             :         }
    5096             :         {
    5097           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
    5098           0 :                 if (PyLong_Check(value)) {
    5099             :                         unsigned long long test_var;
    5100           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5101           0 :                         if (PyErr_Occurred() != NULL) {
    5102           0 :                                 return -1;
    5103             :                         }
    5104           0 :                         if (test_var > uint_max) {
    5105           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5106             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5107           0 :                                 return -1;
    5108             :                         }
    5109           0 :                         object->length = test_var;
    5110             :                 } else {
    5111           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5112             :                           PyLong_Type.tp_name);
    5113           0 :                         return -1;
    5114             :                 }
    5115             :         }
    5116           0 :         return 0;
    5117             : }
    5118             : 
    5119           0 : static PyObject *py_dgram_message_get_offset(PyObject *obj, void *closure)
    5120             : {
    5121           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
    5122             :         PyObject *py_offset;
    5123           0 :         py_offset = PyLong_FromLong((uint16_t)object->offset);
    5124           0 :         return py_offset;
    5125             : }
    5126             : 
    5127           0 : static int py_dgram_message_set_offset(PyObject *py_obj, PyObject *value, void *closure)
    5128             : {
    5129           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
    5130           0 :         if (value == NULL) {
    5131           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->offset");
    5132           0 :                 return -1;
    5133             :         }
    5134             :         {
    5135           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->offset));
    5136           0 :                 if (PyLong_Check(value)) {
    5137             :                         unsigned long long test_var;
    5138           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5139           0 :                         if (PyErr_Occurred() != NULL) {
    5140           0 :                                 return -1;
    5141             :                         }
    5142           0 :                         if (test_var > uint_max) {
    5143           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5144             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5145           0 :                                 return -1;
    5146             :                         }
    5147           0 :                         object->offset = test_var;
    5148             :                 } else {
    5149           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5150             :                           PyLong_Type.tp_name);
    5151           0 :                         return -1;
    5152             :                 }
    5153             :         }
    5154           0 :         return 0;
    5155             : }
    5156             : 
    5157           0 : static PyObject *py_dgram_message_get_source_name(PyObject *obj, void *closure)
    5158             : {
    5159           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
    5160             :         PyObject *py_source_name;
    5161           0 :         py_source_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->source_name);
    5162           0 :         return py_source_name;
    5163             : }
    5164             : 
    5165           0 : static int py_dgram_message_set_source_name(PyObject *py_obj, PyObject *value, void *closure)
    5166             : {
    5167           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
    5168           0 :         if (value == NULL) {
    5169           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source_name");
    5170           0 :                 return -1;
    5171             :         }
    5172           0 :         PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
    5173           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5174           0 :                 PyErr_NoMemory();
    5175           0 :                 return -1;
    5176             :         }
    5177           0 :         object->source_name = *(struct nbt_name *)pytalloc_get_ptr(value);
    5178           0 :         return 0;
    5179             : }
    5180             : 
    5181           0 : static PyObject *py_dgram_message_get_dest_name(PyObject *obj, void *closure)
    5182             : {
    5183           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
    5184             :         PyObject *py_dest_name;
    5185           0 :         py_dest_name = pytalloc_reference_ex(&nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->dest_name);
    5186           0 :         return py_dest_name;
    5187             : }
    5188             : 
    5189           0 : static int py_dgram_message_set_dest_name(PyObject *py_obj, PyObject *value, void *closure)
    5190             : {
    5191           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
    5192           0 :         if (value == NULL) {
    5193           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dest_name");
    5194           0 :                 return -1;
    5195             :         }
    5196           0 :         PY_CHECK_TYPE(&nbt_name_Type, value, return -1;);
    5197           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5198           0 :                 PyErr_NoMemory();
    5199           0 :                 return -1;
    5200             :         }
    5201           0 :         object->dest_name = *(struct nbt_name *)pytalloc_get_ptr(value);
    5202           0 :         return 0;
    5203             : }
    5204             : 
    5205           0 : static PyObject *py_dgram_message_get_dgram_body_type(PyObject *obj, void *closure)
    5206             : {
    5207           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
    5208             :         PyObject *py_dgram_body_type;
    5209           0 :         py_dgram_body_type = PyLong_FromUnsignedLongLong((uint32_t)object->dgram_body_type);
    5210           0 :         return py_dgram_body_type;
    5211             : }
    5212             : 
    5213           0 : static int py_dgram_message_set_dgram_body_type(PyObject *py_obj, PyObject *value, void *closure)
    5214             : {
    5215           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
    5216           0 :         if (value == NULL) {
    5217           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dgram_body_type");
    5218           0 :                 return -1;
    5219             :         }
    5220             :         {
    5221           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_body_type));
    5222           0 :                 if (PyLong_Check(value)) {
    5223             :                         unsigned long long test_var;
    5224           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5225           0 :                         if (PyErr_Occurred() != NULL) {
    5226           0 :                                 return -1;
    5227             :                         }
    5228           0 :                         if (test_var > uint_max) {
    5229           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5230             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5231           0 :                                 return -1;
    5232             :                         }
    5233           0 :                         object->dgram_body_type = test_var;
    5234             :                 } else {
    5235           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5236             :                           PyLong_Type.tp_name);
    5237           0 :                         return -1;
    5238             :                 }
    5239             :         }
    5240           0 :         return 0;
    5241             : }
    5242             : 
    5243           0 : static PyObject *py_dgram_message_get_body(PyObject *obj, void *closure)
    5244             : {
    5245           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(obj);
    5246             :         PyObject *py_body;
    5247           0 :         py_body = pyrpc_import_union(&dgram_message_body_Type, pytalloc_get_mem_ctx(obj), object->dgram_body_type, &object->body, "union dgram_message_body");
    5248           0 :         if (py_body == NULL) {
    5249           0 :                 return NULL;
    5250             :         }
    5251           0 :         return py_body;
    5252             : }
    5253             : 
    5254           0 : static int py_dgram_message_set_body(PyObject *py_obj, PyObject *value, void *closure)
    5255             : {
    5256           0 :         struct dgram_message *object = (struct dgram_message *)pytalloc_get_ptr(py_obj);
    5257           0 :         if (value == NULL) {
    5258           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->body");
    5259           0 :                 return -1;
    5260             :         }
    5261             :         {
    5262             :                 union dgram_message_body *body_switch_0;
    5263           0 :                 body_switch_0 = (union dgram_message_body *)pyrpc_export_union(&dgram_message_body_Type, pytalloc_get_mem_ctx(py_obj), object->dgram_body_type, value, "union dgram_message_body");
    5264           0 :                 if (body_switch_0 == NULL) {
    5265           0 :                         return -1;
    5266             :                 }
    5267           0 :                 object->body = *body_switch_0;
    5268             :         }
    5269           0 :         return 0;
    5270             : }
    5271             : 
    5272             : static PyGetSetDef py_dgram_message_getsetters[] = {
    5273             :         {
    5274             :                 .name = discard_const_p(char, "length"),
    5275             :                 .get = py_dgram_message_get_length,
    5276             :                 .set = py_dgram_message_set_length,
    5277             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5278             :         },
    5279             :         {
    5280             :                 .name = discard_const_p(char, "offset"),
    5281             :                 .get = py_dgram_message_get_offset,
    5282             :                 .set = py_dgram_message_set_offset,
    5283             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5284             :         },
    5285             :         {
    5286             :                 .name = discard_const_p(char, "source_name"),
    5287             :                 .get = py_dgram_message_get_source_name,
    5288             :                 .set = py_dgram_message_set_source_name,
    5289             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
    5290             :         },
    5291             :         {
    5292             :                 .name = discard_const_p(char, "dest_name"),
    5293             :                 .get = py_dgram_message_get_dest_name,
    5294             :                 .set = py_dgram_message_set_dest_name,
    5295             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
    5296             :         },
    5297             :         {
    5298             :                 .name = discard_const_p(char, "dgram_body_type"),
    5299             :                 .get = py_dgram_message_get_dgram_body_type,
    5300             :                 .set = py_dgram_message_set_dgram_body_type,
    5301             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5302             :         },
    5303             :         {
    5304             :                 .name = discard_const_p(char, "body"),
    5305             :                 .get = py_dgram_message_get_body,
    5306             :                 .set = py_dgram_message_set_body,
    5307             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dgram_message_body")
    5308             :         },
    5309             :         { .name = NULL }
    5310             : };
    5311             : 
    5312           0 : static PyObject *py_dgram_message_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5313             : {
    5314           0 :         return pytalloc_new(struct dgram_message, type);
    5315             : }
    5316             : 
    5317             : 
    5318             : static PyTypeObject dgram_message_Type = {
    5319             :         PyVarObject_HEAD_INIT(NULL, 0)
    5320             :         .tp_name = "nbt.dgram_message",
    5321             :         .tp_getset = py_dgram_message_getsetters,
    5322             :         .tp_methods = NULL,
    5323             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5324             :         .tp_new = py_dgram_message_new,
    5325             : };
    5326             : 
    5327           0 : static PyObject *py_import_dgram_data(TALLOC_CTX *mem_ctx, int level, union dgram_data *in)
    5328             : {
    5329             :         PyObject *ret;
    5330             : 
    5331           0 :         switch (level) {
    5332           0 :                 case DGRAM_DIRECT_UNIQUE:
    5333           0 :                         ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
    5334           0 :                         return ret;
    5335             : 
    5336           0 :                 case DGRAM_DIRECT_GROUP:
    5337           0 :                         ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
    5338           0 :                         return ret;
    5339             : 
    5340           0 :                 case DGRAM_BCAST:
    5341           0 :                         ret = pytalloc_reference_ex(&dgram_message_Type, mem_ctx, &in->msg);
    5342           0 :                         return ret;
    5343             : 
    5344           0 :                 case DGRAM_ERROR:
    5345           0 :                         ret = PyLong_FromLong((uint16_t)in->error);
    5346           0 :                         return ret;
    5347             : 
    5348           0 :                 case DGRAM_QUERY:
    5349           0 :                         ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
    5350           0 :                         return ret;
    5351             : 
    5352           0 :                 case DGRAM_QUERY_POSITIVE:
    5353           0 :                         ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
    5354           0 :                         return ret;
    5355             : 
    5356           0 :                 case DGRAM_QUERY_NEGATIVE:
    5357           0 :                         ret = pytalloc_reference_ex(&nbt_name_Type, mem_ctx, &in->dest_name);
    5358           0 :                         return ret;
    5359             : 
    5360             :         }
    5361           0 :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    5362           0 :         return NULL;
    5363             : }
    5364             : 
    5365           0 : static union dgram_data *py_export_dgram_data(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    5366             : {
    5367           0 :         union dgram_data *ret = talloc_zero(mem_ctx, union dgram_data);
    5368           0 :         switch (level) {
    5369           0 :                 case DGRAM_DIRECT_UNIQUE:
    5370           0 :                         if (in == NULL) {
    5371           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
    5372           0 :                                 talloc_free(ret); return NULL;
    5373             :                         }
    5374           0 :                         PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
    5375           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    5376           0 :                                 PyErr_NoMemory();
    5377           0 :                                 talloc_free(ret); return NULL;
    5378             :                         }
    5379           0 :                         ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
    5380           0 :                         break;
    5381             : 
    5382           0 :                 case DGRAM_DIRECT_GROUP:
    5383           0 :                         if (in == NULL) {
    5384           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
    5385           0 :                                 talloc_free(ret); return NULL;
    5386             :                         }
    5387           0 :                         PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
    5388           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    5389           0 :                                 PyErr_NoMemory();
    5390           0 :                                 talloc_free(ret); return NULL;
    5391             :                         }
    5392           0 :                         ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
    5393           0 :                         break;
    5394             : 
    5395           0 :                 case DGRAM_BCAST:
    5396           0 :                         if (in == NULL) {
    5397           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->msg");
    5398           0 :                                 talloc_free(ret); return NULL;
    5399             :                         }
    5400           0 :                         PY_CHECK_TYPE(&dgram_message_Type, in, talloc_free(ret); return NULL;);
    5401           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    5402           0 :                                 PyErr_NoMemory();
    5403           0 :                                 talloc_free(ret); return NULL;
    5404             :                         }
    5405           0 :                         ret->msg = *(struct dgram_message *)pytalloc_get_ptr(in);
    5406           0 :                         break;
    5407             : 
    5408           0 :                 case DGRAM_ERROR:
    5409           0 :                         if (in == NULL) {
    5410           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->error");
    5411           0 :                                 talloc_free(ret); return NULL;
    5412             :                         }
    5413             :                         {
    5414           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->error));
    5415           0 :                                 if (PyLong_Check(in)) {
    5416             :                                         unsigned long long test_var;
    5417           0 :                                         test_var = PyLong_AsUnsignedLongLong(in);
    5418           0 :                                         if (PyErr_Occurred() != NULL) {
    5419           0 :                                                 talloc_free(ret); return NULL;
    5420             :                                         }
    5421           0 :                                         if (test_var > uint_max) {
    5422           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5423             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    5424           0 :                                                 talloc_free(ret); return NULL;
    5425             :                                         }
    5426           0 :                                         ret->error = test_var;
    5427             :                                 } else {
    5428           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5429             :                                           PyLong_Type.tp_name);
    5430           0 :                                         talloc_free(ret); return NULL;
    5431             :                                 }
    5432             :                         }
    5433           0 :                         break;
    5434             : 
    5435           0 :                 case DGRAM_QUERY:
    5436           0 :                         if (in == NULL) {
    5437           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
    5438           0 :                                 talloc_free(ret); return NULL;
    5439             :                         }
    5440           0 :                         PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
    5441           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    5442           0 :                                 PyErr_NoMemory();
    5443           0 :                                 talloc_free(ret); return NULL;
    5444             :                         }
    5445           0 :                         ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
    5446           0 :                         break;
    5447             : 
    5448           0 :                 case DGRAM_QUERY_POSITIVE:
    5449           0 :                         if (in == NULL) {
    5450           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
    5451           0 :                                 talloc_free(ret); return NULL;
    5452             :                         }
    5453           0 :                         PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
    5454           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    5455           0 :                                 PyErr_NoMemory();
    5456           0 :                                 talloc_free(ret); return NULL;
    5457             :                         }
    5458           0 :                         ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
    5459           0 :                         break;
    5460             : 
    5461           0 :                 case DGRAM_QUERY_NEGATIVE:
    5462           0 :                         if (in == NULL) {
    5463           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dest_name");
    5464           0 :                                 talloc_free(ret); return NULL;
    5465             :                         }
    5466           0 :                         PY_CHECK_TYPE(&nbt_name_Type, in, talloc_free(ret); return NULL;);
    5467           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    5468           0 :                                 PyErr_NoMemory();
    5469           0 :                                 talloc_free(ret); return NULL;
    5470             :                         }
    5471           0 :                         ret->dest_name = *(struct nbt_name *)pytalloc_get_ptr(in);
    5472           0 :                         break;
    5473             : 
    5474           0 :                 default:
    5475           0 :                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
    5476           0 :                         talloc_free(ret);
    5477           0 :                         ret = NULL;
    5478             :         }
    5479             : 
    5480           0 :         return ret;
    5481             : }
    5482             : 
    5483           0 : static PyObject *py_dgram_data_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5484             : {
    5485           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    5486           0 :         PyObject *mem_ctx_obj = NULL;
    5487           0 :         TALLOC_CTX *mem_ctx = NULL;
    5488           0 :         int level = 0;
    5489           0 :         PyObject *in_obj = NULL;
    5490           0 :         union dgram_data *in = NULL;
    5491             : 
    5492           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    5493             :                 discard_const_p(char *, kwnames),
    5494             :                 &mem_ctx_obj,
    5495             :                 &level,
    5496             :                 &in_obj)) {
    5497           0 :                 return NULL;
    5498             :         }
    5499           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    5500           0 :         if (mem_ctx == NULL) {
    5501           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    5502           0 :                 return NULL;
    5503             :         }
    5504           0 :         in = (union dgram_data *)pytalloc_get_ptr(in_obj);
    5505           0 :         if (in == NULL) {
    5506           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dgram_data!");
    5507           0 :                 return NULL;
    5508             :         }
    5509             : 
    5510           0 :         return py_import_dgram_data(mem_ctx, level, in);
    5511             : }
    5512             : 
    5513           0 : static PyObject *py_dgram_data_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5514             : {
    5515           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    5516           0 :         PyObject *mem_ctx_obj = NULL;
    5517           0 :         TALLOC_CTX *mem_ctx = NULL;
    5518           0 :         int level = 0;
    5519           0 :         PyObject *in = NULL;
    5520           0 :         union dgram_data *out = NULL;
    5521             : 
    5522           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    5523             :                 discard_const_p(char *, kwnames),
    5524             :                 &mem_ctx_obj,
    5525             :                 &level,
    5526             :                 &in)) {
    5527           0 :                 return NULL;
    5528             :         }
    5529           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    5530           0 :         if (mem_ctx == NULL) {
    5531           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    5532           0 :                 return NULL;
    5533             :         }
    5534             : 
    5535           0 :         out = py_export_dgram_data(mem_ctx, level, in);
    5536           0 :         if (out == NULL) {
    5537           0 :                 return NULL;
    5538             :         }
    5539             : 
    5540           0 :         return pytalloc_GenericObject_reference(out);
    5541             : }
    5542             : 
    5543             : static PyMethodDef py_dgram_data_methods[] = {
    5544             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_import),
    5545             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    5546             :                 "T.__import__(mem_ctx, level, in) => ret." },
    5547             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dgram_data_export),
    5548             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    5549             :                 "T.__export__(mem_ctx, level, in) => ret." },
    5550             :         { NULL, NULL, 0, NULL }
    5551             : };
    5552             : 
    5553           0 : static PyObject *py_dgram_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5554             : {
    5555           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    5556           0 :         return NULL;
    5557             : }
    5558             : 
    5559             : 
    5560             : static PyTypeObject dgram_data_Type = {
    5561             :         PyVarObject_HEAD_INIT(NULL, 0)
    5562             :         .tp_name = "nbt.dgram_data",
    5563             :         .tp_getset = NULL,
    5564             :         .tp_methods = py_dgram_data_methods,
    5565             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5566             :         .tp_new = py_dgram_data_new,
    5567             : };
    5568             : 
    5569             : 
    5570           0 : static PyObject *py_nbt_dgram_packet_get_msg_type(PyObject *obj, void *closure)
    5571             : {
    5572           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
    5573             :         PyObject *py_msg_type;
    5574           0 :         py_msg_type = PyLong_FromLong((uint16_t)object->msg_type);
    5575           0 :         return py_msg_type;
    5576             : }
    5577             : 
    5578           0 : static int py_nbt_dgram_packet_set_msg_type(PyObject *py_obj, PyObject *value, void *closure)
    5579             : {
    5580           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5581           0 :         if (value == NULL) {
    5582           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->msg_type");
    5583           0 :                 return -1;
    5584             :         }
    5585             :         {
    5586           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->msg_type));
    5587           0 :                 if (PyLong_Check(value)) {
    5588             :                         unsigned long long test_var;
    5589           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5590           0 :                         if (PyErr_Occurred() != NULL) {
    5591           0 :                                 return -1;
    5592             :                         }
    5593           0 :                         if (test_var > uint_max) {
    5594           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5595             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5596           0 :                                 return -1;
    5597             :                         }
    5598           0 :                         object->msg_type = test_var;
    5599             :                 } else {
    5600           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5601             :                           PyLong_Type.tp_name);
    5602           0 :                         return -1;
    5603             :                 }
    5604             :         }
    5605           0 :         return 0;
    5606             : }
    5607             : 
    5608           0 : static PyObject *py_nbt_dgram_packet_get_flags(PyObject *obj, void *closure)
    5609             : {
    5610           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
    5611             :         PyObject *py_flags;
    5612           0 :         py_flags = PyLong_FromLong((uint16_t)object->flags);
    5613           0 :         return py_flags;
    5614             : }
    5615             : 
    5616           0 : static int py_nbt_dgram_packet_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    5617             : {
    5618           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5619           0 :         if (value == NULL) {
    5620           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
    5621           0 :                 return -1;
    5622             :         }
    5623             :         {
    5624           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
    5625           0 :                 if (PyLong_Check(value)) {
    5626             :                         unsigned long long test_var;
    5627           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5628           0 :                         if (PyErr_Occurred() != NULL) {
    5629           0 :                                 return -1;
    5630             :                         }
    5631           0 :                         if (test_var > uint_max) {
    5632           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5633             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5634           0 :                                 return -1;
    5635             :                         }
    5636           0 :                         object->flags = test_var;
    5637             :                 } else {
    5638           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5639             :                           PyLong_Type.tp_name);
    5640           0 :                         return -1;
    5641             :                 }
    5642             :         }
    5643           0 :         return 0;
    5644             : }
    5645             : 
    5646           0 : static PyObject *py_nbt_dgram_packet_get_dgram_id(PyObject *obj, void *closure)
    5647             : {
    5648           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
    5649             :         PyObject *py_dgram_id;
    5650           0 :         py_dgram_id = PyLong_FromLong((uint16_t)object->dgram_id);
    5651           0 :         return py_dgram_id;
    5652             : }
    5653             : 
    5654           0 : static int py_nbt_dgram_packet_set_dgram_id(PyObject *py_obj, PyObject *value, void *closure)
    5655             : {
    5656           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5657           0 :         if (value == NULL) {
    5658           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dgram_id");
    5659           0 :                 return -1;
    5660             :         }
    5661             :         {
    5662           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dgram_id));
    5663           0 :                 if (PyLong_Check(value)) {
    5664             :                         unsigned long long test_var;
    5665           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5666           0 :                         if (PyErr_Occurred() != NULL) {
    5667           0 :                                 return -1;
    5668             :                         }
    5669           0 :                         if (test_var > uint_max) {
    5670           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5671             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5672           0 :                                 return -1;
    5673             :                         }
    5674           0 :                         object->dgram_id = test_var;
    5675             :                 } else {
    5676           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5677             :                           PyLong_Type.tp_name);
    5678           0 :                         return -1;
    5679             :                 }
    5680             :         }
    5681           0 :         return 0;
    5682             : }
    5683             : 
    5684           0 : static PyObject *py_nbt_dgram_packet_get_src_addr(PyObject *obj, void *closure)
    5685             : {
    5686           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
    5687             :         PyObject *py_src_addr;
    5688           0 :         py_src_addr = PyString_FromStringOrNULL(object->src_addr);
    5689           0 :         return py_src_addr;
    5690             : }
    5691             : 
    5692           0 : static int py_nbt_dgram_packet_set_src_addr(PyObject *py_obj, PyObject *value, void *closure)
    5693             : {
    5694           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5695           0 :         if (value == NULL) {
    5696           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->src_addr");
    5697           0 :                 return -1;
    5698             :         }
    5699             :         {
    5700             :                 const char *test_str;
    5701             :                 const char *talloc_str;
    5702           0 :                 PyObject *unicode = NULL;
    5703           0 :                 if (PyUnicode_Check(value)) {
    5704           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5705           0 :                         if (unicode == NULL) {
    5706           0 :                                 PyErr_NoMemory();
    5707           0 :                                 return -1;
    5708             :                         }
    5709           0 :                         test_str = PyBytes_AS_STRING(unicode);
    5710           0 :                 } else if (PyBytes_Check(value)) {
    5711           0 :                         test_str = PyBytes_AS_STRING(value);
    5712             :                 } else {
    5713           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5714           0 :                         return -1;
    5715             :                 }
    5716           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5717           0 :                 if (unicode != NULL) {
    5718           0 :                         Py_DECREF(unicode);
    5719             :                 }
    5720           0 :                 if (talloc_str == NULL) {
    5721           0 :                         PyErr_NoMemory();
    5722           0 :                         return -1;
    5723             :                 }
    5724           0 :                 object->src_addr = talloc_str;
    5725             :         }
    5726           0 :         return 0;
    5727             : }
    5728             : 
    5729           0 : static PyObject *py_nbt_dgram_packet_get_src_port(PyObject *obj, void *closure)
    5730             : {
    5731           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
    5732             :         PyObject *py_src_port;
    5733           0 :         py_src_port = PyLong_FromLong((uint16_t)object->src_port);
    5734           0 :         return py_src_port;
    5735             : }
    5736             : 
    5737           0 : static int py_nbt_dgram_packet_set_src_port(PyObject *py_obj, PyObject *value, void *closure)
    5738             : {
    5739           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5740           0 :         if (value == NULL) {
    5741           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->src_port");
    5742           0 :                 return -1;
    5743             :         }
    5744             :         {
    5745           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->src_port));
    5746           0 :                 if (PyLong_Check(value)) {
    5747             :                         unsigned long long test_var;
    5748           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5749           0 :                         if (PyErr_Occurred() != NULL) {
    5750           0 :                                 return -1;
    5751             :                         }
    5752           0 :                         if (test_var > uint_max) {
    5753           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5754             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5755           0 :                                 return -1;
    5756             :                         }
    5757           0 :                         object->src_port = test_var;
    5758             :                 } else {
    5759           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5760             :                           PyLong_Type.tp_name);
    5761           0 :                         return -1;
    5762             :                 }
    5763             :         }
    5764           0 :         return 0;
    5765             : }
    5766             : 
    5767           0 : static PyObject *py_nbt_dgram_packet_get_data(PyObject *obj, void *closure)
    5768             : {
    5769           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(obj);
    5770             :         PyObject *py_data;
    5771           0 :         py_data = pyrpc_import_union(&dgram_data_Type, pytalloc_get_mem_ctx(obj), object->msg_type, &object->data, "union dgram_data");
    5772           0 :         if (py_data == NULL) {
    5773           0 :                 return NULL;
    5774             :         }
    5775           0 :         return py_data;
    5776             : }
    5777             : 
    5778           0 : static int py_nbt_dgram_packet_set_data(PyObject *py_obj, PyObject *value, void *closure)
    5779             : {
    5780           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5781           0 :         if (value == NULL) {
    5782           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
    5783           0 :                 return -1;
    5784             :         }
    5785             :         {
    5786             :                 union dgram_data *data_switch_0;
    5787           0 :                 data_switch_0 = (union dgram_data *)pyrpc_export_union(&dgram_data_Type, pytalloc_get_mem_ctx(py_obj), object->msg_type, value, "union dgram_data");
    5788           0 :                 if (data_switch_0 == NULL) {
    5789           0 :                         return -1;
    5790             :                 }
    5791           0 :                 object->data = *data_switch_0;
    5792             :         }
    5793           0 :         return 0;
    5794             : }
    5795             : 
    5796             : static PyGetSetDef py_nbt_dgram_packet_getsetters[] = {
    5797             :         {
    5798             :                 .name = discard_const_p(char, "msg_type"),
    5799             :                 .get = py_nbt_dgram_packet_get_msg_type,
    5800             :                 .set = py_nbt_dgram_packet_set_msg_type,
    5801             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dgram_msg_type")
    5802             :         },
    5803             :         {
    5804             :                 .name = discard_const_p(char, "flags"),
    5805             :                 .get = py_nbt_dgram_packet_get_flags,
    5806             :                 .set = py_nbt_dgram_packet_set_flags,
    5807             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dgram_flags")
    5808             :         },
    5809             :         {
    5810             :                 .name = discard_const_p(char, "dgram_id"),
    5811             :                 .get = py_nbt_dgram_packet_get_dgram_id,
    5812             :                 .set = py_nbt_dgram_packet_set_dgram_id,
    5813             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5814             :         },
    5815             :         {
    5816             :                 .name = discard_const_p(char, "src_addr"),
    5817             :                 .get = py_nbt_dgram_packet_get_src_addr,
    5818             :                 .set = py_nbt_dgram_packet_set_src_addr,
    5819             :                 .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
    5820             :         },
    5821             :         {
    5822             :                 .name = discard_const_p(char, "src_port"),
    5823             :                 .get = py_nbt_dgram_packet_get_src_port,
    5824             :                 .set = py_nbt_dgram_packet_set_src_port,
    5825             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5826             :         },
    5827             :         {
    5828             :                 .name = discard_const_p(char, "data"),
    5829             :                 .get = py_nbt_dgram_packet_get_data,
    5830             :                 .set = py_nbt_dgram_packet_set_data,
    5831             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dgram_data")
    5832             :         },
    5833             :         { .name = NULL }
    5834             : };
    5835             : 
    5836           0 : static PyObject *py_nbt_dgram_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5837             : {
    5838           0 :         return pytalloc_new(struct nbt_dgram_packet, type);
    5839             : }
    5840             : 
    5841           0 : static PyObject *py_nbt_dgram_packet_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    5842             : {
    5843           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5844           0 :         PyObject *ret = NULL;
    5845             :         DATA_BLOB blob;
    5846             :         enum ndr_err_code err;
    5847           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    5848           0 :         if (tmp_ctx == NULL) {
    5849           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5850           0 :                 return NULL;
    5851             :         }
    5852           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_dgram_packet);
    5853           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5854           0 :                 TALLOC_FREE(tmp_ctx);
    5855           0 :                 PyErr_SetNdrError(err);
    5856           0 :                 return NULL;
    5857             :         }
    5858             : 
    5859           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5860           0 :         TALLOC_FREE(tmp_ctx);
    5861           0 :         return ret;
    5862             : }
    5863             : 
    5864           0 : static PyObject *py_nbt_dgram_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5865             : {
    5866           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5867           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    5868           0 :         Py_ssize_t blob_length = 0;
    5869             :         enum ndr_err_code err;
    5870           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    5871           0 :         PyObject *allow_remaining_obj = NULL;
    5872           0 :         bool allow_remaining = false;
    5873             : 
    5874           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    5875             :                 discard_const_p(char *, kwnames),
    5876             :                 &blob.data, &blob_length,
    5877             :                 &allow_remaining_obj)) {
    5878           0 :                 return NULL;
    5879             :         }
    5880           0 :         blob.length = blob_length;
    5881             : 
    5882           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5883           0 :                 allow_remaining = true;
    5884             :         }
    5885             : 
    5886           0 :         if (allow_remaining) {
    5887           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
    5888             :         } else {
    5889           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet);
    5890             :         }
    5891           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5892           0 :                 PyErr_SetNdrError(err);
    5893           0 :                 return NULL;
    5894             :         }
    5895             : 
    5896           0 :         Py_RETURN_NONE;
    5897             : }
    5898             : 
    5899           0 : static PyObject *py_nbt_dgram_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5900             : {
    5901           0 :         struct nbt_dgram_packet *object = (struct nbt_dgram_packet *)pytalloc_get_ptr(py_obj);
    5902             :         PyObject *ret;
    5903             :         char *retstr;
    5904             : 
    5905           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_dgram_packet, "nbt_dgram_packet", object);
    5906           0 :         ret = PyUnicode_FromString(retstr);
    5907           0 :         talloc_free(retstr);
    5908             : 
    5909           0 :         return ret;
    5910             : }
    5911             : 
    5912             : static PyMethodDef py_nbt_dgram_packet_methods[] = {
    5913             :         { "__ndr_pack__", (PyCFunction)py_nbt_dgram_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    5914             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_dgram_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    5915             :         { "__ndr_print__", (PyCFunction)py_nbt_dgram_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    5916             :         { NULL, NULL, 0, NULL }
    5917             : };
    5918             : 
    5919             : 
    5920             : static PyTypeObject nbt_dgram_packet_Type = {
    5921             :         PyVarObject_HEAD_INIT(NULL, 0)
    5922             :         .tp_name = "nbt.dgram_packet",
    5923             :         .tp_getset = py_nbt_dgram_packet_getsetters,
    5924             :         .tp_methods = py_nbt_dgram_packet_methods,
    5925             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5926             :         .tp_new = py_nbt_dgram_packet_new,
    5927             : };
    5928             : 
    5929             : 
    5930           0 : static PyObject *py_nbt_sockaddr_get_sockaddr_family(PyObject *obj, void *closure)
    5931             : {
    5932           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
    5933             :         PyObject *py_sockaddr_family;
    5934           0 :         py_sockaddr_family = PyLong_FromUnsignedLongLong((uint32_t)object->sockaddr_family);
    5935           0 :         return py_sockaddr_family;
    5936             : }
    5937             : 
    5938           0 : static int py_nbt_sockaddr_set_sockaddr_family(PyObject *py_obj, PyObject *value, void *closure)
    5939             : {
    5940           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
    5941           0 :         if (value == NULL) {
    5942           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr_family");
    5943           0 :                 return -1;
    5944             :         }
    5945             :         {
    5946           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_family));
    5947           0 :                 if (PyLong_Check(value)) {
    5948             :                         unsigned long long test_var;
    5949           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5950           0 :                         if (PyErr_Occurred() != NULL) {
    5951           0 :                                 return -1;
    5952             :                         }
    5953           0 :                         if (test_var > uint_max) {
    5954           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5955             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5956           0 :                                 return -1;
    5957             :                         }
    5958           0 :                         object->sockaddr_family = test_var;
    5959             :                 } else {
    5960           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5961             :                           PyLong_Type.tp_name);
    5962           0 :                         return -1;
    5963             :                 }
    5964             :         }
    5965           0 :         return 0;
    5966             : }
    5967             : 
    5968           0 : static PyObject *py_nbt_sockaddr_get_pdc_ip(PyObject *obj, void *closure)
    5969             : {
    5970           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
    5971             :         PyObject *py_pdc_ip;
    5972           0 :         py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
    5973           0 :         return py_pdc_ip;
    5974             : }
    5975             : 
    5976           0 : static int py_nbt_sockaddr_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
    5977             : {
    5978           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
    5979           0 :         if (value == NULL) {
    5980           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_ip");
    5981           0 :                 return -1;
    5982             :         }
    5983             :         {
    5984             :                 const char *test_str;
    5985             :                 const char *talloc_str;
    5986           0 :                 PyObject *unicode = NULL;
    5987           0 :                 if (PyUnicode_Check(value)) {
    5988           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5989           0 :                         if (unicode == NULL) {
    5990           0 :                                 PyErr_NoMemory();
    5991           0 :                                 return -1;
    5992             :                         }
    5993           0 :                         test_str = PyBytes_AS_STRING(unicode);
    5994           0 :                 } else if (PyBytes_Check(value)) {
    5995           0 :                         test_str = PyBytes_AS_STRING(value);
    5996             :                 } else {
    5997           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5998           0 :                         return -1;
    5999             :                 }
    6000           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6001           0 :                 if (unicode != NULL) {
    6002           0 :                         Py_DECREF(unicode);
    6003             :                 }
    6004           0 :                 if (talloc_str == NULL) {
    6005           0 :                         PyErr_NoMemory();
    6006           0 :                         return -1;
    6007             :                 }
    6008           0 :                 object->pdc_ip = talloc_str;
    6009             :         }
    6010           0 :         return 0;
    6011             : }
    6012             : 
    6013           0 : static PyObject *py_nbt_sockaddr_get_remaining(PyObject *obj, void *closure)
    6014             : {
    6015           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(obj);
    6016             :         PyObject *py_remaining;
    6017           0 :         py_remaining = PyBytes_FromStringAndSize((char *)(object->remaining).data, (object->remaining).length);
    6018           0 :         return py_remaining;
    6019             : }
    6020             : 
    6021           0 : static int py_nbt_sockaddr_set_remaining(PyObject *py_obj, PyObject *value, void *closure)
    6022             : {
    6023           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
    6024           0 :         if (value == NULL) {
    6025           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->remaining");
    6026           0 :                 return -1;
    6027             :         }
    6028           0 :         object->remaining = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    6029           0 :         return 0;
    6030             : }
    6031             : 
    6032             : static PyGetSetDef py_nbt_sockaddr_getsetters[] = {
    6033             :         {
    6034             :                 .name = discard_const_p(char, "sockaddr_family"),
    6035             :                 .get = py_nbt_sockaddr_get_sockaddr_family,
    6036             :                 .set = py_nbt_sockaddr_set_sockaddr_family,
    6037             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6038             :         },
    6039             :         {
    6040             :                 .name = discard_const_p(char, "pdc_ip"),
    6041             :                 .get = py_nbt_sockaddr_get_pdc_ip,
    6042             :                 .set = py_nbt_sockaddr_set_pdc_ip,
    6043             :                 .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
    6044             :         },
    6045             :         {
    6046             :                 .name = discard_const_p(char, "remaining"),
    6047             :                 .get = py_nbt_sockaddr_get_remaining,
    6048             :                 .set = py_nbt_sockaddr_set_remaining,
    6049             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    6050             :         },
    6051             :         { .name = NULL }
    6052             : };
    6053             : 
    6054           0 : static PyObject *py_nbt_sockaddr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6055             : {
    6056           0 :         return pytalloc_new(struct nbt_sockaddr, type);
    6057             : }
    6058             : 
    6059           0 : static PyObject *py_nbt_sockaddr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    6060             : {
    6061           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
    6062           0 :         PyObject *ret = NULL;
    6063             :         DATA_BLOB blob;
    6064             :         enum ndr_err_code err;
    6065           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    6066           0 :         if (tmp_ctx == NULL) {
    6067           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6068           0 :                 return NULL;
    6069             :         }
    6070           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr);
    6071           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6072           0 :                 TALLOC_FREE(tmp_ctx);
    6073           0 :                 PyErr_SetNdrError(err);
    6074           0 :                 return NULL;
    6075             :         }
    6076             : 
    6077           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6078           0 :         TALLOC_FREE(tmp_ctx);
    6079           0 :         return ret;
    6080             : }
    6081             : 
    6082           0 : static PyObject *py_nbt_sockaddr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6083             : {
    6084           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
    6085           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    6086           0 :         Py_ssize_t blob_length = 0;
    6087             :         enum ndr_err_code err;
    6088           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    6089           0 :         PyObject *allow_remaining_obj = NULL;
    6090           0 :         bool allow_remaining = false;
    6091             : 
    6092           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    6093             :                 discard_const_p(char *, kwnames),
    6094             :                 &blob.data, &blob_length,
    6095             :                 &allow_remaining_obj)) {
    6096           0 :                 return NULL;
    6097             :         }
    6098           0 :         blob.length = blob_length;
    6099             : 
    6100           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6101           0 :                 allow_remaining = true;
    6102             :         }
    6103             : 
    6104           0 :         if (allow_remaining) {
    6105           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
    6106             :         } else {
    6107           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_nbt_sockaddr);
    6108             :         }
    6109           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6110           0 :                 PyErr_SetNdrError(err);
    6111           0 :                 return NULL;
    6112             :         }
    6113             : 
    6114           0 :         Py_RETURN_NONE;
    6115             : }
    6116             : 
    6117           0 : static PyObject *py_nbt_sockaddr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6118             : {
    6119           0 :         struct nbt_sockaddr *object = (struct nbt_sockaddr *)pytalloc_get_ptr(py_obj);
    6120             :         PyObject *ret;
    6121             :         char *retstr;
    6122             : 
    6123           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_nbt_sockaddr, "nbt_sockaddr", object);
    6124           0 :         ret = PyUnicode_FromString(retstr);
    6125           0 :         talloc_free(retstr);
    6126             : 
    6127           0 :         return ret;
    6128             : }
    6129             : 
    6130             : static PyMethodDef py_nbt_sockaddr_methods[] = {
    6131             :         { "__ndr_pack__", (PyCFunction)py_nbt_sockaddr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    6132             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbt_sockaddr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    6133             :         { "__ndr_print__", (PyCFunction)py_nbt_sockaddr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    6134             :         { NULL, NULL, 0, NULL }
    6135             : };
    6136             : 
    6137             : 
    6138             : static PyTypeObject nbt_sockaddr_Type = {
    6139             :         PyVarObject_HEAD_INIT(NULL, 0)
    6140             :         .tp_name = "nbt.sockaddr",
    6141             :         .tp_getset = py_nbt_sockaddr_getsetters,
    6142             :         .tp_methods = py_nbt_sockaddr_methods,
    6143             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6144             :         .tp_new = py_nbt_sockaddr_new,
    6145             : };
    6146             : 
    6147             : 
    6148           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
    6149             : {
    6150           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6151             :         PyObject *py_request_count;
    6152           0 :         py_request_count = PyLong_FromLong((uint16_t)object->request_count);
    6153           0 :         return py_request_count;
    6154             : }
    6155             : 
    6156           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
    6157             : {
    6158           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6159           0 :         if (value == NULL) {
    6160           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->request_count");
    6161           0 :                 return -1;
    6162             :         }
    6163             :         {
    6164           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
    6165           0 :                 if (PyLong_Check(value)) {
    6166             :                         unsigned long long test_var;
    6167           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6168           0 :                         if (PyErr_Occurred() != NULL) {
    6169           0 :                                 return -1;
    6170             :                         }
    6171           0 :                         if (test_var > uint_max) {
    6172           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6173             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6174           0 :                                 return -1;
    6175             :                         }
    6176           0 :                         object->request_count = test_var;
    6177             :                 } else {
    6178           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6179             :                           PyLong_Type.tp_name);
    6180           0 :                         return -1;
    6181             :                 }
    6182             :         }
    6183           0 :         return 0;
    6184             : }
    6185             : 
    6186           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
    6187             : {
    6188           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6189             :         PyObject *py_computer_name;
    6190           0 :         py_computer_name = PyString_FromStringOrNULL(object->computer_name);
    6191           0 :         return py_computer_name;
    6192             : }
    6193             : 
    6194           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
    6195             : {
    6196           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6197           0 :         if (value == NULL) {
    6198           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
    6199           0 :                 return -1;
    6200             :         }
    6201             :         {
    6202             :                 const char *test_str;
    6203             :                 const char *talloc_str;
    6204           0 :                 PyObject *unicode = NULL;
    6205           0 :                 if (PyUnicode_Check(value)) {
    6206           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6207           0 :                         if (unicode == NULL) {
    6208           0 :                                 PyErr_NoMemory();
    6209           0 :                                 return -1;
    6210             :                         }
    6211           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6212           0 :                 } else if (PyBytes_Check(value)) {
    6213           0 :                         test_str = PyBytes_AS_STRING(value);
    6214             :                 } else {
    6215           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6216           0 :                         return -1;
    6217             :                 }
    6218           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6219           0 :                 if (unicode != NULL) {
    6220           0 :                         Py_DECREF(unicode);
    6221             :                 }
    6222           0 :                 if (talloc_str == NULL) {
    6223           0 :                         PyErr_NoMemory();
    6224           0 :                         return -1;
    6225             :                 }
    6226           0 :                 object->computer_name = talloc_str;
    6227             :         }
    6228           0 :         return 0;
    6229             : }
    6230             : 
    6231           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
    6232             : {
    6233           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6234             :         PyObject *py_user_name;
    6235           0 :         py_user_name = PyString_FromStringOrNULL(object->user_name);
    6236           0 :         return py_user_name;
    6237             : }
    6238             : 
    6239           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
    6240             : {
    6241           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6242           0 :         if (value == NULL) {
    6243           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
    6244           0 :                 return -1;
    6245             :         }
    6246             :         {
    6247             :                 const char *test_str;
    6248             :                 const char *talloc_str;
    6249           0 :                 PyObject *unicode = NULL;
    6250           0 :                 if (PyUnicode_Check(value)) {
    6251           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6252           0 :                         if (unicode == NULL) {
    6253           0 :                                 PyErr_NoMemory();
    6254           0 :                                 return -1;
    6255             :                         }
    6256           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6257           0 :                 } else if (PyBytes_Check(value)) {
    6258           0 :                         test_str = PyBytes_AS_STRING(value);
    6259             :                 } else {
    6260           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6261           0 :                         return -1;
    6262             :                 }
    6263           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6264           0 :                 if (unicode != NULL) {
    6265           0 :                         Py_DECREF(unicode);
    6266             :                 }
    6267           0 :                 if (talloc_str == NULL) {
    6268           0 :                         PyErr_NoMemory();
    6269           0 :                         return -1;
    6270             :                 }
    6271           0 :                 object->user_name = talloc_str;
    6272             :         }
    6273           0 :         return 0;
    6274             : }
    6275             : 
    6276           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
    6277             : {
    6278           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6279             :         PyObject *py_mailslot_name;
    6280           0 :         py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
    6281           0 :         return py_mailslot_name;
    6282             : }
    6283             : 
    6284           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
    6285             : {
    6286           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6287           0 :         if (value == NULL) {
    6288           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
    6289           0 :                 return -1;
    6290             :         }
    6291             :         {
    6292             :                 const char *test_str;
    6293             :                 const char *talloc_str;
    6294           0 :                 PyObject *unicode = NULL;
    6295           0 :                 if (PyUnicode_Check(value)) {
    6296           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6297           0 :                         if (unicode == NULL) {
    6298           0 :                                 PyErr_NoMemory();
    6299           0 :                                 return -1;
    6300             :                         }
    6301           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6302           0 :                 } else if (PyBytes_Check(value)) {
    6303           0 :                         test_str = PyBytes_AS_STRING(value);
    6304             :                 } else {
    6305           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6306           0 :                         return -1;
    6307             :                 }
    6308           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6309           0 :                 if (unicode != NULL) {
    6310           0 :                         Py_DECREF(unicode);
    6311             :                 }
    6312           0 :                 if (talloc_str == NULL) {
    6313           0 :                         PyErr_NoMemory();
    6314           0 :                         return -1;
    6315             :                 }
    6316           0 :                 object->mailslot_name = talloc_str;
    6317             :         }
    6318           0 :         return 0;
    6319             : }
    6320             : 
    6321           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control(PyObject *obj, void *closure)
    6322             : {
    6323           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6324             :         PyObject *py_acct_control;
    6325           0 :         py_acct_control = PyLong_FromUnsignedLongLong((uint32_t)object->acct_control);
    6326           0 :         return py_acct_control;
    6327             : }
    6328             : 
    6329           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control(PyObject *py_obj, PyObject *value, void *closure)
    6330             : {
    6331           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6332           0 :         if (value == NULL) {
    6333           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_control");
    6334           0 :                 return -1;
    6335             :         }
    6336             :         {
    6337           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_control));
    6338           0 :                 if (PyLong_Check(value)) {
    6339             :                         unsigned long long test_var;
    6340           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6341           0 :                         if (PyErr_Occurred() != NULL) {
    6342           0 :                                 return -1;
    6343             :                         }
    6344           0 :                         if (test_var > uint_max) {
    6345           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6346             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6347           0 :                                 return -1;
    6348             :                         }
    6349           0 :                         object->acct_control = test_var;
    6350             :                 } else {
    6351           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6352             :                           PyLong_Type.tp_name);
    6353           0 :                         return -1;
    6354             :                 }
    6355             :         }
    6356           0 :         return 0;
    6357             : }
    6358             : 
    6359           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size(PyObject *obj, void *closure)
    6360             : {
    6361           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6362             :         PyObject *py_sid_size;
    6363           0 :         py_sid_size = PyLong_FromUnsignedLongLong((uint32_t)object->sid_size);
    6364           0 :         return py_sid_size;
    6365             : }
    6366             : 
    6367           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size(PyObject *py_obj, PyObject *value, void *closure)
    6368             : {
    6369           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6370           0 :         if (value == NULL) {
    6371           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_size");
    6372           0 :                 return -1;
    6373             :         }
    6374             :         {
    6375           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_size));
    6376           0 :                 if (PyLong_Check(value)) {
    6377             :                         unsigned long long test_var;
    6378           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6379           0 :                         if (PyErr_Occurred() != NULL) {
    6380           0 :                                 return -1;
    6381             :                         }
    6382           0 :                         if (test_var > uint_max) {
    6383           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6384             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6385           0 :                                 return -1;
    6386             :                         }
    6387           0 :                         object->sid_size = test_var;
    6388             :                 } else {
    6389           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6390             :                           PyLong_Type.tp_name);
    6391           0 :                         return -1;
    6392             :                 }
    6393             :         }
    6394           0 :         return 0;
    6395             : }
    6396             : 
    6397           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get__pad(PyObject *obj, void *closure)
    6398             : {
    6399           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6400             :         PyObject *py__pad;
    6401           0 :         py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
    6402           0 :         return py__pad;
    6403             : }
    6404             : 
    6405           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set__pad(PyObject *py_obj, PyObject *value, void *closure)
    6406             : {
    6407           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6408           0 :         if (value == NULL) {
    6409           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
    6410           0 :                 return -1;
    6411             :         }
    6412           0 :         object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    6413           0 :         return 0;
    6414             : }
    6415             : 
    6416           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_sid(PyObject *obj, void *closure)
    6417             : {
    6418           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6419             :         PyObject *py_sid;
    6420           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
    6421           0 :         return py_sid;
    6422             : }
    6423             : 
    6424           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    6425             : {
    6426           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6427           0 :         if (value == NULL) {
    6428           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
    6429           0 :                 return -1;
    6430             :         }
    6431           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    6432           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6433           0 :                 PyErr_NoMemory();
    6434           0 :                 return -1;
    6435             :         }
    6436           0 :         object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
    6437           0 :         return 0;
    6438             : }
    6439             : 
    6440           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version(PyObject *obj, void *closure)
    6441             : {
    6442           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6443             :         PyObject *py_nt_version;
    6444           0 :         py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
    6445           0 :         return py_nt_version;
    6446             : }
    6447             : 
    6448           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
    6449             : {
    6450           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6451           0 :         if (value == NULL) {
    6452           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
    6453           0 :                 return -1;
    6454             :         }
    6455             :         {
    6456           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
    6457           0 :                 if (PyLong_Check(value)) {
    6458             :                         unsigned long long test_var;
    6459           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6460           0 :                         if (PyErr_Occurred() != NULL) {
    6461           0 :                                 return -1;
    6462             :                         }
    6463           0 :                         if (test_var > uint_max) {
    6464           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6465             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6466           0 :                                 return -1;
    6467             :                         }
    6468           0 :                         object->nt_version = test_var;
    6469             :                 } else {
    6470           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6471             :                           PyLong_Type.tp_name);
    6472           0 :                         return -1;
    6473             :                 }
    6474             :         }
    6475           0 :         return 0;
    6476             : }
    6477             : 
    6478           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
    6479             : {
    6480           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6481             :         PyObject *py_lmnt_token;
    6482           0 :         py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
    6483           0 :         return py_lmnt_token;
    6484             : }
    6485             : 
    6486           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
    6487             : {
    6488           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6489           0 :         if (value == NULL) {
    6490           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
    6491           0 :                 return -1;
    6492             :         }
    6493             :         {
    6494           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
    6495           0 :                 if (PyLong_Check(value)) {
    6496             :                         unsigned long long test_var;
    6497           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6498           0 :                         if (PyErr_Occurred() != NULL) {
    6499           0 :                                 return -1;
    6500             :                         }
    6501           0 :                         if (test_var > uint_max) {
    6502           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6503             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6504           0 :                                 return -1;
    6505             :                         }
    6506           0 :                         object->lmnt_token = test_var;
    6507             :                 } else {
    6508           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6509             :                           PyLong_Type.tp_name);
    6510           0 :                         return -1;
    6511             :                 }
    6512             :         }
    6513           0 :         return 0;
    6514             : }
    6515             : 
    6516           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
    6517             : {
    6518           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6519             :         PyObject *py_lm20_token;
    6520           0 :         py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
    6521           0 :         return py_lm20_token;
    6522             : }
    6523             : 
    6524           0 : static int py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
    6525             : {
    6526           0 :         struct NETLOGON_SAM_LOGON_REQUEST *object = (struct NETLOGON_SAM_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6527           0 :         if (value == NULL) {
    6528           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
    6529           0 :                 return -1;
    6530             :         }
    6531             :         {
    6532           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
    6533           0 :                 if (PyLong_Check(value)) {
    6534             :                         unsigned long long test_var;
    6535           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6536           0 :                         if (PyErr_Occurred() != NULL) {
    6537           0 :                                 return -1;
    6538             :                         }
    6539           0 :                         if (test_var > uint_max) {
    6540           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6541             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6542           0 :                                 return -1;
    6543             :                         }
    6544           0 :                         object->lm20_token = test_var;
    6545             :                 } else {
    6546           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6547             :                           PyLong_Type.tp_name);
    6548           0 :                         return -1;
    6549             :                 }
    6550             :         }
    6551           0 :         return 0;
    6552             : }
    6553             : 
    6554             : static PyGetSetDef py_NETLOGON_SAM_LOGON_REQUEST_getsetters[] = {
    6555             :         {
    6556             :                 .name = discard_const_p(char, "request_count"),
    6557             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_request_count,
    6558             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_request_count,
    6559             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6560             :         },
    6561             :         {
    6562             :                 .name = discard_const_p(char, "computer_name"),
    6563             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_computer_name,
    6564             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_computer_name,
    6565             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    6566             :         },
    6567             :         {
    6568             :                 .name = discard_const_p(char, "user_name"),
    6569             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_user_name,
    6570             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_user_name,
    6571             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    6572             :         },
    6573             :         {
    6574             :                 .name = discard_const_p(char, "mailslot_name"),
    6575             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_mailslot_name,
    6576             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_mailslot_name,
    6577             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    6578             :         },
    6579             :         {
    6580             :                 .name = discard_const_p(char, "acct_control"),
    6581             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_acct_control,
    6582             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_acct_control,
    6583             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6584             :         },
    6585             :         {
    6586             :                 .name = discard_const_p(char, "sid_size"),
    6587             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid_size,
    6588             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid_size,
    6589             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6590             :         },
    6591             :         {
    6592             :                 .name = discard_const_p(char, "_pad"),
    6593             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get__pad,
    6594             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set__pad,
    6595             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    6596             :         },
    6597             :         {
    6598             :                 .name = discard_const_p(char, "sid"),
    6599             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_sid,
    6600             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_sid,
    6601             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid0")
    6602             :         },
    6603             :         {
    6604             :                 .name = discard_const_p(char, "nt_version"),
    6605             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_nt_version,
    6606             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_nt_version,
    6607             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
    6608             :         },
    6609             :         {
    6610             :                 .name = discard_const_p(char, "lmnt_token"),
    6611             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lmnt_token,
    6612             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lmnt_token,
    6613             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6614             :         },
    6615             :         {
    6616             :                 .name = discard_const_p(char, "lm20_token"),
    6617             :                 .get = py_NETLOGON_SAM_LOGON_REQUEST_get_lm20_token,
    6618             :                 .set = py_NETLOGON_SAM_LOGON_REQUEST_set_lm20_token,
    6619             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6620             :         },
    6621             :         { .name = NULL }
    6622             : };
    6623             : 
    6624           0 : static PyObject *py_NETLOGON_SAM_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6625             : {
    6626           0 :         return pytalloc_new(struct NETLOGON_SAM_LOGON_REQUEST, type);
    6627             : }
    6628             : 
    6629             : 
    6630             : static PyTypeObject NETLOGON_SAM_LOGON_REQUEST_Type = {
    6631             :         PyVarObject_HEAD_INIT(NULL, 0)
    6632             :         .tp_name = "nbt.NETLOGON_SAM_LOGON_REQUEST",
    6633             :         .tp_getset = py_NETLOGON_SAM_LOGON_REQUEST_getsetters,
    6634             :         .tp_methods = NULL,
    6635             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6636             :         .tp_new = py_NETLOGON_SAM_LOGON_REQUEST_new,
    6637             : };
    6638             : 
    6639             : 
    6640           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_computer_name(PyObject *obj, void *closure)
    6641             : {
    6642           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6643             :         PyObject *py_computer_name;
    6644           0 :         py_computer_name = PyString_FromStringOrNULL(object->computer_name);
    6645           0 :         return py_computer_name;
    6646             : }
    6647             : 
    6648           0 : static int py_NETLOGON_LOGON_REQUEST_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
    6649             : {
    6650           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6651           0 :         if (value == NULL) {
    6652           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
    6653           0 :                 return -1;
    6654             :         }
    6655             :         {
    6656             :                 const char *test_str;
    6657             :                 const char *talloc_str;
    6658           0 :                 PyObject *unicode = NULL;
    6659           0 :                 if (PyUnicode_Check(value)) {
    6660           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6661           0 :                         if (unicode == NULL) {
    6662           0 :                                 PyErr_NoMemory();
    6663           0 :                                 return -1;
    6664             :                         }
    6665           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6666           0 :                 } else if (PyBytes_Check(value)) {
    6667           0 :                         test_str = PyBytes_AS_STRING(value);
    6668             :                 } else {
    6669           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6670           0 :                         return -1;
    6671             :                 }
    6672           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6673           0 :                 if (unicode != NULL) {
    6674           0 :                         Py_DECREF(unicode);
    6675             :                 }
    6676           0 :                 if (talloc_str == NULL) {
    6677           0 :                         PyErr_NoMemory();
    6678           0 :                         return -1;
    6679             :                 }
    6680           0 :                 object->computer_name = talloc_str;
    6681             :         }
    6682           0 :         return 0;
    6683             : }
    6684             : 
    6685           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_user_name(PyObject *obj, void *closure)
    6686             : {
    6687           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6688             :         PyObject *py_user_name;
    6689           0 :         py_user_name = PyString_FromStringOrNULL(object->user_name);
    6690           0 :         return py_user_name;
    6691             : }
    6692             : 
    6693           0 : static int py_NETLOGON_LOGON_REQUEST_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
    6694             : {
    6695           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6696           0 :         if (value == NULL) {
    6697           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
    6698           0 :                 return -1;
    6699             :         }
    6700             :         {
    6701             :                 const char *test_str;
    6702             :                 const char *talloc_str;
    6703           0 :                 PyObject *unicode = NULL;
    6704           0 :                 if (PyUnicode_Check(value)) {
    6705           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6706           0 :                         if (unicode == NULL) {
    6707           0 :                                 PyErr_NoMemory();
    6708           0 :                                 return -1;
    6709             :                         }
    6710           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6711           0 :                 } else if (PyBytes_Check(value)) {
    6712           0 :                         test_str = PyBytes_AS_STRING(value);
    6713             :                 } else {
    6714           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6715           0 :                         return -1;
    6716             :                 }
    6717           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6718           0 :                 if (unicode != NULL) {
    6719           0 :                         Py_DECREF(unicode);
    6720             :                 }
    6721           0 :                 if (talloc_str == NULL) {
    6722           0 :                         PyErr_NoMemory();
    6723           0 :                         return -1;
    6724             :                 }
    6725           0 :                 object->user_name = talloc_str;
    6726             :         }
    6727           0 :         return 0;
    6728             : }
    6729             : 
    6730           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_mailslot_name(PyObject *obj, void *closure)
    6731             : {
    6732           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6733             :         PyObject *py_mailslot_name;
    6734           0 :         py_mailslot_name = PyString_FromStringOrNULL(object->mailslot_name);
    6735           0 :         return py_mailslot_name;
    6736             : }
    6737             : 
    6738           0 : static int py_NETLOGON_LOGON_REQUEST_set_mailslot_name(PyObject *py_obj, PyObject *value, void *closure)
    6739             : {
    6740           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6741           0 :         if (value == NULL) {
    6742           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mailslot_name");
    6743           0 :                 return -1;
    6744             :         }
    6745             :         {
    6746             :                 const char *test_str;
    6747             :                 const char *talloc_str;
    6748           0 :                 PyObject *unicode = NULL;
    6749           0 :                 if (PyUnicode_Check(value)) {
    6750           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6751           0 :                         if (unicode == NULL) {
    6752           0 :                                 PyErr_NoMemory();
    6753           0 :                                 return -1;
    6754             :                         }
    6755           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6756           0 :                 } else if (PyBytes_Check(value)) {
    6757           0 :                         test_str = PyBytes_AS_STRING(value);
    6758             :                 } else {
    6759           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6760           0 :                         return -1;
    6761             :                 }
    6762           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6763           0 :                 if (unicode != NULL) {
    6764           0 :                         Py_DECREF(unicode);
    6765             :                 }
    6766           0 :                 if (talloc_str == NULL) {
    6767           0 :                         PyErr_NoMemory();
    6768           0 :                         return -1;
    6769             :                 }
    6770           0 :                 object->mailslot_name = talloc_str;
    6771             :         }
    6772           0 :         return 0;
    6773             : }
    6774             : 
    6775           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_request_count(PyObject *obj, void *closure)
    6776             : {
    6777           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6778             :         PyObject *py_request_count;
    6779           0 :         py_request_count = PyLong_FromLong((uint16_t)object->request_count);
    6780           0 :         return py_request_count;
    6781             : }
    6782             : 
    6783           0 : static int py_NETLOGON_LOGON_REQUEST_set_request_count(PyObject *py_obj, PyObject *value, void *closure)
    6784             : {
    6785           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6786           0 :         if (value == NULL) {
    6787           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->request_count");
    6788           0 :                 return -1;
    6789             :         }
    6790             :         {
    6791           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->request_count));
    6792           0 :                 if (PyLong_Check(value)) {
    6793             :                         unsigned long long test_var;
    6794           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6795           0 :                         if (PyErr_Occurred() != NULL) {
    6796           0 :                                 return -1;
    6797             :                         }
    6798           0 :                         if (test_var > uint_max) {
    6799           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6800             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6801           0 :                                 return -1;
    6802             :                         }
    6803           0 :                         object->request_count = test_var;
    6804             :                 } else {
    6805           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6806             :                           PyLong_Type.tp_name);
    6807           0 :                         return -1;
    6808             :                 }
    6809             :         }
    6810           0 :         return 0;
    6811             : }
    6812             : 
    6813           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lmnt_token(PyObject *obj, void *closure)
    6814             : {
    6815           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6816             :         PyObject *py_lmnt_token;
    6817           0 :         py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
    6818           0 :         return py_lmnt_token;
    6819             : }
    6820             : 
    6821           0 : static int py_NETLOGON_LOGON_REQUEST_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
    6822             : {
    6823           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6824           0 :         if (value == NULL) {
    6825           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
    6826           0 :                 return -1;
    6827             :         }
    6828             :         {
    6829           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
    6830           0 :                 if (PyLong_Check(value)) {
    6831             :                         unsigned long long test_var;
    6832           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6833           0 :                         if (PyErr_Occurred() != NULL) {
    6834           0 :                                 return -1;
    6835             :                         }
    6836           0 :                         if (test_var > uint_max) {
    6837           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6838             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6839           0 :                                 return -1;
    6840             :                         }
    6841           0 :                         object->lmnt_token = test_var;
    6842             :                 } else {
    6843           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6844             :                           PyLong_Type.tp_name);
    6845           0 :                         return -1;
    6846             :                 }
    6847             :         }
    6848           0 :         return 0;
    6849             : }
    6850             : 
    6851           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_get_lm20_token(PyObject *obj, void *closure)
    6852             : {
    6853           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(obj);
    6854             :         PyObject *py_lm20_token;
    6855           0 :         py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
    6856           0 :         return py_lm20_token;
    6857             : }
    6858             : 
    6859           0 : static int py_NETLOGON_LOGON_REQUEST_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
    6860             : {
    6861           0 :         struct NETLOGON_LOGON_REQUEST *object = (struct NETLOGON_LOGON_REQUEST *)pytalloc_get_ptr(py_obj);
    6862           0 :         if (value == NULL) {
    6863           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
    6864           0 :                 return -1;
    6865             :         }
    6866             :         {
    6867           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
    6868           0 :                 if (PyLong_Check(value)) {
    6869             :                         unsigned long long test_var;
    6870           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6871           0 :                         if (PyErr_Occurred() != NULL) {
    6872           0 :                                 return -1;
    6873             :                         }
    6874           0 :                         if (test_var > uint_max) {
    6875           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6876             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6877           0 :                                 return -1;
    6878             :                         }
    6879           0 :                         object->lm20_token = test_var;
    6880             :                 } else {
    6881           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6882             :                           PyLong_Type.tp_name);
    6883           0 :                         return -1;
    6884             :                 }
    6885             :         }
    6886           0 :         return 0;
    6887             : }
    6888             : 
    6889             : static PyGetSetDef py_NETLOGON_LOGON_REQUEST_getsetters[] = {
    6890             :         {
    6891             :                 .name = discard_const_p(char, "computer_name"),
    6892             :                 .get = py_NETLOGON_LOGON_REQUEST_get_computer_name,
    6893             :                 .set = py_NETLOGON_LOGON_REQUEST_set_computer_name,
    6894             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    6895             :         },
    6896             :         {
    6897             :                 .name = discard_const_p(char, "user_name"),
    6898             :                 .get = py_NETLOGON_LOGON_REQUEST_get_user_name,
    6899             :                 .set = py_NETLOGON_LOGON_REQUEST_set_user_name,
    6900             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    6901             :         },
    6902             :         {
    6903             :                 .name = discard_const_p(char, "mailslot_name"),
    6904             :                 .get = py_NETLOGON_LOGON_REQUEST_get_mailslot_name,
    6905             :                 .set = py_NETLOGON_LOGON_REQUEST_set_mailslot_name,
    6906             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    6907             :         },
    6908             :         {
    6909             :                 .name = discard_const_p(char, "request_count"),
    6910             :                 .get = py_NETLOGON_LOGON_REQUEST_get_request_count,
    6911             :                 .set = py_NETLOGON_LOGON_REQUEST_set_request_count,
    6912             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    6913             :         },
    6914             :         {
    6915             :                 .name = discard_const_p(char, "lmnt_token"),
    6916             :                 .get = py_NETLOGON_LOGON_REQUEST_get_lmnt_token,
    6917             :                 .set = py_NETLOGON_LOGON_REQUEST_set_lmnt_token,
    6918             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6919             :         },
    6920             :         {
    6921             :                 .name = discard_const_p(char, "lm20_token"),
    6922             :                 .get = py_NETLOGON_LOGON_REQUEST_get_lm20_token,
    6923             :                 .set = py_NETLOGON_LOGON_REQUEST_set_lm20_token,
    6924             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6925             :         },
    6926             :         { .name = NULL }
    6927             : };
    6928             : 
    6929           0 : static PyObject *py_NETLOGON_LOGON_REQUEST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6930             : {
    6931           0 :         return pytalloc_new(struct NETLOGON_LOGON_REQUEST, type);
    6932             : }
    6933             : 
    6934             : 
    6935             : static PyTypeObject NETLOGON_LOGON_REQUEST_Type = {
    6936             :         PyVarObject_HEAD_INIT(NULL, 0)
    6937             :         .tp_name = "nbt.NETLOGON_LOGON_REQUEST",
    6938             :         .tp_getset = py_NETLOGON_LOGON_REQUEST_getsetters,
    6939             :         .tp_methods = NULL,
    6940             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6941             :         .tp_new = py_NETLOGON_LOGON_REQUEST_new,
    6942             : };
    6943             : 
    6944             : 
    6945           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command(PyObject *obj, void *closure)
    6946             : {
    6947           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    6948             :         PyObject *py_command;
    6949           0 :         py_command = PyLong_FromLong((uint16_t)object->command);
    6950           0 :         return py_command;
    6951             : }
    6952             : 
    6953           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command(PyObject *py_obj, PyObject *value, void *closure)
    6954             : {
    6955           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    6956           0 :         if (value == NULL) {
    6957           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
    6958           0 :                 return -1;
    6959             :         }
    6960             :         {
    6961           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
    6962           0 :                 if (PyLong_Check(value)) {
    6963             :                         unsigned long long test_var;
    6964           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6965           0 :                         if (PyErr_Occurred() != NULL) {
    6966           0 :                                 return -1;
    6967             :                         }
    6968           0 :                         if (test_var > uint_max) {
    6969           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6970             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6971           0 :                                 return -1;
    6972             :                         }
    6973           0 :                         object->command = test_var;
    6974             :                 } else {
    6975           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6976             :                           PyLong_Type.tp_name);
    6977           0 :                         return -1;
    6978             :                 }
    6979             :         }
    6980           0 :         return 0;
    6981             : }
    6982             : 
    6983           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name(PyObject *obj, void *closure)
    6984             : {
    6985           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    6986             :         PyObject *py_pdc_name;
    6987           0 :         py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
    6988           0 :         return py_pdc_name;
    6989             : }
    6990             : 
    6991           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
    6992             : {
    6993           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    6994           0 :         if (value == NULL) {
    6995           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
    6996           0 :                 return -1;
    6997             :         }
    6998             :         {
    6999             :                 const char *test_str;
    7000             :                 const char *talloc_str;
    7001           0 :                 PyObject *unicode = NULL;
    7002           0 :                 if (PyUnicode_Check(value)) {
    7003           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7004           0 :                         if (unicode == NULL) {
    7005           0 :                                 PyErr_NoMemory();
    7006           0 :                                 return -1;
    7007             :                         }
    7008           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7009           0 :                 } else if (PyBytes_Check(value)) {
    7010           0 :                         test_str = PyBytes_AS_STRING(value);
    7011             :                 } else {
    7012           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7013           0 :                         return -1;
    7014             :                 }
    7015           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7016           0 :                 if (unicode != NULL) {
    7017           0 :                         Py_DECREF(unicode);
    7018             :                 }
    7019           0 :                 if (talloc_str == NULL) {
    7020           0 :                         PyErr_NoMemory();
    7021           0 :                         return -1;
    7022             :                 }
    7023           0 :                 object->pdc_name = talloc_str;
    7024             :         }
    7025           0 :         return 0;
    7026             : }
    7027             : 
    7028           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name(PyObject *obj, void *closure)
    7029             : {
    7030           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    7031             :         PyObject *py_user_name;
    7032           0 :         py_user_name = PyString_FromStringOrNULL(object->user_name);
    7033           0 :         return py_user_name;
    7034             : }
    7035             : 
    7036           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
    7037             : {
    7038           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7039           0 :         if (value == NULL) {
    7040           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
    7041           0 :                 return -1;
    7042             :         }
    7043             :         {
    7044             :                 const char *test_str;
    7045             :                 const char *talloc_str;
    7046           0 :                 PyObject *unicode = NULL;
    7047           0 :                 if (PyUnicode_Check(value)) {
    7048           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7049           0 :                         if (unicode == NULL) {
    7050           0 :                                 PyErr_NoMemory();
    7051           0 :                                 return -1;
    7052             :                         }
    7053           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7054           0 :                 } else if (PyBytes_Check(value)) {
    7055           0 :                         test_str = PyBytes_AS_STRING(value);
    7056             :                 } else {
    7057           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7058           0 :                         return -1;
    7059             :                 }
    7060           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7061           0 :                 if (unicode != NULL) {
    7062           0 :                         Py_DECREF(unicode);
    7063             :                 }
    7064           0 :                 if (talloc_str == NULL) {
    7065           0 :                         PyErr_NoMemory();
    7066           0 :                         return -1;
    7067             :                 }
    7068           0 :                 object->user_name = talloc_str;
    7069             :         }
    7070           0 :         return 0;
    7071             : }
    7072             : 
    7073           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name(PyObject *obj, void *closure)
    7074             : {
    7075           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    7076             :         PyObject *py_domain_name;
    7077           0 :         py_domain_name = PyString_FromStringOrNULL(object->domain_name);
    7078           0 :         return py_domain_name;
    7079             : }
    7080             : 
    7081           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    7082             : {
    7083           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7084           0 :         if (value == NULL) {
    7085           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
    7086           0 :                 return -1;
    7087             :         }
    7088             :         {
    7089             :                 const char *test_str;
    7090             :                 const char *talloc_str;
    7091           0 :                 PyObject *unicode = NULL;
    7092           0 :                 if (PyUnicode_Check(value)) {
    7093           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7094           0 :                         if (unicode == NULL) {
    7095           0 :                                 PyErr_NoMemory();
    7096           0 :                                 return -1;
    7097             :                         }
    7098           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7099           0 :                 } else if (PyBytes_Check(value)) {
    7100           0 :                         test_str = PyBytes_AS_STRING(value);
    7101             :                 } else {
    7102           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7103           0 :                         return -1;
    7104             :                 }
    7105           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7106           0 :                 if (unicode != NULL) {
    7107           0 :                         Py_DECREF(unicode);
    7108             :                 }
    7109           0 :                 if (talloc_str == NULL) {
    7110           0 :                         PyErr_NoMemory();
    7111           0 :                         return -1;
    7112             :                 }
    7113           0 :                 object->domain_name = talloc_str;
    7114             :         }
    7115           0 :         return 0;
    7116             : }
    7117             : 
    7118           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version(PyObject *obj, void *closure)
    7119             : {
    7120           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    7121             :         PyObject *py_nt_version;
    7122           0 :         py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
    7123           0 :         return py_nt_version;
    7124             : }
    7125             : 
    7126           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
    7127             : {
    7128           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7129           0 :         if (value == NULL) {
    7130           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
    7131           0 :                 return -1;
    7132             :         }
    7133             :         {
    7134           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
    7135           0 :                 if (PyLong_Check(value)) {
    7136             :                         unsigned long long test_var;
    7137           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7138           0 :                         if (PyErr_Occurred() != NULL) {
    7139           0 :                                 return -1;
    7140             :                         }
    7141           0 :                         if (test_var > uint_max) {
    7142           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7143             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7144           0 :                                 return -1;
    7145             :                         }
    7146           0 :                         object->nt_version = test_var;
    7147             :                 } else {
    7148           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7149             :                           PyLong_Type.tp_name);
    7150           0 :                         return -1;
    7151             :                 }
    7152             :         }
    7153           0 :         return 0;
    7154             : }
    7155             : 
    7156           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token(PyObject *obj, void *closure)
    7157             : {
    7158           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    7159             :         PyObject *py_lmnt_token;
    7160           0 :         py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
    7161           0 :         return py_lmnt_token;
    7162             : }
    7163             : 
    7164           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
    7165             : {
    7166           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7167           0 :         if (value == NULL) {
    7168           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
    7169           0 :                 return -1;
    7170             :         }
    7171             :         {
    7172           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
    7173           0 :                 if (PyLong_Check(value)) {
    7174             :                         unsigned long long test_var;
    7175           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7176           0 :                         if (PyErr_Occurred() != NULL) {
    7177           0 :                                 return -1;
    7178             :                         }
    7179           0 :                         if (test_var > uint_max) {
    7180           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7181             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7182           0 :                                 return -1;
    7183             :                         }
    7184           0 :                         object->lmnt_token = test_var;
    7185             :                 } else {
    7186           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7187             :                           PyLong_Type.tp_name);
    7188           0 :                         return -1;
    7189             :                 }
    7190             :         }
    7191           0 :         return 0;
    7192             : }
    7193             : 
    7194           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token(PyObject *obj, void *closure)
    7195             : {
    7196           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(obj);
    7197             :         PyObject *py_lm20_token;
    7198           0 :         py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
    7199           0 :         return py_lm20_token;
    7200             : }
    7201             : 
    7202           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
    7203             : {
    7204           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7205           0 :         if (value == NULL) {
    7206           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
    7207           0 :                 return -1;
    7208             :         }
    7209             :         {
    7210           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
    7211           0 :                 if (PyLong_Check(value)) {
    7212             :                         unsigned long long test_var;
    7213           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7214           0 :                         if (PyErr_Occurred() != NULL) {
    7215           0 :                                 return -1;
    7216             :                         }
    7217           0 :                         if (test_var > uint_max) {
    7218           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7219             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7220           0 :                                 return -1;
    7221             :                         }
    7222           0 :                         object->lm20_token = test_var;
    7223             :                 } else {
    7224           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7225             :                           PyLong_Type.tp_name);
    7226           0 :                         return -1;
    7227             :                 }
    7228             :         }
    7229           0 :         return 0;
    7230             : }
    7231             : 
    7232             : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters[] = {
    7233             :         {
    7234             :                 .name = discard_const_p(char, "command"),
    7235             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_command,
    7236             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_command,
    7237             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
    7238             :         },
    7239             :         {
    7240             :                 .name = discard_const_p(char, "pdc_name"),
    7241             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_pdc_name,
    7242             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_pdc_name,
    7243             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    7244             :         },
    7245             :         {
    7246             :                 .name = discard_const_p(char, "user_name"),
    7247             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_user_name,
    7248             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_user_name,
    7249             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    7250             :         },
    7251             :         {
    7252             :                 .name = discard_const_p(char, "domain_name"),
    7253             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_domain_name,
    7254             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_domain_name,
    7255             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    7256             :         },
    7257             :         {
    7258             :                 .name = discard_const_p(char, "nt_version"),
    7259             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_nt_version,
    7260             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_nt_version,
    7261             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
    7262             :         },
    7263             :         {
    7264             :                 .name = discard_const_p(char, "lmnt_token"),
    7265             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lmnt_token,
    7266             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lmnt_token,
    7267             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7268             :         },
    7269             :         {
    7270             :                 .name = discard_const_p(char, "lm20_token"),
    7271             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_get_lm20_token,
    7272             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_set_lm20_token,
    7273             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7274             :         },
    7275             :         { .name = NULL }
    7276             : };
    7277             : 
    7278           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7279             : {
    7280           0 :         return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_NT40, type);
    7281             : }
    7282             : 
    7283           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    7284             : {
    7285           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7286           0 :         PyObject *ret = NULL;
    7287             :         DATA_BLOB blob;
    7288             :         enum ndr_err_code err;
    7289           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    7290           0 :         if (tmp_ctx == NULL) {
    7291           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7292           0 :                 return NULL;
    7293             :         }
    7294           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40);
    7295           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7296           0 :                 TALLOC_FREE(tmp_ctx);
    7297           0 :                 PyErr_SetNdrError(err);
    7298           0 :                 return NULL;
    7299             :         }
    7300             : 
    7301           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    7302           0 :         TALLOC_FREE(tmp_ctx);
    7303           0 :         return ret;
    7304             : }
    7305             : 
    7306           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7307             : {
    7308           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7309           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    7310           0 :         Py_ssize_t blob_length = 0;
    7311             :         enum ndr_err_code err;
    7312           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    7313           0 :         PyObject *allow_remaining_obj = NULL;
    7314           0 :         bool allow_remaining = false;
    7315             : 
    7316           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    7317             :                 discard_const_p(char *, kwnames),
    7318             :                 &blob.data, &blob_length,
    7319             :                 &allow_remaining_obj)) {
    7320           0 :                 return NULL;
    7321             :         }
    7322           0 :         blob.length = blob_length;
    7323             : 
    7324           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7325           0 :                 allow_remaining = true;
    7326             :         }
    7327             : 
    7328           0 :         if (allow_remaining) {
    7329           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
    7330             :         } else {
    7331           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
    7332             :         }
    7333           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7334           0 :                 PyErr_SetNdrError(err);
    7335           0 :                 return NULL;
    7336             :         }
    7337             : 
    7338           0 :         Py_RETURN_NONE;
    7339             : }
    7340             : 
    7341           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7342             : {
    7343           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *object = (struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(py_obj);
    7344             :         PyObject *ret;
    7345             :         char *retstr;
    7346             : 
    7347           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40, "NETLOGON_SAM_LOGON_RESPONSE_NT40", object);
    7348           0 :         ret = PyUnicode_FromString(retstr);
    7349           0 :         talloc_free(retstr);
    7350             : 
    7351           0 :         return ret;
    7352             : }
    7353             : 
    7354             : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods[] = {
    7355             :         { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    7356             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    7357             :         { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_NT40_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    7358             :         { NULL, NULL, 0, NULL }
    7359             : };
    7360             : 
    7361             : 
    7362             : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_NT40_Type = {
    7363             :         PyVarObject_HEAD_INIT(NULL, 0)
    7364             :         .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40",
    7365             :         .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_getsetters,
    7366             :         .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_methods,
    7367             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7368             :         .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_NT40_new,
    7369             : };
    7370             : 
    7371             : 
    7372           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_command(PyObject *obj, void *closure)
    7373             : {
    7374           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7375             :         PyObject *py_command;
    7376           0 :         py_command = PyLong_FromLong((uint16_t)object->command);
    7377           0 :         return py_command;
    7378             : }
    7379             : 
    7380           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_command(PyObject *py_obj, PyObject *value, void *closure)
    7381             : {
    7382           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7383           0 :         if (value == NULL) {
    7384           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
    7385           0 :                 return -1;
    7386             :         }
    7387             :         {
    7388           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
    7389           0 :                 if (PyLong_Check(value)) {
    7390             :                         unsigned long long test_var;
    7391           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7392           0 :                         if (PyErr_Occurred() != NULL) {
    7393           0 :                                 return -1;
    7394             :                         }
    7395           0 :                         if (test_var > uint_max) {
    7396           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7397             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7398           0 :                                 return -1;
    7399             :                         }
    7400           0 :                         object->command = test_var;
    7401             :                 } else {
    7402           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7403             :                           PyLong_Type.tp_name);
    7404           0 :                         return -1;
    7405             :                 }
    7406             :         }
    7407           0 :         return 0;
    7408             : }
    7409             : 
    7410           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name(PyObject *obj, void *closure)
    7411             : {
    7412           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7413             :         PyObject *py_pdc_name;
    7414           0 :         py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
    7415           0 :         return py_pdc_name;
    7416             : }
    7417             : 
    7418           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
    7419             : {
    7420           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7421           0 :         if (value == NULL) {
    7422           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
    7423           0 :                 return -1;
    7424             :         }
    7425             :         {
    7426             :                 const char *test_str;
    7427             :                 const char *talloc_str;
    7428           0 :                 PyObject *unicode = NULL;
    7429           0 :                 if (PyUnicode_Check(value)) {
    7430           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7431           0 :                         if (unicode == NULL) {
    7432           0 :                                 PyErr_NoMemory();
    7433           0 :                                 return -1;
    7434             :                         }
    7435           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7436           0 :                 } else if (PyBytes_Check(value)) {
    7437           0 :                         test_str = PyBytes_AS_STRING(value);
    7438             :                 } else {
    7439           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7440           0 :                         return -1;
    7441             :                 }
    7442           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7443           0 :                 if (unicode != NULL) {
    7444           0 :                         Py_DECREF(unicode);
    7445             :                 }
    7446           0 :                 if (talloc_str == NULL) {
    7447           0 :                         PyErr_NoMemory();
    7448           0 :                         return -1;
    7449             :                 }
    7450           0 :                 object->pdc_name = talloc_str;
    7451             :         }
    7452           0 :         return 0;
    7453             : }
    7454             : 
    7455           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name(PyObject *obj, void *closure)
    7456             : {
    7457           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7458             :         PyObject *py_user_name;
    7459           0 :         py_user_name = PyString_FromStringOrNULL(object->user_name);
    7460           0 :         return py_user_name;
    7461             : }
    7462             : 
    7463           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
    7464             : {
    7465           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7466           0 :         if (value == NULL) {
    7467           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
    7468           0 :                 return -1;
    7469             :         }
    7470             :         {
    7471             :                 const char *test_str;
    7472             :                 const char *talloc_str;
    7473           0 :                 PyObject *unicode = NULL;
    7474           0 :                 if (PyUnicode_Check(value)) {
    7475           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7476           0 :                         if (unicode == NULL) {
    7477           0 :                                 PyErr_NoMemory();
    7478           0 :                                 return -1;
    7479             :                         }
    7480           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7481           0 :                 } else if (PyBytes_Check(value)) {
    7482           0 :                         test_str = PyBytes_AS_STRING(value);
    7483             :                 } else {
    7484           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7485           0 :                         return -1;
    7486             :                 }
    7487           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7488           0 :                 if (unicode != NULL) {
    7489           0 :                         Py_DECREF(unicode);
    7490             :                 }
    7491           0 :                 if (talloc_str == NULL) {
    7492           0 :                         PyErr_NoMemory();
    7493           0 :                         return -1;
    7494             :                 }
    7495           0 :                 object->user_name = talloc_str;
    7496             :         }
    7497           0 :         return 0;
    7498             : }
    7499             : 
    7500           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name(PyObject *obj, void *closure)
    7501             : {
    7502           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7503             :         PyObject *py_domain_name;
    7504           0 :         py_domain_name = PyString_FromStringOrNULL(object->domain_name);
    7505           0 :         return py_domain_name;
    7506             : }
    7507             : 
    7508           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    7509             : {
    7510           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7511           0 :         if (value == NULL) {
    7512           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
    7513           0 :                 return -1;
    7514             :         }
    7515             :         {
    7516             :                 const char *test_str;
    7517             :                 const char *talloc_str;
    7518           0 :                 PyObject *unicode = NULL;
    7519           0 :                 if (PyUnicode_Check(value)) {
    7520           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7521           0 :                         if (unicode == NULL) {
    7522           0 :                                 PyErr_NoMemory();
    7523           0 :                                 return -1;
    7524             :                         }
    7525           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7526           0 :                 } else if (PyBytes_Check(value)) {
    7527           0 :                         test_str = PyBytes_AS_STRING(value);
    7528             :                 } else {
    7529           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7530           0 :                         return -1;
    7531             :                 }
    7532           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7533           0 :                 if (unicode != NULL) {
    7534           0 :                         Py_DECREF(unicode);
    7535             :                 }
    7536           0 :                 if (talloc_str == NULL) {
    7537           0 :                         PyErr_NoMemory();
    7538           0 :                         return -1;
    7539             :                 }
    7540           0 :                 object->domain_name = talloc_str;
    7541             :         }
    7542           0 :         return 0;
    7543             : }
    7544             : 
    7545           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid(PyObject *obj, void *closure)
    7546             : {
    7547           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7548             :         PyObject *py_domain_uuid;
    7549           0 :         py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
    7550           0 :         return py_domain_uuid;
    7551             : }
    7552             : 
    7553           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
    7554             : {
    7555           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7556           0 :         if (value == NULL) {
    7557           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_uuid");
    7558           0 :                 return -1;
    7559             :         }
    7560           0 :         PY_CHECK_TYPE(GUID_Type, value, return -1;);
    7561           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7562           0 :                 PyErr_NoMemory();
    7563           0 :                 return -1;
    7564             :         }
    7565           0 :         object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
    7566           0 :         return 0;
    7567             : }
    7568             : 
    7569           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid(PyObject *obj, void *closure)
    7570             : {
    7571           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7572             :         PyObject *py_zero_uuid;
    7573           0 :         py_zero_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->zero_uuid);
    7574           0 :         return py_zero_uuid;
    7575             : }
    7576             : 
    7577           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid(PyObject *py_obj, PyObject *value, void *closure)
    7578             : {
    7579           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7580           0 :         if (value == NULL) {
    7581           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->zero_uuid");
    7582           0 :                 return -1;
    7583             :         }
    7584           0 :         PY_CHECK_TYPE(GUID_Type, value, return -1;);
    7585           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7586           0 :                 PyErr_NoMemory();
    7587           0 :                 return -1;
    7588             :         }
    7589           0 :         object->zero_uuid = *(struct GUID *)pytalloc_get_ptr(value);
    7590           0 :         return 0;
    7591             : }
    7592             : 
    7593           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_forest(PyObject *obj, void *closure)
    7594             : {
    7595           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7596             :         PyObject *py_forest;
    7597           0 :         py_forest = PyString_FromStringOrNULL(object->forest);
    7598           0 :         return py_forest;
    7599             : }
    7600             : 
    7601           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_forest(PyObject *py_obj, PyObject *value, void *closure)
    7602             : {
    7603           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7604           0 :         if (value == NULL) {
    7605           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest");
    7606           0 :                 return -1;
    7607             :         }
    7608             :         {
    7609             :                 const char *test_str;
    7610             :                 const char *talloc_str;
    7611           0 :                 PyObject *unicode = NULL;
    7612           0 :                 if (PyUnicode_Check(value)) {
    7613           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7614           0 :                         if (unicode == NULL) {
    7615           0 :                                 PyErr_NoMemory();
    7616           0 :                                 return -1;
    7617             :                         }
    7618           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7619           0 :                 } else if (PyBytes_Check(value)) {
    7620           0 :                         test_str = PyBytes_AS_STRING(value);
    7621             :                 } else {
    7622           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7623           0 :                         return -1;
    7624             :                 }
    7625           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7626           0 :                 if (unicode != NULL) {
    7627           0 :                         Py_DECREF(unicode);
    7628             :                 }
    7629           0 :                 if (talloc_str == NULL) {
    7630           0 :                         PyErr_NoMemory();
    7631           0 :                         return -1;
    7632             :                 }
    7633           0 :                 object->forest = talloc_str;
    7634             :         }
    7635           0 :         return 0;
    7636             : }
    7637             : 
    7638           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain(PyObject *obj, void *closure)
    7639             : {
    7640           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7641             :         PyObject *py_dns_domain;
    7642           0 :         py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
    7643           0 :         return py_dns_domain;
    7644             : }
    7645             : 
    7646           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
    7647             : {
    7648           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7649           0 :         if (value == NULL) {
    7650           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
    7651           0 :                 return -1;
    7652             :         }
    7653             :         {
    7654             :                 const char *test_str;
    7655             :                 const char *talloc_str;
    7656           0 :                 PyObject *unicode = NULL;
    7657           0 :                 if (PyUnicode_Check(value)) {
    7658           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7659           0 :                         if (unicode == NULL) {
    7660           0 :                                 PyErr_NoMemory();
    7661           0 :                                 return -1;
    7662             :                         }
    7663           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7664           0 :                 } else if (PyBytes_Check(value)) {
    7665           0 :                         test_str = PyBytes_AS_STRING(value);
    7666             :                 } else {
    7667           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7668           0 :                         return -1;
    7669             :                 }
    7670           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7671           0 :                 if (unicode != NULL) {
    7672           0 :                         Py_DECREF(unicode);
    7673             :                 }
    7674           0 :                 if (talloc_str == NULL) {
    7675           0 :                         PyErr_NoMemory();
    7676           0 :                         return -1;
    7677             :                 }
    7678           0 :                 object->dns_domain = talloc_str;
    7679             :         }
    7680           0 :         return 0;
    7681             : }
    7682             : 
    7683           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name(PyObject *obj, void *closure)
    7684             : {
    7685           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7686             :         PyObject *py_pdc_dns_name;
    7687           0 :         py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
    7688           0 :         return py_pdc_dns_name;
    7689             : }
    7690             : 
    7691           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
    7692             : {
    7693           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7694           0 :         if (value == NULL) {
    7695           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_dns_name");
    7696           0 :                 return -1;
    7697             :         }
    7698             :         {
    7699             :                 const char *test_str;
    7700             :                 const char *talloc_str;
    7701           0 :                 PyObject *unicode = NULL;
    7702           0 :                 if (PyUnicode_Check(value)) {
    7703           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7704           0 :                         if (unicode == NULL) {
    7705           0 :                                 PyErr_NoMemory();
    7706           0 :                                 return -1;
    7707             :                         }
    7708           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7709           0 :                 } else if (PyBytes_Check(value)) {
    7710           0 :                         test_str = PyBytes_AS_STRING(value);
    7711             :                 } else {
    7712           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7713           0 :                         return -1;
    7714             :                 }
    7715           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7716           0 :                 if (unicode != NULL) {
    7717           0 :                         Py_DECREF(unicode);
    7718             :                 }
    7719           0 :                 if (talloc_str == NULL) {
    7720           0 :                         PyErr_NoMemory();
    7721           0 :                         return -1;
    7722             :                 }
    7723           0 :                 object->pdc_dns_name = talloc_str;
    7724             :         }
    7725           0 :         return 0;
    7726             : }
    7727             : 
    7728           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip(PyObject *obj, void *closure)
    7729             : {
    7730           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7731             :         PyObject *py_pdc_ip;
    7732           0 :         py_pdc_ip = PyString_FromStringOrNULL(object->pdc_ip);
    7733           0 :         return py_pdc_ip;
    7734             : }
    7735             : 
    7736           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip(PyObject *py_obj, PyObject *value, void *closure)
    7737             : {
    7738           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7739           0 :         if (value == NULL) {
    7740           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_ip");
    7741           0 :                 return -1;
    7742             :         }
    7743             :         {
    7744             :                 const char *test_str;
    7745             :                 const char *talloc_str;
    7746           0 :                 PyObject *unicode = NULL;
    7747           0 :                 if (PyUnicode_Check(value)) {
    7748           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7749           0 :                         if (unicode == NULL) {
    7750           0 :                                 PyErr_NoMemory();
    7751           0 :                                 return -1;
    7752             :                         }
    7753           0 :                         test_str = PyBytes_AS_STRING(unicode);
    7754           0 :                 } else if (PyBytes_Check(value)) {
    7755           0 :                         test_str = PyBytes_AS_STRING(value);
    7756             :                 } else {
    7757           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7758           0 :                         return -1;
    7759             :                 }
    7760           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7761           0 :                 if (unicode != NULL) {
    7762           0 :                         Py_DECREF(unicode);
    7763             :                 }
    7764           0 :                 if (talloc_str == NULL) {
    7765           0 :                         PyErr_NoMemory();
    7766           0 :                         return -1;
    7767             :                 }
    7768           0 :                 object->pdc_ip = talloc_str;
    7769             :         }
    7770           0 :         return 0;
    7771             : }
    7772             : 
    7773           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type(PyObject *obj, void *closure)
    7774             : {
    7775           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7776             :         PyObject *py_server_type;
    7777           0 :         py_server_type = PyLong_FromUnsignedLongLong((uint32_t)object->server_type);
    7778           0 :         return py_server_type;
    7779             : }
    7780             : 
    7781           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
    7782             : {
    7783           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7784           0 :         if (value == NULL) {
    7785           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_type");
    7786           0 :                 return -1;
    7787             :         }
    7788             :         {
    7789           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
    7790           0 :                 if (PyLong_Check(value)) {
    7791             :                         unsigned long long test_var;
    7792           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7793           0 :                         if (PyErr_Occurred() != NULL) {
    7794           0 :                                 return -1;
    7795             :                         }
    7796           0 :                         if (test_var > uint_max) {
    7797           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7798             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7799           0 :                                 return -1;
    7800             :                         }
    7801           0 :                         object->server_type = test_var;
    7802             :                 } else {
    7803           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7804             :                           PyLong_Type.tp_name);
    7805           0 :                         return -1;
    7806             :                 }
    7807             :         }
    7808           0 :         return 0;
    7809             : }
    7810             : 
    7811           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version(PyObject *obj, void *closure)
    7812             : {
    7813           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7814             :         PyObject *py_nt_version;
    7815           0 :         py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
    7816           0 :         return py_nt_version;
    7817             : }
    7818             : 
    7819           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
    7820             : {
    7821           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7822           0 :         if (value == NULL) {
    7823           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
    7824           0 :                 return -1;
    7825             :         }
    7826             :         {
    7827           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
    7828           0 :                 if (PyLong_Check(value)) {
    7829             :                         unsigned long long test_var;
    7830           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7831           0 :                         if (PyErr_Occurred() != NULL) {
    7832           0 :                                 return -1;
    7833             :                         }
    7834           0 :                         if (test_var > uint_max) {
    7835           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7836             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7837           0 :                                 return -1;
    7838             :                         }
    7839           0 :                         object->nt_version = test_var;
    7840             :                 } else {
    7841           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7842             :                           PyLong_Type.tp_name);
    7843           0 :                         return -1;
    7844             :                 }
    7845             :         }
    7846           0 :         return 0;
    7847             : }
    7848             : 
    7849           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token(PyObject *obj, void *closure)
    7850             : {
    7851           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7852             :         PyObject *py_lmnt_token;
    7853           0 :         py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
    7854           0 :         return py_lmnt_token;
    7855             : }
    7856             : 
    7857           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
    7858             : {
    7859           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7860           0 :         if (value == NULL) {
    7861           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
    7862           0 :                 return -1;
    7863             :         }
    7864             :         {
    7865           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
    7866           0 :                 if (PyLong_Check(value)) {
    7867             :                         unsigned long long test_var;
    7868           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7869           0 :                         if (PyErr_Occurred() != NULL) {
    7870           0 :                                 return -1;
    7871             :                         }
    7872           0 :                         if (test_var > uint_max) {
    7873           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7874             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7875           0 :                                 return -1;
    7876             :                         }
    7877           0 :                         object->lmnt_token = test_var;
    7878             :                 } else {
    7879           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7880             :                           PyLong_Type.tp_name);
    7881           0 :                         return -1;
    7882             :                 }
    7883             :         }
    7884           0 :         return 0;
    7885             : }
    7886             : 
    7887           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token(PyObject *obj, void *closure)
    7888             : {
    7889           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(obj);
    7890             :         PyObject *py_lm20_token;
    7891           0 :         py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
    7892           0 :         return py_lm20_token;
    7893             : }
    7894             : 
    7895           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
    7896             : {
    7897           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    7898           0 :         if (value == NULL) {
    7899           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
    7900           0 :                 return -1;
    7901             :         }
    7902             :         {
    7903           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
    7904           0 :                 if (PyLong_Check(value)) {
    7905             :                         unsigned long long test_var;
    7906           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7907           0 :                         if (PyErr_Occurred() != NULL) {
    7908           0 :                                 return -1;
    7909             :                         }
    7910           0 :                         if (test_var > uint_max) {
    7911           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7912             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7913           0 :                                 return -1;
    7914             :                         }
    7915           0 :                         object->lm20_token = test_var;
    7916             :                 } else {
    7917           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7918             :                           PyLong_Type.tp_name);
    7919           0 :                         return -1;
    7920             :                 }
    7921             :         }
    7922           0 :         return 0;
    7923             : }
    7924             : 
    7925             : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_getsetters[] = {
    7926             :         {
    7927             :                 .name = discard_const_p(char, "command"),
    7928             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_command,
    7929             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_command,
    7930             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
    7931             :         },
    7932             :         {
    7933             :                 .name = discard_const_p(char, "pdc_name"),
    7934             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_name,
    7935             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_name,
    7936             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    7937             :         },
    7938             :         {
    7939             :                 .name = discard_const_p(char, "user_name"),
    7940             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_user_name,
    7941             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_user_name,
    7942             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    7943             :         },
    7944             :         {
    7945             :                 .name = discard_const_p(char, "domain_name"),
    7946             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_name,
    7947             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_name,
    7948             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    7949             :         },
    7950             :         {
    7951             :                 .name = discard_const_p(char, "domain_uuid"),
    7952             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_domain_uuid,
    7953             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_domain_uuid,
    7954             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    7955             :         },
    7956             :         {
    7957             :                 .name = discard_const_p(char, "zero_uuid"),
    7958             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_zero_uuid,
    7959             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_zero_uuid,
    7960             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    7961             :         },
    7962             :         {
    7963             :                 .name = discard_const_p(char, "forest"),
    7964             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_forest,
    7965             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_forest,
    7966             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    7967             :         },
    7968             :         {
    7969             :                 .name = discard_const_p(char, "dns_domain"),
    7970             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_dns_domain,
    7971             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_dns_domain,
    7972             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    7973             :         },
    7974             :         {
    7975             :                 .name = discard_const_p(char, "pdc_dns_name"),
    7976             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_dns_name,
    7977             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_dns_name,
    7978             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    7979             :         },
    7980             :         {
    7981             :                 .name = discard_const_p(char, "pdc_ip"),
    7982             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_pdc_ip,
    7983             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_pdc_ip,
    7984             :                 .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
    7985             :         },
    7986             :         {
    7987             :                 .name = discard_const_p(char, "server_type"),
    7988             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_server_type,
    7989             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_server_type,
    7990             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
    7991             :         },
    7992             :         {
    7993             :                 .name = discard_const_p(char, "nt_version"),
    7994             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_nt_version,
    7995             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_nt_version,
    7996             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
    7997             :         },
    7998             :         {
    7999             :                 .name = discard_const_p(char, "lmnt_token"),
    8000             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lmnt_token,
    8001             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lmnt_token,
    8002             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8003             :         },
    8004             :         {
    8005             :                 .name = discard_const_p(char, "lm20_token"),
    8006             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_get_lm20_token,
    8007             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_set_lm20_token,
    8008             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8009             :         },
    8010             :         { .name = NULL }
    8011             : };
    8012             : 
    8013           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8014             : {
    8015           0 :         return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE, type);
    8016             : }
    8017             : 
    8018           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    8019             : {
    8020           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    8021           0 :         PyObject *ret = NULL;
    8022             :         DATA_BLOB blob;
    8023             :         enum ndr_err_code err;
    8024           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    8025           0 :         if (tmp_ctx == NULL) {
    8026           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8027           0 :                 return NULL;
    8028             :         }
    8029           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE);
    8030           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8031           0 :                 TALLOC_FREE(tmp_ctx);
    8032           0 :                 PyErr_SetNdrError(err);
    8033           0 :                 return NULL;
    8034             :         }
    8035             : 
    8036           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8037           0 :         TALLOC_FREE(tmp_ctx);
    8038           0 :         return ret;
    8039             : }
    8040             : 
    8041           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8042             : {
    8043           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    8044           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    8045           0 :         Py_ssize_t blob_length = 0;
    8046             :         enum ndr_err_code err;
    8047           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    8048           0 :         PyObject *allow_remaining_obj = NULL;
    8049           0 :         bool allow_remaining = false;
    8050             : 
    8051           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    8052             :                 discard_const_p(char *, kwnames),
    8053             :                 &blob.data, &blob_length,
    8054             :                 &allow_remaining_obj)) {
    8055           0 :                 return NULL;
    8056             :         }
    8057           0 :         blob.length = blob_length;
    8058             : 
    8059           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8060           0 :                 allow_remaining = true;
    8061             :         }
    8062             : 
    8063           0 :         if (allow_remaining) {
    8064           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
    8065             :         } else {
    8066           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
    8067             :         }
    8068           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8069           0 :                 PyErr_SetNdrError(err);
    8070           0 :                 return NULL;
    8071             :         }
    8072             : 
    8073           0 :         Py_RETURN_NONE;
    8074             : }
    8075             : 
    8076           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8077             : {
    8078           0 :         struct NETLOGON_SAM_LOGON_RESPONSE *object = (struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(py_obj);
    8079             :         PyObject *ret;
    8080             :         char *retstr;
    8081             : 
    8082           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE, "NETLOGON_SAM_LOGON_RESPONSE", object);
    8083           0 :         ret = PyUnicode_FromString(retstr);
    8084           0 :         talloc_free(retstr);
    8085             : 
    8086           0 :         return ret;
    8087             : }
    8088             : 
    8089             : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_methods[] = {
    8090             :         { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    8091             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    8092             :         { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    8093             :         { NULL, NULL, 0, NULL }
    8094             : };
    8095             : 
    8096             : 
    8097             : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_Type = {
    8098             :         PyVarObject_HEAD_INIT(NULL, 0)
    8099             :         .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE",
    8100             :         .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_getsetters,
    8101             :         .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_methods,
    8102             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8103             :         .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_new,
    8104             : };
    8105             : 
    8106             : 
    8107           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command(PyObject *obj, void *closure)
    8108             : {
    8109           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8110             :         PyObject *py_command;
    8111           0 :         py_command = PyLong_FromLong((uint16_t)object->command);
    8112           0 :         return py_command;
    8113             : }
    8114             : 
    8115           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command(PyObject *py_obj, PyObject *value, void *closure)
    8116             : {
    8117           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8118           0 :         if (value == NULL) {
    8119           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
    8120           0 :                 return -1;
    8121             :         }
    8122             :         {
    8123           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
    8124           0 :                 if (PyLong_Check(value)) {
    8125             :                         unsigned long long test_var;
    8126           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8127           0 :                         if (PyErr_Occurred() != NULL) {
    8128           0 :                                 return -1;
    8129             :                         }
    8130           0 :                         if (test_var > uint_max) {
    8131           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8132             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8133           0 :                                 return -1;
    8134             :                         }
    8135           0 :                         object->command = test_var;
    8136             :                 } else {
    8137           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8138             :                           PyLong_Type.tp_name);
    8139           0 :                         return -1;
    8140             :                 }
    8141             :         }
    8142           0 :         return 0;
    8143             : }
    8144             : 
    8145           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz(PyObject *obj, void *closure)
    8146             : {
    8147           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8148             :         PyObject *py_sbz;
    8149           0 :         py_sbz = PyLong_FromLong((uint16_t)object->sbz);
    8150           0 :         return py_sbz;
    8151             : }
    8152             : 
    8153           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz(PyObject *py_obj, PyObject *value, void *closure)
    8154             : {
    8155           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8156           0 :         if (value == NULL) {
    8157           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sbz");
    8158           0 :                 return -1;
    8159             :         }
    8160             :         {
    8161           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sbz));
    8162           0 :                 if (PyLong_Check(value)) {
    8163             :                         unsigned long long test_var;
    8164           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8165           0 :                         if (PyErr_Occurred() != NULL) {
    8166           0 :                                 return -1;
    8167             :                         }
    8168           0 :                         if (test_var > uint_max) {
    8169           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8170             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8171           0 :                                 return -1;
    8172             :                         }
    8173           0 :                         object->sbz = test_var;
    8174             :                 } else {
    8175           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8176             :                           PyLong_Type.tp_name);
    8177           0 :                         return -1;
    8178             :                 }
    8179             :         }
    8180           0 :         return 0;
    8181             : }
    8182             : 
    8183          21 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type(PyObject *obj, void *closure)
    8184             : {
    8185          21 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8186             :         PyObject *py_server_type;
    8187          21 :         py_server_type = PyLong_FromUnsignedLongLong((uint32_t)object->server_type);
    8188          21 :         return py_server_type;
    8189             : }
    8190             : 
    8191           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type(PyObject *py_obj, PyObject *value, void *closure)
    8192             : {
    8193           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8194           0 :         if (value == NULL) {
    8195           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_type");
    8196           0 :                 return -1;
    8197             :         }
    8198             :         {
    8199           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type));
    8200           0 :                 if (PyLong_Check(value)) {
    8201             :                         unsigned long long test_var;
    8202           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8203           0 :                         if (PyErr_Occurred() != NULL) {
    8204           0 :                                 return -1;
    8205             :                         }
    8206           0 :                         if (test_var > uint_max) {
    8207           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8208             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8209           0 :                                 return -1;
    8210             :                         }
    8211           0 :                         object->server_type = test_var;
    8212             :                 } else {
    8213           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8214             :                           PyLong_Type.tp_name);
    8215           0 :                         return -1;
    8216             :                 }
    8217             :         }
    8218           0 :         return 0;
    8219             : }
    8220             : 
    8221           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid(PyObject *obj, void *closure)
    8222             : {
    8223           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8224             :         PyObject *py_domain_uuid;
    8225           0 :         py_domain_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_uuid);
    8226           0 :         return py_domain_uuid;
    8227             : }
    8228             : 
    8229           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid(PyObject *py_obj, PyObject *value, void *closure)
    8230             : {
    8231           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8232           0 :         if (value == NULL) {
    8233           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_uuid");
    8234           0 :                 return -1;
    8235             :         }
    8236           0 :         PY_CHECK_TYPE(GUID_Type, value, return -1;);
    8237           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8238           0 :                 PyErr_NoMemory();
    8239           0 :                 return -1;
    8240             :         }
    8241           0 :         object->domain_uuid = *(struct GUID *)pytalloc_get_ptr(value);
    8242           0 :         return 0;
    8243             : }
    8244             : 
    8245           1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest(PyObject *obj, void *closure)
    8246             : {
    8247           1 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8248             :         PyObject *py_forest;
    8249           1 :         py_forest = PyString_FromStringOrNULL(object->forest);
    8250           1 :         return py_forest;
    8251             : }
    8252             : 
    8253           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest(PyObject *py_obj, PyObject *value, void *closure)
    8254             : {
    8255           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8256           0 :         if (value == NULL) {
    8257           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest");
    8258           0 :                 return -1;
    8259             :         }
    8260             :         {
    8261             :                 const char *test_str;
    8262             :                 const char *talloc_str;
    8263           0 :                 PyObject *unicode = NULL;
    8264           0 :                 if (PyUnicode_Check(value)) {
    8265           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8266           0 :                         if (unicode == NULL) {
    8267           0 :                                 PyErr_NoMemory();
    8268           0 :                                 return -1;
    8269             :                         }
    8270           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8271           0 :                 } else if (PyBytes_Check(value)) {
    8272           0 :                         test_str = PyBytes_AS_STRING(value);
    8273             :                 } else {
    8274           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8275           0 :                         return -1;
    8276             :                 }
    8277           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8278           0 :                 if (unicode != NULL) {
    8279           0 :                         Py_DECREF(unicode);
    8280             :                 }
    8281           0 :                 if (talloc_str == NULL) {
    8282           0 :                         PyErr_NoMemory();
    8283           0 :                         return -1;
    8284             :                 }
    8285           0 :                 object->forest = talloc_str;
    8286             :         }
    8287           0 :         return 0;
    8288             : }
    8289             : 
    8290         241 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain(PyObject *obj, void *closure)
    8291             : {
    8292         241 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8293             :         PyObject *py_dns_domain;
    8294         241 :         py_dns_domain = PyString_FromStringOrNULL(object->dns_domain);
    8295         241 :         return py_dns_domain;
    8296             : }
    8297             : 
    8298           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
    8299             : {
    8300           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8301           0 :         if (value == NULL) {
    8302           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
    8303           0 :                 return -1;
    8304             :         }
    8305             :         {
    8306             :                 const char *test_str;
    8307             :                 const char *talloc_str;
    8308           0 :                 PyObject *unicode = NULL;
    8309           0 :                 if (PyUnicode_Check(value)) {
    8310           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8311           0 :                         if (unicode == NULL) {
    8312           0 :                                 PyErr_NoMemory();
    8313           0 :                                 return -1;
    8314             :                         }
    8315           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8316           0 :                 } else if (PyBytes_Check(value)) {
    8317           0 :                         test_str = PyBytes_AS_STRING(value);
    8318             :                 } else {
    8319           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8320           0 :                         return -1;
    8321             :                 }
    8322           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8323           0 :                 if (unicode != NULL) {
    8324           0 :                         Py_DECREF(unicode);
    8325             :                 }
    8326           0 :                 if (talloc_str == NULL) {
    8327           0 :                         PyErr_NoMemory();
    8328           0 :                         return -1;
    8329             :                 }
    8330           0 :                 object->dns_domain = talloc_str;
    8331             :         }
    8332           0 :         return 0;
    8333             : }
    8334             : 
    8335          83 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name(PyObject *obj, void *closure)
    8336             : {
    8337          83 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8338             :         PyObject *py_pdc_dns_name;
    8339          83 :         py_pdc_dns_name = PyString_FromStringOrNULL(object->pdc_dns_name);
    8340          83 :         return py_pdc_dns_name;
    8341             : }
    8342             : 
    8343           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name(PyObject *py_obj, PyObject *value, void *closure)
    8344             : {
    8345           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8346           0 :         if (value == NULL) {
    8347           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_dns_name");
    8348           0 :                 return -1;
    8349             :         }
    8350             :         {
    8351             :                 const char *test_str;
    8352             :                 const char *talloc_str;
    8353           0 :                 PyObject *unicode = NULL;
    8354           0 :                 if (PyUnicode_Check(value)) {
    8355           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8356           0 :                         if (unicode == NULL) {
    8357           0 :                                 PyErr_NoMemory();
    8358           0 :                                 return -1;
    8359             :                         }
    8360           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8361           0 :                 } else if (PyBytes_Check(value)) {
    8362           0 :                         test_str = PyBytes_AS_STRING(value);
    8363             :                 } else {
    8364           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8365           0 :                         return -1;
    8366             :                 }
    8367           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8368           0 :                 if (unicode != NULL) {
    8369           0 :                         Py_DECREF(unicode);
    8370             :                 }
    8371           0 :                 if (talloc_str == NULL) {
    8372           0 :                         PyErr_NoMemory();
    8373           0 :                         return -1;
    8374             :                 }
    8375           0 :                 object->pdc_dns_name = talloc_str;
    8376             :         }
    8377           0 :         return 0;
    8378             : }
    8379             : 
    8380           1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name(PyObject *obj, void *closure)
    8381             : {
    8382           1 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8383             :         PyObject *py_domain_name;
    8384           1 :         py_domain_name = PyString_FromStringOrNULL(object->domain_name);
    8385           1 :         return py_domain_name;
    8386             : }
    8387             : 
    8388           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    8389             : {
    8390           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8391           0 :         if (value == NULL) {
    8392           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
    8393           0 :                 return -1;
    8394             :         }
    8395             :         {
    8396             :                 const char *test_str;
    8397             :                 const char *talloc_str;
    8398           0 :                 PyObject *unicode = NULL;
    8399           0 :                 if (PyUnicode_Check(value)) {
    8400           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8401           0 :                         if (unicode == NULL) {
    8402           0 :                                 PyErr_NoMemory();
    8403           0 :                                 return -1;
    8404             :                         }
    8405           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8406           0 :                 } else if (PyBytes_Check(value)) {
    8407           0 :                         test_str = PyBytes_AS_STRING(value);
    8408             :                 } else {
    8409           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8410           0 :                         return -1;
    8411             :                 }
    8412           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8413           0 :                 if (unicode != NULL) {
    8414           0 :                         Py_DECREF(unicode);
    8415             :                 }
    8416           0 :                 if (talloc_str == NULL) {
    8417           0 :                         PyErr_NoMemory();
    8418           0 :                         return -1;
    8419             :                 }
    8420           0 :                 object->domain_name = talloc_str;
    8421             :         }
    8422           0 :         return 0;
    8423             : }
    8424             : 
    8425          22 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name(PyObject *obj, void *closure)
    8426             : {
    8427          22 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8428             :         PyObject *py_pdc_name;
    8429          22 :         py_pdc_name = PyString_FromStringOrNULL(object->pdc_name);
    8430          22 :         return py_pdc_name;
    8431             : }
    8432             : 
    8433           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name(PyObject *py_obj, PyObject *value, void *closure)
    8434             : {
    8435           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8436           0 :         if (value == NULL) {
    8437           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_name");
    8438           0 :                 return -1;
    8439             :         }
    8440             :         {
    8441             :                 const char *test_str;
    8442             :                 const char *talloc_str;
    8443           0 :                 PyObject *unicode = NULL;
    8444           0 :                 if (PyUnicode_Check(value)) {
    8445           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8446           0 :                         if (unicode == NULL) {
    8447           0 :                                 PyErr_NoMemory();
    8448           0 :                                 return -1;
    8449             :                         }
    8450           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8451           0 :                 } else if (PyBytes_Check(value)) {
    8452           0 :                         test_str = PyBytes_AS_STRING(value);
    8453             :                 } else {
    8454           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8455           0 :                         return -1;
    8456             :                 }
    8457           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8458           0 :                 if (unicode != NULL) {
    8459           0 :                         Py_DECREF(unicode);
    8460             :                 }
    8461           0 :                 if (talloc_str == NULL) {
    8462           0 :                         PyErr_NoMemory();
    8463           0 :                         return -1;
    8464             :                 }
    8465           0 :                 object->pdc_name = talloc_str;
    8466             :         }
    8467           0 :         return 0;
    8468             : }
    8469             : 
    8470           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name(PyObject *obj, void *closure)
    8471             : {
    8472           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8473             :         PyObject *py_user_name;
    8474           0 :         py_user_name = PyString_FromStringOrNULL(object->user_name);
    8475           0 :         return py_user_name;
    8476             : }
    8477             : 
    8478           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
    8479             : {
    8480           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8481           0 :         if (value == NULL) {
    8482           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_name");
    8483           0 :                 return -1;
    8484             :         }
    8485             :         {
    8486             :                 const char *test_str;
    8487             :                 const char *talloc_str;
    8488           0 :                 PyObject *unicode = NULL;
    8489           0 :                 if (PyUnicode_Check(value)) {
    8490           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8491           0 :                         if (unicode == NULL) {
    8492           0 :                                 PyErr_NoMemory();
    8493           0 :                                 return -1;
    8494             :                         }
    8495           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8496           0 :                 } else if (PyBytes_Check(value)) {
    8497           0 :                         test_str = PyBytes_AS_STRING(value);
    8498             :                 } else {
    8499           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8500           0 :                         return -1;
    8501             :                 }
    8502           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8503           0 :                 if (unicode != NULL) {
    8504           0 :                         Py_DECREF(unicode);
    8505             :                 }
    8506           0 :                 if (talloc_str == NULL) {
    8507           0 :                         PyErr_NoMemory();
    8508           0 :                         return -1;
    8509             :                 }
    8510           0 :                 object->user_name = talloc_str;
    8511             :         }
    8512           0 :         return 0;
    8513             : }
    8514             : 
    8515           1 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site(PyObject *obj, void *closure)
    8516             : {
    8517           1 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8518             :         PyObject *py_server_site;
    8519           1 :         py_server_site = PyString_FromStringOrNULL(object->server_site);
    8520           1 :         return py_server_site;
    8521             : }
    8522             : 
    8523           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site(PyObject *py_obj, PyObject *value, void *closure)
    8524             : {
    8525           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8526           0 :         if (value == NULL) {
    8527           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_site");
    8528           0 :                 return -1;
    8529             :         }
    8530             :         {
    8531             :                 const char *test_str;
    8532             :                 const char *talloc_str;
    8533           0 :                 PyObject *unicode = NULL;
    8534           0 :                 if (PyUnicode_Check(value)) {
    8535           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8536           0 :                         if (unicode == NULL) {
    8537           0 :                                 PyErr_NoMemory();
    8538           0 :                                 return -1;
    8539             :                         }
    8540           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8541           0 :                 } else if (PyBytes_Check(value)) {
    8542           0 :                         test_str = PyBytes_AS_STRING(value);
    8543             :                 } else {
    8544           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8545           0 :                         return -1;
    8546             :                 }
    8547           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8548           0 :                 if (unicode != NULL) {
    8549           0 :                         Py_DECREF(unicode);
    8550             :                 }
    8551           0 :                 if (talloc_str == NULL) {
    8552           0 :                         PyErr_NoMemory();
    8553           0 :                         return -1;
    8554             :                 }
    8555           0 :                 object->server_site = talloc_str;
    8556             :         }
    8557           0 :         return 0;
    8558             : }
    8559             : 
    8560         185 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site(PyObject *obj, void *closure)
    8561             : {
    8562         185 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8563             :         PyObject *py_client_site;
    8564         185 :         py_client_site = PyString_FromStringOrNULL(object->client_site);
    8565         185 :         return py_client_site;
    8566             : }
    8567             : 
    8568           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site(PyObject *py_obj, PyObject *value, void *closure)
    8569             : {
    8570           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8571           0 :         if (value == NULL) {
    8572           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_site");
    8573           0 :                 return -1;
    8574             :         }
    8575             :         {
    8576             :                 const char *test_str;
    8577             :                 const char *talloc_str;
    8578           0 :                 PyObject *unicode = NULL;
    8579           0 :                 if (PyUnicode_Check(value)) {
    8580           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8581           0 :                         if (unicode == NULL) {
    8582           0 :                                 PyErr_NoMemory();
    8583           0 :                                 return -1;
    8584             :                         }
    8585           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8586           0 :                 } else if (PyBytes_Check(value)) {
    8587           0 :                         test_str = PyBytes_AS_STRING(value);
    8588             :                 } else {
    8589           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8590           0 :                         return -1;
    8591             :                 }
    8592           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8593           0 :                 if (unicode != NULL) {
    8594           0 :                         Py_DECREF(unicode);
    8595             :                 }
    8596           0 :                 if (talloc_str == NULL) {
    8597           0 :                         PyErr_NoMemory();
    8598           0 :                         return -1;
    8599             :                 }
    8600           0 :                 object->client_site = talloc_str;
    8601             :         }
    8602           0 :         return 0;
    8603             : }
    8604             : 
    8605           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size(PyObject *obj, void *closure)
    8606             : {
    8607           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8608             :         PyObject *py_sockaddr_size;
    8609           0 :         py_sockaddr_size = PyLong_FromLong((uint16_t)object->sockaddr_size);
    8610           0 :         return py_sockaddr_size;
    8611             : }
    8612             : 
    8613           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size(PyObject *py_obj, PyObject *value, void *closure)
    8614             : {
    8615           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8616           0 :         if (value == NULL) {
    8617           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr_size");
    8618           0 :                 return -1;
    8619             :         }
    8620             :         {
    8621           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sockaddr_size));
    8622           0 :                 if (PyLong_Check(value)) {
    8623             :                         unsigned long long test_var;
    8624           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8625           0 :                         if (PyErr_Occurred() != NULL) {
    8626           0 :                                 return -1;
    8627             :                         }
    8628           0 :                         if (test_var > uint_max) {
    8629           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8630             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8631           0 :                                 return -1;
    8632             :                         }
    8633           0 :                         object->sockaddr_size = test_var;
    8634             :                 } else {
    8635           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8636             :                           PyLong_Type.tp_name);
    8637           0 :                         return -1;
    8638             :                 }
    8639             :         }
    8640           0 :         return 0;
    8641             : }
    8642             : 
    8643           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr(PyObject *obj, void *closure)
    8644             : {
    8645           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8646             :         PyObject *py_sockaddr;
    8647           0 :         py_sockaddr = pytalloc_reference_ex(&nbt_sockaddr_Type, pytalloc_get_mem_ctx(obj), &object->sockaddr);
    8648           0 :         return py_sockaddr;
    8649             : }
    8650             : 
    8651           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr(PyObject *py_obj, PyObject *value, void *closure)
    8652             : {
    8653           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8654           0 :         if (value == NULL) {
    8655           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sockaddr");
    8656           0 :                 return -1;
    8657             :         }
    8658           0 :         PY_CHECK_TYPE(&nbt_sockaddr_Type, value, return -1;);
    8659           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8660           0 :                 PyErr_NoMemory();
    8661           0 :                 return -1;
    8662             :         }
    8663           0 :         object->sockaddr = *(struct nbt_sockaddr *)pytalloc_get_ptr(value);
    8664           0 :         return 0;
    8665             : }
    8666             : 
    8667           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site(PyObject *obj, void *closure)
    8668             : {
    8669           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8670             :         PyObject *py_next_closest_site;
    8671           0 :         py_next_closest_site = PyString_FromStringOrNULL(object->next_closest_site);
    8672           0 :         return py_next_closest_site;
    8673             : }
    8674             : 
    8675           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site(PyObject *py_obj, PyObject *value, void *closure)
    8676             : {
    8677           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8678           0 :         if (value == NULL) {
    8679           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->next_closest_site");
    8680           0 :                 return -1;
    8681             :         }
    8682             :         {
    8683             :                 const char *test_str;
    8684             :                 const char *talloc_str;
    8685           0 :                 PyObject *unicode = NULL;
    8686           0 :                 if (PyUnicode_Check(value)) {
    8687           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8688           0 :                         if (unicode == NULL) {
    8689           0 :                                 PyErr_NoMemory();
    8690           0 :                                 return -1;
    8691             :                         }
    8692           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8693           0 :                 } else if (PyBytes_Check(value)) {
    8694           0 :                         test_str = PyBytes_AS_STRING(value);
    8695             :                 } else {
    8696           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8697           0 :                         return -1;
    8698             :                 }
    8699           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8700           0 :                 if (unicode != NULL) {
    8701           0 :                         Py_DECREF(unicode);
    8702             :                 }
    8703           0 :                 if (talloc_str == NULL) {
    8704           0 :                         PyErr_NoMemory();
    8705           0 :                         return -1;
    8706             :                 }
    8707           0 :                 object->next_closest_site = talloc_str;
    8708             :         }
    8709           0 :         return 0;
    8710             : }
    8711             : 
    8712           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version(PyObject *obj, void *closure)
    8713             : {
    8714           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8715             :         PyObject *py_nt_version;
    8716           0 :         py_nt_version = PyLong_FromUnsignedLongLong((uint32_t)object->nt_version);
    8717           0 :         return py_nt_version;
    8718             : }
    8719             : 
    8720           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version(PyObject *py_obj, PyObject *value, void *closure)
    8721             : {
    8722           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8723           0 :         if (value == NULL) {
    8724           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_version");
    8725           0 :                 return -1;
    8726             :         }
    8727             :         {
    8728           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_version));
    8729           0 :                 if (PyLong_Check(value)) {
    8730             :                         unsigned long long test_var;
    8731           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8732           0 :                         if (PyErr_Occurred() != NULL) {
    8733           0 :                                 return -1;
    8734             :                         }
    8735           0 :                         if (test_var > uint_max) {
    8736           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8737             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8738           0 :                                 return -1;
    8739             :                         }
    8740           0 :                         object->nt_version = test_var;
    8741             :                 } else {
    8742           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8743             :                           PyLong_Type.tp_name);
    8744           0 :                         return -1;
    8745             :                 }
    8746             :         }
    8747           0 :         return 0;
    8748             : }
    8749             : 
    8750           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token(PyObject *obj, void *closure)
    8751             : {
    8752           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8753             :         PyObject *py_lmnt_token;
    8754           0 :         py_lmnt_token = PyLong_FromLong((uint16_t)object->lmnt_token);
    8755           0 :         return py_lmnt_token;
    8756             : }
    8757             : 
    8758           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token(PyObject *py_obj, PyObject *value, void *closure)
    8759             : {
    8760           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8761           0 :         if (value == NULL) {
    8762           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmnt_token");
    8763           0 :                 return -1;
    8764             :         }
    8765             :         {
    8766           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmnt_token));
    8767           0 :                 if (PyLong_Check(value)) {
    8768             :                         unsigned long long test_var;
    8769           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8770           0 :                         if (PyErr_Occurred() != NULL) {
    8771           0 :                                 return -1;
    8772             :                         }
    8773           0 :                         if (test_var > uint_max) {
    8774           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8775             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8776           0 :                                 return -1;
    8777             :                         }
    8778           0 :                         object->lmnt_token = test_var;
    8779             :                 } else {
    8780           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8781             :                           PyLong_Type.tp_name);
    8782           0 :                         return -1;
    8783             :                 }
    8784             :         }
    8785           0 :         return 0;
    8786             : }
    8787             : 
    8788           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token(PyObject *obj, void *closure)
    8789             : {
    8790           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(obj);
    8791             :         PyObject *py_lm20_token;
    8792           0 :         py_lm20_token = PyLong_FromLong((uint16_t)object->lm20_token);
    8793           0 :         return py_lm20_token;
    8794             : }
    8795             : 
    8796           0 : static int py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token(PyObject *py_obj, PyObject *value, void *closure)
    8797             : {
    8798           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8799           0 :         if (value == NULL) {
    8800           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm20_token");
    8801           0 :                 return -1;
    8802             :         }
    8803             :         {
    8804           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm20_token));
    8805           0 :                 if (PyLong_Check(value)) {
    8806             :                         unsigned long long test_var;
    8807           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8808           0 :                         if (PyErr_Occurred() != NULL) {
    8809           0 :                                 return -1;
    8810             :                         }
    8811           0 :                         if (test_var > uint_max) {
    8812           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8813             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8814           0 :                                 return -1;
    8815             :                         }
    8816           0 :                         object->lm20_token = test_var;
    8817             :                 } else {
    8818           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8819             :                           PyLong_Type.tp_name);
    8820           0 :                         return -1;
    8821             :                 }
    8822             :         }
    8823           0 :         return 0;
    8824             : }
    8825             : 
    8826             : static PyGetSetDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters[] = {
    8827             :         {
    8828             :                 .name = discard_const_p(char, "command"),
    8829             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_command,
    8830             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_command,
    8831             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_command")
    8832             :         },
    8833             :         {
    8834             :                 .name = discard_const_p(char, "sbz"),
    8835             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sbz,
    8836             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sbz,
    8837             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8838             :         },
    8839             :         {
    8840             :                 .name = discard_const_p(char, "server_type"),
    8841             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_type,
    8842             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_type,
    8843             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_server_type")
    8844             :         },
    8845             :         {
    8846             :                 .name = discard_const_p(char, "domain_uuid"),
    8847             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_uuid,
    8848             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_uuid,
    8849             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    8850             :         },
    8851             :         {
    8852             :                 .name = discard_const_p(char, "forest"),
    8853             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_forest,
    8854             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_forest,
    8855             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8856             :         },
    8857             :         {
    8858             :                 .name = discard_const_p(char, "dns_domain"),
    8859             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_dns_domain,
    8860             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_dns_domain,
    8861             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8862             :         },
    8863             :         {
    8864             :                 .name = discard_const_p(char, "pdc_dns_name"),
    8865             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_dns_name,
    8866             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_dns_name,
    8867             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8868             :         },
    8869             :         {
    8870             :                 .name = discard_const_p(char, "domain_name"),
    8871             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_domain_name,
    8872             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_domain_name,
    8873             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8874             :         },
    8875             :         {
    8876             :                 .name = discard_const_p(char, "pdc_name"),
    8877             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_pdc_name,
    8878             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_pdc_name,
    8879             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8880             :         },
    8881             :         {
    8882             :                 .name = discard_const_p(char, "user_name"),
    8883             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_user_name,
    8884             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_user_name,
    8885             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8886             :         },
    8887             :         {
    8888             :                 .name = discard_const_p(char, "server_site"),
    8889             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_server_site,
    8890             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_server_site,
    8891             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8892             :         },
    8893             :         {
    8894             :                 .name = discard_const_p(char, "client_site"),
    8895             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_client_site,
    8896             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_client_site,
    8897             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8898             :         },
    8899             :         {
    8900             :                 .name = discard_const_p(char, "sockaddr_size"),
    8901             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr_size,
    8902             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr_size,
    8903             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    8904             :         },
    8905             :         {
    8906             :                 .name = discard_const_p(char, "sockaddr"),
    8907             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_sockaddr,
    8908             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_sockaddr,
    8909             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_sockaddr")
    8910             :         },
    8911             :         {
    8912             :                 .name = discard_const_p(char, "next_closest_site"),
    8913             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_next_closest_site,
    8914             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_next_closest_site,
    8915             :                 .doc = discard_const_p(char, "PIDL-generated element of base type nbt_string")
    8916             :         },
    8917             :         {
    8918             :                 .name = discard_const_p(char, "nt_version"),
    8919             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_nt_version,
    8920             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_nt_version,
    8921             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netlogon_nt_version_flags")
    8922             :         },
    8923             :         {
    8924             :                 .name = discard_const_p(char, "lmnt_token"),
    8925             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lmnt_token,
    8926             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lmnt_token,
    8927             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8928             :         },
    8929             :         {
    8930             :                 .name = discard_const_p(char, "lm20_token"),
    8931             :                 .get = py_NETLOGON_SAM_LOGON_RESPONSE_EX_get_lm20_token,
    8932             :                 .set = py_NETLOGON_SAM_LOGON_RESPONSE_EX_set_lm20_token,
    8933             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8934             :         },
    8935             :         { .name = NULL }
    8936             : };
    8937             : 
    8938           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8939             : {
    8940           0 :         return pytalloc_new(struct NETLOGON_SAM_LOGON_RESPONSE_EX, type);
    8941             : }
    8942             : 
    8943           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    8944             : {
    8945           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8946           0 :         PyObject *ret = NULL;
    8947             :         DATA_BLOB blob;
    8948             :         enum ndr_err_code err;
    8949           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    8950           0 :         if (tmp_ctx == NULL) {
    8951           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8952           0 :                 return NULL;
    8953             :         }
    8954           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX);
    8955           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8956           0 :                 TALLOC_FREE(tmp_ctx);
    8957           0 :                 PyErr_SetNdrError(err);
    8958           0 :                 return NULL;
    8959             :         }
    8960             : 
    8961           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8962           0 :         TALLOC_FREE(tmp_ctx);
    8963           0 :         return ret;
    8964             : }
    8965             : 
    8966           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8967             : {
    8968           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    8969           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    8970           0 :         Py_ssize_t blob_length = 0;
    8971             :         enum ndr_err_code err;
    8972           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    8973           0 :         PyObject *allow_remaining_obj = NULL;
    8974           0 :         bool allow_remaining = false;
    8975             : 
    8976           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    8977             :                 discard_const_p(char *, kwnames),
    8978             :                 &blob.data, &blob_length,
    8979             :                 &allow_remaining_obj)) {
    8980           0 :                 return NULL;
    8981             :         }
    8982           0 :         blob.length = blob_length;
    8983             : 
    8984           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8985           0 :                 allow_remaining = true;
    8986             :         }
    8987             : 
    8988           0 :         if (allow_remaining) {
    8989           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
    8990             :         } else {
    8991           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX);
    8992             :         }
    8993           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8994           0 :                 PyErr_SetNdrError(err);
    8995           0 :                 return NULL;
    8996             :         }
    8997             : 
    8998           0 :         Py_RETURN_NONE;
    8999             : }
    9000             : 
    9001           0 : static PyObject *py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9002             : {
    9003           0 :         struct NETLOGON_SAM_LOGON_RESPONSE_EX *object = (struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(py_obj);
    9004             :         PyObject *ret;
    9005             :         char *retstr;
    9006             : 
    9007           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX, "NETLOGON_SAM_LOGON_RESPONSE_EX", object);
    9008           0 :         ret = PyUnicode_FromString(retstr);
    9009           0 :         talloc_free(retstr);
    9010             : 
    9011           0 :         return ret;
    9012             : }
    9013             : 
    9014             : static PyMethodDef py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods[] = {
    9015             :         { "__ndr_pack__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    9016             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    9017             :         { "__ndr_print__", (PyCFunction)py_NETLOGON_SAM_LOGON_RESPONSE_EX_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    9018             :         { NULL, NULL, 0, NULL }
    9019             : };
    9020             : 
    9021             : 
    9022             : static PyTypeObject NETLOGON_SAM_LOGON_RESPONSE_EX_Type = {
    9023             :         PyVarObject_HEAD_INIT(NULL, 0)
    9024             :         .tp_name = "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX",
    9025             :         .tp_getset = py_NETLOGON_SAM_LOGON_RESPONSE_EX_getsetters,
    9026             :         .tp_methods = py_NETLOGON_SAM_LOGON_RESPONSE_EX_methods,
    9027             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9028             :         .tp_new = py_NETLOGON_SAM_LOGON_RESPONSE_EX_new,
    9029             : };
    9030             : 
    9031           0 : static PyObject *py_import_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, union netlogon_samlogon_response_union *in)
    9032             : {
    9033             :         PyObject *ret;
    9034             : 
    9035           0 :         switch (level) {
    9036           0 :                 case NETLOGON_NT_VERSION_1:
    9037           0 :                         ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, mem_ctx, &in->nt4);
    9038           0 :                         return ret;
    9039             : 
    9040           0 :                 case NETLOGON_NT_VERSION_5:
    9041           0 :                         ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_Type, mem_ctx, &in->nt5);
    9042           0 :                         return ret;
    9043             : 
    9044           0 :                 case NETLOGON_NT_VERSION_5EX:
    9045           0 :                         ret = pytalloc_reference_ex(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, mem_ctx, &in->nt5_ex);
    9046           0 :                         return ret;
    9047             : 
    9048             :         }
    9049           0 :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    9050           0 :         return NULL;
    9051             : }
    9052             : 
    9053           0 : static union netlogon_samlogon_response_union *py_export_netlogon_samlogon_response_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    9054             : {
    9055           0 :         union netlogon_samlogon_response_union *ret = talloc_zero(mem_ctx, union netlogon_samlogon_response_union);
    9056           0 :         switch (level) {
    9057           0 :                 case NETLOGON_NT_VERSION_1:
    9058           0 :                         if (in == NULL) {
    9059           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt4");
    9060           0 :                                 talloc_free(ret); return NULL;
    9061             :                         }
    9062           0 :                         PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_NT40_Type, in, talloc_free(ret); return NULL;);
    9063           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    9064           0 :                                 PyErr_NoMemory();
    9065           0 :                                 talloc_free(ret); return NULL;
    9066             :                         }
    9067           0 :                         ret->nt4 = *(struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *)pytalloc_get_ptr(in);
    9068           0 :                         break;
    9069             : 
    9070           0 :                 case NETLOGON_NT_VERSION_5:
    9071           0 :                         if (in == NULL) {
    9072           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt5");
    9073           0 :                                 talloc_free(ret); return NULL;
    9074             :                         }
    9075           0 :                         PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_Type, in, talloc_free(ret); return NULL;);
    9076           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    9077           0 :                                 PyErr_NoMemory();
    9078           0 :                                 talloc_free(ret); return NULL;
    9079             :                         }
    9080           0 :                         ret->nt5 = *(struct NETLOGON_SAM_LOGON_RESPONSE *)pytalloc_get_ptr(in);
    9081           0 :                         break;
    9082             : 
    9083           0 :                 case NETLOGON_NT_VERSION_5EX:
    9084           0 :                         if (in == NULL) {
    9085           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nt5_ex");
    9086           0 :                                 talloc_free(ret); return NULL;
    9087             :                         }
    9088           0 :                         PY_CHECK_TYPE(&NETLOGON_SAM_LOGON_RESPONSE_EX_Type, in, talloc_free(ret); return NULL;);
    9089           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    9090           0 :                                 PyErr_NoMemory();
    9091           0 :                                 talloc_free(ret); return NULL;
    9092             :                         }
    9093           0 :                         ret->nt5_ex = *(struct NETLOGON_SAM_LOGON_RESPONSE_EX *)pytalloc_get_ptr(in);
    9094           0 :                         break;
    9095             : 
    9096           0 :                 default:
    9097           0 :                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
    9098           0 :                         talloc_free(ret);
    9099           0 :                         ret = NULL;
    9100             :         }
    9101             : 
    9102           0 :         return ret;
    9103             : }
    9104             : 
    9105           0 : static PyObject *py_netlogon_samlogon_response_union_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9106             : {
    9107           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    9108           0 :         PyObject *mem_ctx_obj = NULL;
    9109           0 :         TALLOC_CTX *mem_ctx = NULL;
    9110           0 :         int level = 0;
    9111           0 :         PyObject *in_obj = NULL;
    9112           0 :         union netlogon_samlogon_response_union *in = NULL;
    9113             : 
    9114           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    9115             :                 discard_const_p(char *, kwnames),
    9116             :                 &mem_ctx_obj,
    9117             :                 &level,
    9118             :                 &in_obj)) {
    9119           0 :                 return NULL;
    9120             :         }
    9121           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    9122           0 :         if (mem_ctx == NULL) {
    9123           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    9124           0 :                 return NULL;
    9125             :         }
    9126           0 :         in = (union netlogon_samlogon_response_union *)pytalloc_get_ptr(in_obj);
    9127           0 :         if (in == NULL) {
    9128           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netlogon_samlogon_response_union!");
    9129           0 :                 return NULL;
    9130             :         }
    9131             : 
    9132           0 :         return py_import_netlogon_samlogon_response_union(mem_ctx, level, in);
    9133             : }
    9134             : 
    9135           0 : static PyObject *py_netlogon_samlogon_response_union_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9136             : {
    9137           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    9138           0 :         PyObject *mem_ctx_obj = NULL;
    9139           0 :         TALLOC_CTX *mem_ctx = NULL;
    9140           0 :         int level = 0;
    9141           0 :         PyObject *in = NULL;
    9142           0 :         union netlogon_samlogon_response_union *out = NULL;
    9143             : 
    9144           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    9145             :                 discard_const_p(char *, kwnames),
    9146             :                 &mem_ctx_obj,
    9147             :                 &level,
    9148             :                 &in)) {
    9149           0 :                 return NULL;
    9150             :         }
    9151           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    9152           0 :         if (mem_ctx == NULL) {
    9153           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    9154           0 :                 return NULL;
    9155             :         }
    9156             : 
    9157           0 :         out = py_export_netlogon_samlogon_response_union(mem_ctx, level, in);
    9158           0 :         if (out == NULL) {
    9159           0 :                 return NULL;
    9160             :         }
    9161             : 
    9162           0 :         return pytalloc_GenericObject_reference(out);
    9163             : }
    9164             : 
    9165             : static PyMethodDef py_netlogon_samlogon_response_union_methods[] = {
    9166             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_import),
    9167             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    9168             :                 "T.__import__(mem_ctx, level, in) => ret." },
    9169             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_samlogon_response_union_export),
    9170             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    9171             :                 "T.__export__(mem_ctx, level, in) => ret." },
    9172             :         { NULL, NULL, 0, NULL }
    9173             : };
    9174             : 
    9175           0 : static PyObject *py_netlogon_samlogon_response_union_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9176             : {
    9177           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    9178           0 :         return NULL;
    9179             : }
    9180             : 
    9181             : 
    9182             : static PyTypeObject netlogon_samlogon_response_union_Type = {
    9183             :         PyVarObject_HEAD_INIT(NULL, 0)
    9184             :         .tp_name = "nbt.netlogon_samlogon_response_union",
    9185             :         .tp_getset = NULL,
    9186             :         .tp_methods = py_netlogon_samlogon_response_union_methods,
    9187             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9188             :         .tp_new = py_netlogon_samlogon_response_union_new,
    9189             : };
    9190             : 
    9191             : 
    9192           0 : static PyObject *py_netlogon_samlogon_response_get_ntver(PyObject *obj, void *closure)
    9193             : {
    9194           0 :         struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(obj);
    9195             :         PyObject *py_ntver;
    9196           0 :         py_ntver = PyLong_FromUnsignedLongLong((uint32_t)object->ntver);
    9197           0 :         return py_ntver;
    9198             : }
    9199             : 
    9200           0 : static int py_netlogon_samlogon_response_set_ntver(PyObject *py_obj, PyObject *value, void *closure)
    9201             : {
    9202           0 :         struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(py_obj);
    9203           0 :         if (value == NULL) {
    9204           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntver");
    9205           0 :                 return -1;
    9206             :         }
    9207             :         {
    9208           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ntver));
    9209           0 :                 if (PyLong_Check(value)) {
    9210             :                         unsigned long long test_var;
    9211           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    9212           0 :                         if (PyErr_Occurred() != NULL) {
    9213           0 :                                 return -1;
    9214             :                         }
    9215           0 :                         if (test_var > uint_max) {
    9216           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    9217             :                                   PyLong_Type.tp_name, uint_max, test_var);
    9218           0 :                                 return -1;
    9219             :                         }
    9220           0 :                         object->ntver = test_var;
    9221             :                 } else {
    9222           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    9223             :                           PyLong_Type.tp_name);
    9224           0 :                         return -1;
    9225             :                 }
    9226             :         }
    9227           0 :         return 0;
    9228             : }
    9229             : 
    9230           0 : static PyObject *py_netlogon_samlogon_response_get_data(PyObject *obj, void *closure)
    9231             : {
    9232           0 :         struct netlogon_samlogon_response *object = (struct netlogon_samlogon_response *)pytalloc_get_ptr(obj);
    9233             :         PyObject *py_data;
    9234           0 :         py_data = pyrpc_import_union(&netlogon_samlogon_response_union_Type, pytalloc_get_mem_ctx(obj), object->ntver, &object->data, "union netlogon_samlogon_response_union");
    9235           0 :         if (py_data == NULL) {