LCOV - code coverage report
Current view: top level - bin/default/source4/librpc/gen_ndr - py_irpc.c (source / functions) Hit Total Coverage
Test: coverage report for v4-17-test 1498b464 Lines: 210 4317 4.9 %
Date: 2024-06-13 04:01:37 Functions: 3 342 0.9 %

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

Generated by: LCOV version 1.13