LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_dcerpc.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 1171 5906 19.8 %
Date: 2021-09-23 10:06:22 Functions: 107 476 22.5 %

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