LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_epmapper.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 609 3790 16.1 %
Date: 2024-04-21 15:09:00 Functions: 44 268 16.4 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include "lib/replace/system/python.h"
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_epmapper.h"
      12             : #include "bin/default/librpc/gen_ndr/ndr_epmapper_c.h"
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32         432 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34         432 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37         288 :         case 4:
      38         288 :                 return UINT32_MAX;
      39         144 :         case 2:
      40         144 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48             : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50             :         switch (var_size) {
      51             :         case 8:
      52             :                 return INT64_MAX;
      53             :         case 4:
      54             :                 return INT32_MAX;
      55             :         case 2:
      56             :                 return INT16_MAX;
      57             :         case 1:
      58             :                 return INT8_MAX;
      59             :         }
      60             : 
      61             :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/misc.h"
      65             : static PyTypeObject epm_rhs_dnet_nsp_Type;
      66             : static PyTypeObject epm_rhs_osi_tp4_Type;
      67             : static PyTypeObject epm_rhs_osi_clns_Type;
      68             : static PyTypeObject epm_rhs_udp_Type;
      69             : static PyTypeObject epm_rhs_tcp_Type;
      70             : static PyTypeObject epm_rhs_ip_Type;
      71             : static PyTypeObject epm_rhs_ncadg_Type;
      72             : static PyTypeObject epm_rhs_ncacn_Type;
      73             : static PyTypeObject epm_rhs_uuid_Type;
      74             : static PyTypeObject epm_rhs_ipx_Type;
      75             : static PyTypeObject epm_rhs_smb_Type;
      76             : static PyTypeObject epm_rhs_named_pipe_Type;
      77             : static PyTypeObject epm_rhs_netbios_Type;
      78             : static PyTypeObject epm_rhs_netbeui_Type;
      79             : static PyTypeObject epm_rhs_spx_Type;
      80             : static PyTypeObject epm_rhs_nb_ipx_Type;
      81             : static PyTypeObject epm_rhs_http_Type;
      82             : static PyTypeObject epm_rhs_unix_ds_Type;
      83             : static PyTypeObject epm_rhs_null_Type;
      84             : static PyTypeObject epm_rhs_ncalrpc_Type;
      85             : static PyTypeObject epm_rhs_appletalk_Type;
      86             : static PyTypeObject epm_rhs_atalk_stream_Type;
      87             : static PyTypeObject epm_rhs_atalk_datagram_Type;
      88             : static PyTypeObject epm_rhs_vines_spp_Type;
      89             : static PyTypeObject epm_rhs_vines_ipc_Type;
      90             : static PyTypeObject epm_rhs_streettalk_Type;
      91             : static PyTypeObject epm_rhs_Type;
      92             : static PyTypeObject epm_lhs_Type;
      93             : static PyTypeObject epm_floor_Type;
      94             : static PyTypeObject epm_tower_Type;
      95             : static PyTypeObject epm_twr_t_Type;
      96             : static PyTypeObject epm_entry_t_Type;
      97             : static PyTypeObject rpc_if_id_t_Type;
      98             : static PyTypeObject epm_twr_p_t_Type;
      99             : static PyTypeObject epmapper_InterfaceType;
     100             : static PyTypeObject epm_Insert_Type;
     101             : static PyTypeObject epm_Delete_Type;
     102             : static PyTypeObject epm_Lookup_Type;
     103             : static PyTypeObject epm_Map_Type;
     104             : static PyTypeObject epm_LookupHandleFree_Type;
     105             : static PyTypeObject epm_InqObject_Type;
     106             : static PyTypeObject epm_MgmtDelete_Type;
     107             : 
     108             : static PyTypeObject *BaseObject_Type;
     109             : static PyTypeObject *GUID_Type;
     110             : static PyTypeObject *policy_handle_Type;
     111             : static PyTypeObject *ClientConnection_Type;
     112             : static PyTypeObject *ndr_syntax_id_Type;
     113             : 
     114           0 : static PyObject *py_epm_rhs_dnet_nsp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     115             : {
     116           0 :         return pytalloc_new(struct epm_rhs_dnet_nsp, type);
     117             : }
     118             : 
     119             : 
     120             : static PyTypeObject epm_rhs_dnet_nsp_Type = {
     121             :         PyVarObject_HEAD_INIT(NULL, 0)
     122             :         .tp_name = "epmapper.epm_rhs_dnet_nsp",
     123             :         .tp_getset = NULL,
     124             :         .tp_methods = NULL,
     125             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     126             :         .tp_new = py_epm_rhs_dnet_nsp_new,
     127             : };
     128             : 
     129             : 
     130           0 : static PyObject *py_epm_rhs_osi_tp4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     131             : {
     132           0 :         return pytalloc_new(struct epm_rhs_osi_tp4, type);
     133             : }
     134             : 
     135             : 
     136             : static PyTypeObject epm_rhs_osi_tp4_Type = {
     137             :         PyVarObject_HEAD_INIT(NULL, 0)
     138             :         .tp_name = "epmapper.epm_rhs_osi_tp4",
     139             :         .tp_getset = NULL,
     140             :         .tp_methods = NULL,
     141             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     142             :         .tp_new = py_epm_rhs_osi_tp4_new,
     143             : };
     144             : 
     145             : 
     146           0 : static PyObject *py_epm_rhs_osi_clns_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     147             : {
     148           0 :         return pytalloc_new(struct epm_rhs_osi_clns, type);
     149             : }
     150             : 
     151             : 
     152             : static PyTypeObject epm_rhs_osi_clns_Type = {
     153             :         PyVarObject_HEAD_INIT(NULL, 0)
     154             :         .tp_name = "epmapper.epm_rhs_osi_clns",
     155             :         .tp_getset = NULL,
     156             :         .tp_methods = NULL,
     157             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     158             :         .tp_new = py_epm_rhs_osi_clns_new,
     159             : };
     160             : 
     161             : 
     162           0 : static PyObject *py_epm_rhs_udp_get_port(PyObject *obj, void *closure)
     163             : {
     164           0 :         struct epm_rhs_udp *object = pytalloc_get_ptr(obj);
     165           0 :         PyObject *py_port;
     166           0 :         py_port = PyLong_FromLong((uint16_t)(object->port));
     167           0 :         return py_port;
     168             : }
     169             : 
     170           0 : static int py_epm_rhs_udp_set_port(PyObject *py_obj, PyObject *value, void *closure)
     171             : {
     172           0 :         struct epm_rhs_udp *object = pytalloc_get_ptr(py_obj);
     173           0 :         if (value == NULL) {
     174           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port");
     175           0 :                 return -1;
     176             :         }
     177             :         {
     178           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
     179           0 :                 if (PyLong_Check(value)) {
     180           0 :                         unsigned long long test_var;
     181           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     182           0 :                         if (PyErr_Occurred() != NULL) {
     183           0 :                                 return -1;
     184             :                         }
     185           0 :                         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           0 :                         object->port = 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           0 :         return 0;
     198             : }
     199             : 
     200             : static PyGetSetDef py_epm_rhs_udp_getsetters[] = {
     201             :         {
     202             :                 .name = discard_const_p(char, "port"),
     203             :                 .get = py_epm_rhs_udp_get_port,
     204             :                 .set = py_epm_rhs_udp_set_port,
     205             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     206             :         },
     207             :         { .name = NULL }
     208             : };
     209             : 
     210           0 : static PyObject *py_epm_rhs_udp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     211             : {
     212           0 :         return pytalloc_new(struct epm_rhs_udp, type);
     213             : }
     214             : 
     215             : 
     216             : static PyTypeObject epm_rhs_udp_Type = {
     217             :         PyVarObject_HEAD_INIT(NULL, 0)
     218             :         .tp_name = "epmapper.epm_rhs_udp",
     219             :         .tp_getset = py_epm_rhs_udp_getsetters,
     220             :         .tp_methods = NULL,
     221             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     222             :         .tp_new = py_epm_rhs_udp_new,
     223             : };
     224             : 
     225             : 
     226          16 : static PyObject *py_epm_rhs_tcp_get_port(PyObject *obj, void *closure)
     227             : {
     228          16 :         struct epm_rhs_tcp *object = pytalloc_get_ptr(obj);
     229           0 :         PyObject *py_port;
     230          16 :         py_port = PyLong_FromLong((uint16_t)(object->port));
     231          16 :         return py_port;
     232             : }
     233             : 
     234          48 : static int py_epm_rhs_tcp_set_port(PyObject *py_obj, PyObject *value, void *closure)
     235             : {
     236          48 :         struct epm_rhs_tcp *object = pytalloc_get_ptr(py_obj);
     237          48 :         if (value == NULL) {
     238           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port");
     239           0 :                 return -1;
     240             :         }
     241             :         {
     242          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
     243          48 :                 if (PyLong_Check(value)) {
     244           0 :                         unsigned long long test_var;
     245          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
     246          48 :                         if (PyErr_Occurred() != NULL) {
     247           0 :                                 return -1;
     248             :                         }
     249          48 :                         if (test_var > uint_max) {
     250           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     251             :                                   PyLong_Type.tp_name, uint_max, test_var);
     252           0 :                                 return -1;
     253             :                         }
     254          48 :                         object->port = test_var;
     255             :                 } else {
     256           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     257             :                           PyLong_Type.tp_name);
     258           0 :                         return -1;
     259             :                 }
     260             :         }
     261          48 :         return 0;
     262             : }
     263             : 
     264             : static PyGetSetDef py_epm_rhs_tcp_getsetters[] = {
     265             :         {
     266             :                 .name = discard_const_p(char, "port"),
     267             :                 .get = py_epm_rhs_tcp_get_port,
     268             :                 .set = py_epm_rhs_tcp_set_port,
     269             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     270             :         },
     271             :         { .name = NULL }
     272             : };
     273             : 
     274           0 : static PyObject *py_epm_rhs_tcp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     275             : {
     276           0 :         return pytalloc_new(struct epm_rhs_tcp, type);
     277             : }
     278             : 
     279             : 
     280             : static PyTypeObject epm_rhs_tcp_Type = {
     281             :         PyVarObject_HEAD_INIT(NULL, 0)
     282             :         .tp_name = "epmapper.epm_rhs_tcp",
     283             :         .tp_getset = py_epm_rhs_tcp_getsetters,
     284             :         .tp_methods = NULL,
     285             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     286             :         .tp_new = py_epm_rhs_tcp_new,
     287             : };
     288             : 
     289             : 
     290           0 : static PyObject *py_epm_rhs_ip_get_ipaddr(PyObject *obj, void *closure)
     291             : {
     292           0 :         struct epm_rhs_ip *object = pytalloc_get_ptr(obj);
     293           0 :         PyObject *py_ipaddr;
     294           0 :         py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
     295           0 :         return py_ipaddr;
     296             : }
     297             : 
     298          48 : static int py_epm_rhs_ip_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
     299             : {
     300          48 :         struct epm_rhs_ip *object = pytalloc_get_ptr(py_obj);
     301          48 :         if (value == NULL) {
     302           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ipaddr");
     303           0 :                 return -1;
     304             :         }
     305             :         {
     306           0 :                 const char *test_str;
     307           0 :                 const char *talloc_str;
     308          48 :                 PyObject *unicode = NULL;
     309          48 :                 if (PyUnicode_Check(value)) {
     310          48 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     311          48 :                         if (unicode == NULL) {
     312           0 :                                 return -1;
     313             :                         }
     314          48 :                         test_str = PyBytes_AS_STRING(unicode);
     315           0 :                 } else if (PyBytes_Check(value)) {
     316           0 :                         test_str = PyBytes_AS_STRING(value);
     317             :                 } else {
     318           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     319           0 :                         return -1;
     320             :                 }
     321          48 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     322          48 :                 if (unicode != NULL) {
     323          32 :                         Py_DECREF(unicode);
     324             :                 }
     325          48 :                 if (talloc_str == NULL) {
     326           0 :                         PyErr_NoMemory();
     327           0 :                         return -1;
     328             :                 }
     329          48 :                 object->ipaddr = talloc_str;
     330             :         }
     331          48 :         return 0;
     332             : }
     333             : 
     334             : static PyGetSetDef py_epm_rhs_ip_getsetters[] = {
     335             :         {
     336             :                 .name = discard_const_p(char, "ipaddr"),
     337             :                 .get = py_epm_rhs_ip_get_ipaddr,
     338             :                 .set = py_epm_rhs_ip_set_ipaddr,
     339             :                 .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
     340             :         },
     341             :         { .name = NULL }
     342             : };
     343             : 
     344           0 : static PyObject *py_epm_rhs_ip_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     345             : {
     346           0 :         return pytalloc_new(struct epm_rhs_ip, type);
     347             : }
     348             : 
     349             : 
     350             : static PyTypeObject epm_rhs_ip_Type = {
     351             :         PyVarObject_HEAD_INIT(NULL, 0)
     352             :         .tp_name = "epmapper.epm_rhs_ip",
     353             :         .tp_getset = py_epm_rhs_ip_getsetters,
     354             :         .tp_methods = NULL,
     355             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     356             :         .tp_new = py_epm_rhs_ip_new,
     357             : };
     358             : 
     359             : 
     360           0 : static PyObject *py_epm_rhs_ncadg_get_minor_version(PyObject *obj, void *closure)
     361             : {
     362           0 :         struct epm_rhs_ncadg *object = pytalloc_get_ptr(obj);
     363           0 :         PyObject *py_minor_version;
     364           0 :         py_minor_version = PyLong_FromLong((uint16_t)(object->minor_version));
     365           0 :         return py_minor_version;
     366             : }
     367             : 
     368           0 : static int py_epm_rhs_ncadg_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
     369             : {
     370           0 :         struct epm_rhs_ncadg *object = pytalloc_get_ptr(py_obj);
     371           0 :         if (value == NULL) {
     372           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor_version");
     373           0 :                 return -1;
     374             :         }
     375             :         {
     376           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor_version));
     377           0 :                 if (PyLong_Check(value)) {
     378           0 :                         unsigned long long test_var;
     379           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     380           0 :                         if (PyErr_Occurred() != NULL) {
     381           0 :                                 return -1;
     382             :                         }
     383           0 :                         if (test_var > uint_max) {
     384           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     385             :                                   PyLong_Type.tp_name, uint_max, test_var);
     386           0 :                                 return -1;
     387             :                         }
     388           0 :                         object->minor_version = test_var;
     389             :                 } else {
     390           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     391             :                           PyLong_Type.tp_name);
     392           0 :                         return -1;
     393             :                 }
     394             :         }
     395           0 :         return 0;
     396             : }
     397             : 
     398             : static PyGetSetDef py_epm_rhs_ncadg_getsetters[] = {
     399             :         {
     400             :                 .name = discard_const_p(char, "minor_version"),
     401             :                 .get = py_epm_rhs_ncadg_get_minor_version,
     402             :                 .set = py_epm_rhs_ncadg_set_minor_version,
     403             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     404             :         },
     405             :         { .name = NULL }
     406             : };
     407             : 
     408           0 : static PyObject *py_epm_rhs_ncadg_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     409             : {
     410           0 :         return pytalloc_new(struct epm_rhs_ncadg, type);
     411             : }
     412             : 
     413             : 
     414             : static PyTypeObject epm_rhs_ncadg_Type = {
     415             :         PyVarObject_HEAD_INIT(NULL, 0)
     416             :         .tp_name = "epmapper.epm_rhs_ncadg",
     417             :         .tp_getset = py_epm_rhs_ncadg_getsetters,
     418             :         .tp_methods = NULL,
     419             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     420             :         .tp_new = py_epm_rhs_ncadg_new,
     421             : };
     422             : 
     423             : 
     424           0 : static PyObject *py_epm_rhs_ncacn_get_minor_version(PyObject *obj, void *closure)
     425             : {
     426           0 :         struct epm_rhs_ncacn *object = pytalloc_get_ptr(obj);
     427           0 :         PyObject *py_minor_version;
     428           0 :         py_minor_version = PyLong_FromLong((uint16_t)(object->minor_version));
     429           0 :         return py_minor_version;
     430             : }
     431             : 
     432          48 : static int py_epm_rhs_ncacn_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
     433             : {
     434          48 :         struct epm_rhs_ncacn *object = pytalloc_get_ptr(py_obj);
     435          48 :         if (value == NULL) {
     436           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor_version");
     437           0 :                 return -1;
     438             :         }
     439             :         {
     440          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor_version));
     441          48 :                 if (PyLong_Check(value)) {
     442           0 :                         unsigned long long test_var;
     443          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
     444          48 :                         if (PyErr_Occurred() != NULL) {
     445           0 :                                 return -1;
     446             :                         }
     447          48 :                         if (test_var > uint_max) {
     448           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     449             :                                   PyLong_Type.tp_name, uint_max, test_var);
     450           0 :                                 return -1;
     451             :                         }
     452          48 :                         object->minor_version = test_var;
     453             :                 } else {
     454           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     455             :                           PyLong_Type.tp_name);
     456           0 :                         return -1;
     457             :                 }
     458             :         }
     459          48 :         return 0;
     460             : }
     461             : 
     462             : static PyGetSetDef py_epm_rhs_ncacn_getsetters[] = {
     463             :         {
     464             :                 .name = discard_const_p(char, "minor_version"),
     465             :                 .get = py_epm_rhs_ncacn_get_minor_version,
     466             :                 .set = py_epm_rhs_ncacn_set_minor_version,
     467             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     468             :         },
     469             :         { .name = NULL }
     470             : };
     471             : 
     472           0 : static PyObject *py_epm_rhs_ncacn_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     473             : {
     474           0 :         return pytalloc_new(struct epm_rhs_ncacn, type);
     475             : }
     476             : 
     477             : 
     478             : static PyTypeObject epm_rhs_ncacn_Type = {
     479             :         PyVarObject_HEAD_INIT(NULL, 0)
     480             :         .tp_name = "epmapper.epm_rhs_ncacn",
     481             :         .tp_getset = py_epm_rhs_ncacn_getsetters,
     482             :         .tp_methods = NULL,
     483             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     484             :         .tp_new = py_epm_rhs_ncacn_new,
     485             : };
     486             : 
     487             : 
     488           0 : static PyObject *py_epm_rhs_uuid_get_unknown(PyObject *obj, void *closure)
     489             : {
     490           0 :         struct epm_rhs_uuid *object = pytalloc_get_ptr(obj);
     491           0 :         PyObject *py_unknown;
     492           0 :         py_unknown = PyBytes_FromStringAndSize((char *)(object->unknown).data, (object->unknown).length);
     493           0 :         return py_unknown;
     494             : }
     495             : 
     496          96 : static int py_epm_rhs_uuid_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
     497             : {
     498          96 :         struct epm_rhs_uuid *object = pytalloc_get_ptr(py_obj);
     499          96 :         if (value == NULL) {
     500           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unknown");
     501           0 :                 return -1;
     502             :         }
     503          96 :         object->unknown = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
     504          96 :         return 0;
     505             : }
     506             : 
     507             : static PyGetSetDef py_epm_rhs_uuid_getsetters[] = {
     508             :         {
     509             :                 .name = discard_const_p(char, "unknown"),
     510             :                 .get = py_epm_rhs_uuid_get_unknown,
     511             :                 .set = py_epm_rhs_uuid_set_unknown,
     512             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
     513             :         },
     514             :         { .name = NULL }
     515             : };
     516             : 
     517          96 : static PyObject *py_epm_rhs_uuid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     518             : {
     519          96 :         return pytalloc_new(struct epm_rhs_uuid, type);
     520             : }
     521             : 
     522             : 
     523             : static PyTypeObject epm_rhs_uuid_Type = {
     524             :         PyVarObject_HEAD_INIT(NULL, 0)
     525             :         .tp_name = "epmapper.epm_rhs_uuid",
     526             :         .tp_getset = py_epm_rhs_uuid_getsetters,
     527             :         .tp_methods = NULL,
     528             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     529             :         .tp_new = py_epm_rhs_uuid_new,
     530             : };
     531             : 
     532             : 
     533           0 : static PyObject *py_epm_rhs_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     534             : {
     535           0 :         return pytalloc_new(struct epm_rhs_ipx, type);
     536             : }
     537             : 
     538             : 
     539             : static PyTypeObject epm_rhs_ipx_Type = {
     540             :         PyVarObject_HEAD_INIT(NULL, 0)
     541             :         .tp_name = "epmapper.epm_rhs_ipx",
     542             :         .tp_getset = NULL,
     543             :         .tp_methods = NULL,
     544             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     545             :         .tp_new = py_epm_rhs_ipx_new,
     546             : };
     547             : 
     548             : 
     549           0 : static PyObject *py_epm_rhs_smb_get_unc(PyObject *obj, void *closure)
     550             : {
     551           0 :         struct epm_rhs_smb *object = pytalloc_get_ptr(obj);
     552           0 :         PyObject *py_unc;
     553           0 :         py_unc = PyString_FromStringOrNULL(object->unc);
     554           0 :         return py_unc;
     555             : }
     556             : 
     557           0 : static int py_epm_rhs_smb_set_unc(PyObject *py_obj, PyObject *value, void *closure)
     558             : {
     559           0 :         struct epm_rhs_smb *object = pytalloc_get_ptr(py_obj);
     560           0 :         if (value == NULL) {
     561           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unc");
     562           0 :                 return -1;
     563             :         }
     564             :         {
     565           0 :                 const char *test_str;
     566           0 :                 const char *talloc_str;
     567           0 :                 PyObject *unicode = NULL;
     568           0 :                 if (PyUnicode_Check(value)) {
     569           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     570           0 :                         if (unicode == NULL) {
     571           0 :                                 return -1;
     572             :                         }
     573           0 :                         test_str = PyBytes_AS_STRING(unicode);
     574           0 :                 } else if (PyBytes_Check(value)) {
     575           0 :                         test_str = PyBytes_AS_STRING(value);
     576             :                 } else {
     577           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     578           0 :                         return -1;
     579             :                 }
     580           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     581           0 :                 if (unicode != NULL) {
     582           0 :                         Py_DECREF(unicode);
     583             :                 }
     584           0 :                 if (talloc_str == NULL) {
     585           0 :                         PyErr_NoMemory();
     586           0 :                         return -1;
     587             :                 }
     588           0 :                 object->unc = talloc_str;
     589             :         }
     590           0 :         return 0;
     591             : }
     592             : 
     593             : static PyGetSetDef py_epm_rhs_smb_getsetters[] = {
     594             :         {
     595             :                 .name = discard_const_p(char, "unc"),
     596             :                 .get = py_epm_rhs_smb_get_unc,
     597             :                 .set = py_epm_rhs_smb_set_unc,
     598             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     599             :         },
     600             :         { .name = NULL }
     601             : };
     602             : 
     603           0 : static PyObject *py_epm_rhs_smb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     604             : {
     605           0 :         return pytalloc_new(struct epm_rhs_smb, type);
     606             : }
     607             : 
     608             : 
     609             : static PyTypeObject epm_rhs_smb_Type = {
     610             :         PyVarObject_HEAD_INIT(NULL, 0)
     611             :         .tp_name = "epmapper.epm_rhs_smb",
     612             :         .tp_getset = py_epm_rhs_smb_getsetters,
     613             :         .tp_methods = NULL,
     614             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     615             :         .tp_new = py_epm_rhs_smb_new,
     616             : };
     617             : 
     618             : 
     619           0 : static PyObject *py_epm_rhs_named_pipe_get_path(PyObject *obj, void *closure)
     620             : {
     621           0 :         struct epm_rhs_named_pipe *object = pytalloc_get_ptr(obj);
     622           0 :         PyObject *py_path;
     623           0 :         py_path = PyString_FromStringOrNULL(object->path);
     624           0 :         return py_path;
     625             : }
     626             : 
     627           0 : static int py_epm_rhs_named_pipe_set_path(PyObject *py_obj, PyObject *value, void *closure)
     628             : {
     629           0 :         struct epm_rhs_named_pipe *object = pytalloc_get_ptr(py_obj);
     630           0 :         if (value == NULL) {
     631           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->path");
     632           0 :                 return -1;
     633             :         }
     634             :         {
     635           0 :                 const char *test_str;
     636           0 :                 const char *talloc_str;
     637           0 :                 PyObject *unicode = NULL;
     638           0 :                 if (PyUnicode_Check(value)) {
     639           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     640           0 :                         if (unicode == NULL) {
     641           0 :                                 return -1;
     642             :                         }
     643           0 :                         test_str = PyBytes_AS_STRING(unicode);
     644           0 :                 } else if (PyBytes_Check(value)) {
     645           0 :                         test_str = PyBytes_AS_STRING(value);
     646             :                 } else {
     647           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     648           0 :                         return -1;
     649             :                 }
     650           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     651           0 :                 if (unicode != NULL) {
     652           0 :                         Py_DECREF(unicode);
     653             :                 }
     654           0 :                 if (talloc_str == NULL) {
     655           0 :                         PyErr_NoMemory();
     656           0 :                         return -1;
     657             :                 }
     658           0 :                 object->path = talloc_str;
     659             :         }
     660           0 :         return 0;
     661             : }
     662             : 
     663             : static PyGetSetDef py_epm_rhs_named_pipe_getsetters[] = {
     664             :         {
     665             :                 .name = discard_const_p(char, "path"),
     666             :                 .get = py_epm_rhs_named_pipe_get_path,
     667             :                 .set = py_epm_rhs_named_pipe_set_path,
     668             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     669             :         },
     670             :         { .name = NULL }
     671             : };
     672             : 
     673           0 : static PyObject *py_epm_rhs_named_pipe_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     674             : {
     675           0 :         return pytalloc_new(struct epm_rhs_named_pipe, type);
     676             : }
     677             : 
     678             : 
     679             : static PyTypeObject epm_rhs_named_pipe_Type = {
     680             :         PyVarObject_HEAD_INIT(NULL, 0)
     681             :         .tp_name = "epmapper.epm_rhs_named_pipe",
     682             :         .tp_getset = py_epm_rhs_named_pipe_getsetters,
     683             :         .tp_methods = NULL,
     684             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     685             :         .tp_new = py_epm_rhs_named_pipe_new,
     686             : };
     687             : 
     688             : 
     689           0 : static PyObject *py_epm_rhs_netbios_get_name(PyObject *obj, void *closure)
     690             : {
     691           0 :         struct epm_rhs_netbios *object = pytalloc_get_ptr(obj);
     692           0 :         PyObject *py_name;
     693           0 :         py_name = PyString_FromStringOrNULL(object->name);
     694           0 :         return py_name;
     695             : }
     696             : 
     697           0 : static int py_epm_rhs_netbios_set_name(PyObject *py_obj, PyObject *value, void *closure)
     698             : {
     699           0 :         struct epm_rhs_netbios *object = pytalloc_get_ptr(py_obj);
     700           0 :         if (value == NULL) {
     701           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
     702           0 :                 return -1;
     703             :         }
     704             :         {
     705           0 :                 const char *test_str;
     706           0 :                 const char *talloc_str;
     707           0 :                 PyObject *unicode = NULL;
     708           0 :                 if (PyUnicode_Check(value)) {
     709           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     710           0 :                         if (unicode == NULL) {
     711           0 :                                 return -1;
     712             :                         }
     713           0 :                         test_str = PyBytes_AS_STRING(unicode);
     714           0 :                 } else if (PyBytes_Check(value)) {
     715           0 :                         test_str = PyBytes_AS_STRING(value);
     716             :                 } else {
     717           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     718           0 :                         return -1;
     719             :                 }
     720           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     721           0 :                 if (unicode != NULL) {
     722           0 :                         Py_DECREF(unicode);
     723             :                 }
     724           0 :                 if (talloc_str == NULL) {
     725           0 :                         PyErr_NoMemory();
     726           0 :                         return -1;
     727             :                 }
     728           0 :                 object->name = talloc_str;
     729             :         }
     730           0 :         return 0;
     731             : }
     732             : 
     733             : static PyGetSetDef py_epm_rhs_netbios_getsetters[] = {
     734             :         {
     735             :                 .name = discard_const_p(char, "name"),
     736             :                 .get = py_epm_rhs_netbios_get_name,
     737             :                 .set = py_epm_rhs_netbios_set_name,
     738             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     739             :         },
     740             :         { .name = NULL }
     741             : };
     742             : 
     743           0 : static PyObject *py_epm_rhs_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     744             : {
     745           0 :         return pytalloc_new(struct epm_rhs_netbios, type);
     746             : }
     747             : 
     748             : 
     749             : static PyTypeObject epm_rhs_netbios_Type = {
     750             :         PyVarObject_HEAD_INIT(NULL, 0)
     751             :         .tp_name = "epmapper.epm_rhs_netbios",
     752             :         .tp_getset = py_epm_rhs_netbios_getsetters,
     753             :         .tp_methods = NULL,
     754             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     755             :         .tp_new = py_epm_rhs_netbios_new,
     756             : };
     757             : 
     758             : 
     759           0 : static PyObject *py_epm_rhs_netbeui_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     760             : {
     761           0 :         return pytalloc_new(struct epm_rhs_netbeui, type);
     762             : }
     763             : 
     764             : 
     765             : static PyTypeObject epm_rhs_netbeui_Type = {
     766             :         PyVarObject_HEAD_INIT(NULL, 0)
     767             :         .tp_name = "epmapper.epm_rhs_netbeui",
     768             :         .tp_getset = NULL,
     769             :         .tp_methods = NULL,
     770             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     771             :         .tp_new = py_epm_rhs_netbeui_new,
     772             : };
     773             : 
     774             : 
     775           0 : static PyObject *py_epm_rhs_spx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     776             : {
     777           0 :         return pytalloc_new(struct epm_rhs_spx, type);
     778             : }
     779             : 
     780             : 
     781             : static PyTypeObject epm_rhs_spx_Type = {
     782             :         PyVarObject_HEAD_INIT(NULL, 0)
     783             :         .tp_name = "epmapper.epm_rhs_spx",
     784             :         .tp_getset = NULL,
     785             :         .tp_methods = NULL,
     786             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     787             :         .tp_new = py_epm_rhs_spx_new,
     788             : };
     789             : 
     790             : 
     791           0 : static PyObject *py_epm_rhs_nb_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     792             : {
     793           0 :         return pytalloc_new(struct epm_rhs_nb_ipx, type);
     794             : }
     795             : 
     796             : 
     797             : static PyTypeObject epm_rhs_nb_ipx_Type = {
     798             :         PyVarObject_HEAD_INIT(NULL, 0)
     799             :         .tp_name = "epmapper.epm_rhs_nb_ipx",
     800             :         .tp_getset = NULL,
     801             :         .tp_methods = NULL,
     802             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     803             :         .tp_new = py_epm_rhs_nb_ipx_new,
     804             : };
     805             : 
     806             : 
     807           0 : static PyObject *py_epm_rhs_http_get_port(PyObject *obj, void *closure)
     808             : {
     809           0 :         struct epm_rhs_http *object = pytalloc_get_ptr(obj);
     810           0 :         PyObject *py_port;
     811           0 :         py_port = PyLong_FromLong((uint16_t)(object->port));
     812           0 :         return py_port;
     813             : }
     814             : 
     815           0 : static int py_epm_rhs_http_set_port(PyObject *py_obj, PyObject *value, void *closure)
     816             : {
     817           0 :         struct epm_rhs_http *object = pytalloc_get_ptr(py_obj);
     818           0 :         if (value == NULL) {
     819           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port");
     820           0 :                 return -1;
     821             :         }
     822             :         {
     823           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
     824           0 :                 if (PyLong_Check(value)) {
     825           0 :                         unsigned long long test_var;
     826           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     827           0 :                         if (PyErr_Occurred() != NULL) {
     828           0 :                                 return -1;
     829             :                         }
     830           0 :                         if (test_var > uint_max) {
     831           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     832             :                                   PyLong_Type.tp_name, uint_max, test_var);
     833           0 :                                 return -1;
     834             :                         }
     835           0 :                         object->port = test_var;
     836             :                 } else {
     837           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     838             :                           PyLong_Type.tp_name);
     839           0 :                         return -1;
     840             :                 }
     841             :         }
     842           0 :         return 0;
     843             : }
     844             : 
     845             : static PyGetSetDef py_epm_rhs_http_getsetters[] = {
     846             :         {
     847             :                 .name = discard_const_p(char, "port"),
     848             :                 .get = py_epm_rhs_http_get_port,
     849             :                 .set = py_epm_rhs_http_set_port,
     850             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     851             :         },
     852             :         { .name = NULL }
     853             : };
     854             : 
     855           0 : static PyObject *py_epm_rhs_http_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     856             : {
     857           0 :         return pytalloc_new(struct epm_rhs_http, type);
     858             : }
     859             : 
     860             : 
     861             : static PyTypeObject epm_rhs_http_Type = {
     862             :         PyVarObject_HEAD_INIT(NULL, 0)
     863             :         .tp_name = "epmapper.epm_rhs_http",
     864             :         .tp_getset = py_epm_rhs_http_getsetters,
     865             :         .tp_methods = NULL,
     866             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     867             :         .tp_new = py_epm_rhs_http_new,
     868             : };
     869             : 
     870             : 
     871           0 : static PyObject *py_epm_rhs_unix_ds_get_path(PyObject *obj, void *closure)
     872             : {
     873           0 :         struct epm_rhs_unix_ds *object = pytalloc_get_ptr(obj);
     874           0 :         PyObject *py_path;
     875           0 :         py_path = PyString_FromStringOrNULL(object->path);
     876           0 :         return py_path;
     877             : }
     878             : 
     879           0 : static int py_epm_rhs_unix_ds_set_path(PyObject *py_obj, PyObject *value, void *closure)
     880             : {
     881           0 :         struct epm_rhs_unix_ds *object = pytalloc_get_ptr(py_obj);
     882           0 :         if (value == NULL) {
     883           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->path");
     884           0 :                 return -1;
     885             :         }
     886             :         {
     887           0 :                 const char *test_str;
     888           0 :                 const char *talloc_str;
     889           0 :                 PyObject *unicode = NULL;
     890           0 :                 if (PyUnicode_Check(value)) {
     891           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     892           0 :                         if (unicode == NULL) {
     893           0 :                                 return -1;
     894             :                         }
     895           0 :                         test_str = PyBytes_AS_STRING(unicode);
     896           0 :                 } else if (PyBytes_Check(value)) {
     897           0 :                         test_str = PyBytes_AS_STRING(value);
     898             :                 } else {
     899           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     900           0 :                         return -1;
     901             :                 }
     902           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     903           0 :                 if (unicode != NULL) {
     904           0 :                         Py_DECREF(unicode);
     905             :                 }
     906           0 :                 if (talloc_str == NULL) {
     907           0 :                         PyErr_NoMemory();
     908           0 :                         return -1;
     909             :                 }
     910           0 :                 object->path = talloc_str;
     911             :         }
     912           0 :         return 0;
     913             : }
     914             : 
     915             : static PyGetSetDef py_epm_rhs_unix_ds_getsetters[] = {
     916             :         {
     917             :                 .name = discard_const_p(char, "path"),
     918             :                 .get = py_epm_rhs_unix_ds_get_path,
     919             :                 .set = py_epm_rhs_unix_ds_set_path,
     920             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     921             :         },
     922             :         { .name = NULL }
     923             : };
     924             : 
     925           0 : static PyObject *py_epm_rhs_unix_ds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     926             : {
     927           0 :         return pytalloc_new(struct epm_rhs_unix_ds, type);
     928             : }
     929             : 
     930             : 
     931             : static PyTypeObject epm_rhs_unix_ds_Type = {
     932             :         PyVarObject_HEAD_INIT(NULL, 0)
     933             :         .tp_name = "epmapper.epm_rhs_unix_ds",
     934             :         .tp_getset = py_epm_rhs_unix_ds_getsetters,
     935             :         .tp_methods = NULL,
     936             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     937             :         .tp_new = py_epm_rhs_unix_ds_new,
     938             : };
     939             : 
     940             : 
     941           0 : static PyObject *py_epm_rhs_null_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     942             : {
     943           0 :         return pytalloc_new(struct epm_rhs_null, type);
     944             : }
     945             : 
     946             : 
     947             : static PyTypeObject epm_rhs_null_Type = {
     948             :         PyVarObject_HEAD_INIT(NULL, 0)
     949             :         .tp_name = "epmapper.epm_rhs_null",
     950             :         .tp_getset = NULL,
     951             :         .tp_methods = NULL,
     952             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     953             :         .tp_new = py_epm_rhs_null_new,
     954             : };
     955             : 
     956             : 
     957           0 : static PyObject *py_epm_rhs_ncalrpc_get_minor_version(PyObject *obj, void *closure)
     958             : {
     959           0 :         struct epm_rhs_ncalrpc *object = pytalloc_get_ptr(obj);
     960           0 :         PyObject *py_minor_version;
     961           0 :         py_minor_version = PyLong_FromLong((uint16_t)(object->minor_version));
     962           0 :         return py_minor_version;
     963             : }
     964             : 
     965           0 : static int py_epm_rhs_ncalrpc_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
     966             : {
     967           0 :         struct epm_rhs_ncalrpc *object = pytalloc_get_ptr(py_obj);
     968           0 :         if (value == NULL) {
     969           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor_version");
     970           0 :                 return -1;
     971             :         }
     972             :         {
     973           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor_version));
     974           0 :                 if (PyLong_Check(value)) {
     975           0 :                         unsigned long long test_var;
     976           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     977           0 :                         if (PyErr_Occurred() != NULL) {
     978           0 :                                 return -1;
     979             :                         }
     980           0 :                         if (test_var > uint_max) {
     981           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     982             :                                   PyLong_Type.tp_name, uint_max, test_var);
     983           0 :                                 return -1;
     984             :                         }
     985           0 :                         object->minor_version = test_var;
     986             :                 } else {
     987           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     988             :                           PyLong_Type.tp_name);
     989           0 :                         return -1;
     990             :                 }
     991             :         }
     992           0 :         return 0;
     993             : }
     994             : 
     995             : static PyGetSetDef py_epm_rhs_ncalrpc_getsetters[] = {
     996             :         {
     997             :                 .name = discard_const_p(char, "minor_version"),
     998             :                 .get = py_epm_rhs_ncalrpc_get_minor_version,
     999             :                 .set = py_epm_rhs_ncalrpc_set_minor_version,
    1000             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1001             :         },
    1002             :         { .name = NULL }
    1003             : };
    1004             : 
    1005           0 : static PyObject *py_epm_rhs_ncalrpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1006             : {
    1007           0 :         return pytalloc_new(struct epm_rhs_ncalrpc, type);
    1008             : }
    1009             : 
    1010             : 
    1011             : static PyTypeObject epm_rhs_ncalrpc_Type = {
    1012             :         PyVarObject_HEAD_INIT(NULL, 0)
    1013             :         .tp_name = "epmapper.epm_rhs_ncalrpc",
    1014             :         .tp_getset = py_epm_rhs_ncalrpc_getsetters,
    1015             :         .tp_methods = NULL,
    1016             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1017             :         .tp_new = py_epm_rhs_ncalrpc_new,
    1018             : };
    1019             : 
    1020             : 
    1021           0 : static PyObject *py_epm_rhs_appletalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1022             : {
    1023           0 :         return pytalloc_new(struct epm_rhs_appletalk, type);
    1024             : }
    1025             : 
    1026             : 
    1027             : static PyTypeObject epm_rhs_appletalk_Type = {
    1028             :         PyVarObject_HEAD_INIT(NULL, 0)
    1029             :         .tp_name = "epmapper.epm_rhs_appletalk",
    1030             :         .tp_getset = NULL,
    1031             :         .tp_methods = NULL,
    1032             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1033             :         .tp_new = py_epm_rhs_appletalk_new,
    1034             : };
    1035             : 
    1036             : 
    1037           0 : static PyObject *py_epm_rhs_atalk_stream_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1038             : {
    1039           0 :         return pytalloc_new(struct epm_rhs_atalk_stream, type);
    1040             : }
    1041             : 
    1042             : 
    1043             : static PyTypeObject epm_rhs_atalk_stream_Type = {
    1044             :         PyVarObject_HEAD_INIT(NULL, 0)
    1045             :         .tp_name = "epmapper.epm_rhs_atalk_stream",
    1046             :         .tp_getset = NULL,
    1047             :         .tp_methods = NULL,
    1048             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1049             :         .tp_new = py_epm_rhs_atalk_stream_new,
    1050             : };
    1051             : 
    1052             : 
    1053           0 : static PyObject *py_epm_rhs_atalk_datagram_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1054             : {
    1055           0 :         return pytalloc_new(struct epm_rhs_atalk_datagram, type);
    1056             : }
    1057             : 
    1058             : 
    1059             : static PyTypeObject epm_rhs_atalk_datagram_Type = {
    1060             :         PyVarObject_HEAD_INIT(NULL, 0)
    1061             :         .tp_name = "epmapper.epm_rhs_atalk_datagram",
    1062             :         .tp_getset = NULL,
    1063             :         .tp_methods = NULL,
    1064             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1065             :         .tp_new = py_epm_rhs_atalk_datagram_new,
    1066             : };
    1067             : 
    1068             : 
    1069           0 : static PyObject *py_epm_rhs_vines_spp_get_port(PyObject *obj, void *closure)
    1070             : {
    1071           0 :         struct epm_rhs_vines_spp *object = pytalloc_get_ptr(obj);
    1072           0 :         PyObject *py_port;
    1073           0 :         py_port = PyLong_FromLong((uint16_t)(object->port));
    1074           0 :         return py_port;
    1075             : }
    1076             : 
    1077           0 : static int py_epm_rhs_vines_spp_set_port(PyObject *py_obj, PyObject *value, void *closure)
    1078             : {
    1079           0 :         struct epm_rhs_vines_spp *object = pytalloc_get_ptr(py_obj);
    1080           0 :         if (value == NULL) {
    1081           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port");
    1082           0 :                 return -1;
    1083             :         }
    1084             :         {
    1085           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
    1086           0 :                 if (PyLong_Check(value)) {
    1087           0 :                         unsigned long long test_var;
    1088           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1089           0 :                         if (PyErr_Occurred() != NULL) {
    1090           0 :                                 return -1;
    1091             :                         }
    1092           0 :                         if (test_var > uint_max) {
    1093           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1094             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1095           0 :                                 return -1;
    1096             :                         }
    1097           0 :                         object->port = test_var;
    1098             :                 } else {
    1099           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1100             :                           PyLong_Type.tp_name);
    1101           0 :                         return -1;
    1102             :                 }
    1103             :         }
    1104           0 :         return 0;
    1105             : }
    1106             : 
    1107             : static PyGetSetDef py_epm_rhs_vines_spp_getsetters[] = {
    1108             :         {
    1109             :                 .name = discard_const_p(char, "port"),
    1110             :                 .get = py_epm_rhs_vines_spp_get_port,
    1111             :                 .set = py_epm_rhs_vines_spp_set_port,
    1112             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1113             :         },
    1114             :         { .name = NULL }
    1115             : };
    1116             : 
    1117           0 : static PyObject *py_epm_rhs_vines_spp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1118             : {
    1119           0 :         return pytalloc_new(struct epm_rhs_vines_spp, type);
    1120             : }
    1121             : 
    1122             : 
    1123             : static PyTypeObject epm_rhs_vines_spp_Type = {
    1124             :         PyVarObject_HEAD_INIT(NULL, 0)
    1125             :         .tp_name = "epmapper.epm_rhs_vines_spp",
    1126             :         .tp_getset = py_epm_rhs_vines_spp_getsetters,
    1127             :         .tp_methods = NULL,
    1128             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1129             :         .tp_new = py_epm_rhs_vines_spp_new,
    1130             : };
    1131             : 
    1132             : 
    1133           0 : static PyObject *py_epm_rhs_vines_ipc_get_port(PyObject *obj, void *closure)
    1134             : {
    1135           0 :         struct epm_rhs_vines_ipc *object = pytalloc_get_ptr(obj);
    1136           0 :         PyObject *py_port;
    1137           0 :         py_port = PyLong_FromLong((uint16_t)(object->port));
    1138           0 :         return py_port;
    1139             : }
    1140             : 
    1141           0 : static int py_epm_rhs_vines_ipc_set_port(PyObject *py_obj, PyObject *value, void *closure)
    1142             : {
    1143           0 :         struct epm_rhs_vines_ipc *object = pytalloc_get_ptr(py_obj);
    1144           0 :         if (value == NULL) {
    1145           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port");
    1146           0 :                 return -1;
    1147             :         }
    1148             :         {
    1149           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
    1150           0 :                 if (PyLong_Check(value)) {
    1151           0 :                         unsigned long long test_var;
    1152           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1153           0 :                         if (PyErr_Occurred() != NULL) {
    1154           0 :                                 return -1;
    1155             :                         }
    1156           0 :                         if (test_var > uint_max) {
    1157           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1158             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1159           0 :                                 return -1;
    1160             :                         }
    1161           0 :                         object->port = test_var;
    1162             :                 } else {
    1163           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1164             :                           PyLong_Type.tp_name);
    1165           0 :                         return -1;
    1166             :                 }
    1167             :         }
    1168           0 :         return 0;
    1169             : }
    1170             : 
    1171             : static PyGetSetDef py_epm_rhs_vines_ipc_getsetters[] = {
    1172             :         {
    1173             :                 .name = discard_const_p(char, "port"),
    1174             :                 .get = py_epm_rhs_vines_ipc_get_port,
    1175             :                 .set = py_epm_rhs_vines_ipc_set_port,
    1176             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1177             :         },
    1178             :         { .name = NULL }
    1179             : };
    1180             : 
    1181           0 : static PyObject *py_epm_rhs_vines_ipc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1182             : {
    1183           0 :         return pytalloc_new(struct epm_rhs_vines_ipc, type);
    1184             : }
    1185             : 
    1186             : 
    1187             : static PyTypeObject epm_rhs_vines_ipc_Type = {
    1188             :         PyVarObject_HEAD_INIT(NULL, 0)
    1189             :         .tp_name = "epmapper.epm_rhs_vines_ipc",
    1190             :         .tp_getset = py_epm_rhs_vines_ipc_getsetters,
    1191             :         .tp_methods = NULL,
    1192             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1193             :         .tp_new = py_epm_rhs_vines_ipc_new,
    1194             : };
    1195             : 
    1196             : 
    1197           0 : static PyObject *py_epm_rhs_streettalk_get_streettalk(PyObject *obj, void *closure)
    1198             : {
    1199           0 :         struct epm_rhs_streettalk *object = pytalloc_get_ptr(obj);
    1200           0 :         PyObject *py_streettalk;
    1201           0 :         py_streettalk = PyString_FromStringOrNULL(object->streettalk);
    1202           0 :         return py_streettalk;
    1203             : }
    1204             : 
    1205           0 : static int py_epm_rhs_streettalk_set_streettalk(PyObject *py_obj, PyObject *value, void *closure)
    1206             : {
    1207           0 :         struct epm_rhs_streettalk *object = pytalloc_get_ptr(py_obj);
    1208           0 :         if (value == NULL) {
    1209           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->streettalk");
    1210           0 :                 return -1;
    1211             :         }
    1212             :         {
    1213           0 :                 const char *test_str;
    1214           0 :                 const char *talloc_str;
    1215           0 :                 PyObject *unicode = NULL;
    1216           0 :                 if (PyUnicode_Check(value)) {
    1217           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1218           0 :                         if (unicode == NULL) {
    1219           0 :                                 return -1;
    1220             :                         }
    1221           0 :                         test_str = PyBytes_AS_STRING(unicode);
    1222           0 :                 } else if (PyBytes_Check(value)) {
    1223           0 :                         test_str = PyBytes_AS_STRING(value);
    1224             :                 } else {
    1225           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1226           0 :                         return -1;
    1227             :                 }
    1228           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1229           0 :                 if (unicode != NULL) {
    1230           0 :                         Py_DECREF(unicode);
    1231             :                 }
    1232           0 :                 if (talloc_str == NULL) {
    1233           0 :                         PyErr_NoMemory();
    1234           0 :                         return -1;
    1235             :                 }
    1236           0 :                 object->streettalk = talloc_str;
    1237             :         }
    1238           0 :         return 0;
    1239             : }
    1240             : 
    1241             : static PyGetSetDef py_epm_rhs_streettalk_getsetters[] = {
    1242             :         {
    1243             :                 .name = discard_const_p(char, "streettalk"),
    1244             :                 .get = py_epm_rhs_streettalk_get_streettalk,
    1245             :                 .set = py_epm_rhs_streettalk_set_streettalk,
    1246             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    1247             :         },
    1248             :         { .name = NULL }
    1249             : };
    1250             : 
    1251           0 : static PyObject *py_epm_rhs_streettalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1252             : {
    1253           0 :         return pytalloc_new(struct epm_rhs_streettalk, type);
    1254             : }
    1255             : 
    1256             : 
    1257             : static PyTypeObject epm_rhs_streettalk_Type = {
    1258             :         PyVarObject_HEAD_INIT(NULL, 0)
    1259             :         .tp_name = "epmapper.epm_rhs_streettalk",
    1260             :         .tp_getset = py_epm_rhs_streettalk_getsetters,
    1261             :         .tp_methods = NULL,
    1262             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1263             :         .tp_new = py_epm_rhs_streettalk_new,
    1264             : };
    1265             : 
    1266         160 : static PyObject *py_import_epm_rhs(TALLOC_CTX *mem_ctx, int level, union epm_rhs *in)
    1267             : {
    1268           0 :         PyObject *ret;
    1269             : 
    1270         160 :         switch (level) {
    1271           0 :                 case EPM_PROTOCOL_DNET_NSP:
    1272           0 :                         ret = pytalloc_reference_ex(&epm_rhs_dnet_nsp_Type, mem_ctx, &in->dnet_nsp);
    1273           0 :                         return ret;
    1274             : 
    1275           0 :                 case EPM_PROTOCOL_OSI_TP4:
    1276           0 :                         ret = pytalloc_reference_ex(&epm_rhs_osi_tp4_Type, mem_ctx, &in->osi_tp4);
    1277           0 :                         return ret;
    1278             : 
    1279           0 :                 case EPM_PROTOCOL_OSI_CLNS:
    1280           0 :                         ret = pytalloc_reference_ex(&epm_rhs_osi_clns_Type, mem_ctx, &in->osi_clns);
    1281           0 :                         return ret;
    1282             : 
    1283          64 :                 case EPM_PROTOCOL_TCP:
    1284          64 :                         ret = pytalloc_reference_ex(&epm_rhs_tcp_Type, mem_ctx, &in->tcp);
    1285          64 :                         return ret;
    1286             : 
    1287           0 :                 case EPM_PROTOCOL_UDP:
    1288           0 :                         ret = pytalloc_reference_ex(&epm_rhs_udp_Type, mem_ctx, &in->udp);
    1289           0 :                         return ret;
    1290             : 
    1291          48 :                 case EPM_PROTOCOL_IP:
    1292          48 :                         ret = pytalloc_reference_ex(&epm_rhs_ip_Type, mem_ctx, &in->ip);
    1293          48 :                         return ret;
    1294             : 
    1295           0 :                 case EPM_PROTOCOL_NCADG:
    1296           0 :                         ret = pytalloc_reference_ex(&epm_rhs_ncadg_Type, mem_ctx, &in->ncadg);
    1297           0 :                         return ret;
    1298             : 
    1299          48 :                 case EPM_PROTOCOL_NCACN:
    1300          48 :                         ret = pytalloc_reference_ex(&epm_rhs_ncacn_Type, mem_ctx, &in->ncacn);
    1301          48 :                         return ret;
    1302             : 
    1303           0 :                 case EPM_PROTOCOL_NCALRPC:
    1304           0 :                         ret = pytalloc_reference_ex(&epm_rhs_ncalrpc_Type, mem_ctx, &in->ncalrpc);
    1305           0 :                         return ret;
    1306             : 
    1307           0 :                 case EPM_PROTOCOL_UUID:
    1308           0 :                         ret = pytalloc_reference_ex(&epm_rhs_uuid_Type, mem_ctx, &in->uuid);
    1309           0 :                         return ret;
    1310             : 
    1311           0 :                 case EPM_PROTOCOL_IPX:
    1312           0 :                         ret = pytalloc_reference_ex(&epm_rhs_ipx_Type, mem_ctx, &in->ipx);
    1313           0 :                         return ret;
    1314             : 
    1315           0 :                 case EPM_PROTOCOL_SMB:
    1316           0 :                         ret = pytalloc_reference_ex(&epm_rhs_smb_Type, mem_ctx, &in->smb);
    1317           0 :                         return ret;
    1318             : 
    1319           0 :                 case EPM_PROTOCOL_NAMED_PIPE:
    1320           0 :                         ret = pytalloc_reference_ex(&epm_rhs_named_pipe_Type, mem_ctx, &in->named_pipe);
    1321           0 :                         return ret;
    1322             : 
    1323           0 :                 case EPM_PROTOCOL_NETBIOS:
    1324           0 :                         ret = pytalloc_reference_ex(&epm_rhs_netbios_Type, mem_ctx, &in->netbios);
    1325           0 :                         return ret;
    1326             : 
    1327           0 :                 case EPM_PROTOCOL_NETBEUI:
    1328           0 :                         ret = pytalloc_reference_ex(&epm_rhs_netbeui_Type, mem_ctx, &in->netbeui);
    1329           0 :                         return ret;
    1330             : 
    1331           0 :                 case EPM_PROTOCOL_SPX:
    1332           0 :                         ret = pytalloc_reference_ex(&epm_rhs_spx_Type, mem_ctx, &in->spx);
    1333           0 :                         return ret;
    1334             : 
    1335           0 :                 case EPM_PROTOCOL_NB_IPX:
    1336           0 :                         ret = pytalloc_reference_ex(&epm_rhs_nb_ipx_Type, mem_ctx, &in->nb_ipx);
    1337           0 :                         return ret;
    1338             : 
    1339           0 :                 case EPM_PROTOCOL_DSP:
    1340           0 :                         ret = pytalloc_reference_ex(&epm_rhs_atalk_stream_Type, mem_ctx, &in->atalk_stream);
    1341           0 :                         return ret;
    1342             : 
    1343           0 :                 case EPM_PROTOCOL_DDP:
    1344           0 :                         ret = pytalloc_reference_ex(&epm_rhs_atalk_datagram_Type, mem_ctx, &in->atalk_datagram);
    1345           0 :                         return ret;
    1346             : 
    1347           0 :                 case EPM_PROTOCOL_APPLETALK:
    1348           0 :                         ret = pytalloc_reference_ex(&epm_rhs_appletalk_Type, mem_ctx, &in->appletalk);
    1349           0 :                         return ret;
    1350             : 
    1351           0 :                 case EPM_PROTOCOL_VINES_SPP:
    1352           0 :                         ret = pytalloc_reference_ex(&epm_rhs_vines_spp_Type, mem_ctx, &in->vines_spp);
    1353           0 :                         return ret;
    1354             : 
    1355           0 :                 case EPM_PROTOCOL_VINES_IPC:
    1356           0 :                         ret = pytalloc_reference_ex(&epm_rhs_vines_ipc_Type, mem_ctx, &in->vines_ipc);
    1357           0 :                         return ret;
    1358             : 
    1359           0 :                 case EPM_PROTOCOL_STREETTALK:
    1360           0 :                         ret = pytalloc_reference_ex(&epm_rhs_streettalk_Type, mem_ctx, &in->streettalk);
    1361           0 :                         return ret;
    1362             : 
    1363           0 :                 case EPM_PROTOCOL_HTTP:
    1364           0 :                         ret = pytalloc_reference_ex(&epm_rhs_http_Type, mem_ctx, &in->http);
    1365           0 :                         return ret;
    1366             : 
    1367           0 :                 case EPM_PROTOCOL_UNIX_DS:
    1368           0 :                         ret = pytalloc_reference_ex(&epm_rhs_unix_ds_Type, mem_ctx, &in->unix_ds);
    1369           0 :                         return ret;
    1370             : 
    1371           0 :                 case EPM_PROTOCOL_NULL:
    1372           0 :                         ret = pytalloc_reference_ex(&epm_rhs_null_Type, mem_ctx, &in->null);
    1373           0 :                         return ret;
    1374             : 
    1375           0 :                 default:
    1376           0 :                         ret = PyBytes_FromStringAndSize((char *)(in->unknown).data, (in->unknown).length);
    1377           0 :                         return ret;
    1378             : 
    1379             :         }
    1380             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    1381             :         return NULL;
    1382             : }
    1383             : 
    1384          96 : static union epm_rhs *py_export_epm_rhs(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    1385             : {
    1386          96 :         union epm_rhs *ret = talloc_zero(mem_ctx, union epm_rhs);
    1387          96 :         switch (level) {
    1388           0 :                 case EPM_PROTOCOL_DNET_NSP:
    1389           0 :                         if (in == NULL) {
    1390           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dnet_nsp");
    1391           0 :                                 talloc_free(ret); return NULL;
    1392             :                         }
    1393           0 :                         PY_CHECK_TYPE(&epm_rhs_dnet_nsp_Type, in, talloc_free(ret); return NULL;);
    1394           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1395           0 :                                 PyErr_NoMemory();
    1396           0 :                                 talloc_free(ret); return NULL;
    1397             :                         }
    1398           0 :                         ret->dnet_nsp = *(struct epm_rhs_dnet_nsp *)pytalloc_get_ptr(in);
    1399           0 :                         break;
    1400             : 
    1401           0 :                 case EPM_PROTOCOL_OSI_TP4:
    1402           0 :                         if (in == NULL) {
    1403           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->osi_tp4");
    1404           0 :                                 talloc_free(ret); return NULL;
    1405             :                         }
    1406           0 :                         PY_CHECK_TYPE(&epm_rhs_osi_tp4_Type, in, talloc_free(ret); return NULL;);
    1407           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1408           0 :                                 PyErr_NoMemory();
    1409           0 :                                 talloc_free(ret); return NULL;
    1410             :                         }
    1411           0 :                         ret->osi_tp4 = *(struct epm_rhs_osi_tp4 *)pytalloc_get_ptr(in);
    1412           0 :                         break;
    1413             : 
    1414           0 :                 case EPM_PROTOCOL_OSI_CLNS:
    1415           0 :                         if (in == NULL) {
    1416           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->osi_clns");
    1417           0 :                                 talloc_free(ret); return NULL;
    1418             :                         }
    1419           0 :                         PY_CHECK_TYPE(&epm_rhs_osi_clns_Type, in, talloc_free(ret); return NULL;);
    1420           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1421           0 :                                 PyErr_NoMemory();
    1422           0 :                                 talloc_free(ret); return NULL;
    1423             :                         }
    1424           0 :                         ret->osi_clns = *(struct epm_rhs_osi_clns *)pytalloc_get_ptr(in);
    1425           0 :                         break;
    1426             : 
    1427           0 :                 case EPM_PROTOCOL_TCP:
    1428           0 :                         if (in == NULL) {
    1429           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->tcp");
    1430           0 :                                 talloc_free(ret); return NULL;
    1431             :                         }
    1432           0 :                         PY_CHECK_TYPE(&epm_rhs_tcp_Type, in, talloc_free(ret); return NULL;);
    1433           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1434           0 :                                 PyErr_NoMemory();
    1435           0 :                                 talloc_free(ret); return NULL;
    1436             :                         }
    1437           0 :                         ret->tcp = *(struct epm_rhs_tcp *)pytalloc_get_ptr(in);
    1438           0 :                         break;
    1439             : 
    1440           0 :                 case EPM_PROTOCOL_UDP:
    1441           0 :                         if (in == NULL) {
    1442           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->udp");
    1443           0 :                                 talloc_free(ret); return NULL;
    1444             :                         }
    1445           0 :                         PY_CHECK_TYPE(&epm_rhs_udp_Type, in, talloc_free(ret); return NULL;);
    1446           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1447           0 :                                 PyErr_NoMemory();
    1448           0 :                                 talloc_free(ret); return NULL;
    1449             :                         }
    1450           0 :                         ret->udp = *(struct epm_rhs_udp *)pytalloc_get_ptr(in);
    1451           0 :                         break;
    1452             : 
    1453           0 :                 case EPM_PROTOCOL_IP:
    1454           0 :                         if (in == NULL) {
    1455           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ip");
    1456           0 :                                 talloc_free(ret); return NULL;
    1457             :                         }
    1458           0 :                         PY_CHECK_TYPE(&epm_rhs_ip_Type, in, talloc_free(ret); return NULL;);
    1459           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1460           0 :                                 PyErr_NoMemory();
    1461           0 :                                 talloc_free(ret); return NULL;
    1462             :                         }
    1463           0 :                         ret->ip = *(struct epm_rhs_ip *)pytalloc_get_ptr(in);
    1464           0 :                         break;
    1465             : 
    1466           0 :                 case EPM_PROTOCOL_NCADG:
    1467           0 :                         if (in == NULL) {
    1468           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ncadg");
    1469           0 :                                 talloc_free(ret); return NULL;
    1470             :                         }
    1471           0 :                         PY_CHECK_TYPE(&epm_rhs_ncadg_Type, in, talloc_free(ret); return NULL;);
    1472           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1473           0 :                                 PyErr_NoMemory();
    1474           0 :                                 talloc_free(ret); return NULL;
    1475             :                         }
    1476           0 :                         ret->ncadg = *(struct epm_rhs_ncadg *)pytalloc_get_ptr(in);
    1477           0 :                         break;
    1478             : 
    1479           0 :                 case EPM_PROTOCOL_NCACN:
    1480           0 :                         if (in == NULL) {
    1481           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ncacn");
    1482           0 :                                 talloc_free(ret); return NULL;
    1483             :                         }
    1484           0 :                         PY_CHECK_TYPE(&epm_rhs_ncacn_Type, in, talloc_free(ret); return NULL;);
    1485           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1486           0 :                                 PyErr_NoMemory();
    1487           0 :                                 talloc_free(ret); return NULL;
    1488             :                         }
    1489           0 :                         ret->ncacn = *(struct epm_rhs_ncacn *)pytalloc_get_ptr(in);
    1490           0 :                         break;
    1491             : 
    1492           0 :                 case EPM_PROTOCOL_NCALRPC:
    1493           0 :                         if (in == NULL) {
    1494           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ncalrpc");
    1495           0 :                                 talloc_free(ret); return NULL;
    1496             :                         }
    1497           0 :                         PY_CHECK_TYPE(&epm_rhs_ncalrpc_Type, in, talloc_free(ret); return NULL;);
    1498           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1499           0 :                                 PyErr_NoMemory();
    1500           0 :                                 talloc_free(ret); return NULL;
    1501             :                         }
    1502           0 :                         ret->ncalrpc = *(struct epm_rhs_ncalrpc *)pytalloc_get_ptr(in);
    1503           0 :                         break;
    1504             : 
    1505          96 :                 case EPM_PROTOCOL_UUID:
    1506          96 :                         if (in == NULL) {
    1507           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->uuid");
    1508           0 :                                 talloc_free(ret); return NULL;
    1509             :                         }
    1510          96 :                         PY_CHECK_TYPE(&epm_rhs_uuid_Type, in, talloc_free(ret); return NULL;);
    1511          96 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1512           0 :                                 PyErr_NoMemory();
    1513           0 :                                 talloc_free(ret); return NULL;
    1514             :                         }
    1515          96 :                         ret->uuid = *(struct epm_rhs_uuid *)pytalloc_get_ptr(in);
    1516          96 :                         break;
    1517             : 
    1518           0 :                 case EPM_PROTOCOL_IPX:
    1519           0 :                         if (in == NULL) {
    1520           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ipx");
    1521           0 :                                 talloc_free(ret); return NULL;
    1522             :                         }
    1523           0 :                         PY_CHECK_TYPE(&epm_rhs_ipx_Type, in, talloc_free(ret); return NULL;);
    1524           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1525           0 :                                 PyErr_NoMemory();
    1526           0 :                                 talloc_free(ret); return NULL;
    1527             :                         }
    1528           0 :                         ret->ipx = *(struct epm_rhs_ipx *)pytalloc_get_ptr(in);
    1529           0 :                         break;
    1530             : 
    1531           0 :                 case EPM_PROTOCOL_SMB:
    1532           0 :                         if (in == NULL) {
    1533           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->smb");
    1534           0 :                                 talloc_free(ret); return NULL;
    1535             :                         }
    1536           0 :                         PY_CHECK_TYPE(&epm_rhs_smb_Type, in, talloc_free(ret); return NULL;);
    1537           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1538           0 :                                 PyErr_NoMemory();
    1539           0 :                                 talloc_free(ret); return NULL;
    1540             :                         }
    1541           0 :                         ret->smb = *(struct epm_rhs_smb *)pytalloc_get_ptr(in);
    1542           0 :                         break;
    1543             : 
    1544           0 :                 case EPM_PROTOCOL_NAMED_PIPE:
    1545           0 :                         if (in == NULL) {
    1546           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->named_pipe");
    1547           0 :                                 talloc_free(ret); return NULL;
    1548             :                         }
    1549           0 :                         PY_CHECK_TYPE(&epm_rhs_named_pipe_Type, in, talloc_free(ret); return NULL;);
    1550           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1551           0 :                                 PyErr_NoMemory();
    1552           0 :                                 talloc_free(ret); return NULL;
    1553             :                         }
    1554           0 :                         ret->named_pipe = *(struct epm_rhs_named_pipe *)pytalloc_get_ptr(in);
    1555           0 :                         break;
    1556             : 
    1557           0 :                 case EPM_PROTOCOL_NETBIOS:
    1558           0 :                         if (in == NULL) {
    1559           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->netbios");
    1560           0 :                                 talloc_free(ret); return NULL;
    1561             :                         }
    1562           0 :                         PY_CHECK_TYPE(&epm_rhs_netbios_Type, in, talloc_free(ret); return NULL;);
    1563           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1564           0 :                                 PyErr_NoMemory();
    1565           0 :                                 talloc_free(ret); return NULL;
    1566             :                         }
    1567           0 :                         ret->netbios = *(struct epm_rhs_netbios *)pytalloc_get_ptr(in);
    1568           0 :                         break;
    1569             : 
    1570           0 :                 case EPM_PROTOCOL_NETBEUI:
    1571           0 :                         if (in == NULL) {
    1572           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->netbeui");
    1573           0 :                                 talloc_free(ret); return NULL;
    1574             :                         }
    1575           0 :                         PY_CHECK_TYPE(&epm_rhs_netbeui_Type, in, talloc_free(ret); return NULL;);
    1576           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1577           0 :                                 PyErr_NoMemory();
    1578           0 :                                 talloc_free(ret); return NULL;
    1579             :                         }
    1580           0 :                         ret->netbeui = *(struct epm_rhs_netbeui *)pytalloc_get_ptr(in);
    1581           0 :                         break;
    1582             : 
    1583           0 :                 case EPM_PROTOCOL_SPX:
    1584           0 :                         if (in == NULL) {
    1585           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->spx");
    1586           0 :                                 talloc_free(ret); return NULL;
    1587             :                         }
    1588           0 :                         PY_CHECK_TYPE(&epm_rhs_spx_Type, in, talloc_free(ret); return NULL;);
    1589           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1590           0 :                                 PyErr_NoMemory();
    1591           0 :                                 talloc_free(ret); return NULL;
    1592             :                         }
    1593           0 :                         ret->spx = *(struct epm_rhs_spx *)pytalloc_get_ptr(in);
    1594           0 :                         break;
    1595             : 
    1596           0 :                 case EPM_PROTOCOL_NB_IPX:
    1597           0 :                         if (in == NULL) {
    1598           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->nb_ipx");
    1599           0 :                                 talloc_free(ret); return NULL;
    1600             :                         }
    1601           0 :                         PY_CHECK_TYPE(&epm_rhs_nb_ipx_Type, in, talloc_free(ret); return NULL;);
    1602           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1603           0 :                                 PyErr_NoMemory();
    1604           0 :                                 talloc_free(ret); return NULL;
    1605             :                         }
    1606           0 :                         ret->nb_ipx = *(struct epm_rhs_nb_ipx *)pytalloc_get_ptr(in);
    1607           0 :                         break;
    1608             : 
    1609           0 :                 case EPM_PROTOCOL_DSP:
    1610           0 :                         if (in == NULL) {
    1611           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->atalk_stream");
    1612           0 :                                 talloc_free(ret); return NULL;
    1613             :                         }
    1614           0 :                         PY_CHECK_TYPE(&epm_rhs_atalk_stream_Type, in, talloc_free(ret); return NULL;);
    1615           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1616           0 :                                 PyErr_NoMemory();
    1617           0 :                                 talloc_free(ret); return NULL;
    1618             :                         }
    1619           0 :                         ret->atalk_stream = *(struct epm_rhs_atalk_stream *)pytalloc_get_ptr(in);
    1620           0 :                         break;
    1621             : 
    1622           0 :                 case EPM_PROTOCOL_DDP:
    1623           0 :                         if (in == NULL) {
    1624           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->atalk_datagram");
    1625           0 :                                 talloc_free(ret); return NULL;
    1626             :                         }
    1627           0 :                         PY_CHECK_TYPE(&epm_rhs_atalk_datagram_Type, in, talloc_free(ret); return NULL;);
    1628           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1629           0 :                                 PyErr_NoMemory();
    1630           0 :                                 talloc_free(ret); return NULL;
    1631             :                         }
    1632           0 :                         ret->atalk_datagram = *(struct epm_rhs_atalk_datagram *)pytalloc_get_ptr(in);
    1633           0 :                         break;
    1634             : 
    1635           0 :                 case EPM_PROTOCOL_APPLETALK:
    1636           0 :                         if (in == NULL) {
    1637           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->appletalk");
    1638           0 :                                 talloc_free(ret); return NULL;
    1639             :                         }
    1640           0 :                         PY_CHECK_TYPE(&epm_rhs_appletalk_Type, in, talloc_free(ret); return NULL;);
    1641           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1642           0 :                                 PyErr_NoMemory();
    1643           0 :                                 talloc_free(ret); return NULL;
    1644             :                         }
    1645           0 :                         ret->appletalk = *(struct epm_rhs_appletalk *)pytalloc_get_ptr(in);
    1646           0 :                         break;
    1647             : 
    1648           0 :                 case EPM_PROTOCOL_VINES_SPP:
    1649           0 :                         if (in == NULL) {
    1650           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->vines_spp");
    1651           0 :                                 talloc_free(ret); return NULL;
    1652             :                         }
    1653           0 :                         PY_CHECK_TYPE(&epm_rhs_vines_spp_Type, in, talloc_free(ret); return NULL;);
    1654           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1655           0 :                                 PyErr_NoMemory();
    1656           0 :                                 talloc_free(ret); return NULL;
    1657             :                         }
    1658           0 :                         ret->vines_spp = *(struct epm_rhs_vines_spp *)pytalloc_get_ptr(in);
    1659           0 :                         break;
    1660             : 
    1661           0 :                 case EPM_PROTOCOL_VINES_IPC:
    1662           0 :                         if (in == NULL) {
    1663           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->vines_ipc");
    1664           0 :                                 talloc_free(ret); return NULL;
    1665             :                         }
    1666           0 :                         PY_CHECK_TYPE(&epm_rhs_vines_ipc_Type, in, talloc_free(ret); return NULL;);
    1667           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1668           0 :                                 PyErr_NoMemory();
    1669           0 :                                 talloc_free(ret); return NULL;
    1670             :                         }
    1671           0 :                         ret->vines_ipc = *(struct epm_rhs_vines_ipc *)pytalloc_get_ptr(in);
    1672           0 :                         break;
    1673             : 
    1674           0 :                 case EPM_PROTOCOL_STREETTALK:
    1675           0 :                         if (in == NULL) {
    1676           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->streettalk");
    1677           0 :                                 talloc_free(ret); return NULL;
    1678             :                         }
    1679           0 :                         PY_CHECK_TYPE(&epm_rhs_streettalk_Type, in, talloc_free(ret); return NULL;);
    1680           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1681           0 :                                 PyErr_NoMemory();
    1682           0 :                                 talloc_free(ret); return NULL;
    1683             :                         }
    1684           0 :                         ret->streettalk = *(struct epm_rhs_streettalk *)pytalloc_get_ptr(in);
    1685           0 :                         break;
    1686             : 
    1687           0 :                 case EPM_PROTOCOL_HTTP:
    1688           0 :                         if (in == NULL) {
    1689           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->http");
    1690           0 :                                 talloc_free(ret); return NULL;
    1691             :                         }
    1692           0 :                         PY_CHECK_TYPE(&epm_rhs_http_Type, in, talloc_free(ret); return NULL;);
    1693           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1694           0 :                                 PyErr_NoMemory();
    1695           0 :                                 talloc_free(ret); return NULL;
    1696             :                         }
    1697           0 :                         ret->http = *(struct epm_rhs_http *)pytalloc_get_ptr(in);
    1698           0 :                         break;
    1699             : 
    1700           0 :                 case EPM_PROTOCOL_UNIX_DS:
    1701           0 :                         if (in == NULL) {
    1702           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->unix_ds");
    1703           0 :                                 talloc_free(ret); return NULL;
    1704             :                         }
    1705           0 :                         PY_CHECK_TYPE(&epm_rhs_unix_ds_Type, in, talloc_free(ret); return NULL;);
    1706           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1707           0 :                                 PyErr_NoMemory();
    1708           0 :                                 talloc_free(ret); return NULL;
    1709             :                         }
    1710           0 :                         ret->unix_ds = *(struct epm_rhs_unix_ds *)pytalloc_get_ptr(in);
    1711           0 :                         break;
    1712             : 
    1713           0 :                 case EPM_PROTOCOL_NULL:
    1714           0 :                         if (in == NULL) {
    1715           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->null");
    1716           0 :                                 talloc_free(ret); return NULL;
    1717             :                         }
    1718           0 :                         PY_CHECK_TYPE(&epm_rhs_null_Type, in, talloc_free(ret); return NULL;);
    1719           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1720           0 :                                 PyErr_NoMemory();
    1721           0 :                                 talloc_free(ret); return NULL;
    1722             :                         }
    1723           0 :                         ret->null = *(struct epm_rhs_null *)pytalloc_get_ptr(in);
    1724           0 :                         break;
    1725             : 
    1726           0 :                 default:
    1727           0 :                         if (in == NULL) {
    1728           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->unknown");
    1729           0 :                                 talloc_free(ret); return NULL;
    1730             :                         }
    1731           0 :                         ret->unknown = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
    1732           0 :                         break;
    1733             : 
    1734             :         }
    1735             : 
    1736          96 :         return ret;
    1737             : }
    1738             : 
    1739         160 : static PyObject *py_epm_rhs_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1740             : {
    1741         160 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    1742         160 :         PyObject *mem_ctx_obj = NULL;
    1743         160 :         TALLOC_CTX *mem_ctx = NULL;
    1744         160 :         int level = 0;
    1745         160 :         PyObject *in_obj = NULL;
    1746         160 :         union epm_rhs *in = NULL;
    1747             : 
    1748         160 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    1749             :                 discard_const_p(char *, kwnames),
    1750             :                 &mem_ctx_obj,
    1751             :                 &level,
    1752             :                 &in_obj)) {
    1753           0 :                 return NULL;
    1754             :         }
    1755         160 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    1756         160 :         if (mem_ctx == NULL) {
    1757           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    1758           0 :                 return NULL;
    1759             :         }
    1760         160 :         in = (union epm_rhs *)pytalloc_get_ptr(in_obj);
    1761         160 :         if (in == NULL) {
    1762           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union epm_rhs!");
    1763           0 :                 return NULL;
    1764             :         }
    1765             : 
    1766         160 :         return py_import_epm_rhs(mem_ctx, level, in);
    1767             : }
    1768             : 
    1769          96 : static PyObject *py_epm_rhs_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1770             : {
    1771          96 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    1772          96 :         PyObject *mem_ctx_obj = NULL;
    1773          96 :         TALLOC_CTX *mem_ctx = NULL;
    1774          96 :         int level = 0;
    1775          96 :         PyObject *in = NULL;
    1776          96 :         union epm_rhs *out = NULL;
    1777             : 
    1778          96 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    1779             :                 discard_const_p(char *, kwnames),
    1780             :                 &mem_ctx_obj,
    1781             :                 &level,
    1782             :                 &in)) {
    1783           0 :                 return NULL;
    1784             :         }
    1785          96 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    1786          96 :         if (mem_ctx == NULL) {
    1787           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    1788           0 :                 return NULL;
    1789             :         }
    1790             : 
    1791          96 :         out = py_export_epm_rhs(mem_ctx, level, in);
    1792          96 :         if (out == NULL) {
    1793           0 :                 return NULL;
    1794             :         }
    1795             : 
    1796          96 :         return pytalloc_GenericObject_reference(out);
    1797             : }
    1798             : 
    1799             : static PyMethodDef py_epm_rhs_methods[] = {
    1800             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_rhs_import),
    1801             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    1802             :                 "T.__import__(mem_ctx, level, in) => ret." },
    1803             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_rhs_export),
    1804             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    1805             :                 "T.__export__(mem_ctx, level, in) => ret." },
    1806             :         { NULL, NULL, 0, NULL }
    1807             : };
    1808             : 
    1809           0 : static PyObject *py_epm_rhs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1810             : {
    1811           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    1812           0 :         return NULL;
    1813             : }
    1814             : 
    1815             : 
    1816             : static PyTypeObject epm_rhs_Type = {
    1817             :         PyVarObject_HEAD_INIT(NULL, 0)
    1818             :         .tp_name = "epmapper.epm_rhs",
    1819             :         .tp_getset = NULL,
    1820             :         .tp_methods = py_epm_rhs_methods,
    1821             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1822             :         .tp_new = py_epm_rhs_new,
    1823             : };
    1824             : 
    1825             : 
    1826          32 : static PyObject *py_epm_lhs_get_protocol(PyObject *obj, void *closure)
    1827             : {
    1828          32 :         struct epm_lhs *object = pytalloc_get_ptr(obj);
    1829           0 :         PyObject *py_protocol;
    1830          32 :         py_protocol = PyLong_FromLong((uint16_t)(object->protocol));
    1831          32 :         return py_protocol;
    1832             : }
    1833             : 
    1834         240 : static int py_epm_lhs_set_protocol(PyObject *py_obj, PyObject *value, void *closure)
    1835             : {
    1836         240 :         struct epm_lhs *object = pytalloc_get_ptr(py_obj);
    1837         240 :         if (value == NULL) {
    1838           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->protocol");
    1839           0 :                 return -1;
    1840             :         }
    1841             :         {
    1842         240 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->protocol));
    1843         240 :                 if (PyLong_Check(value)) {
    1844           0 :                         unsigned long long test_var;
    1845         240 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1846         240 :                         if (PyErr_Occurred() != NULL) {
    1847           0 :                                 return -1;
    1848             :                         }
    1849         240 :                         if (test_var > uint_max) {
    1850           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1851             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1852           0 :                                 return -1;
    1853             :                         }
    1854         240 :                         object->protocol = test_var;
    1855             :                 } else {
    1856           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1857             :                           PyLong_Type.tp_name);
    1858           0 :                         return -1;
    1859             :                 }
    1860             :         }
    1861         240 :         return 0;
    1862             : }
    1863             : 
    1864           0 : static PyObject *py_epm_lhs_get_lhs_data(PyObject *obj, void *closure)
    1865             : {
    1866           0 :         struct epm_lhs *object = pytalloc_get_ptr(obj);
    1867           0 :         PyObject *py_lhs_data;
    1868           0 :         py_lhs_data = PyBytes_FromStringAndSize((char *)(object->lhs_data).data, (object->lhs_data).length);
    1869           0 :         return py_lhs_data;
    1870             : }
    1871             : 
    1872         240 : static int py_epm_lhs_set_lhs_data(PyObject *py_obj, PyObject *value, void *closure)
    1873             : {
    1874         240 :         struct epm_lhs *object = pytalloc_get_ptr(py_obj);
    1875         240 :         if (value == NULL) {
    1876           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lhs_data");
    1877           0 :                 return -1;
    1878             :         }
    1879         240 :         object->lhs_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    1880         240 :         return 0;
    1881             : }
    1882             : 
    1883             : static PyGetSetDef py_epm_lhs_getsetters[] = {
    1884             :         {
    1885             :                 .name = discard_const_p(char, "protocol"),
    1886             :                 .get = py_epm_lhs_get_protocol,
    1887             :                 .set = py_epm_lhs_set_protocol,
    1888             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_protocol")
    1889             :         },
    1890             :         {
    1891             :                 .name = discard_const_p(char, "lhs_data"),
    1892             :                 .get = py_epm_lhs_get_lhs_data,
    1893             :                 .set = py_epm_lhs_set_lhs_data,
    1894             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    1895             :         },
    1896             :         { .name = NULL }
    1897             : };
    1898             : 
    1899         240 : static PyObject *py_epm_lhs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1900             : {
    1901         240 :         return pytalloc_new(struct epm_lhs, type);
    1902             : }
    1903             : 
    1904             : 
    1905             : static PyTypeObject epm_lhs_Type = {
    1906             :         PyVarObject_HEAD_INIT(NULL, 0)
    1907             :         .tp_name = "epmapper.epm_lhs",
    1908             :         .tp_getset = py_epm_lhs_getsetters,
    1909             :         .tp_methods = NULL,
    1910             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1911             :         .tp_new = py_epm_lhs_new,
    1912             : };
    1913             : 
    1914             : 
    1915          32 : static PyObject *py_epm_floor_get_lhs(PyObject *obj, void *closure)
    1916             : {
    1917          32 :         struct epm_floor *object = pytalloc_get_ptr(obj);
    1918           0 :         PyObject *py_lhs;
    1919          32 :         py_lhs = pytalloc_reference_ex(&epm_lhs_Type, pytalloc_get_mem_ctx(obj), &object->lhs);
    1920          32 :         return py_lhs;
    1921             : }
    1922             : 
    1923         240 : static int py_epm_floor_set_lhs(PyObject *py_obj, PyObject *value, void *closure)
    1924             : {
    1925         240 :         struct epm_floor *object = pytalloc_get_ptr(py_obj);
    1926         240 :         if (value == NULL) {
    1927           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lhs");
    1928           0 :                 return -1;
    1929             :         }
    1930         240 :         PY_CHECK_TYPE(&epm_lhs_Type, value, return -1;);
    1931         240 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1932           0 :                 PyErr_NoMemory();
    1933           0 :                 return -1;
    1934             :         }
    1935         240 :         object->lhs = *(struct epm_lhs *)pytalloc_get_ptr(value);
    1936         240 :         return 0;
    1937             : }
    1938             : 
    1939         160 : static PyObject *py_epm_floor_get_rhs(PyObject *obj, void *closure)
    1940             : {
    1941         160 :         struct epm_floor *object = pytalloc_get_ptr(obj);
    1942           0 :         PyObject *py_rhs;
    1943         160 :         py_rhs = pyrpc_import_union(&epm_rhs_Type, pytalloc_get_mem_ctx(obj), object->lhs.protocol, &object->rhs, "union epm_rhs");
    1944         160 :         if (py_rhs == NULL) {
    1945           0 :                 return NULL;
    1946             :         }
    1947         160 :         return py_rhs;
    1948             : }
    1949             : 
    1950          96 : static int py_epm_floor_set_rhs(PyObject *py_obj, PyObject *value, void *closure)
    1951             : {
    1952          96 :         struct epm_floor *object = pytalloc_get_ptr(py_obj);
    1953          96 :         if (value == NULL) {
    1954           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rhs");
    1955           0 :                 return -1;
    1956             :         }
    1957             :         {
    1958           0 :                 union epm_rhs *rhs_switch_1;
    1959          96 :                 rhs_switch_1 = (union epm_rhs *)pyrpc_export_union(&epm_rhs_Type, pytalloc_get_mem_ctx(py_obj), object->lhs.protocol, value, "union epm_rhs");
    1960          96 :                 if (rhs_switch_1 == NULL) {
    1961           0 :                         return -1;
    1962             :                 }
    1963          96 :                 object->rhs = *rhs_switch_1;
    1964             :         }
    1965          96 :         return 0;
    1966             : }
    1967             : 
    1968             : static PyGetSetDef py_epm_floor_getsetters[] = {
    1969             :         {
    1970             :                 .name = discard_const_p(char, "lhs"),
    1971             :                 .get = py_epm_floor_get_lhs,
    1972             :                 .set = py_epm_floor_set_lhs,
    1973             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_lhs")
    1974             :         },
    1975             :         {
    1976             :                 .name = discard_const_p(char, "rhs"),
    1977             :                 .get = py_epm_floor_get_rhs,
    1978             :                 .set = py_epm_floor_set_rhs,
    1979             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_rhs")
    1980             :         },
    1981             :         { .name = NULL }
    1982             : };
    1983             : 
    1984         240 : static PyObject *py_epm_floor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1985             : {
    1986         240 :         return pytalloc_new(struct epm_floor, type);
    1987             : }
    1988             : 
    1989             : 
    1990             : static PyTypeObject epm_floor_Type = {
    1991             :         PyVarObject_HEAD_INIT(NULL, 0)
    1992             :         .tp_name = "epmapper.epm_floor",
    1993             :         .tp_getset = py_epm_floor_getsetters,
    1994             :         .tp_methods = NULL,
    1995             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1996             :         .tp_new = py_epm_floor_new,
    1997             : };
    1998             : 
    1999             : 
    2000          16 : static PyObject *py_epm_tower_get_num_floors(PyObject *obj, void *closure)
    2001             : {
    2002          16 :         struct epm_tower *object = pytalloc_get_ptr(obj);
    2003           0 :         PyObject *py_num_floors;
    2004          16 :         py_num_floors = PyLong_FromLong((uint16_t)(object->num_floors));
    2005          16 :         return py_num_floors;
    2006             : }
    2007             : 
    2008          48 : static int py_epm_tower_set_num_floors(PyObject *py_obj, PyObject *value, void *closure)
    2009             : {
    2010          48 :         struct epm_tower *object = pytalloc_get_ptr(py_obj);
    2011          48 :         if (value == NULL) {
    2012           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_floors");
    2013           0 :                 return -1;
    2014             :         }
    2015             :         {
    2016          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_floors));
    2017          48 :                 if (PyLong_Check(value)) {
    2018           0 :                         unsigned long long test_var;
    2019          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2020          48 :                         if (PyErr_Occurred() != NULL) {
    2021           0 :                                 return -1;
    2022             :                         }
    2023          48 :                         if (test_var > uint_max) {
    2024           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2025             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2026           0 :                                 return -1;
    2027             :                         }
    2028          48 :                         object->num_floors = test_var;
    2029             :                 } else {
    2030           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2031             :                           PyLong_Type.tp_name);
    2032           0 :                         return -1;
    2033             :                 }
    2034             :         }
    2035          48 :         return 0;
    2036             : }
    2037             : 
    2038          64 : static PyObject *py_epm_tower_get_floors(PyObject *obj, void *closure)
    2039             : {
    2040          64 :         struct epm_tower *object = pytalloc_get_ptr(obj);
    2041           0 :         PyObject *py_floors;
    2042          64 :         py_floors = PyList_New(object->num_floors);
    2043          64 :         if (py_floors == NULL) {
    2044           0 :                 return NULL;
    2045             :         }
    2046             :         {
    2047             :                 int floors_cntr_0;
    2048         384 :                 for (floors_cntr_0 = 0; floors_cntr_0 < (object->num_floors); floors_cntr_0++) {
    2049           0 :                         PyObject *py_floors_0;
    2050         320 :                         py_floors_0 = pytalloc_reference_ex(&epm_floor_Type, object->floors, &(object->floors)[floors_cntr_0]);
    2051         320 :                         PyList_SetItem(py_floors, floors_cntr_0, py_floors_0);
    2052             :                 }
    2053             :         }
    2054          64 :         return py_floors;
    2055             : }
    2056             : 
    2057          48 : static int py_epm_tower_set_floors(PyObject *py_obj, PyObject *value, void *closure)
    2058             : {
    2059          48 :         struct epm_tower *object = pytalloc_get_ptr(py_obj);
    2060          48 :         if (value == NULL) {
    2061           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->floors");
    2062           0 :                 return -1;
    2063             :         }
    2064          48 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2065             :         {
    2066           0 :                 int floors_cntr_0;
    2067          48 :                 object->floors = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->floors, PyList_GET_SIZE(value));
    2068          48 :                 if (!object->floors) { return -1; }
    2069          48 :                 talloc_set_name_const(object->floors, "ARRAY: object->floors");
    2070         288 :                 for (floors_cntr_0 = 0; floors_cntr_0 < PyList_GET_SIZE(value); floors_cntr_0++) {
    2071         240 :                         if (PyList_GET_ITEM(value, floors_cntr_0) == NULL) {
    2072           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->floors)[floors_cntr_0]");
    2073           0 :                                 return -1;
    2074             :                         }
    2075         240 :                         PY_CHECK_TYPE(&epm_floor_Type, PyList_GET_ITEM(value, floors_cntr_0), return -1;);
    2076         240 :                         if (talloc_reference(object->floors, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, floors_cntr_0))) == NULL) {
    2077           0 :                                 PyErr_NoMemory();
    2078           0 :                                 return -1;
    2079             :                         }
    2080         240 :                         (object->floors)[floors_cntr_0] = *(struct epm_floor *)pytalloc_get_ptr(PyList_GET_ITEM(value, floors_cntr_0));
    2081             :                 }
    2082             :         }
    2083          48 :         return 0;
    2084             : }
    2085             : 
    2086             : static PyGetSetDef py_epm_tower_getsetters[] = {
    2087             :         {
    2088             :                 .name = discard_const_p(char, "num_floors"),
    2089             :                 .get = py_epm_tower_get_num_floors,
    2090             :                 .set = py_epm_tower_set_num_floors,
    2091             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2092             :         },
    2093             :         {
    2094             :                 .name = discard_const_p(char, "floors"),
    2095             :                 .get = py_epm_tower_get_floors,
    2096             :                 .set = py_epm_tower_set_floors,
    2097             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_floor")
    2098             :         },
    2099             :         { .name = NULL }
    2100             : };
    2101             : 
    2102          48 : static PyObject *py_epm_tower_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2103             : {
    2104          48 :         return pytalloc_new(struct epm_tower, type);
    2105             : }
    2106             : 
    2107             : 
    2108             : static PyTypeObject epm_tower_Type = {
    2109             :         PyVarObject_HEAD_INIT(NULL, 0)
    2110             :         .tp_name = "epmapper.epm_tower",
    2111             :         .tp_getset = py_epm_tower_getsetters,
    2112             :         .tp_methods = NULL,
    2113             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2114             :         .tp_new = py_epm_tower_new,
    2115             : };
    2116             : 
    2117             : 
    2118          16 : static PyObject *py_epm_twr_t_get_tower_length(PyObject *obj, void *closure)
    2119             : {
    2120          16 :         struct epm_twr_t *object = pytalloc_get_ptr(obj);
    2121           0 :         PyObject *py_tower_length;
    2122          16 :         py_tower_length = PyLong_FromUnsignedLongLong((uint32_t)(object->tower_length));
    2123          16 :         return py_tower_length;
    2124             : }
    2125             : 
    2126           0 : static int py_epm_twr_t_set_tower_length(PyObject *py_obj, PyObject *value, void *closure)
    2127             : {
    2128           0 :         struct epm_twr_t *object = pytalloc_get_ptr(py_obj);
    2129           0 :         if (value == NULL) {
    2130           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->tower_length");
    2131           0 :                 return -1;
    2132             :         }
    2133             :         {
    2134           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tower_length));
    2135           0 :                 if (PyLong_Check(value)) {
    2136           0 :                         unsigned long long test_var;
    2137           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2138           0 :                         if (PyErr_Occurred() != NULL) {
    2139           0 :                                 return -1;
    2140             :                         }
    2141           0 :                         if (test_var > uint_max) {
    2142           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2143             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2144           0 :                                 return -1;
    2145             :                         }
    2146           0 :                         object->tower_length = test_var;
    2147             :                 } else {
    2148           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2149             :                           PyLong_Type.tp_name);
    2150           0 :                         return -1;
    2151             :                 }
    2152             :         }
    2153           0 :         return 0;
    2154             : }
    2155             : 
    2156          80 : static PyObject *py_epm_twr_t_get_tower(PyObject *obj, void *closure)
    2157             : {
    2158          80 :         struct epm_twr_t *object = pytalloc_get_ptr(obj);
    2159           0 :         PyObject *py_tower;
    2160          80 :         py_tower = pytalloc_reference_ex(&epm_tower_Type, pytalloc_get_mem_ctx(obj), &object->tower);
    2161          80 :         return py_tower;
    2162             : }
    2163             : 
    2164          48 : static int py_epm_twr_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
    2165             : {
    2166          48 :         struct epm_twr_t *object = pytalloc_get_ptr(py_obj);
    2167          48 :         if (value == NULL) {
    2168           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->tower");
    2169           0 :                 return -1;
    2170             :         }
    2171          48 :         PY_CHECK_TYPE(&epm_tower_Type, value, return -1;);
    2172          48 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2173           0 :                 PyErr_NoMemory();
    2174           0 :                 return -1;
    2175             :         }
    2176          48 :         object->tower = *(struct epm_tower *)pytalloc_get_ptr(value);
    2177          48 :         return 0;
    2178             : }
    2179             : 
    2180             : static PyGetSetDef py_epm_twr_t_getsetters[] = {
    2181             :         {
    2182             :                 .name = discard_const_p(char, "tower_length"),
    2183             :                 .get = py_epm_twr_t_get_tower_length,
    2184             :                 .set = py_epm_twr_t_set_tower_length,
    2185             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2186             :         },
    2187             :         {
    2188             :                 .name = discard_const_p(char, "tower"),
    2189             :                 .get = py_epm_twr_t_get_tower,
    2190             :                 .set = py_epm_twr_t_set_tower,
    2191             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_tower")
    2192             :         },
    2193             :         { .name = NULL }
    2194             : };
    2195             : 
    2196          48 : static PyObject *py_epm_twr_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2197             : {
    2198          48 :         return pytalloc_new(struct epm_twr_t, type);
    2199             : }
    2200             : 
    2201           0 : static PyObject *py_epm_twr_t_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2202             : {
    2203           0 :         struct epm_twr_t *object = pytalloc_get_ptr(py_obj);
    2204           0 :         PyObject *ret = NULL;
    2205           0 :         DATA_BLOB blob;
    2206           0 :         enum ndr_err_code err;
    2207           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2208           0 :         if (tmp_ctx == NULL) {
    2209           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2210           0 :                 return NULL;
    2211             :         }
    2212           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_epm_twr_t);
    2213           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2214           0 :                 TALLOC_FREE(tmp_ctx);
    2215           0 :                 PyErr_SetNdrError(err);
    2216           0 :                 return NULL;
    2217             :         }
    2218             : 
    2219           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2220           0 :         TALLOC_FREE(tmp_ctx);
    2221           0 :         return ret;
    2222             : }
    2223             : 
    2224           0 : static PyObject *py_epm_twr_t_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2225             : {
    2226           0 :         struct epm_twr_t *object = pytalloc_get_ptr(py_obj);
    2227           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2228           0 :         Py_ssize_t blob_length = 0;
    2229           0 :         enum ndr_err_code err;
    2230           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2231           0 :         PyObject *allow_remaining_obj = NULL;
    2232           0 :         bool allow_remaining = false;
    2233             : 
    2234           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2235             :                 discard_const_p(char *, kwnames),
    2236             :                 &blob.data, &blob_length,
    2237             :                 &allow_remaining_obj)) {
    2238           0 :                 return NULL;
    2239             :         }
    2240           0 :         blob.length = blob_length;
    2241             : 
    2242           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2243           0 :                 allow_remaining = true;
    2244             :         }
    2245             : 
    2246           0 :         if (allow_remaining) {
    2247           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_epm_twr_t);
    2248             :         } else {
    2249           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_epm_twr_t);
    2250             :         }
    2251           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2252           0 :                 PyErr_SetNdrError(err);
    2253           0 :                 return NULL;
    2254             :         }
    2255             : 
    2256           0 :         Py_RETURN_NONE;
    2257             : }
    2258             : 
    2259           0 : static PyObject *py_epm_twr_t_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2260             : {
    2261           0 :         struct epm_twr_t *object = pytalloc_get_ptr(py_obj);
    2262           0 :         PyObject *ret;
    2263           0 :         char *retstr;
    2264             : 
    2265           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_epm_twr_t, "epm_twr_t", object);
    2266           0 :         ret = PyUnicode_FromString(retstr);
    2267           0 :         talloc_free(retstr);
    2268             : 
    2269           0 :         return ret;
    2270             : }
    2271             : 
    2272             : static PyMethodDef py_epm_twr_t_methods[] = {
    2273             :         { "__ndr_pack__", (PyCFunction)py_epm_twr_t_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2274             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_twr_t_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2275             :         { "__ndr_print__", (PyCFunction)py_epm_twr_t_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2276             :         { NULL, NULL, 0, NULL }
    2277             : };
    2278             : 
    2279             : 
    2280             : static PyTypeObject epm_twr_t_Type = {
    2281             :         PyVarObject_HEAD_INIT(NULL, 0)
    2282             :         .tp_name = "epmapper.epm_twr_t",
    2283             :         .tp_getset = py_epm_twr_t_getsetters,
    2284             :         .tp_methods = py_epm_twr_t_methods,
    2285             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2286             :         .tp_new = py_epm_twr_t_new,
    2287             : };
    2288             : 
    2289             : 
    2290           0 : static PyObject *py_epm_entry_t_get_object(PyObject *obj, void *closure)
    2291             : {
    2292           0 :         struct epm_entry_t *object = pytalloc_get_ptr(obj);
    2293           0 :         PyObject *py_object;
    2294           0 :         py_object = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->object);
    2295           0 :         return py_object;
    2296             : }
    2297             : 
    2298           0 : static int py_epm_entry_t_set_object(PyObject *py_obj, PyObject *value, void *closure)
    2299             : {
    2300           0 :         struct epm_entry_t *object = pytalloc_get_ptr(py_obj);
    2301           0 :         if (value == NULL) {
    2302           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->object");
    2303           0 :                 return -1;
    2304             :         }
    2305           0 :         PY_CHECK_TYPE(GUID_Type, value, return -1;);
    2306           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2307           0 :                 PyErr_NoMemory();
    2308           0 :                 return -1;
    2309             :         }
    2310           0 :         object->object = *(struct GUID *)pytalloc_get_ptr(value);
    2311           0 :         return 0;
    2312             : }
    2313             : 
    2314           0 : static PyObject *py_epm_entry_t_get_tower(PyObject *obj, void *closure)
    2315             : {
    2316           0 :         struct epm_entry_t *object = pytalloc_get_ptr(obj);
    2317           0 :         PyObject *py_tower;
    2318           0 :         if (object->tower == NULL) {
    2319           0 :                 Py_RETURN_NONE;
    2320             :         }
    2321           0 :         if (object->tower == NULL) {
    2322           0 :                 py_tower = Py_None;
    2323           0 :                 Py_INCREF(py_tower);
    2324             :         } else {
    2325           0 :                 py_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->tower, object->tower);
    2326             :         }
    2327           0 :         return py_tower;
    2328             : }
    2329             : 
    2330           0 : static int py_epm_entry_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
    2331             : {
    2332           0 :         struct epm_entry_t *object = pytalloc_get_ptr(py_obj);
    2333           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->tower));
    2334           0 :         if (value == NULL) {
    2335           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->tower");
    2336           0 :                 return -1;
    2337             :         }
    2338           0 :         if (value == Py_None) {
    2339           0 :                 object->tower = NULL;
    2340             :         } else {
    2341           0 :                 object->tower = NULL;
    2342           0 :                 PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
    2343           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2344           0 :                         PyErr_NoMemory();
    2345           0 :                         return -1;
    2346             :                 }
    2347           0 :                 object->tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
    2348             :         }
    2349           0 :         return 0;
    2350             : }
    2351             : 
    2352           0 : static PyObject *py_epm_entry_t_get___annotation_offset(PyObject *obj, void *closure)
    2353             : {
    2354           0 :         struct epm_entry_t *object = pytalloc_get_ptr(obj);
    2355           0 :         PyObject *py___annotation_offset;
    2356           0 :         py___annotation_offset = PyLong_FromUnsignedLongLong((uint32_t)(object->__annotation_offset));
    2357           0 :         return py___annotation_offset;
    2358             : }
    2359             : 
    2360           0 : static int py_epm_entry_t_set___annotation_offset(PyObject *py_obj, PyObject *value, void *closure)
    2361             : {
    2362           0 :         struct epm_entry_t *object = pytalloc_get_ptr(py_obj);
    2363           0 :         if (value == NULL) {
    2364           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->__annotation_offset");
    2365           0 :                 return -1;
    2366             :         }
    2367             :         {
    2368           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__annotation_offset));
    2369           0 :                 if (PyLong_Check(value)) {
    2370           0 :                         unsigned long long test_var;
    2371           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2372           0 :                         if (PyErr_Occurred() != NULL) {
    2373           0 :                                 return -1;
    2374             :                         }
    2375           0 :                         if (test_var > uint_max) {
    2376           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2377             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2378           0 :                                 return -1;
    2379             :                         }
    2380           0 :                         object->__annotation_offset = test_var;
    2381             :                 } else {
    2382           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2383             :                           PyLong_Type.tp_name);
    2384           0 :                         return -1;
    2385             :                 }
    2386             :         }
    2387           0 :         return 0;
    2388             : }
    2389             : 
    2390           0 : static PyObject *py_epm_entry_t_get___annotation_length(PyObject *obj, void *closure)
    2391             : {
    2392           0 :         struct epm_entry_t *object = pytalloc_get_ptr(obj);
    2393           0 :         PyObject *py___annotation_length;
    2394           0 :         py___annotation_length = PyLong_FromUnsignedLongLong((uint32_t)(object->__annotation_length));
    2395           0 :         return py___annotation_length;
    2396             : }
    2397             : 
    2398           0 : static int py_epm_entry_t_set___annotation_length(PyObject *py_obj, PyObject *value, void *closure)
    2399             : {
    2400           0 :         struct epm_entry_t *object = pytalloc_get_ptr(py_obj);
    2401           0 :         if (value == NULL) {
    2402           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->__annotation_length");
    2403           0 :                 return -1;
    2404             :         }
    2405             :         {
    2406           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__annotation_length));
    2407           0 :                 if (PyLong_Check(value)) {
    2408           0 :                         unsigned long long test_var;
    2409           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2410           0 :                         if (PyErr_Occurred() != NULL) {
    2411           0 :                                 return -1;
    2412             :                         }
    2413           0 :                         if (test_var > uint_max) {
    2414           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2415             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2416           0 :                                 return -1;
    2417             :                         }
    2418           0 :                         object->__annotation_length = test_var;
    2419             :                 } else {
    2420           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2421             :                           PyLong_Type.tp_name);
    2422           0 :                         return -1;
    2423             :                 }
    2424             :         }
    2425           0 :         return 0;
    2426             : }
    2427             : 
    2428           0 : static PyObject *py_epm_entry_t_get_annotation(PyObject *obj, void *closure)
    2429             : {
    2430           0 :         struct epm_entry_t *object = pytalloc_get_ptr(obj);
    2431           0 :         PyObject *py_annotation;
    2432           0 :         if (object->annotation == NULL) {
    2433           0 :                 py_annotation = Py_None;
    2434           0 :                 Py_INCREF(py_annotation);
    2435             :         } else {
    2436           0 :                 py_annotation = PyUnicode_Decode(object->annotation, strlen(object->annotation), "utf-8", "ignore");
    2437             :         }
    2438           0 :         return py_annotation;
    2439             : }
    2440             : 
    2441           0 : static int py_epm_entry_t_set_annotation(PyObject *py_obj, PyObject *value, void *closure)
    2442             : {
    2443           0 :         struct epm_entry_t *object = pytalloc_get_ptr(py_obj);
    2444           0 :         if (value == NULL) {
    2445           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->annotation");
    2446           0 :                 return -1;
    2447             :         }
    2448             :         {
    2449           0 :                 const char *test_str;
    2450           0 :                 const char *talloc_str;
    2451           0 :                 PyObject *unicode = NULL;
    2452           0 :                 if (PyUnicode_Check(value)) {
    2453           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2454           0 :                         if (unicode == NULL) {
    2455           0 :                                 return -1;
    2456             :                         }
    2457           0 :                         test_str = PyBytes_AS_STRING(unicode);
    2458           0 :                 } else if (PyBytes_Check(value)) {
    2459           0 :                         test_str = PyBytes_AS_STRING(value);
    2460             :                 } else {
    2461           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2462           0 :                         return -1;
    2463             :                 }
    2464           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2465           0 :                 if (unicode != NULL) {
    2466           0 :                         Py_DECREF(unicode);
    2467             :                 }
    2468           0 :                 if (talloc_str == NULL) {
    2469           0 :                         PyErr_NoMemory();
    2470           0 :                         return -1;
    2471             :                 }
    2472           0 :                 object->annotation = talloc_str;
    2473             :         }
    2474           0 :         return 0;
    2475             : }
    2476             : 
    2477             : static PyGetSetDef py_epm_entry_t_getsetters[] = {
    2478             :         {
    2479             :                 .name = discard_const_p(char, "object"),
    2480             :                 .get = py_epm_entry_t_get_object,
    2481             :                 .set = py_epm_entry_t_set_object,
    2482             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    2483             :         },
    2484             :         {
    2485             :                 .name = discard_const_p(char, "tower"),
    2486             :                 .get = py_epm_entry_t_get_tower,
    2487             :                 .set = py_epm_entry_t_set_tower,
    2488             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
    2489             :         },
    2490             :         {
    2491             :                 .name = discard_const_p(char, "__annotation_offset"),
    2492             :                 .get = py_epm_entry_t_get___annotation_offset,
    2493             :                 .set = py_epm_entry_t_set___annotation_offset,
    2494             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2495             :         },
    2496             :         {
    2497             :                 .name = discard_const_p(char, "__annotation_length"),
    2498             :                 .get = py_epm_entry_t_get___annotation_length,
    2499             :                 .set = py_epm_entry_t_set___annotation_length,
    2500             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2501             :         },
    2502             :         {
    2503             :                 .name = discard_const_p(char, "annotation"),
    2504             :                 .get = py_epm_entry_t_get_annotation,
    2505             :                 .set = py_epm_entry_t_set_annotation,
    2506             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2507             :         },
    2508             :         { .name = NULL }
    2509             : };
    2510             : 
    2511           0 : static PyObject *py_epm_entry_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2512             : {
    2513           0 :         return pytalloc_new(struct epm_entry_t, type);
    2514             : }
    2515             : 
    2516             : 
    2517             : static PyTypeObject epm_entry_t_Type = {
    2518             :         PyVarObject_HEAD_INIT(NULL, 0)
    2519             :         .tp_name = "epmapper.epm_entry_t",
    2520             :         .tp_getset = py_epm_entry_t_getsetters,
    2521             :         .tp_methods = NULL,
    2522             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2523             :         .tp_new = py_epm_entry_t_new,
    2524             : };
    2525             : 
    2526             : 
    2527           0 : static PyObject *py_rpc_if_id_t_get_uuid(PyObject *obj, void *closure)
    2528             : {
    2529           0 :         struct rpc_if_id_t *object = pytalloc_get_ptr(obj);
    2530           0 :         PyObject *py_uuid;
    2531           0 :         py_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->uuid);
    2532           0 :         return py_uuid;
    2533             : }
    2534             : 
    2535           0 : static int py_rpc_if_id_t_set_uuid(PyObject *py_obj, PyObject *value, void *closure)
    2536             : {
    2537           0 :         struct rpc_if_id_t *object = pytalloc_get_ptr(py_obj);
    2538           0 :         if (value == NULL) {
    2539           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->uuid");
    2540           0 :                 return -1;
    2541             :         }
    2542           0 :         PY_CHECK_TYPE(GUID_Type, value, return -1;);
    2543           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2544           0 :                 PyErr_NoMemory();
    2545           0 :                 return -1;
    2546             :         }
    2547           0 :         object->uuid = *(struct GUID *)pytalloc_get_ptr(value);
    2548           0 :         return 0;
    2549             : }
    2550             : 
    2551           0 : static PyObject *py_rpc_if_id_t_get_vers_major(PyObject *obj, void *closure)
    2552             : {
    2553           0 :         struct rpc_if_id_t *object = pytalloc_get_ptr(obj);
    2554           0 :         PyObject *py_vers_major;
    2555           0 :         py_vers_major = PyLong_FromLong((uint16_t)(object->vers_major));
    2556           0 :         return py_vers_major;
    2557             : }
    2558             : 
    2559           0 : static int py_rpc_if_id_t_set_vers_major(PyObject *py_obj, PyObject *value, void *closure)
    2560             : {
    2561           0 :         struct rpc_if_id_t *object = pytalloc_get_ptr(py_obj);
    2562           0 :         if (value == NULL) {
    2563           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->vers_major");
    2564           0 :                 return -1;
    2565             :         }
    2566             :         {
    2567           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vers_major));
    2568           0 :                 if (PyLong_Check(value)) {
    2569           0 :                         unsigned long long test_var;
    2570           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2571           0 :                         if (PyErr_Occurred() != NULL) {
    2572           0 :                                 return -1;
    2573             :                         }
    2574           0 :                         if (test_var > uint_max) {
    2575           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2576             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2577           0 :                                 return -1;
    2578             :                         }
    2579           0 :                         object->vers_major = test_var;
    2580             :                 } else {
    2581           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2582             :                           PyLong_Type.tp_name);
    2583           0 :                         return -1;
    2584             :                 }
    2585             :         }
    2586           0 :         return 0;
    2587             : }
    2588             : 
    2589           0 : static PyObject *py_rpc_if_id_t_get_vers_minor(PyObject *obj, void *closure)
    2590             : {
    2591           0 :         struct rpc_if_id_t *object = pytalloc_get_ptr(obj);
    2592           0 :         PyObject *py_vers_minor;
    2593           0 :         py_vers_minor = PyLong_FromLong((uint16_t)(object->vers_minor));
    2594           0 :         return py_vers_minor;
    2595             : }
    2596             : 
    2597           0 : static int py_rpc_if_id_t_set_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
    2598             : {
    2599           0 :         struct rpc_if_id_t *object = pytalloc_get_ptr(py_obj);
    2600           0 :         if (value == NULL) {
    2601           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->vers_minor");
    2602           0 :                 return -1;
    2603             :         }
    2604             :         {
    2605           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vers_minor));
    2606           0 :                 if (PyLong_Check(value)) {
    2607           0 :                         unsigned long long test_var;
    2608           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2609           0 :                         if (PyErr_Occurred() != NULL) {
    2610           0 :                                 return -1;
    2611             :                         }
    2612           0 :                         if (test_var > uint_max) {
    2613           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2614             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2615           0 :                                 return -1;
    2616             :                         }
    2617           0 :                         object->vers_minor = test_var;
    2618             :                 } else {
    2619           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2620             :                           PyLong_Type.tp_name);
    2621           0 :                         return -1;
    2622             :                 }
    2623             :         }
    2624           0 :         return 0;
    2625             : }
    2626             : 
    2627             : static PyGetSetDef py_rpc_if_id_t_getsetters[] = {
    2628             :         {
    2629             :                 .name = discard_const_p(char, "uuid"),
    2630             :                 .get = py_rpc_if_id_t_get_uuid,
    2631             :                 .set = py_rpc_if_id_t_set_uuid,
    2632             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    2633             :         },
    2634             :         {
    2635             :                 .name = discard_const_p(char, "vers_major"),
    2636             :                 .get = py_rpc_if_id_t_get_vers_major,
    2637             :                 .set = py_rpc_if_id_t_set_vers_major,
    2638             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2639             :         },
    2640             :         {
    2641             :                 .name = discard_const_p(char, "vers_minor"),
    2642             :                 .get = py_rpc_if_id_t_get_vers_minor,
    2643             :                 .set = py_rpc_if_id_t_set_vers_minor,
    2644             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2645             :         },
    2646             :         { .name = NULL }
    2647             : };
    2648             : 
    2649           0 : static PyObject *py_rpc_if_id_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2650             : {
    2651           0 :         return pytalloc_new(struct rpc_if_id_t, type);
    2652             : }
    2653             : 
    2654             : 
    2655             : static PyTypeObject rpc_if_id_t_Type = {
    2656             :         PyVarObject_HEAD_INIT(NULL, 0)
    2657             :         .tp_name = "epmapper.rpc_if_id_t",
    2658             :         .tp_getset = py_rpc_if_id_t_getsetters,
    2659             :         .tp_methods = NULL,
    2660             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2661             :         .tp_new = py_rpc_if_id_t_new,
    2662             : };
    2663             : 
    2664             : 
    2665          16 : static PyObject *py_epm_twr_p_t_get_twr(PyObject *obj, void *closure)
    2666             : {
    2667          16 :         struct epm_twr_p_t *object = pytalloc_get_ptr(obj);
    2668           0 :         PyObject *py_twr;
    2669          16 :         if (object->twr == NULL) {
    2670           0 :                 Py_RETURN_NONE;
    2671             :         }
    2672          16 :         if (object->twr == NULL) {
    2673           0 :                 py_twr = Py_None;
    2674           0 :                 Py_INCREF(py_twr);
    2675             :         } else {
    2676          16 :                 py_twr = pytalloc_reference_ex(&epm_twr_t_Type, object->twr, object->twr);
    2677             :         }
    2678          16 :         return py_twr;
    2679             : }
    2680             : 
    2681           0 : static int py_epm_twr_p_t_set_twr(PyObject *py_obj, PyObject *value, void *closure)
    2682             : {
    2683           0 :         struct epm_twr_p_t *object = pytalloc_get_ptr(py_obj);
    2684           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->twr));
    2685           0 :         if (value == NULL) {
    2686           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->twr");
    2687           0 :                 return -1;
    2688             :         }
    2689           0 :         if (value == Py_None) {
    2690           0 :                 object->twr = NULL;
    2691             :         } else {
    2692           0 :                 object->twr = NULL;
    2693           0 :                 PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
    2694           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2695           0 :                         PyErr_NoMemory();
    2696           0 :                         return -1;
    2697             :                 }
    2698           0 :                 object->twr = (struct epm_twr_t *)pytalloc_get_ptr(value);
    2699             :         }
    2700           0 :         return 0;
    2701             : }
    2702             : 
    2703             : static PyGetSetDef py_epm_twr_p_t_getsetters[] = {
    2704             :         {
    2705             :                 .name = discard_const_p(char, "twr"),
    2706             :                 .get = py_epm_twr_p_t_get_twr,
    2707             :                 .set = py_epm_twr_p_t_set_twr,
    2708             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
    2709             :         },
    2710             :         { .name = NULL }
    2711             : };
    2712             : 
    2713           0 : static PyObject *py_epm_twr_p_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2714             : {
    2715           0 :         return pytalloc_new(struct epm_twr_p_t, type);
    2716             : }
    2717             : 
    2718             : 
    2719             : static PyTypeObject epm_twr_p_t_Type = {
    2720             :         PyVarObject_HEAD_INIT(NULL, 0)
    2721             :         .tp_name = "epmapper.epm_twr_p_t",
    2722             :         .tp_getset = py_epm_twr_p_t_getsetters,
    2723             :         .tp_methods = NULL,
    2724             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2725             :         .tp_new = py_epm_twr_p_t_new,
    2726             : };
    2727             : 
    2728             : 
    2729             : 
    2730           0 : static PyObject *py_epm_Insert_in_get_num_ents(PyObject *obj, void *closure)
    2731             : {
    2732           0 :         struct epm_Insert *object = pytalloc_get_ptr(obj);
    2733           0 :         PyObject *py_num_ents;
    2734           0 :         py_num_ents = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_ents));
    2735           0 :         return py_num_ents;
    2736             : }
    2737             : 
    2738           0 : static int py_epm_Insert_in_set_num_ents(PyObject *py_obj, PyObject *value, void *closure)
    2739             : {
    2740           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    2741           0 :         if (value == NULL) {
    2742           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_ents");
    2743           0 :                 return -1;
    2744             :         }
    2745             :         {
    2746           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ents));
    2747           0 :                 if (PyLong_Check(value)) {
    2748           0 :                         unsigned long long test_var;
    2749           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2750           0 :                         if (PyErr_Occurred() != NULL) {
    2751           0 :                                 return -1;
    2752             :                         }
    2753           0 :                         if (test_var > uint_max) {
    2754           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2755             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2756           0 :                                 return -1;
    2757             :                         }
    2758           0 :                         object->in.num_ents = test_var;
    2759             :                 } else {
    2760           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2761             :                           PyLong_Type.tp_name);
    2762           0 :                         return -1;
    2763             :                 }
    2764             :         }
    2765           0 :         return 0;
    2766             : }
    2767             : 
    2768           0 : static PyObject *py_epm_Insert_in_get_entries(PyObject *obj, void *closure)
    2769             : {
    2770           0 :         struct epm_Insert *object = pytalloc_get_ptr(obj);
    2771           0 :         PyObject *py_entries;
    2772           0 :         py_entries = PyList_New(object->in.num_ents);
    2773           0 :         if (py_entries == NULL) {
    2774           0 :                 return NULL;
    2775             :         }
    2776             :         {
    2777             :                 int entries_cntr_0;
    2778           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < (object->in.num_ents); entries_cntr_0++) {
    2779           0 :                         PyObject *py_entries_0;
    2780           0 :                         py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, object->in.entries, &(object->in.entries)[entries_cntr_0]);
    2781           0 :                         PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
    2782             :                 }
    2783             :         }
    2784           0 :         return py_entries;
    2785             : }
    2786             : 
    2787           0 : static int py_epm_Insert_in_set_entries(PyObject *py_obj, PyObject *value, void *closure)
    2788             : {
    2789           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    2790           0 :         if (value == NULL) {
    2791           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.entries");
    2792           0 :                 return -1;
    2793             :         }
    2794           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2795             :         {
    2796           0 :                 int entries_cntr_0;
    2797           0 :                 object->in.entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entries, PyList_GET_SIZE(value));
    2798           0 :                 if (!object->in.entries) { return -1; }
    2799           0 :                 talloc_set_name_const(object->in.entries, "ARRAY: object->in.entries");
    2800           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
    2801           0 :                         if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
    2802           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.entries)[entries_cntr_0]");
    2803           0 :                                 return -1;
    2804             :                         }
    2805           0 :                         PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
    2806           0 :                         if (talloc_reference(object->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
    2807           0 :                                 PyErr_NoMemory();
    2808           0 :                                 return -1;
    2809             :                         }
    2810           0 :                         (object->in.entries)[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
    2811             :                 }
    2812             :         }
    2813           0 :         return 0;
    2814             : }
    2815             : 
    2816           0 : static PyObject *py_epm_Insert_in_get_replace(PyObject *obj, void *closure)
    2817             : {
    2818           0 :         struct epm_Insert *object = pytalloc_get_ptr(obj);
    2819           0 :         PyObject *py_replace;
    2820           0 :         py_replace = PyLong_FromUnsignedLongLong((uint32_t)(object->in.replace));
    2821           0 :         return py_replace;
    2822             : }
    2823             : 
    2824           0 : static int py_epm_Insert_in_set_replace(PyObject *py_obj, PyObject *value, void *closure)
    2825             : {
    2826           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    2827           0 :         if (value == NULL) {
    2828           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.replace");
    2829           0 :                 return -1;
    2830             :         }
    2831             :         {
    2832           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.replace));
    2833           0 :                 if (PyLong_Check(value)) {
    2834           0 :                         unsigned long long test_var;
    2835           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2836           0 :                         if (PyErr_Occurred() != NULL) {
    2837           0 :                                 return -1;
    2838             :                         }
    2839           0 :                         if (test_var > uint_max) {
    2840           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2841             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2842           0 :                                 return -1;
    2843             :                         }
    2844           0 :                         object->in.replace = test_var;
    2845             :                 } else {
    2846           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2847             :                           PyLong_Type.tp_name);
    2848           0 :                         return -1;
    2849             :                 }
    2850             :         }
    2851           0 :         return 0;
    2852             : }
    2853             : 
    2854           0 : static PyObject *py_epm_Insert_get_result(PyObject *obj, void *closure)
    2855             : {
    2856           0 :         struct epm_Insert *object = pytalloc_get_ptr(obj);
    2857           0 :         PyObject *py_result;
    2858           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    2859           0 :         return py_result;
    2860             : }
    2861             : 
    2862           0 : static int py_epm_Insert_set_result(PyObject *py_obj, PyObject *value, void *closure)
    2863             : {
    2864           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    2865           0 :         if (value == NULL) {
    2866           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    2867           0 :                 return -1;
    2868             :         }
    2869             :         {
    2870           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    2871           0 :                 if (PyLong_Check(value)) {
    2872           0 :                         unsigned long long test_var;
    2873           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2874           0 :                         if (PyErr_Occurred() != NULL) {
    2875           0 :                                 return -1;
    2876             :                         }
    2877           0 :                         if (test_var > uint_max) {
    2878           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2879             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2880           0 :                                 return -1;
    2881             :                         }
    2882           0 :                         object->out.result = test_var;
    2883             :                 } else {
    2884           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2885             :                           PyLong_Type.tp_name);
    2886           0 :                         return -1;
    2887             :                 }
    2888             :         }
    2889           0 :         return 0;
    2890             : }
    2891             : 
    2892             : static PyGetSetDef py_epm_Insert_getsetters[] = {
    2893             :         {
    2894             :                 .name = discard_const_p(char, "in_num_ents"),
    2895             :                 .get = py_epm_Insert_in_get_num_ents,
    2896             :                 .set = py_epm_Insert_in_set_num_ents,
    2897             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2898             :         },
    2899             :         {
    2900             :                 .name = discard_const_p(char, "in_entries"),
    2901             :                 .get = py_epm_Insert_in_get_entries,
    2902             :                 .set = py_epm_Insert_in_set_entries,
    2903             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_entry_t")
    2904             :         },
    2905             :         {
    2906             :                 .name = discard_const_p(char, "in_replace"),
    2907             :                 .get = py_epm_Insert_in_get_replace,
    2908             :                 .set = py_epm_Insert_in_set_replace,
    2909             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2910             :         },
    2911             :         {
    2912             :                 .name = discard_const_p(char, "result"),
    2913             :                 .get = py_epm_Insert_get_result,
    2914             :                 .set = py_epm_Insert_set_result,
    2915             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    2916             :         },
    2917             :         { .name = NULL }
    2918             : };
    2919             : 
    2920           0 : static PyObject *py_epm_Insert_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2921             : {
    2922           0 :         PyObject *self = pytalloc_new(struct epm_Insert, type);
    2923           0 :         return self;
    2924             : }
    2925             : 
    2926           0 : static PyObject *py_epm_Insert_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    2927             : {
    2928             : 
    2929             : 
    2930           0 :         return PyLong_FromLong(0);
    2931             : }
    2932             : 
    2933           0 : static PyObject *py_epm_Insert_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    2934             : {
    2935           0 :         const struct ndr_interface_call *call = NULL;
    2936           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    2937           0 :         PyObject *ret = NULL;
    2938           0 :         struct ndr_push *push = NULL;
    2939           0 :         DATA_BLOB blob;
    2940           0 :         enum ndr_err_code err;
    2941             : 
    2942           0 :         if (ndr_table_epmapper.num_calls < 1) {
    2943           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Insert_ndr_pack");
    2944           0 :                 return NULL;
    2945             :         }
    2946           0 :         call = &ndr_table_epmapper.calls[0];
    2947             : 
    2948           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    2949           0 :         if (push == NULL) {
    2950           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2951           0 :                 return NULL;
    2952             :         }
    2953             : 
    2954           0 :         push->flags |= ndr_push_flags;
    2955             : 
    2956           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    2957           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2958           0 :                 TALLOC_FREE(push);
    2959           0 :                 PyErr_SetNdrError(err);
    2960           0 :                 return NULL;
    2961             :         }
    2962           0 :         blob = ndr_push_blob(push);
    2963           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2964           0 :         TALLOC_FREE(push);
    2965           0 :         return ret;
    2966             : }
    2967             : 
    2968           0 : static PyObject *py_epm_Insert_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2969             : {
    2970           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2971           0 :         PyObject *bigendian_obj = NULL;
    2972           0 :         PyObject *ndr64_obj = NULL;
    2973           0 :         libndr_flags ndr_push_flags = 0;
    2974             : 
    2975           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    2976             :                 discard_const_p(char *, kwnames),
    2977             :                 &bigendian_obj,
    2978             :                 &ndr64_obj)) {
    2979           0 :                 return NULL;
    2980             :         }
    2981             : 
    2982           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2983           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2984             :         }
    2985           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2986           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2987             :         }
    2988             : 
    2989           0 :         return py_epm_Insert_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    2990             : }
    2991             : 
    2992           0 : static PyObject *py_epm_Insert_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2993             : {
    2994           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2995           0 :         PyObject *bigendian_obj = NULL;
    2996           0 :         PyObject *ndr64_obj = NULL;
    2997           0 :         libndr_flags ndr_push_flags = 0;
    2998             : 
    2999           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3000             :                 discard_const_p(char *, kwnames),
    3001             :                 &bigendian_obj,
    3002             :                 &ndr64_obj)) {
    3003           0 :                 return NULL;
    3004             :         }
    3005             : 
    3006           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3007           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3008             :         }
    3009           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3010           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3011             :         }
    3012             : 
    3013           0 :         return py_epm_Insert_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3014             : }
    3015             : 
    3016           0 : static PyObject *py_epm_Insert_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    3017             : {
    3018           0 :         const struct ndr_interface_call *call = NULL;
    3019           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    3020           0 :         struct ndr_pull *pull = NULL;
    3021           0 :         enum ndr_err_code err;
    3022             : 
    3023           0 :         if (ndr_table_epmapper.num_calls < 1) {
    3024           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Insert_ndr_unpack");
    3025           0 :                 return NULL;
    3026             :         }
    3027           0 :         call = &ndr_table_epmapper.calls[0];
    3028             : 
    3029           0 :         pull = ndr_pull_init_blob(blob, object);
    3030           0 :         if (pull == NULL) {
    3031           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3032           0 :                 return NULL;
    3033             :         }
    3034             : 
    3035           0 :         pull->flags |= ndr_pull_flags;
    3036             : 
    3037           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3038           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3039           0 :                 TALLOC_FREE(pull);
    3040           0 :                 PyErr_SetNdrError(err);
    3041           0 :                 return NULL;
    3042             :         }
    3043           0 :         if (!allow_remaining) {
    3044           0 :                 uint32_t highest_ofs;
    3045             : 
    3046           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3047           0 :                         highest_ofs = pull->offset;
    3048             :                 } else {
    3049           0 :                         highest_ofs = pull->relative_highest_offset;
    3050             :                 }
    3051           0 :                 if (highest_ofs < pull->data_size) {
    3052           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3053             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3054             :                                 highest_ofs, pull->data_size);
    3055           0 :                         TALLOC_FREE(pull);
    3056           0 :                         PyErr_SetNdrError(err);
    3057           0 :                         return NULL;
    3058             :                 }
    3059             :         }
    3060             : 
    3061           0 :         TALLOC_FREE(pull);
    3062           0 :         Py_RETURN_NONE;
    3063             : }
    3064             : 
    3065           0 : static PyObject *py_epm_Insert_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3066             : {
    3067           0 :         DATA_BLOB blob;
    3068           0 :         Py_ssize_t blob_length = 0;
    3069           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3070           0 :         PyObject *bigendian_obj = NULL;
    3071           0 :         PyObject *ndr64_obj = NULL;
    3072           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3073           0 :         PyObject *allow_remaining_obj = NULL;
    3074           0 :         bool allow_remaining = false;
    3075             : 
    3076           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3077             :                 discard_const_p(char *, kwnames),
    3078             :                 &blob.data, &blob_length,
    3079             :                 &bigendian_obj,
    3080             :                 &ndr64_obj,
    3081             :                 &allow_remaining_obj)) {
    3082           0 :                 return NULL;
    3083             :         }
    3084           0 :         blob.length = blob_length;
    3085             : 
    3086           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3087           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3088             :         }
    3089           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3090           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3091             :         }
    3092             : 
    3093           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3094           0 :                 allow_remaining = true;
    3095             :         }
    3096             : 
    3097           0 :         return py_epm_Insert_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3098             : }
    3099             : 
    3100           0 : static PyObject *py_epm_Insert_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3101             : {
    3102           0 :         DATA_BLOB blob;
    3103           0 :         Py_ssize_t blob_length = 0;
    3104           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3105           0 :         PyObject *bigendian_obj = NULL;
    3106           0 :         PyObject *ndr64_obj = NULL;
    3107           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3108           0 :         PyObject *allow_remaining_obj = NULL;
    3109           0 :         bool allow_remaining = false;
    3110             : 
    3111           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3112             :                 discard_const_p(char *, kwnames),
    3113             :                 &blob.data, &blob_length,
    3114             :                 &bigendian_obj,
    3115             :                 &ndr64_obj,
    3116             :                 &allow_remaining_obj)) {
    3117           0 :                 return NULL;
    3118             :         }
    3119           0 :         blob.length = blob_length;
    3120             : 
    3121           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3122           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3123             :         }
    3124           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3125           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3126             :         }
    3127             : 
    3128           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3129           0 :                 allow_remaining = true;
    3130             :         }
    3131             : 
    3132           0 :         return py_epm_Insert_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3133             : }
    3134             : 
    3135           0 : static PyObject *py_epm_Insert_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    3136             : {
    3137           0 :         const struct ndr_interface_call *call = NULL;
    3138           0 :         struct epm_Insert *object = pytalloc_get_ptr(py_obj);
    3139           0 :         PyObject *ret;
    3140           0 :         char *retstr;
    3141             : 
    3142           0 :         if (ndr_table_epmapper.num_calls < 1) {
    3143           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Insert_ndr_print");
    3144           0 :                 return NULL;
    3145             :         }
    3146           0 :         call = &ndr_table_epmapper.calls[0];
    3147             : 
    3148           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3149           0 :         ret = PyUnicode_FromString(retstr);
    3150           0 :         TALLOC_FREE(retstr);
    3151             : 
    3152           0 :         return ret;
    3153             : }
    3154             : 
    3155           0 : static PyObject *py_epm_Insert_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3156             : {
    3157           0 :         return py_epm_Insert_ndr_print(py_obj, "epm_Insert_in", NDR_IN);
    3158             : }
    3159             : 
    3160           0 : static PyObject *py_epm_Insert_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3161             : {
    3162           0 :         return py_epm_Insert_ndr_print(py_obj, "epm_Insert_out", NDR_OUT);
    3163             : }
    3164             : 
    3165             : static PyMethodDef py_epm_Insert_methods[] = {
    3166             :         { "opnum", (PyCFunction)py_epm_Insert_ndr_opnum, METH_NOARGS|METH_CLASS,
    3167             :                 "epmapper.epm_Insert.opnum() -> 0 (0x00) " },
    3168             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3169             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3170             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3171             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3172             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3173             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3174             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3175             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3176             :         { "__ndr_print_in__", (PyCFunction)py_epm_Insert_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3177             :         { "__ndr_print_out__", (PyCFunction)py_epm_Insert_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3178             :         { NULL, NULL, 0, NULL }
    3179             : };
    3180             : 
    3181             : 
    3182             : static PyTypeObject epm_Insert_Type = {
    3183             :         PyVarObject_HEAD_INIT(NULL, 0)
    3184             :         .tp_name = "epmapper.epm_Insert",
    3185             :         .tp_getset = py_epm_Insert_getsetters,
    3186             :         .tp_methods = py_epm_Insert_methods,
    3187             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3188             :         .tp_new = py_epm_Insert_new,
    3189             : };
    3190             : 
    3191           0 : static bool pack_py_epm_Insert_args_in(PyObject *args, PyObject *kwargs, struct epm_Insert *r)
    3192             : {
    3193           0 :         PyObject *py_entries;
    3194           0 :         PyObject *py_replace;
    3195           0 :         const char *kwnames[] = {
    3196             :                 "entries", "replace", NULL
    3197             :         };
    3198             : 
    3199           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:epm_Insert", discard_const_p(char *, kwnames), &py_entries, &py_replace)) {
    3200           0 :                 return false;
    3201             :         }
    3202             : 
    3203           0 :         PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
    3204           0 :         r->in.num_ents = PyList_GET_SIZE(py_entries);
    3205           0 :         if (py_entries == NULL) {
    3206           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.entries");
    3207           0 :                 return false;
    3208             :         }
    3209           0 :         PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
    3210             :         {
    3211           0 :                 int entries_cntr_0;
    3212           0 :                 r->in.entries = talloc_array_ptrtype(r, r->in.entries, PyList_GET_SIZE(py_entries));
    3213           0 :                 if (!r->in.entries) { return false; }
    3214           0 :                 talloc_set_name_const(r->in.entries, "ARRAY: r->in.entries");
    3215           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(py_entries); entries_cntr_0++) {
    3216           0 :                         if (PyList_GET_ITEM(py_entries, entries_cntr_0) == NULL) {
    3217           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.entries)[entries_cntr_0]");
    3218           0 :                                 return false;
    3219             :                         }
    3220           0 :                         PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(py_entries, entries_cntr_0), return false;);
    3221           0 :                         if (talloc_reference(r->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_entries, entries_cntr_0))) == NULL) {
    3222           0 :                                 PyErr_NoMemory();
    3223           0 :                                 return false;
    3224             :                         }
    3225           0 :                         (r->in.entries)[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
    3226             :                 }
    3227             :         }
    3228           0 :         if (py_replace == NULL) {
    3229           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.replace");
    3230           0 :                 return false;
    3231             :         }
    3232             :         {
    3233           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.replace));
    3234           0 :                 if (PyLong_Check(py_replace)) {
    3235           0 :                         unsigned long long test_var;
    3236           0 :                         test_var = PyLong_AsUnsignedLongLong(py_replace);
    3237           0 :                         if (PyErr_Occurred() != NULL) {
    3238           0 :                                 return false;
    3239             :                         }
    3240           0 :                         if (test_var > uint_max) {
    3241           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3242             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3243           0 :                                 return false;
    3244             :                         }
    3245           0 :                         r->in.replace = test_var;
    3246             :                 } else {
    3247           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3248             :                           PyLong_Type.tp_name);
    3249           0 :                         return false;
    3250             :                 }
    3251             :         }
    3252           0 :         return true;
    3253             : }
    3254             : 
    3255           0 : static PyObject *unpack_py_epm_Insert_args_out(struct epm_Insert *r)
    3256             : {
    3257           0 :         PyObject *result;
    3258           0 :         result = PyLong_FromUnsignedLongLong((uint32_t)(r->out.result));
    3259           0 :         return result;
    3260             : }
    3261             : 
    3262             : 
    3263           0 : static PyObject *py_epm_Delete_in_get_num_ents(PyObject *obj, void *closure)
    3264             : {
    3265           0 :         struct epm_Delete *object = pytalloc_get_ptr(obj);
    3266           0 :         PyObject *py_num_ents;
    3267           0 :         py_num_ents = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_ents));
    3268           0 :         return py_num_ents;
    3269             : }
    3270             : 
    3271           0 : static int py_epm_Delete_in_set_num_ents(PyObject *py_obj, PyObject *value, void *closure)
    3272             : {
    3273           0 :         struct epm_Delete *object = pytalloc_get_ptr(py_obj);
    3274           0 :         if (value == NULL) {
    3275           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_ents");
    3276           0 :                 return -1;
    3277             :         }
    3278             :         {
    3279           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ents));
    3280           0 :                 if (PyLong_Check(value)) {
    3281           0 :                         unsigned long long test_var;
    3282           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3283           0 :                         if (PyErr_Occurred() != NULL) {
    3284           0 :                                 return -1;
    3285             :                         }
    3286           0 :                         if (test_var > uint_max) {
    3287           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3288             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3289           0 :                                 return -1;
    3290             :                         }
    3291           0 :                         object->in.num_ents = test_var;
    3292             :                 } else {
    3293           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3294             :                           PyLong_Type.tp_name);
    3295           0 :                         return -1;
    3296             :                 }
    3297             :         }
    3298           0 :         return 0;
    3299             : }
    3300             : 
    3301           0 : static PyObject *py_epm_Delete_in_get_entries(PyObject *obj, void *closure)
    3302             : {
    3303           0 :         struct epm_Delete *object = pytalloc_get_ptr(obj);
    3304           0 :         PyObject *py_entries;
    3305           0 :         py_entries = PyList_New(object->in.num_ents);
    3306           0 :         if (py_entries == NULL) {
    3307           0 :                 return NULL;
    3308             :         }
    3309             :         {
    3310             :                 int entries_cntr_0;
    3311           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < (object->in.num_ents); entries_cntr_0++) {
    3312           0 :                         PyObject *py_entries_0;
    3313           0 :                         py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, object->in.entries, &(object->in.entries)[entries_cntr_0]);
    3314           0 :                         PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
    3315             :                 }
    3316             :         }
    3317           0 :         return py_entries;
    3318             : }
    3319             : 
    3320           0 : static int py_epm_Delete_in_set_entries(PyObject *py_obj, PyObject *value, void *closure)
    3321             : {
    3322           0 :         struct epm_Delete *object = pytalloc_get_ptr(py_obj);
    3323           0 :         if (value == NULL) {
    3324           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.entries");
    3325           0 :                 return -1;
    3326             :         }
    3327           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3328             :         {
    3329           0 :                 int entries_cntr_0;
    3330           0 :                 object->in.entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entries, PyList_GET_SIZE(value));
    3331           0 :                 if (!object->in.entries) { return -1; }
    3332           0 :                 talloc_set_name_const(object->in.entries, "ARRAY: object->in.entries");
    3333           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
    3334           0 :                         if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
    3335           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.entries)[entries_cntr_0]");
    3336           0 :                                 return -1;
    3337             :                         }
    3338           0 :                         PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
    3339           0 :                         if (talloc_reference(object->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
    3340           0 :                                 PyErr_NoMemory();
    3341           0 :                                 return -1;
    3342             :                         }
    3343           0 :                         (object->in.entries)[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
    3344             :                 }
    3345             :         }
    3346           0 :         return 0;
    3347             : }
    3348             : 
    3349           0 : static PyObject *py_epm_Delete_get_result(PyObject *obj, void *closure)
    3350             : {
    3351           0 :         struct epm_Delete *object = pytalloc_get_ptr(obj);
    3352           0 :         PyObject *py_result;
    3353           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    3354           0 :         return py_result;
    3355             : }
    3356             : 
    3357           0 : static int py_epm_Delete_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3358             : {
    3359           0 :         struct epm_Delete *object = pytalloc_get_ptr(py_obj);
    3360           0 :         if (value == NULL) {
    3361           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    3362           0 :                 return -1;
    3363             :         }
    3364             :         {
    3365           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    3366           0 :                 if (PyLong_Check(value)) {
    3367           0 :                         unsigned long long test_var;
    3368           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3369           0 :                         if (PyErr_Occurred() != NULL) {
    3370           0 :                                 return -1;
    3371             :                         }
    3372           0 :                         if (test_var > uint_max) {
    3373           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3374             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3375           0 :                                 return -1;
    3376             :                         }
    3377           0 :                         object->out.result = test_var;
    3378             :                 } else {
    3379           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3380             :                           PyLong_Type.tp_name);
    3381           0 :                         return -1;
    3382             :                 }
    3383             :         }
    3384           0 :         return 0;
    3385             : }
    3386             : 
    3387             : static PyGetSetDef py_epm_Delete_getsetters[] = {
    3388             :         {
    3389             :                 .name = discard_const_p(char, "in_num_ents"),
    3390             :                 .get = py_epm_Delete_in_get_num_ents,
    3391             :                 .set = py_epm_Delete_in_set_num_ents,
    3392             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3393             :         },
    3394             :         {
    3395             :                 .name = discard_const_p(char, "in_entries"),
    3396             :                 .get = py_epm_Delete_in_get_entries,
    3397             :                 .set = py_epm_Delete_in_set_entries,
    3398             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_entry_t")
    3399             :         },
    3400             :         {
    3401             :                 .name = discard_const_p(char, "result"),
    3402             :                 .get = py_epm_Delete_get_result,
    3403             :                 .set = py_epm_Delete_set_result,
    3404             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    3405             :         },
    3406             :         { .name = NULL }
    3407             : };
    3408             : 
    3409           0 : static PyObject *py_epm_Delete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3410             : {
    3411           0 :         PyObject *self = pytalloc_new(struct epm_Delete, type);
    3412           0 :         return self;
    3413             : }
    3414             : 
    3415           0 : static PyObject *py_epm_Delete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3416             : {
    3417             : 
    3418             : 
    3419           0 :         return PyLong_FromLong(1);
    3420             : }
    3421             : 
    3422           0 : static PyObject *py_epm_Delete_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    3423             : {
    3424           0 :         const struct ndr_interface_call *call = NULL;
    3425           0 :         struct epm_Delete *object = pytalloc_get_ptr(py_obj);
    3426           0 :         PyObject *ret = NULL;
    3427           0 :         struct ndr_push *push = NULL;
    3428           0 :         DATA_BLOB blob;
    3429           0 :         enum ndr_err_code err;
    3430             : 
    3431           0 :         if (ndr_table_epmapper.num_calls < 2) {
    3432           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Delete_ndr_pack");
    3433           0 :                 return NULL;
    3434             :         }
    3435           0 :         call = &ndr_table_epmapper.calls[1];
    3436             : 
    3437           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3438           0 :         if (push == NULL) {
    3439           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3440           0 :                 return NULL;
    3441             :         }
    3442             : 
    3443           0 :         push->flags |= ndr_push_flags;
    3444             : 
    3445           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3446           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3447           0 :                 TALLOC_FREE(push);
    3448           0 :                 PyErr_SetNdrError(err);
    3449           0 :                 return NULL;
    3450             :         }
    3451           0 :         blob = ndr_push_blob(push);
    3452           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3453           0 :         TALLOC_FREE(push);
    3454           0 :         return ret;
    3455             : }
    3456             : 
    3457           0 : static PyObject *py_epm_Delete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3458             : {
    3459           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3460           0 :         PyObject *bigendian_obj = NULL;
    3461           0 :         PyObject *ndr64_obj = NULL;
    3462           0 :         libndr_flags ndr_push_flags = 0;
    3463             : 
    3464           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3465             :                 discard_const_p(char *, kwnames),
    3466             :                 &bigendian_obj,
    3467             :                 &ndr64_obj)) {
    3468           0 :                 return NULL;
    3469             :         }
    3470             : 
    3471           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3472           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3473             :         }
    3474           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3475           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3476             :         }
    3477             : 
    3478           0 :         return py_epm_Delete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3479             : }
    3480             : 
    3481           0 : static PyObject *py_epm_Delete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3482             : {
    3483           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3484           0 :         PyObject *bigendian_obj = NULL;
    3485           0 :         PyObject *ndr64_obj = NULL;
    3486           0 :         libndr_flags ndr_push_flags = 0;
    3487             : 
    3488           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3489             :                 discard_const_p(char *, kwnames),
    3490             :                 &bigendian_obj,
    3491             :                 &ndr64_obj)) {
    3492           0 :                 return NULL;
    3493             :         }
    3494             : 
    3495           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3496           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3497             :         }
    3498           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3499           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3500             :         }
    3501             : 
    3502           0 :         return py_epm_Delete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3503             : }
    3504             : 
    3505           0 : static PyObject *py_epm_Delete_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    3506             : {
    3507           0 :         const struct ndr_interface_call *call = NULL;
    3508           0 :         struct epm_Delete *object = pytalloc_get_ptr(py_obj);
    3509           0 :         struct ndr_pull *pull = NULL;
    3510           0 :         enum ndr_err_code err;
    3511             : 
    3512           0 :         if (ndr_table_epmapper.num_calls < 2) {
    3513           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Delete_ndr_unpack");
    3514           0 :                 return NULL;
    3515             :         }
    3516           0 :         call = &ndr_table_epmapper.calls[1];
    3517             : 
    3518           0 :         pull = ndr_pull_init_blob(blob, object);
    3519           0 :         if (pull == NULL) {
    3520           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3521           0 :                 return NULL;
    3522             :         }
    3523             : 
    3524           0 :         pull->flags |= ndr_pull_flags;
    3525             : 
    3526           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3527           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3528           0 :                 TALLOC_FREE(pull);
    3529           0 :                 PyErr_SetNdrError(err);
    3530           0 :                 return NULL;
    3531             :         }
    3532           0 :         if (!allow_remaining) {
    3533           0 :                 uint32_t highest_ofs;
    3534             : 
    3535           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3536           0 :                         highest_ofs = pull->offset;
    3537             :                 } else {
    3538           0 :                         highest_ofs = pull->relative_highest_offset;
    3539             :                 }
    3540           0 :                 if (highest_ofs < pull->data_size) {
    3541           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3542             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3543             :                                 highest_ofs, pull->data_size);
    3544           0 :                         TALLOC_FREE(pull);
    3545           0 :                         PyErr_SetNdrError(err);
    3546           0 :                         return NULL;
    3547             :                 }
    3548             :         }
    3549             : 
    3550           0 :         TALLOC_FREE(pull);
    3551           0 :         Py_RETURN_NONE;
    3552             : }
    3553             : 
    3554           0 : static PyObject *py_epm_Delete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3555             : {
    3556           0 :         DATA_BLOB blob;
    3557           0 :         Py_ssize_t blob_length = 0;
    3558           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3559           0 :         PyObject *bigendian_obj = NULL;
    3560           0 :         PyObject *ndr64_obj = NULL;
    3561           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3562           0 :         PyObject *allow_remaining_obj = NULL;
    3563           0 :         bool allow_remaining = false;
    3564             : 
    3565           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3566             :                 discard_const_p(char *, kwnames),
    3567             :                 &blob.data, &blob_length,
    3568             :                 &bigendian_obj,
    3569             :                 &ndr64_obj,
    3570             :                 &allow_remaining_obj)) {
    3571           0 :                 return NULL;
    3572             :         }
    3573           0 :         blob.length = blob_length;
    3574             : 
    3575           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3576           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3577             :         }
    3578           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3579           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3580             :         }
    3581             : 
    3582           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3583           0 :                 allow_remaining = true;
    3584             :         }
    3585             : 
    3586           0 :         return py_epm_Delete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3587             : }
    3588             : 
    3589           0 : static PyObject *py_epm_Delete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3590             : {
    3591           0 :         DATA_BLOB blob;
    3592           0 :         Py_ssize_t blob_length = 0;
    3593           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3594           0 :         PyObject *bigendian_obj = NULL;
    3595           0 :         PyObject *ndr64_obj = NULL;
    3596           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3597           0 :         PyObject *allow_remaining_obj = NULL;
    3598           0 :         bool allow_remaining = false;
    3599             : 
    3600           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3601             :                 discard_const_p(char *, kwnames),
    3602             :                 &blob.data, &blob_length,
    3603             :                 &bigendian_obj,
    3604             :                 &ndr64_obj,
    3605             :                 &allow_remaining_obj)) {
    3606           0 :                 return NULL;
    3607             :         }
    3608           0 :         blob.length = blob_length;
    3609             : 
    3610           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3611           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3612             :         }
    3613           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3614           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3615             :         }
    3616             : 
    3617           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3618           0 :                 allow_remaining = true;
    3619             :         }
    3620             : 
    3621           0 :         return py_epm_Delete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3622             : }
    3623             : 
    3624           0 : static PyObject *py_epm_Delete_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    3625             : {
    3626           0 :         const struct ndr_interface_call *call = NULL;
    3627           0 :         struct epm_Delete *object = pytalloc_get_ptr(py_obj);
    3628           0 :         PyObject *ret;
    3629           0 :         char *retstr;
    3630             : 
    3631           0 :         if (ndr_table_epmapper.num_calls < 2) {
    3632           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Delete_ndr_print");
    3633           0 :                 return NULL;
    3634             :         }
    3635           0 :         call = &ndr_table_epmapper.calls[1];
    3636             : 
    3637           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3638           0 :         ret = PyUnicode_FromString(retstr);
    3639           0 :         TALLOC_FREE(retstr);
    3640             : 
    3641           0 :         return ret;
    3642             : }
    3643             : 
    3644           0 : static PyObject *py_epm_Delete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3645             : {
    3646           0 :         return py_epm_Delete_ndr_print(py_obj, "epm_Delete_in", NDR_IN);
    3647             : }
    3648             : 
    3649           0 : static PyObject *py_epm_Delete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3650             : {
    3651           0 :         return py_epm_Delete_ndr_print(py_obj, "epm_Delete_out", NDR_OUT);
    3652             : }
    3653             : 
    3654             : static PyMethodDef py_epm_Delete_methods[] = {
    3655             :         { "opnum", (PyCFunction)py_epm_Delete_ndr_opnum, METH_NOARGS|METH_CLASS,
    3656             :                 "epmapper.epm_Delete.opnum() -> 1 (0x01) " },
    3657             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3658             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3659             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3660             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3661             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3662             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3663             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3664             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3665             :         { "__ndr_print_in__", (PyCFunction)py_epm_Delete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3666             :         { "__ndr_print_out__", (PyCFunction)py_epm_Delete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3667             :         { NULL, NULL, 0, NULL }
    3668             : };
    3669             : 
    3670             : 
    3671             : static PyTypeObject epm_Delete_Type = {
    3672             :         PyVarObject_HEAD_INIT(NULL, 0)
    3673             :         .tp_name = "epmapper.epm_Delete",
    3674             :         .tp_getset = py_epm_Delete_getsetters,
    3675             :         .tp_methods = py_epm_Delete_methods,
    3676             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3677             :         .tp_new = py_epm_Delete_new,
    3678             : };
    3679             : 
    3680           0 : static bool pack_py_epm_Delete_args_in(PyObject *args, PyObject *kwargs, struct epm_Delete *r)
    3681             : {
    3682           0 :         PyObject *py_entries;
    3683           0 :         const char *kwnames[] = {
    3684             :                 "entries", NULL
    3685             :         };
    3686             : 
    3687           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_Delete", discard_const_p(char *, kwnames), &py_entries)) {
    3688           0 :                 return false;
    3689             :         }
    3690             : 
    3691           0 :         PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
    3692           0 :         r->in.num_ents = PyList_GET_SIZE(py_entries);
    3693           0 :         if (py_entries == NULL) {
    3694           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.entries");
    3695           0 :                 return false;
    3696             :         }
    3697           0 :         PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
    3698             :         {
    3699           0 :                 int entries_cntr_0;
    3700           0 :                 r->in.entries = talloc_array_ptrtype(r, r->in.entries, PyList_GET_SIZE(py_entries));
    3701           0 :                 if (!r->in.entries) { return false; }
    3702           0 :                 talloc_set_name_const(r->in.entries, "ARRAY: r->in.entries");
    3703           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(py_entries); entries_cntr_0++) {
    3704           0 :                         if (PyList_GET_ITEM(py_entries, entries_cntr_0) == NULL) {
    3705           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.entries)[entries_cntr_0]");
    3706           0 :                                 return false;
    3707             :                         }
    3708           0 :                         PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(py_entries, entries_cntr_0), return false;);
    3709           0 :                         if (talloc_reference(r->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_entries, entries_cntr_0))) == NULL) {
    3710           0 :                                 PyErr_NoMemory();
    3711           0 :                                 return false;
    3712             :                         }
    3713           0 :                         (r->in.entries)[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
    3714             :                 }
    3715             :         }
    3716           0 :         return true;
    3717             : }
    3718             : 
    3719           0 : static PyObject *unpack_py_epm_Delete_args_out(struct epm_Delete *r)
    3720             : {
    3721           0 :         PyObject *result;
    3722           0 :         result = PyLong_FromUnsignedLongLong((uint32_t)(r->out.result));
    3723           0 :         return result;
    3724             : }
    3725             : 
    3726             : 
    3727           0 : static PyObject *py_epm_Lookup_in_get_inquiry_type(PyObject *obj, void *closure)
    3728             : {
    3729           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3730           0 :         PyObject *py_inquiry_type;
    3731           0 :         py_inquiry_type = PyLong_FromUnsignedLongLong((uint32_t)(object->in.inquiry_type));
    3732           0 :         return py_inquiry_type;
    3733             : }
    3734             : 
    3735           0 : static int py_epm_Lookup_in_set_inquiry_type(PyObject *py_obj, PyObject *value, void *closure)
    3736             : {
    3737           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3738           0 :         if (value == NULL) {
    3739           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.inquiry_type");
    3740           0 :                 return -1;
    3741             :         }
    3742             :         {
    3743           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.inquiry_type));
    3744           0 :                 if (PyLong_Check(value)) {
    3745           0 :                         unsigned long long test_var;
    3746           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3747           0 :                         if (PyErr_Occurred() != NULL) {
    3748           0 :                                 return -1;
    3749             :                         }
    3750           0 :                         if (test_var > uint_max) {
    3751           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3752             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3753           0 :                                 return -1;
    3754             :                         }
    3755           0 :                         object->in.inquiry_type = test_var;
    3756             :                 } else {
    3757           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3758             :                           PyLong_Type.tp_name);
    3759           0 :                         return -1;
    3760             :                 }
    3761             :         }
    3762           0 :         return 0;
    3763             : }
    3764             : 
    3765           0 : static PyObject *py_epm_Lookup_in_get_object(PyObject *obj, void *closure)
    3766             : {
    3767           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3768           0 :         PyObject *py_object;
    3769           0 :         if (object->in.object == NULL) {
    3770           0 :                 Py_RETURN_NONE;
    3771             :         }
    3772           0 :         if (object->in.object == NULL) {
    3773           0 :                 py_object = Py_None;
    3774           0 :                 Py_INCREF(py_object);
    3775             :         } else {
    3776           0 :                 py_object = pytalloc_reference_ex(GUID_Type, object->in.object, object->in.object);
    3777             :         }
    3778           0 :         return py_object;
    3779             : }
    3780             : 
    3781           0 : static int py_epm_Lookup_in_set_object(PyObject *py_obj, PyObject *value, void *closure)
    3782             : {
    3783           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3784           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.object));
    3785           0 :         if (value == NULL) {
    3786           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.object");
    3787           0 :                 return -1;
    3788             :         }
    3789           0 :         if (value == Py_None) {
    3790           0 :                 object->in.object = NULL;
    3791             :         } else {
    3792           0 :                 object->in.object = NULL;
    3793           0 :                 PY_CHECK_TYPE(GUID_Type, value, return -1;);
    3794           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3795           0 :                         PyErr_NoMemory();
    3796           0 :                         return -1;
    3797             :                 }
    3798           0 :                 object->in.object = (struct GUID *)pytalloc_get_ptr(value);
    3799             :         }
    3800           0 :         return 0;
    3801             : }
    3802             : 
    3803           0 : static PyObject *py_epm_Lookup_in_get_interface_id(PyObject *obj, void *closure)
    3804             : {
    3805           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3806           0 :         PyObject *py_interface_id;
    3807           0 :         if (object->in.interface_id == NULL) {
    3808           0 :                 Py_RETURN_NONE;
    3809             :         }
    3810           0 :         if (object->in.interface_id == NULL) {
    3811           0 :                 py_interface_id = Py_None;
    3812           0 :                 Py_INCREF(py_interface_id);
    3813             :         } else {
    3814           0 :                 py_interface_id = pytalloc_reference_ex(&rpc_if_id_t_Type, object->in.interface_id, object->in.interface_id);
    3815             :         }
    3816           0 :         return py_interface_id;
    3817             : }
    3818             : 
    3819           0 : static int py_epm_Lookup_in_set_interface_id(PyObject *py_obj, PyObject *value, void *closure)
    3820             : {
    3821           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3822           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.interface_id));
    3823           0 :         if (value == NULL) {
    3824           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.interface_id");
    3825           0 :                 return -1;
    3826             :         }
    3827           0 :         if (value == Py_None) {
    3828           0 :                 object->in.interface_id = NULL;
    3829             :         } else {
    3830           0 :                 object->in.interface_id = NULL;
    3831           0 :                 PY_CHECK_TYPE(&rpc_if_id_t_Type, value, return -1;);
    3832           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3833           0 :                         PyErr_NoMemory();
    3834           0 :                         return -1;
    3835             :                 }
    3836           0 :                 object->in.interface_id = (struct rpc_if_id_t *)pytalloc_get_ptr(value);
    3837             :         }
    3838           0 :         return 0;
    3839             : }
    3840             : 
    3841           0 : static PyObject *py_epm_Lookup_in_get_vers_option(PyObject *obj, void *closure)
    3842             : {
    3843           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3844           0 :         PyObject *py_vers_option;
    3845           0 :         py_vers_option = PyLong_FromUnsignedLongLong((uint32_t)(object->in.vers_option));
    3846           0 :         return py_vers_option;
    3847             : }
    3848             : 
    3849           0 : static int py_epm_Lookup_in_set_vers_option(PyObject *py_obj, PyObject *value, void *closure)
    3850             : {
    3851           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3852           0 :         if (value == NULL) {
    3853           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.vers_option");
    3854           0 :                 return -1;
    3855             :         }
    3856             :         {
    3857           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.vers_option));
    3858           0 :                 if (PyLong_Check(value)) {
    3859           0 :                         unsigned long long test_var;
    3860           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3861           0 :                         if (PyErr_Occurred() != NULL) {
    3862           0 :                                 return -1;
    3863             :                         }
    3864           0 :                         if (test_var > uint_max) {
    3865           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3866             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3867           0 :                                 return -1;
    3868             :                         }
    3869           0 :                         object->in.vers_option = test_var;
    3870             :                 } else {
    3871           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3872             :                           PyLong_Type.tp_name);
    3873           0 :                         return -1;
    3874             :                 }
    3875             :         }
    3876           0 :         return 0;
    3877             : }
    3878             : 
    3879           0 : static PyObject *py_epm_Lookup_in_get_entry_handle(PyObject *obj, void *closure)
    3880             : {
    3881           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3882           0 :         PyObject *py_entry_handle;
    3883           0 :         if (object->in.entry_handle == NULL) {
    3884           0 :                 Py_RETURN_NONE;
    3885             :         }
    3886           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->in.entry_handle, object->in.entry_handle);
    3887           0 :         return py_entry_handle;
    3888             : }
    3889             : 
    3890           0 : static int py_epm_Lookup_in_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
    3891             : {
    3892           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3893           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.entry_handle));
    3894           0 :         if (value == NULL) {
    3895           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.entry_handle");
    3896           0 :                 return -1;
    3897             :         }
    3898           0 :         object->in.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entry_handle);
    3899           0 :         if (object->in.entry_handle == NULL) {
    3900           0 :                 PyErr_NoMemory();
    3901           0 :                 return -1;
    3902             :         }
    3903           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    3904           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3905           0 :                 PyErr_NoMemory();
    3906           0 :                 return -1;
    3907             :         }
    3908           0 :         object->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    3909           0 :         return 0;
    3910             : }
    3911             : 
    3912           0 : static PyObject *py_epm_Lookup_out_get_entry_handle(PyObject *obj, void *closure)
    3913             : {
    3914           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3915           0 :         PyObject *py_entry_handle;
    3916           0 :         if (object->out.entry_handle == NULL) {
    3917           0 :                 Py_RETURN_NONE;
    3918             :         }
    3919           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->out.entry_handle, object->out.entry_handle);
    3920           0 :         return py_entry_handle;
    3921             : }
    3922             : 
    3923           0 : static int py_epm_Lookup_out_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
    3924             : {
    3925           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3926           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.entry_handle));
    3927           0 :         if (value == NULL) {
    3928           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.entry_handle");
    3929           0 :                 return -1;
    3930             :         }
    3931           0 :         object->out.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entry_handle);
    3932           0 :         if (object->out.entry_handle == NULL) {
    3933           0 :                 PyErr_NoMemory();
    3934           0 :                 return -1;
    3935             :         }
    3936           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    3937           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3938           0 :                 PyErr_NoMemory();
    3939           0 :                 return -1;
    3940             :         }
    3941           0 :         object->out.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    3942           0 :         return 0;
    3943             : }
    3944             : 
    3945           0 : static PyObject *py_epm_Lookup_in_get_max_ents(PyObject *obj, void *closure)
    3946             : {
    3947           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3948           0 :         PyObject *py_max_ents;
    3949           0 :         py_max_ents = PyLong_FromUnsignedLongLong((uint32_t)(object->in.max_ents));
    3950           0 :         return py_max_ents;
    3951             : }
    3952             : 
    3953           0 : static int py_epm_Lookup_in_set_max_ents(PyObject *py_obj, PyObject *value, void *closure)
    3954             : {
    3955           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3956           0 :         if (value == NULL) {
    3957           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.max_ents");
    3958           0 :                 return -1;
    3959             :         }
    3960             :         {
    3961           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_ents));
    3962           0 :                 if (PyLong_Check(value)) {
    3963           0 :                         unsigned long long test_var;
    3964           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3965           0 :                         if (PyErr_Occurred() != NULL) {
    3966           0 :                                 return -1;
    3967             :                         }
    3968           0 :                         if (test_var > uint_max) {
    3969           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3970             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3971           0 :                                 return -1;
    3972             :                         }
    3973           0 :                         object->in.max_ents = test_var;
    3974             :                 } else {
    3975           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3976             :                           PyLong_Type.tp_name);
    3977           0 :                         return -1;
    3978             :                 }
    3979             :         }
    3980           0 :         return 0;
    3981             : }
    3982             : 
    3983           0 : static PyObject *py_epm_Lookup_out_get_num_ents(PyObject *obj, void *closure)
    3984             : {
    3985           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    3986           0 :         PyObject *py_num_ents;
    3987           0 :         if (object->out.num_ents == NULL) {
    3988           0 :                 Py_RETURN_NONE;
    3989             :         }
    3990           0 :         py_num_ents = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.num_ents));
    3991           0 :         return py_num_ents;
    3992             : }
    3993             : 
    3994           0 : static int py_epm_Lookup_out_set_num_ents(PyObject *py_obj, PyObject *value, void *closure)
    3995             : {
    3996           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    3997           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_ents));
    3998           0 :         if (value == NULL) {
    3999           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.num_ents");
    4000           0 :                 return -1;
    4001             :         }
    4002           0 :         object->out.num_ents = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_ents);
    4003           0 :         if (object->out.num_ents == NULL) {
    4004           0 :                 PyErr_NoMemory();
    4005           0 :                 return -1;
    4006             :         }
    4007             :         {
    4008           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_ents));
    4009           0 :                 if (PyLong_Check(value)) {
    4010           0 :                         unsigned long long test_var;
    4011           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4012           0 :                         if (PyErr_Occurred() != NULL) {
    4013           0 :                                 return -1;
    4014             :                         }
    4015           0 :                         if (test_var > uint_max) {
    4016           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4017             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4018           0 :                                 return -1;
    4019             :                         }
    4020           0 :                         *object->out.num_ents = test_var;
    4021             :                 } else {
    4022           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4023             :                           PyLong_Type.tp_name);
    4024           0 :                         return -1;
    4025             :                 }
    4026             :         }
    4027           0 :         return 0;
    4028             : }
    4029             : 
    4030           0 : static PyObject *py_epm_Lookup_out_get_entries(PyObject *obj, void *closure)
    4031             : {
    4032           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    4033           0 :         PyObject *py_entries;
    4034           0 :         py_entries = PyList_New(*object->out.num_ents);
    4035           0 :         if (py_entries == NULL) {
    4036           0 :                 return NULL;
    4037             :         }
    4038             :         {
    4039             :                 int entries_cntr_0;
    4040           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < (*object->out.num_ents); entries_cntr_0++) {
    4041           0 :                         PyObject *py_entries_0;
    4042           0 :                         py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, object->out.entries, &(object->out.entries)[entries_cntr_0]);
    4043           0 :                         PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
    4044             :                 }
    4045             :         }
    4046           0 :         return py_entries;
    4047             : }
    4048             : 
    4049           0 : static int py_epm_Lookup_out_set_entries(PyObject *py_obj, PyObject *value, void *closure)
    4050             : {
    4051           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    4052           0 :         if (value == NULL) {
    4053           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.entries");
    4054           0 :                 return -1;
    4055             :         }
    4056           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4057             :         {
    4058           0 :                 int entries_cntr_0;
    4059           0 :                 object->out.entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entries, PyList_GET_SIZE(value));
    4060           0 :                 if (!object->out.entries) { return -1; }
    4061           0 :                 talloc_set_name_const(object->out.entries, "ARRAY: object->out.entries");
    4062           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
    4063           0 :                         if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
    4064           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.entries)[entries_cntr_0]");
    4065           0 :                                 return -1;
    4066             :                         }
    4067           0 :                         PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
    4068           0 :                         if (talloc_reference(object->out.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
    4069           0 :                                 PyErr_NoMemory();
    4070           0 :                                 return -1;
    4071             :                         }
    4072           0 :                         (object->out.entries)[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
    4073             :                 }
    4074             :         }
    4075           0 :         return 0;
    4076             : }
    4077             : 
    4078           0 : static PyObject *py_epm_Lookup_get_result(PyObject *obj, void *closure)
    4079             : {
    4080           0 :         struct epm_Lookup *object = pytalloc_get_ptr(obj);
    4081           0 :         PyObject *py_result;
    4082           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    4083           0 :         return py_result;
    4084             : }
    4085             : 
    4086           0 : static int py_epm_Lookup_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4087             : {
    4088           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    4089           0 :         if (value == NULL) {
    4090           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    4091           0 :                 return -1;
    4092             :         }
    4093             :         {
    4094           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    4095           0 :                 if (PyLong_Check(value)) {
    4096           0 :                         unsigned long long test_var;
    4097           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4098           0 :                         if (PyErr_Occurred() != NULL) {
    4099           0 :                                 return -1;
    4100             :                         }
    4101           0 :                         if (test_var > uint_max) {
    4102           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4103             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4104           0 :                                 return -1;
    4105             :                         }
    4106           0 :                         object->out.result = test_var;
    4107             :                 } else {
    4108           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4109             :                           PyLong_Type.tp_name);
    4110           0 :                         return -1;
    4111             :                 }
    4112             :         }
    4113           0 :         return 0;
    4114             : }
    4115             : 
    4116             : static PyGetSetDef py_epm_Lookup_getsetters[] = {
    4117             :         {
    4118             :                 .name = discard_const_p(char, "in_inquiry_type"),
    4119             :                 .get = py_epm_Lookup_in_get_inquiry_type,
    4120             :                 .set = py_epm_Lookup_in_set_inquiry_type,
    4121             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_InquiryType")
    4122             :         },
    4123             :         {
    4124             :                 .name = discard_const_p(char, "in_object"),
    4125             :                 .get = py_epm_Lookup_in_get_object,
    4126             :                 .set = py_epm_Lookup_in_set_object,
    4127             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    4128             :         },
    4129             :         {
    4130             :                 .name = discard_const_p(char, "in_interface_id"),
    4131             :                 .get = py_epm_Lookup_in_get_interface_id,
    4132             :                 .set = py_epm_Lookup_in_set_interface_id,
    4133             :                 .doc = discard_const_p(char, "PIDL-generated element of base type rpc_if_id_t")
    4134             :         },
    4135             :         {
    4136             :                 .name = discard_const_p(char, "in_vers_option"),
    4137             :                 .get = py_epm_Lookup_in_get_vers_option,
    4138             :                 .set = py_epm_Lookup_in_set_vers_option,
    4139             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_VersionOption")
    4140             :         },
    4141             :         {
    4142             :                 .name = discard_const_p(char, "in_entry_handle"),
    4143             :                 .get = py_epm_Lookup_in_get_entry_handle,
    4144             :                 .set = py_epm_Lookup_in_set_entry_handle,
    4145             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4146             :         },
    4147             :         {
    4148             :                 .name = discard_const_p(char, "out_entry_handle"),
    4149             :                 .get = py_epm_Lookup_out_get_entry_handle,
    4150             :                 .set = py_epm_Lookup_out_set_entry_handle,
    4151             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4152             :         },
    4153             :         {
    4154             :                 .name = discard_const_p(char, "in_max_ents"),
    4155             :                 .get = py_epm_Lookup_in_get_max_ents,
    4156             :                 .set = py_epm_Lookup_in_set_max_ents,
    4157             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4158             :         },
    4159             :         {
    4160             :                 .name = discard_const_p(char, "out_num_ents"),
    4161             :                 .get = py_epm_Lookup_out_get_num_ents,
    4162             :                 .set = py_epm_Lookup_out_set_num_ents,
    4163             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4164             :         },
    4165             :         {
    4166             :                 .name = discard_const_p(char, "out_entries"),
    4167             :                 .get = py_epm_Lookup_out_get_entries,
    4168             :                 .set = py_epm_Lookup_out_set_entries,
    4169             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_entry_t")
    4170             :         },
    4171             :         {
    4172             :                 .name = discard_const_p(char, "result"),
    4173             :                 .get = py_epm_Lookup_get_result,
    4174             :                 .set = py_epm_Lookup_set_result,
    4175             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    4176             :         },
    4177             :         { .name = NULL }
    4178             : };
    4179             : 
    4180           0 : static PyObject *py_epm_Lookup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4181             : {
    4182           0 :         PyObject *self = pytalloc_new(struct epm_Lookup, type);
    4183           0 :         struct epm_Lookup *_self = (struct epm_Lookup *)pytalloc_get_ptr(self);
    4184           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4185           0 :         _self->in.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
    4186           0 :         _self->out.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
    4187           0 :         _self->out.num_ents = talloc_zero(mem_ctx, uint32_t);
    4188           0 :         return self;
    4189             : }
    4190             : 
    4191           0 : static PyObject *py_epm_Lookup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4192             : {
    4193             : 
    4194             : 
    4195           0 :         return PyLong_FromLong(2);
    4196             : }
    4197             : 
    4198           0 : static PyObject *py_epm_Lookup_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    4199             : {
    4200           0 :         const struct ndr_interface_call *call = NULL;
    4201           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    4202           0 :         PyObject *ret = NULL;
    4203           0 :         struct ndr_push *push = NULL;
    4204           0 :         DATA_BLOB blob;
    4205           0 :         enum ndr_err_code err;
    4206             : 
    4207           0 :         if (ndr_table_epmapper.num_calls < 3) {
    4208           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Lookup_ndr_pack");
    4209           0 :                 return NULL;
    4210             :         }
    4211           0 :         call = &ndr_table_epmapper.calls[2];
    4212             : 
    4213           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    4214           0 :         if (push == NULL) {
    4215           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4216           0 :                 return NULL;
    4217             :         }
    4218             : 
    4219           0 :         push->flags |= ndr_push_flags;
    4220             : 
    4221           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    4222           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4223           0 :                 TALLOC_FREE(push);
    4224           0 :                 PyErr_SetNdrError(err);
    4225           0 :                 return NULL;
    4226             :         }
    4227           0 :         blob = ndr_push_blob(push);
    4228           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4229           0 :         TALLOC_FREE(push);
    4230           0 :         return ret;
    4231             : }
    4232             : 
    4233           0 : static PyObject *py_epm_Lookup_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4234             : {
    4235           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4236           0 :         PyObject *bigendian_obj = NULL;
    4237           0 :         PyObject *ndr64_obj = NULL;
    4238           0 :         libndr_flags ndr_push_flags = 0;
    4239             : 
    4240           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    4241             :                 discard_const_p(char *, kwnames),
    4242             :                 &bigendian_obj,
    4243             :                 &ndr64_obj)) {
    4244           0 :                 return NULL;
    4245             :         }
    4246             : 
    4247           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4248           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4249             :         }
    4250           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4251           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4252             :         }
    4253             : 
    4254           0 :         return py_epm_Lookup_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    4255             : }
    4256             : 
    4257           0 : static PyObject *py_epm_Lookup_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4258             : {
    4259           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4260           0 :         PyObject *bigendian_obj = NULL;
    4261           0 :         PyObject *ndr64_obj = NULL;
    4262           0 :         libndr_flags ndr_push_flags = 0;
    4263             : 
    4264           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4265             :                 discard_const_p(char *, kwnames),
    4266             :                 &bigendian_obj,
    4267             :                 &ndr64_obj)) {
    4268           0 :                 return NULL;
    4269             :         }
    4270             : 
    4271           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4272           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4273             :         }
    4274           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4275           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4276             :         }
    4277             : 
    4278           0 :         return py_epm_Lookup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4279             : }
    4280             : 
    4281           0 : static PyObject *py_epm_Lookup_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    4282             : {
    4283           0 :         const struct ndr_interface_call *call = NULL;
    4284           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    4285           0 :         struct ndr_pull *pull = NULL;
    4286           0 :         enum ndr_err_code err;
    4287             : 
    4288           0 :         if (ndr_table_epmapper.num_calls < 3) {
    4289           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Lookup_ndr_unpack");
    4290           0 :                 return NULL;
    4291             :         }
    4292           0 :         call = &ndr_table_epmapper.calls[2];
    4293             : 
    4294           0 :         pull = ndr_pull_init_blob(blob, object);
    4295           0 :         if (pull == NULL) {
    4296           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4297           0 :                 return NULL;
    4298             :         }
    4299             : 
    4300           0 :         pull->flags |= ndr_pull_flags;
    4301             : 
    4302           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4303           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4304           0 :                 TALLOC_FREE(pull);
    4305           0 :                 PyErr_SetNdrError(err);
    4306           0 :                 return NULL;
    4307             :         }
    4308           0 :         if (!allow_remaining) {
    4309           0 :                 uint32_t highest_ofs;
    4310             : 
    4311           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4312           0 :                         highest_ofs = pull->offset;
    4313             :                 } else {
    4314           0 :                         highest_ofs = pull->relative_highest_offset;
    4315             :                 }
    4316           0 :                 if (highest_ofs < pull->data_size) {
    4317           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4318             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4319             :                                 highest_ofs, pull->data_size);
    4320           0 :                         TALLOC_FREE(pull);
    4321           0 :                         PyErr_SetNdrError(err);
    4322           0 :                         return NULL;
    4323             :                 }
    4324             :         }
    4325             : 
    4326           0 :         TALLOC_FREE(pull);
    4327           0 :         Py_RETURN_NONE;
    4328             : }
    4329             : 
    4330           0 : static PyObject *py_epm_Lookup_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4331             : {
    4332           0 :         DATA_BLOB blob;
    4333           0 :         Py_ssize_t blob_length = 0;
    4334           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4335           0 :         PyObject *bigendian_obj = NULL;
    4336           0 :         PyObject *ndr64_obj = NULL;
    4337           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4338           0 :         PyObject *allow_remaining_obj = NULL;
    4339           0 :         bool allow_remaining = false;
    4340             : 
    4341           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4342             :                 discard_const_p(char *, kwnames),
    4343             :                 &blob.data, &blob_length,
    4344             :                 &bigendian_obj,
    4345             :                 &ndr64_obj,
    4346             :                 &allow_remaining_obj)) {
    4347           0 :                 return NULL;
    4348             :         }
    4349           0 :         blob.length = blob_length;
    4350             : 
    4351           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4352           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4353             :         }
    4354           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4355           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4356             :         }
    4357             : 
    4358           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4359           0 :                 allow_remaining = true;
    4360             :         }
    4361             : 
    4362           0 :         return py_epm_Lookup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4363             : }
    4364             : 
    4365           0 : static PyObject *py_epm_Lookup_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4366             : {
    4367           0 :         DATA_BLOB blob;
    4368           0 :         Py_ssize_t blob_length = 0;
    4369           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4370           0 :         PyObject *bigendian_obj = NULL;
    4371           0 :         PyObject *ndr64_obj = NULL;
    4372           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4373           0 :         PyObject *allow_remaining_obj = NULL;
    4374           0 :         bool allow_remaining = false;
    4375             : 
    4376           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4377             :                 discard_const_p(char *, kwnames),
    4378             :                 &blob.data, &blob_length,
    4379             :                 &bigendian_obj,
    4380             :                 &ndr64_obj,
    4381             :                 &allow_remaining_obj)) {
    4382           0 :                 return NULL;
    4383             :         }
    4384           0 :         blob.length = blob_length;
    4385             : 
    4386           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4387           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4388             :         }
    4389           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4390           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4391             :         }
    4392             : 
    4393           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4394           0 :                 allow_remaining = true;
    4395             :         }
    4396             : 
    4397           0 :         return py_epm_Lookup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4398             : }
    4399             : 
    4400           0 : static PyObject *py_epm_Lookup_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    4401             : {
    4402           0 :         const struct ndr_interface_call *call = NULL;
    4403           0 :         struct epm_Lookup *object = pytalloc_get_ptr(py_obj);
    4404           0 :         PyObject *ret;
    4405           0 :         char *retstr;
    4406             : 
    4407           0 :         if (ndr_table_epmapper.num_calls < 3) {
    4408           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Lookup_ndr_print");
    4409           0 :                 return NULL;
    4410             :         }
    4411           0 :         call = &ndr_table_epmapper.calls[2];
    4412             : 
    4413           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4414           0 :         ret = PyUnicode_FromString(retstr);
    4415           0 :         TALLOC_FREE(retstr);
    4416             : 
    4417           0 :         return ret;
    4418             : }
    4419             : 
    4420           0 : static PyObject *py_epm_Lookup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4421             : {
    4422           0 :         return py_epm_Lookup_ndr_print(py_obj, "epm_Lookup_in", NDR_IN);
    4423             : }
    4424             : 
    4425           0 : static PyObject *py_epm_Lookup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4426             : {
    4427           0 :         return py_epm_Lookup_ndr_print(py_obj, "epm_Lookup_out", NDR_OUT);
    4428             : }
    4429             : 
    4430             : static PyMethodDef py_epm_Lookup_methods[] = {
    4431             :         { "opnum", (PyCFunction)py_epm_Lookup_ndr_opnum, METH_NOARGS|METH_CLASS,
    4432             :                 "epmapper.epm_Lookup.opnum() -> 2 (0x02) " },
    4433             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4434             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4435             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4436             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4437             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4438             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4439             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4440             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4441             :         { "__ndr_print_in__", (PyCFunction)py_epm_Lookup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4442             :         { "__ndr_print_out__", (PyCFunction)py_epm_Lookup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4443             :         { NULL, NULL, 0, NULL }
    4444             : };
    4445             : 
    4446             : 
    4447             : static PyTypeObject epm_Lookup_Type = {
    4448             :         PyVarObject_HEAD_INIT(NULL, 0)
    4449             :         .tp_name = "epmapper.epm_Lookup",
    4450             :         .tp_getset = py_epm_Lookup_getsetters,
    4451             :         .tp_methods = py_epm_Lookup_methods,
    4452             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4453             :         .tp_new = py_epm_Lookup_new,
    4454             : };
    4455             : 
    4456           0 : static bool pack_py_epm_Lookup_args_in(PyObject *args, PyObject *kwargs, struct epm_Lookup *r)
    4457             : {
    4458           0 :         PyObject *py_inquiry_type;
    4459           0 :         PyObject *py_object;
    4460           0 :         PyObject *py_interface_id;
    4461           0 :         PyObject *py_vers_option;
    4462           0 :         PyObject *py_entry_handle;
    4463           0 :         PyObject *py_max_ents;
    4464           0 :         const char *kwnames[] = {
    4465             :                 "inquiry_type", "object", "interface_id", "vers_option", "entry_handle", "max_ents", NULL
    4466             :         };
    4467             : 
    4468           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:epm_Lookup", discard_const_p(char *, kwnames), &py_inquiry_type, &py_object, &py_interface_id, &py_vers_option, &py_entry_handle, &py_max_ents)) {
    4469           0 :                 return false;
    4470             :         }
    4471             : 
    4472           0 :         if (py_inquiry_type == NULL) {
    4473           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.inquiry_type");
    4474           0 :                 return false;
    4475             :         }
    4476             :         {
    4477           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.inquiry_type));
    4478           0 :                 if (PyLong_Check(py_inquiry_type)) {
    4479           0 :                         unsigned long long test_var;
    4480           0 :                         test_var = PyLong_AsUnsignedLongLong(py_inquiry_type);
    4481           0 :                         if (PyErr_Occurred() != NULL) {
    4482           0 :                                 return false;
    4483             :                         }
    4484           0 :                         if (test_var > uint_max) {
    4485           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4486             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4487           0 :                                 return false;
    4488             :                         }
    4489           0 :                         r->in.inquiry_type = test_var;
    4490             :                 } else {
    4491           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4492             :                           PyLong_Type.tp_name);
    4493           0 :                         return false;
    4494             :                 }
    4495             :         }
    4496           0 :         if (py_object == NULL) {
    4497           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.object");
    4498           0 :                 return false;
    4499             :         }
    4500           0 :         if (py_object == Py_None) {
    4501           0 :                 r->in.object = NULL;
    4502             :         } else {
    4503           0 :                 r->in.object = NULL;
    4504           0 :                 PY_CHECK_TYPE(GUID_Type, py_object, return false;);
    4505           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
    4506           0 :                         PyErr_NoMemory();
    4507           0 :                         return false;
    4508             :                 }
    4509           0 :                 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
    4510             :         }
    4511           0 :         if (py_interface_id == NULL) {
    4512           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.interface_id");
    4513           0 :                 return false;
    4514             :         }
    4515           0 :         if (py_interface_id == Py_None) {
    4516           0 :                 r->in.interface_id = NULL;
    4517             :         } else {
    4518           0 :                 r->in.interface_id = NULL;
    4519           0 :                 PY_CHECK_TYPE(&rpc_if_id_t_Type, py_interface_id, return false;);
    4520           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_interface_id)) == NULL) {
    4521           0 :                         PyErr_NoMemory();
    4522           0 :                         return false;
    4523             :                 }
    4524           0 :                 r->in.interface_id = (struct rpc_if_id_t *)pytalloc_get_ptr(py_interface_id);
    4525             :         }
    4526           0 :         if (py_vers_option == NULL) {
    4527           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.vers_option");
    4528           0 :                 return false;
    4529             :         }
    4530             :         {
    4531           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.vers_option));
    4532           0 :                 if (PyLong_Check(py_vers_option)) {
    4533           0 :                         unsigned long long test_var;
    4534           0 :                         test_var = PyLong_AsUnsignedLongLong(py_vers_option);
    4535           0 :                         if (PyErr_Occurred() != NULL) {
    4536           0 :                                 return false;
    4537             :                         }
    4538           0 :                         if (test_var > uint_max) {
    4539           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4540             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4541           0 :                                 return false;
    4542             :                         }
    4543           0 :                         r->in.vers_option = test_var;
    4544             :                 } else {
    4545           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4546             :                           PyLong_Type.tp_name);
    4547           0 :                         return false;
    4548             :                 }
    4549             :         }
    4550           0 :         if (py_entry_handle == NULL) {
    4551           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.entry_handle");
    4552           0 :                 return false;
    4553             :         }
    4554           0 :         r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
    4555           0 :         if (r->in.entry_handle == NULL) {
    4556           0 :                 PyErr_NoMemory();
    4557           0 :                 return false;
    4558             :         }
    4559           0 :         PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
    4560           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
    4561           0 :                 PyErr_NoMemory();
    4562           0 :                 return false;
    4563             :         }
    4564           0 :         r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
    4565           0 :         if (py_max_ents == NULL) {
    4566           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.max_ents");
    4567           0 :                 return false;
    4568             :         }
    4569             :         {
    4570           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_ents));
    4571           0 :                 if (PyLong_Check(py_max_ents)) {
    4572           0 :                         unsigned long long test_var;
    4573           0 :                         test_var = PyLong_AsUnsignedLongLong(py_max_ents);
    4574           0 :                         if (PyErr_Occurred() != NULL) {
    4575           0 :                                 return false;
    4576             :                         }
    4577           0 :                         if (test_var > uint_max) {
    4578           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4579             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4580           0 :                                 return false;
    4581             :                         }
    4582           0 :                         r->in.max_ents = test_var;
    4583             :                 } else {
    4584           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4585             :                           PyLong_Type.tp_name);
    4586           0 :                         return false;
    4587             :                 }
    4588             :         }
    4589           0 :         return true;
    4590             : }
    4591             : 
    4592           0 : static PyObject *unpack_py_epm_Lookup_args_out(struct epm_Lookup *r)
    4593             : {
    4594           0 :         PyObject *result;
    4595           0 :         PyObject *py_entry_handle;
    4596           0 :         PyObject *py_entries;
    4597           0 :         result = PyTuple_New(3);
    4598           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
    4599           0 :         PyTuple_SetItem(result, 0, py_entry_handle);
    4600           0 :         py_entries = PyList_New(*r->out.num_ents);
    4601           0 :         if (py_entries == NULL) {
    4602           0 :                 return NULL;
    4603             :         }
    4604             :         {
    4605             :                 int entries_cntr_0;
    4606           0 :                 for (entries_cntr_0 = 0; entries_cntr_0 < (*r->out.num_ents); entries_cntr_0++) {
    4607           0 :                         PyObject *py_entries_0;
    4608           0 :                         py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, r->out.entries, &(r->out.entries)[entries_cntr_0]);
    4609           0 :                         PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
    4610             :                 }
    4611             :         }
    4612           0 :         PyTuple_SetItem(result, 1, py_entries);
    4613           0 :         PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)(r->out.result)));
    4614           0 :         return result;
    4615             : }
    4616             : 
    4617             : 
    4618           0 : static PyObject *py_epm_Map_in_get_object(PyObject *obj, void *closure)
    4619             : {
    4620           0 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4621           0 :         PyObject *py_object;
    4622           0 :         if (object->in.object == NULL) {
    4623           0 :                 Py_RETURN_NONE;
    4624             :         }
    4625           0 :         if (object->in.object == NULL) {
    4626           0 :                 py_object = Py_None;
    4627           0 :                 Py_INCREF(py_object);
    4628             :         } else {
    4629           0 :                 py_object = pytalloc_reference_ex(GUID_Type, object->in.object, object->in.object);
    4630             :         }
    4631           0 :         return py_object;
    4632             : }
    4633             : 
    4634          48 : static int py_epm_Map_in_set_object(PyObject *py_obj, PyObject *value, void *closure)
    4635             : {
    4636          48 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4637          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.object));
    4638          48 :         if (value == NULL) {
    4639           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.object");
    4640           0 :                 return -1;
    4641             :         }
    4642          48 :         if (value == Py_None) {
    4643           0 :                 object->in.object = NULL;
    4644             :         } else {
    4645          48 :                 object->in.object = NULL;
    4646          48 :                 PY_CHECK_TYPE(GUID_Type, value, return -1;);
    4647          48 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4648           0 :                         PyErr_NoMemory();
    4649           0 :                         return -1;
    4650             :                 }
    4651          48 :                 object->in.object = (struct GUID *)pytalloc_get_ptr(value);
    4652             :         }
    4653          48 :         return 0;
    4654             : }
    4655             : 
    4656           0 : static PyObject *py_epm_Map_in_get_map_tower(PyObject *obj, void *closure)
    4657             : {
    4658           0 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4659           0 :         PyObject *py_map_tower;
    4660           0 :         if (object->in.map_tower == NULL) {
    4661           0 :                 Py_RETURN_NONE;
    4662             :         }
    4663           0 :         if (object->in.map_tower == NULL) {
    4664           0 :                 py_map_tower = Py_None;
    4665           0 :                 Py_INCREF(py_map_tower);
    4666             :         } else {
    4667           0 :                 py_map_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->in.map_tower, object->in.map_tower);
    4668             :         }
    4669           0 :         return py_map_tower;
    4670             : }
    4671             : 
    4672          48 : static int py_epm_Map_in_set_map_tower(PyObject *py_obj, PyObject *value, void *closure)
    4673             : {
    4674          48 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4675          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.map_tower));
    4676          48 :         if (value == NULL) {
    4677           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.map_tower");
    4678           0 :                 return -1;
    4679             :         }
    4680          48 :         if (value == Py_None) {
    4681           0 :                 object->in.map_tower = NULL;
    4682             :         } else {
    4683          48 :                 object->in.map_tower = NULL;
    4684          48 :                 PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
    4685          48 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4686           0 :                         PyErr_NoMemory();
    4687           0 :                         return -1;
    4688             :                 }
    4689          48 :                 object->in.map_tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
    4690             :         }
    4691          48 :         return 0;
    4692             : }
    4693             : 
    4694           0 : static PyObject *py_epm_Map_in_get_entry_handle(PyObject *obj, void *closure)
    4695             : {
    4696           0 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4697           0 :         PyObject *py_entry_handle;
    4698           0 :         if (object->in.entry_handle == NULL) {
    4699           0 :                 Py_RETURN_NONE;
    4700             :         }
    4701           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->in.entry_handle, object->in.entry_handle);
    4702           0 :         return py_entry_handle;
    4703             : }
    4704             : 
    4705          48 : static int py_epm_Map_in_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
    4706             : {
    4707          48 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4708          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.entry_handle));
    4709          48 :         if (value == NULL) {
    4710           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.entry_handle");
    4711           0 :                 return -1;
    4712             :         }
    4713          48 :         object->in.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entry_handle);
    4714          48 :         if (object->in.entry_handle == NULL) {
    4715           0 :                 PyErr_NoMemory();
    4716           0 :                 return -1;
    4717             :         }
    4718          48 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    4719          48 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4720           0 :                 PyErr_NoMemory();
    4721           0 :                 return -1;
    4722             :         }
    4723          48 :         object->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    4724          48 :         return 0;
    4725             : }
    4726             : 
    4727           0 : static PyObject *py_epm_Map_out_get_entry_handle(PyObject *obj, void *closure)
    4728             : {
    4729           0 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4730           0 :         PyObject *py_entry_handle;
    4731           0 :         if (object->out.entry_handle == NULL) {
    4732           0 :                 Py_RETURN_NONE;
    4733             :         }
    4734           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->out.entry_handle, object->out.entry_handle);
    4735           0 :         return py_entry_handle;
    4736             : }
    4737             : 
    4738           0 : static int py_epm_Map_out_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
    4739             : {
    4740           0 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4741           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.entry_handle));
    4742           0 :         if (value == NULL) {
    4743           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.entry_handle");
    4744           0 :                 return -1;
    4745             :         }
    4746           0 :         object->out.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entry_handle);
    4747           0 :         if (object->out.entry_handle == NULL) {
    4748           0 :                 PyErr_NoMemory();
    4749           0 :                 return -1;
    4750             :         }
    4751           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    4752           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4753           0 :                 PyErr_NoMemory();
    4754           0 :                 return -1;
    4755             :         }
    4756           0 :         object->out.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    4757           0 :         return 0;
    4758             : }
    4759             : 
    4760           0 : static PyObject *py_epm_Map_in_get_max_towers(PyObject *obj, void *closure)
    4761             : {
    4762           0 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4763           0 :         PyObject *py_max_towers;
    4764           0 :         py_max_towers = PyLong_FromUnsignedLongLong((uint32_t)(object->in.max_towers));
    4765           0 :         return py_max_towers;
    4766             : }
    4767             : 
    4768          48 : static int py_epm_Map_in_set_max_towers(PyObject *py_obj, PyObject *value, void *closure)
    4769             : {
    4770          48 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4771          48 :         if (value == NULL) {
    4772           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.max_towers");
    4773           0 :                 return -1;
    4774             :         }
    4775             :         {
    4776          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_towers));
    4777          48 :                 if (PyLong_Check(value)) {
    4778           0 :                         unsigned long long test_var;
    4779          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4780          48 :                         if (PyErr_Occurred() != NULL) {
    4781           0 :                                 return -1;
    4782             :                         }
    4783          48 :                         if (test_var > uint_max) {
    4784           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4785             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4786           0 :                                 return -1;
    4787             :                         }
    4788          48 :                         object->in.max_towers = test_var;
    4789             :                 } else {
    4790           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4791             :                           PyLong_Type.tp_name);
    4792           0 :                         return -1;
    4793             :                 }
    4794             :         }
    4795          48 :         return 0;
    4796             : }
    4797             : 
    4798          48 : static PyObject *py_epm_Map_out_get_num_towers(PyObject *obj, void *closure)
    4799             : {
    4800          48 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4801           0 :         PyObject *py_num_towers;
    4802          48 :         if (object->out.num_towers == NULL) {
    4803           0 :                 Py_RETURN_NONE;
    4804             :         }
    4805          48 :         py_num_towers = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.num_towers));
    4806          48 :         return py_num_towers;
    4807             : }
    4808             : 
    4809           0 : static int py_epm_Map_out_set_num_towers(PyObject *py_obj, PyObject *value, void *closure)
    4810             : {
    4811           0 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4812           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_towers));
    4813           0 :         if (value == NULL) {
    4814           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.num_towers");
    4815           0 :                 return -1;
    4816             :         }
    4817           0 :         object->out.num_towers = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_towers);
    4818           0 :         if (object->out.num_towers == NULL) {
    4819           0 :                 PyErr_NoMemory();
    4820           0 :                 return -1;
    4821             :         }
    4822             :         {
    4823           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_towers));
    4824           0 :                 if (PyLong_Check(value)) {
    4825           0 :                         unsigned long long test_var;
    4826           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4827           0 :                         if (PyErr_Occurred() != NULL) {
    4828           0 :                                 return -1;
    4829             :                         }
    4830           0 :                         if (test_var > uint_max) {
    4831           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4832             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4833           0 :                                 return -1;
    4834             :                         }
    4835           0 :                         *object->out.num_towers = test_var;
    4836             :                 } else {
    4837           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4838             :                           PyLong_Type.tp_name);
    4839           0 :                         return -1;
    4840             :                 }
    4841             :         }
    4842           0 :         return 0;
    4843             : }
    4844             : 
    4845          16 : static PyObject *py_epm_Map_out_get_towers(PyObject *obj, void *closure)
    4846             : {
    4847          16 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4848           0 :         PyObject *py_towers;
    4849          16 :         py_towers = PyList_New(*object->out.num_towers);
    4850          16 :         if (py_towers == NULL) {
    4851           0 :                 return NULL;
    4852             :         }
    4853             :         {
    4854             :                 int towers_cntr_0;
    4855          32 :                 for (towers_cntr_0 = 0; towers_cntr_0 < (*object->out.num_towers); towers_cntr_0++) {
    4856           0 :                         PyObject *py_towers_0;
    4857          16 :                         py_towers_0 = pytalloc_reference_ex(&epm_twr_p_t_Type, object->out.towers, &(object->out.towers)[towers_cntr_0]);
    4858          16 :                         PyList_SetItem(py_towers, towers_cntr_0, py_towers_0);
    4859             :                 }
    4860             :         }
    4861          16 :         return py_towers;
    4862             : }
    4863             : 
    4864           0 : static int py_epm_Map_out_set_towers(PyObject *py_obj, PyObject *value, void *closure)
    4865             : {
    4866           0 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4867           0 :         if (value == NULL) {
    4868           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.towers");
    4869           0 :                 return -1;
    4870             :         }
    4871           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4872             :         {
    4873           0 :                 int towers_cntr_0;
    4874           0 :                 object->out.towers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.towers, PyList_GET_SIZE(value));
    4875           0 :                 if (!object->out.towers) { return -1; }
    4876           0 :                 talloc_set_name_const(object->out.towers, "ARRAY: object->out.towers");
    4877           0 :                 for (towers_cntr_0 = 0; towers_cntr_0 < PyList_GET_SIZE(value); towers_cntr_0++) {
    4878           0 :                         if (PyList_GET_ITEM(value, towers_cntr_0) == NULL) {
    4879           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.towers)[towers_cntr_0]");
    4880           0 :                                 return -1;
    4881             :                         }
    4882           0 :                         PY_CHECK_TYPE(&epm_twr_p_t_Type, PyList_GET_ITEM(value, towers_cntr_0), return -1;);
    4883           0 :                         if (talloc_reference(object->out.towers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, towers_cntr_0))) == NULL) {
    4884           0 :                                 PyErr_NoMemory();
    4885           0 :                                 return -1;
    4886             :                         }
    4887           0 :                         (object->out.towers)[towers_cntr_0] = *(struct epm_twr_p_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, towers_cntr_0));
    4888             :                 }
    4889             :         }
    4890           0 :         return 0;
    4891             : }
    4892             : 
    4893           0 : static PyObject *py_epm_Map_get_result(PyObject *obj, void *closure)
    4894             : {
    4895           0 :         struct epm_Map *object = pytalloc_get_ptr(obj);
    4896           0 :         PyObject *py_result;
    4897           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    4898           0 :         return py_result;
    4899             : }
    4900             : 
    4901           0 : static int py_epm_Map_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4902             : {
    4903           0 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    4904           0 :         if (value == NULL) {
    4905           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    4906           0 :                 return -1;
    4907             :         }
    4908             :         {
    4909           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    4910           0 :                 if (PyLong_Check(value)) {
    4911           0 :                         unsigned long long test_var;
    4912           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4913           0 :                         if (PyErr_Occurred() != NULL) {
    4914           0 :                                 return -1;
    4915             :                         }
    4916           0 :                         if (test_var > uint_max) {
    4917           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4918             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4919           0 :                                 return -1;
    4920             :                         }
    4921           0 :                         object->out.result = test_var;
    4922             :                 } else {
    4923           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4924             :                           PyLong_Type.tp_name);
    4925           0 :                         return -1;
    4926             :                 }
    4927             :         }
    4928           0 :         return 0;
    4929             : }
    4930             : 
    4931             : static PyGetSetDef py_epm_Map_getsetters[] = {
    4932             :         {
    4933             :                 .name = discard_const_p(char, "in_object"),
    4934             :                 .get = py_epm_Map_in_get_object,
    4935             :                 .set = py_epm_Map_in_set_object,
    4936             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    4937             :         },
    4938             :         {
    4939             :                 .name = discard_const_p(char, "in_map_tower"),
    4940             :                 .get = py_epm_Map_in_get_map_tower,
    4941             :                 .set = py_epm_Map_in_set_map_tower,
    4942             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
    4943             :         },
    4944             :         {
    4945             :                 .name = discard_const_p(char, "in_entry_handle"),
    4946             :                 .get = py_epm_Map_in_get_entry_handle,
    4947             :                 .set = py_epm_Map_in_set_entry_handle,
    4948             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4949             :         },
    4950             :         {
    4951             :                 .name = discard_const_p(char, "out_entry_handle"),
    4952             :                 .get = py_epm_Map_out_get_entry_handle,
    4953             :                 .set = py_epm_Map_out_set_entry_handle,
    4954             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4955             :         },
    4956             :         {
    4957             :                 .name = discard_const_p(char, "in_max_towers"),
    4958             :                 .get = py_epm_Map_in_get_max_towers,
    4959             :                 .set = py_epm_Map_in_set_max_towers,
    4960             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4961             :         },
    4962             :         {
    4963             :                 .name = discard_const_p(char, "out_num_towers"),
    4964             :                 .get = py_epm_Map_out_get_num_towers,
    4965             :                 .set = py_epm_Map_out_set_num_towers,
    4966             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4967             :         },
    4968             :         {
    4969             :                 .name = discard_const_p(char, "out_towers"),
    4970             :                 .get = py_epm_Map_out_get_towers,
    4971             :                 .set = py_epm_Map_out_set_towers,
    4972             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_p_t")
    4973             :         },
    4974             :         {
    4975             :                 .name = discard_const_p(char, "result"),
    4976             :                 .get = py_epm_Map_get_result,
    4977             :                 .set = py_epm_Map_set_result,
    4978             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    4979             :         },
    4980             :         { .name = NULL }
    4981             : };
    4982             : 
    4983          48 : static PyObject *py_epm_Map_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4984             : {
    4985          48 :         PyObject *self = pytalloc_new(struct epm_Map, type);
    4986          48 :         struct epm_Map *_self = (struct epm_Map *)pytalloc_get_ptr(self);
    4987          48 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4988          48 :         _self->in.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
    4989          48 :         _self->out.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
    4990          48 :         _self->out.num_towers = talloc_zero(mem_ctx, uint32_t);
    4991          48 :         return self;
    4992             : }
    4993             : 
    4994          48 : static PyObject *py_epm_Map_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4995             : {
    4996             : 
    4997             : 
    4998          48 :         return PyLong_FromLong(3);
    4999             : }
    5000             : 
    5001          48 : static PyObject *py_epm_Map_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    5002             : {
    5003          48 :         const struct ndr_interface_call *call = NULL;
    5004          48 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    5005          48 :         PyObject *ret = NULL;
    5006          48 :         struct ndr_push *push = NULL;
    5007           0 :         DATA_BLOB blob;
    5008           0 :         enum ndr_err_code err;
    5009             : 
    5010          48 :         if (ndr_table_epmapper.num_calls < 4) {
    5011           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Map_ndr_pack");
    5012           0 :                 return NULL;
    5013             :         }
    5014          48 :         call = &ndr_table_epmapper.calls[3];
    5015             : 
    5016          48 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5017          48 :         if (push == NULL) {
    5018           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5019           0 :                 return NULL;
    5020             :         }
    5021             : 
    5022          48 :         push->flags |= ndr_push_flags;
    5023             : 
    5024          48 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5025          48 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5026           0 :                 TALLOC_FREE(push);
    5027           0 :                 PyErr_SetNdrError(err);
    5028           0 :                 return NULL;
    5029             :         }
    5030          48 :         blob = ndr_push_blob(push);
    5031          48 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5032          48 :         TALLOC_FREE(push);
    5033          48 :         return ret;
    5034             : }
    5035             : 
    5036          48 : static PyObject *py_epm_Map_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5037             : {
    5038          48 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5039          48 :         PyObject *bigendian_obj = NULL;
    5040          48 :         PyObject *ndr64_obj = NULL;
    5041          48 :         libndr_flags ndr_push_flags = 0;
    5042             : 
    5043          48 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5044             :                 discard_const_p(char *, kwnames),
    5045             :                 &bigendian_obj,
    5046             :                 &ndr64_obj)) {
    5047           0 :                 return NULL;
    5048             :         }
    5049             : 
    5050          48 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5051           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5052             :         }
    5053          48 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5054           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5055             :         }
    5056             : 
    5057          48 :         return py_epm_Map_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5058             : }
    5059             : 
    5060           0 : static PyObject *py_epm_Map_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5061             : {
    5062           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5063           0 :         PyObject *bigendian_obj = NULL;
    5064           0 :         PyObject *ndr64_obj = NULL;
    5065           0 :         libndr_flags ndr_push_flags = 0;
    5066             : 
    5067           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5068             :                 discard_const_p(char *, kwnames),
    5069             :                 &bigendian_obj,
    5070             :                 &ndr64_obj)) {
    5071           0 :                 return NULL;
    5072             :         }
    5073             : 
    5074           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5075           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5076             :         }
    5077           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5078           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5079             :         }
    5080             : 
    5081           0 :         return py_epm_Map_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5082             : }
    5083             : 
    5084          48 : static PyObject *py_epm_Map_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    5085             : {
    5086          48 :         const struct ndr_interface_call *call = NULL;
    5087          48 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    5088          48 :         struct ndr_pull *pull = NULL;
    5089           0 :         enum ndr_err_code err;
    5090             : 
    5091          48 :         if (ndr_table_epmapper.num_calls < 4) {
    5092           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Map_ndr_unpack");
    5093           0 :                 return NULL;
    5094             :         }
    5095          48 :         call = &ndr_table_epmapper.calls[3];
    5096             : 
    5097          48 :         pull = ndr_pull_init_blob(blob, object);
    5098          48 :         if (pull == NULL) {
    5099           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5100           0 :                 return NULL;
    5101             :         }
    5102             : 
    5103          48 :         pull->flags |= ndr_pull_flags;
    5104             : 
    5105          48 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5106          48 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5107           0 :                 TALLOC_FREE(pull);
    5108           0 :                 PyErr_SetNdrError(err);
    5109           0 :                 return NULL;
    5110             :         }
    5111          48 :         if (!allow_remaining) {
    5112           0 :                 uint32_t highest_ofs;
    5113             : 
    5114          48 :                 if (pull->offset > pull->relative_highest_offset) {
    5115          48 :                         highest_ofs = pull->offset;
    5116             :                 } else {
    5117           0 :                         highest_ofs = pull->relative_highest_offset;
    5118             :                 }
    5119          48 :                 if (highest_ofs < pull->data_size) {
    5120           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5121             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5122             :                                 highest_ofs, pull->data_size);
    5123           0 :                         TALLOC_FREE(pull);
    5124           0 :                         PyErr_SetNdrError(err);
    5125           0 :                         return NULL;
    5126             :                 }
    5127             :         }
    5128             : 
    5129          48 :         TALLOC_FREE(pull);
    5130          48 :         Py_RETURN_NONE;
    5131             : }
    5132             : 
    5133           0 : static PyObject *py_epm_Map_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5134             : {
    5135           0 :         DATA_BLOB blob;
    5136           0 :         Py_ssize_t blob_length = 0;
    5137           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5138           0 :         PyObject *bigendian_obj = NULL;
    5139           0 :         PyObject *ndr64_obj = NULL;
    5140           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5141           0 :         PyObject *allow_remaining_obj = NULL;
    5142           0 :         bool allow_remaining = false;
    5143             : 
    5144           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5145             :                 discard_const_p(char *, kwnames),
    5146             :                 &blob.data, &blob_length,
    5147             :                 &bigendian_obj,
    5148             :                 &ndr64_obj,
    5149             :                 &allow_remaining_obj)) {
    5150           0 :                 return NULL;
    5151             :         }
    5152           0 :         blob.length = blob_length;
    5153             : 
    5154           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5155           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5156             :         }
    5157           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5158           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5159             :         }
    5160             : 
    5161           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5162           0 :                 allow_remaining = true;
    5163             :         }
    5164             : 
    5165           0 :         return py_epm_Map_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    5166             : }
    5167             : 
    5168          48 : static PyObject *py_epm_Map_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5169             : {
    5170           0 :         DATA_BLOB blob;
    5171          48 :         Py_ssize_t blob_length = 0;
    5172          48 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5173          48 :         PyObject *bigendian_obj = NULL;
    5174          48 :         PyObject *ndr64_obj = NULL;
    5175          48 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5176          48 :         PyObject *allow_remaining_obj = NULL;
    5177          48 :         bool allow_remaining = false;
    5178             : 
    5179          48 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    5180             :                 discard_const_p(char *, kwnames),
    5181             :                 &blob.data, &blob_length,
    5182             :                 &bigendian_obj,
    5183             :                 &ndr64_obj,
    5184             :                 &allow_remaining_obj)) {
    5185           0 :                 return NULL;
    5186             :         }
    5187          48 :         blob.length = blob_length;
    5188             : 
    5189          48 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5190           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5191             :         }
    5192          48 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5193           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5194             :         }
    5195             : 
    5196          48 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5197           0 :                 allow_remaining = true;
    5198             :         }
    5199             : 
    5200          48 :         return py_epm_Map_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    5201             : }
    5202             : 
    5203           0 : static PyObject *py_epm_Map_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    5204             : {
    5205           0 :         const struct ndr_interface_call *call = NULL;
    5206           0 :         struct epm_Map *object = pytalloc_get_ptr(py_obj);
    5207           0 :         PyObject *ret;
    5208           0 :         char *retstr;
    5209             : 
    5210           0 :         if (ndr_table_epmapper.num_calls < 4) {
    5211           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Map_ndr_print");
    5212           0 :                 return NULL;
    5213             :         }
    5214           0 :         call = &ndr_table_epmapper.calls[3];
    5215             : 
    5216           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5217           0 :         ret = PyUnicode_FromString(retstr);
    5218           0 :         TALLOC_FREE(retstr);
    5219             : 
    5220           0 :         return ret;
    5221             : }
    5222             : 
    5223           0 : static PyObject *py_epm_Map_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5224             : {
    5225           0 :         return py_epm_Map_ndr_print(py_obj, "epm_Map_in", NDR_IN);
    5226             : }
    5227             : 
    5228           0 : static PyObject *py_epm_Map_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5229             : {
    5230           0 :         return py_epm_Map_ndr_print(py_obj, "epm_Map_out", NDR_OUT);
    5231             : }
    5232             : 
    5233             : static PyMethodDef py_epm_Map_methods[] = {
    5234             :         { "opnum", (PyCFunction)py_epm_Map_ndr_opnum, METH_NOARGS|METH_CLASS,
    5235             :                 "epmapper.epm_Map.opnum() -> 3 (0x03) " },
    5236             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5237             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5238             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5239             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5240             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5241             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5242             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5243             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5244             :         { "__ndr_print_in__", (PyCFunction)py_epm_Map_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5245             :         { "__ndr_print_out__", (PyCFunction)py_epm_Map_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5246             :         { NULL, NULL, 0, NULL }
    5247             : };
    5248             : 
    5249             : 
    5250             : static PyTypeObject epm_Map_Type = {
    5251             :         PyVarObject_HEAD_INIT(NULL, 0)
    5252             :         .tp_name = "epmapper.epm_Map",
    5253             :         .tp_getset = py_epm_Map_getsetters,
    5254             :         .tp_methods = py_epm_Map_methods,
    5255             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5256             :         .tp_new = py_epm_Map_new,
    5257             : };
    5258             : 
    5259           0 : static bool pack_py_epm_Map_args_in(PyObject *args, PyObject *kwargs, struct epm_Map *r)
    5260             : {
    5261           0 :         PyObject *py_object;
    5262           0 :         PyObject *py_map_tower;
    5263           0 :         PyObject *py_entry_handle;
    5264           0 :         PyObject *py_max_towers;
    5265           0 :         const char *kwnames[] = {
    5266             :                 "object", "map_tower", "entry_handle", "max_towers", NULL
    5267             :         };
    5268             : 
    5269           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:epm_Map", discard_const_p(char *, kwnames), &py_object, &py_map_tower, &py_entry_handle, &py_max_towers)) {
    5270           0 :                 return false;
    5271             :         }
    5272             : 
    5273           0 :         if (py_object == NULL) {
    5274           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.object");
    5275           0 :                 return false;
    5276             :         }
    5277           0 :         if (py_object == Py_None) {
    5278           0 :                 r->in.object = NULL;
    5279             :         } else {
    5280           0 :                 r->in.object = NULL;
    5281           0 :                 PY_CHECK_TYPE(GUID_Type, py_object, return false;);
    5282           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
    5283           0 :                         PyErr_NoMemory();
    5284           0 :                         return false;
    5285             :                 }
    5286           0 :                 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
    5287             :         }
    5288           0 :         if (py_map_tower == NULL) {
    5289           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.map_tower");
    5290           0 :                 return false;
    5291             :         }
    5292           0 :         if (py_map_tower == Py_None) {
    5293           0 :                 r->in.map_tower = NULL;
    5294             :         } else {
    5295           0 :                 r->in.map_tower = NULL;
    5296           0 :                 PY_CHECK_TYPE(&epm_twr_t_Type, py_map_tower, return false;);
    5297           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_map_tower)) == NULL) {
    5298           0 :                         PyErr_NoMemory();
    5299           0 :                         return false;
    5300             :                 }
    5301           0 :                 r->in.map_tower = (struct epm_twr_t *)pytalloc_get_ptr(py_map_tower);
    5302             :         }
    5303           0 :         if (py_entry_handle == NULL) {
    5304           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.entry_handle");
    5305           0 :                 return false;
    5306             :         }
    5307           0 :         r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
    5308           0 :         if (r->in.entry_handle == NULL) {
    5309           0 :                 PyErr_NoMemory();
    5310           0 :                 return false;
    5311             :         }
    5312           0 :         PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
    5313           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
    5314           0 :                 PyErr_NoMemory();
    5315           0 :                 return false;
    5316             :         }
    5317           0 :         r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
    5318           0 :         if (py_max_towers == NULL) {
    5319           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.max_towers");
    5320           0 :                 return false;
    5321             :         }
    5322             :         {
    5323           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_towers));
    5324           0 :                 if (PyLong_Check(py_max_towers)) {
    5325           0 :                         unsigned long long test_var;
    5326           0 :                         test_var = PyLong_AsUnsignedLongLong(py_max_towers);
    5327           0 :                         if (PyErr_Occurred() != NULL) {
    5328           0 :                                 return false;
    5329             :                         }
    5330           0 :                         if (test_var > uint_max) {
    5331           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5332             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5333           0 :                                 return false;
    5334             :                         }
    5335           0 :                         r->in.max_towers = test_var;
    5336             :                 } else {
    5337           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5338             :                           PyLong_Type.tp_name);
    5339           0 :                         return false;
    5340             :                 }
    5341             :         }
    5342           0 :         return true;
    5343             : }
    5344             : 
    5345           0 : static PyObject *unpack_py_epm_Map_args_out(struct epm_Map *r)
    5346             : {
    5347           0 :         PyObject *result;
    5348           0 :         PyObject *py_entry_handle;
    5349           0 :         PyObject *py_towers;
    5350           0 :         result = PyTuple_New(3);
    5351           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
    5352           0 :         PyTuple_SetItem(result, 0, py_entry_handle);
    5353           0 :         py_towers = PyList_New(*r->out.num_towers);
    5354           0 :         if (py_towers == NULL) {
    5355           0 :                 return NULL;
    5356             :         }
    5357             :         {
    5358             :                 int towers_cntr_0;
    5359           0 :                 for (towers_cntr_0 = 0; towers_cntr_0 < (*r->out.num_towers); towers_cntr_0++) {
    5360           0 :                         PyObject *py_towers_0;
    5361           0 :                         py_towers_0 = pytalloc_reference_ex(&epm_twr_p_t_Type, r->out.towers, &(r->out.towers)[towers_cntr_0]);
    5362           0 :                         PyList_SetItem(py_towers, towers_cntr_0, py_towers_0);
    5363             :                 }
    5364             :         }
    5365           0 :         PyTuple_SetItem(result, 1, py_towers);
    5366           0 :         PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)(r->out.result)));
    5367           0 :         return result;
    5368             : }
    5369             : 
    5370             : 
    5371           0 : static PyObject *py_epm_LookupHandleFree_in_get_entry_handle(PyObject *obj, void *closure)
    5372             : {
    5373           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(obj);
    5374           0 :         PyObject *py_entry_handle;
    5375           0 :         if (object->in.entry_handle == NULL) {
    5376           0 :                 Py_RETURN_NONE;
    5377             :         }
    5378           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->in.entry_handle, object->in.entry_handle);
    5379           0 :         return py_entry_handle;
    5380             : }
    5381             : 
    5382           0 : static int py_epm_LookupHandleFree_in_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
    5383             : {
    5384           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(py_obj);
    5385           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.entry_handle));
    5386           0 :         if (value == NULL) {
    5387           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.entry_handle");
    5388           0 :                 return -1;
    5389             :         }
    5390           0 :         object->in.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entry_handle);
    5391           0 :         if (object->in.entry_handle == NULL) {
    5392           0 :                 PyErr_NoMemory();
    5393           0 :                 return -1;
    5394             :         }
    5395           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    5396           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5397           0 :                 PyErr_NoMemory();
    5398           0 :                 return -1;
    5399             :         }
    5400           0 :         object->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    5401           0 :         return 0;
    5402             : }
    5403             : 
    5404           0 : static PyObject *py_epm_LookupHandleFree_out_get_entry_handle(PyObject *obj, void *closure)
    5405             : {
    5406           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(obj);
    5407           0 :         PyObject *py_entry_handle;
    5408           0 :         if (object->out.entry_handle == NULL) {
    5409           0 :                 Py_RETURN_NONE;
    5410             :         }
    5411           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->out.entry_handle, object->out.entry_handle);
    5412           0 :         return py_entry_handle;
    5413             : }
    5414             : 
    5415           0 : static int py_epm_LookupHandleFree_out_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
    5416             : {
    5417           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(py_obj);
    5418           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.entry_handle));
    5419           0 :         if (value == NULL) {
    5420           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.entry_handle");
    5421           0 :                 return -1;
    5422             :         }
    5423           0 :         object->out.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entry_handle);
    5424           0 :         if (object->out.entry_handle == NULL) {
    5425           0 :                 PyErr_NoMemory();
    5426           0 :                 return -1;
    5427             :         }
    5428           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    5429           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5430           0 :                 PyErr_NoMemory();
    5431           0 :                 return -1;
    5432             :         }
    5433           0 :         object->out.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    5434           0 :         return 0;
    5435             : }
    5436             : 
    5437           0 : static PyObject *py_epm_LookupHandleFree_get_result(PyObject *obj, void *closure)
    5438             : {
    5439           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(obj);
    5440           0 :         PyObject *py_result;
    5441           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    5442           0 :         return py_result;
    5443             : }
    5444             : 
    5445           0 : static int py_epm_LookupHandleFree_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5446             : {
    5447           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(py_obj);
    5448           0 :         if (value == NULL) {
    5449           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    5450           0 :                 return -1;
    5451             :         }
    5452             :         {
    5453           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    5454           0 :                 if (PyLong_Check(value)) {
    5455           0 :                         unsigned long long test_var;
    5456           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5457           0 :                         if (PyErr_Occurred() != NULL) {
    5458           0 :                                 return -1;
    5459             :                         }
    5460           0 :                         if (test_var > uint_max) {
    5461           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5462             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5463           0 :                                 return -1;
    5464             :                         }
    5465           0 :                         object->out.result = test_var;
    5466             :                 } else {
    5467           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5468             :                           PyLong_Type.tp_name);
    5469           0 :                         return -1;
    5470             :                 }
    5471             :         }
    5472           0 :         return 0;
    5473             : }
    5474             : 
    5475             : static PyGetSetDef py_epm_LookupHandleFree_getsetters[] = {
    5476             :         {
    5477             :                 .name = discard_const_p(char, "in_entry_handle"),
    5478             :                 .get = py_epm_LookupHandleFree_in_get_entry_handle,
    5479             :                 .set = py_epm_LookupHandleFree_in_set_entry_handle,
    5480             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    5481             :         },
    5482             :         {
    5483             :                 .name = discard_const_p(char, "out_entry_handle"),
    5484             :                 .get = py_epm_LookupHandleFree_out_get_entry_handle,
    5485             :                 .set = py_epm_LookupHandleFree_out_set_entry_handle,
    5486             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    5487             :         },
    5488             :         {
    5489             :                 .name = discard_const_p(char, "result"),
    5490             :                 .get = py_epm_LookupHandleFree_get_result,
    5491             :                 .set = py_epm_LookupHandleFree_set_result,
    5492             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    5493             :         },
    5494             :         { .name = NULL }
    5495             : };
    5496             : 
    5497           0 : static PyObject *py_epm_LookupHandleFree_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5498             : {
    5499           0 :         PyObject *self = pytalloc_new(struct epm_LookupHandleFree, type);
    5500           0 :         struct epm_LookupHandleFree *_self = (struct epm_LookupHandleFree *)pytalloc_get_ptr(self);
    5501           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    5502           0 :         _self->in.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
    5503           0 :         _self->out.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
    5504           0 :         return self;
    5505             : }
    5506             : 
    5507           0 : static PyObject *py_epm_LookupHandleFree_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5508             : {
    5509             : 
    5510             : 
    5511           0 :         return PyLong_FromLong(4);
    5512             : }
    5513             : 
    5514           0 : static PyObject *py_epm_LookupHandleFree_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    5515             : {
    5516           0 :         const struct ndr_interface_call *call = NULL;
    5517           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(py_obj);
    5518           0 :         PyObject *ret = NULL;
    5519           0 :         struct ndr_push *push = NULL;
    5520           0 :         DATA_BLOB blob;
    5521           0 :         enum ndr_err_code err;
    5522             : 
    5523           0 :         if (ndr_table_epmapper.num_calls < 5) {
    5524           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_LookupHandleFree_ndr_pack");
    5525           0 :                 return NULL;
    5526             :         }
    5527           0 :         call = &ndr_table_epmapper.calls[4];
    5528             : 
    5529           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5530           0 :         if (push == NULL) {
    5531           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5532           0 :                 return NULL;
    5533             :         }
    5534             : 
    5535           0 :         push->flags |= ndr_push_flags;
    5536             : 
    5537           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5538           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5539           0 :                 TALLOC_FREE(push);
    5540           0 :                 PyErr_SetNdrError(err);
    5541           0 :                 return NULL;
    5542             :         }
    5543           0 :         blob = ndr_push_blob(push);
    5544           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5545           0 :         TALLOC_FREE(push);
    5546           0 :         return ret;
    5547             : }
    5548             : 
    5549           0 : static PyObject *py_epm_LookupHandleFree_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5550             : {
    5551           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5552           0 :         PyObject *bigendian_obj = NULL;
    5553           0 :         PyObject *ndr64_obj = NULL;
    5554           0 :         libndr_flags ndr_push_flags = 0;
    5555             : 
    5556           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5557             :                 discard_const_p(char *, kwnames),
    5558             :                 &bigendian_obj,
    5559             :                 &ndr64_obj)) {
    5560           0 :                 return NULL;
    5561             :         }
    5562             : 
    5563           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5564           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5565             :         }
    5566           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5567           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5568             :         }
    5569             : 
    5570           0 :         return py_epm_LookupHandleFree_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5571             : }
    5572             : 
    5573           0 : static PyObject *py_epm_LookupHandleFree_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5574             : {
    5575           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5576           0 :         PyObject *bigendian_obj = NULL;
    5577           0 :         PyObject *ndr64_obj = NULL;
    5578           0 :         libndr_flags ndr_push_flags = 0;
    5579             : 
    5580           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5581             :                 discard_const_p(char *, kwnames),
    5582             :                 &bigendian_obj,
    5583             :                 &ndr64_obj)) {
    5584           0 :                 return NULL;
    5585             :         }
    5586             : 
    5587           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5588           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5589             :         }
    5590           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5591           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5592             :         }
    5593             : 
    5594           0 :         return py_epm_LookupHandleFree_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5595             : }
    5596             : 
    5597           0 : static PyObject *py_epm_LookupHandleFree_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    5598             : {
    5599           0 :         const struct ndr_interface_call *call = NULL;
    5600           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(py_obj);
    5601           0 :         struct ndr_pull *pull = NULL;
    5602           0 :         enum ndr_err_code err;
    5603             : 
    5604           0 :         if (ndr_table_epmapper.num_calls < 5) {
    5605           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_LookupHandleFree_ndr_unpack");
    5606           0 :                 return NULL;
    5607             :         }
    5608           0 :         call = &ndr_table_epmapper.calls[4];
    5609             : 
    5610           0 :         pull = ndr_pull_init_blob(blob, object);
    5611           0 :         if (pull == NULL) {
    5612           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5613           0 :                 return NULL;
    5614             :         }
    5615             : 
    5616           0 :         pull->flags |= ndr_pull_flags;
    5617             : 
    5618           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5619           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5620           0 :                 TALLOC_FREE(pull);
    5621           0 :                 PyErr_SetNdrError(err);
    5622           0 :                 return NULL;
    5623             :         }
    5624           0 :         if (!allow_remaining) {
    5625           0 :                 uint32_t highest_ofs;
    5626             : 
    5627           0 :                 if (pull->offset > pull->relative_highest_offset) {
    5628           0 :                         highest_ofs = pull->offset;
    5629             :                 } else {
    5630           0 :                         highest_ofs = pull->relative_highest_offset;
    5631             :                 }
    5632           0 :                 if (highest_ofs < pull->data_size) {
    5633           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5634             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5635             :                                 highest_ofs, pull->data_size);
    5636           0 :                         TALLOC_FREE(pull);
    5637           0 :                         PyErr_SetNdrError(err);
    5638           0 :                         return NULL;
    5639             :                 }
    5640             :         }
    5641             : 
    5642           0 :         TALLOC_FREE(pull);
    5643           0 :         Py_RETURN_NONE;
    5644             : }
    5645             : 
    5646           0 : static PyObject *py_epm_LookupHandleFree_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5647             : {
    5648           0 :         DATA_BLOB blob;
    5649           0 :         Py_ssize_t blob_length = 0;
    5650           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5651           0 :         PyObject *bigendian_obj = NULL;
    5652           0 :         PyObject *ndr64_obj = NULL;
    5653           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5654           0 :         PyObject *allow_remaining_obj = NULL;
    5655           0 :         bool allow_remaining = false;
    5656             : 
    5657           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5658             :                 discard_const_p(char *, kwnames),
    5659             :                 &blob.data, &blob_length,
    5660             :                 &bigendian_obj,
    5661             :                 &ndr64_obj,
    5662             :                 &allow_remaining_obj)) {
    5663           0 :                 return NULL;
    5664             :         }
    5665           0 :         blob.length = blob_length;
    5666             : 
    5667           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5668           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5669             :         }
    5670           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5671           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5672             :         }
    5673             : 
    5674           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5675           0 :                 allow_remaining = true;
    5676             :         }
    5677             : 
    5678           0 :         return py_epm_LookupHandleFree_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    5679             : }
    5680             : 
    5681           0 : static PyObject *py_epm_LookupHandleFree_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5682             : {
    5683           0 :         DATA_BLOB blob;
    5684           0 :         Py_ssize_t blob_length = 0;
    5685           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5686           0 :         PyObject *bigendian_obj = NULL;
    5687           0 :         PyObject *ndr64_obj = NULL;
    5688           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5689           0 :         PyObject *allow_remaining_obj = NULL;
    5690           0 :         bool allow_remaining = false;
    5691             : 
    5692           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    5693             :                 discard_const_p(char *, kwnames),
    5694             :                 &blob.data, &blob_length,
    5695             :                 &bigendian_obj,
    5696             :                 &ndr64_obj,
    5697             :                 &allow_remaining_obj)) {
    5698           0 :                 return NULL;
    5699             :         }
    5700           0 :         blob.length = blob_length;
    5701             : 
    5702           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5703           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5704             :         }
    5705           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5706           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5707             :         }
    5708             : 
    5709           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5710           0 :                 allow_remaining = true;
    5711             :         }
    5712             : 
    5713           0 :         return py_epm_LookupHandleFree_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    5714             : }
    5715             : 
    5716           0 : static PyObject *py_epm_LookupHandleFree_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    5717             : {
    5718           0 :         const struct ndr_interface_call *call = NULL;
    5719           0 :         struct epm_LookupHandleFree *object = pytalloc_get_ptr(py_obj);
    5720           0 :         PyObject *ret;
    5721           0 :         char *retstr;
    5722             : 
    5723           0 :         if (ndr_table_epmapper.num_calls < 5) {
    5724           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_LookupHandleFree_ndr_print");
    5725           0 :                 return NULL;
    5726             :         }
    5727           0 :         call = &ndr_table_epmapper.calls[4];
    5728             : 
    5729           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5730           0 :         ret = PyUnicode_FromString(retstr);
    5731           0 :         TALLOC_FREE(retstr);
    5732             : 
    5733           0 :         return ret;
    5734             : }
    5735             : 
    5736           0 : static PyObject *py_epm_LookupHandleFree_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5737             : {
    5738           0 :         return py_epm_LookupHandleFree_ndr_print(py_obj, "epm_LookupHandleFree_in", NDR_IN);
    5739             : }
    5740             : 
    5741           0 : static PyObject *py_epm_LookupHandleFree_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5742             : {
    5743           0 :         return py_epm_LookupHandleFree_ndr_print(py_obj, "epm_LookupHandleFree_out", NDR_OUT);
    5744             : }
    5745             : 
    5746             : static PyMethodDef py_epm_LookupHandleFree_methods[] = {
    5747             :         { "opnum", (PyCFunction)py_epm_LookupHandleFree_ndr_opnum, METH_NOARGS|METH_CLASS,
    5748             :                 "epmapper.epm_LookupHandleFree.opnum() -> 4 (0x04) " },
    5749             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5750             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5751             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5752             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5753             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5754             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5755             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5756             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5757             :         { "__ndr_print_in__", (PyCFunction)py_epm_LookupHandleFree_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5758             :         { "__ndr_print_out__", (PyCFunction)py_epm_LookupHandleFree_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5759             :         { NULL, NULL, 0, NULL }
    5760             : };
    5761             : 
    5762             : 
    5763             : static PyTypeObject epm_LookupHandleFree_Type = {
    5764             :         PyVarObject_HEAD_INIT(NULL, 0)
    5765             :         .tp_name = "epmapper.epm_LookupHandleFree",
    5766             :         .tp_getset = py_epm_LookupHandleFree_getsetters,
    5767             :         .tp_methods = py_epm_LookupHandleFree_methods,
    5768             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5769             :         .tp_new = py_epm_LookupHandleFree_new,
    5770             : };
    5771             : 
    5772           0 : static bool pack_py_epm_LookupHandleFree_args_in(PyObject *args, PyObject *kwargs, struct epm_LookupHandleFree *r)
    5773             : {
    5774           0 :         PyObject *py_entry_handle;
    5775           0 :         const char *kwnames[] = {
    5776             :                 "entry_handle", NULL
    5777             :         };
    5778             : 
    5779           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_LookupHandleFree", discard_const_p(char *, kwnames), &py_entry_handle)) {
    5780           0 :                 return false;
    5781             :         }
    5782             : 
    5783           0 :         if (py_entry_handle == NULL) {
    5784           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.entry_handle");
    5785           0 :                 return false;
    5786             :         }
    5787           0 :         r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
    5788           0 :         if (r->in.entry_handle == NULL) {
    5789           0 :                 PyErr_NoMemory();
    5790           0 :                 return false;
    5791             :         }
    5792           0 :         PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
    5793           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
    5794           0 :                 PyErr_NoMemory();
    5795           0 :                 return false;
    5796             :         }
    5797           0 :         r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
    5798           0 :         return true;
    5799             : }
    5800             : 
    5801           0 : static PyObject *unpack_py_epm_LookupHandleFree_args_out(struct epm_LookupHandleFree *r)
    5802             : {
    5803           0 :         PyObject *result;
    5804           0 :         PyObject *py_entry_handle;
    5805           0 :         result = PyTuple_New(2);
    5806           0 :         py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
    5807           0 :         PyTuple_SetItem(result, 0, py_entry_handle);
    5808           0 :         PyTuple_SetItem(result, 1, PyLong_FromUnsignedLongLong((uint32_t)(r->out.result)));
    5809           0 :         return result;
    5810             : }
    5811             : 
    5812             : 
    5813           0 : static PyObject *py_epm_InqObject_in_get_epm_object(PyObject *obj, void *closure)
    5814             : {
    5815           0 :         struct epm_InqObject *object = pytalloc_get_ptr(obj);
    5816           0 :         PyObject *py_epm_object;
    5817           0 :         if (object->in.epm_object == NULL) {
    5818           0 :                 Py_RETURN_NONE;
    5819             :         }
    5820           0 :         py_epm_object = pytalloc_reference_ex(GUID_Type, object->in.epm_object, object->in.epm_object);
    5821           0 :         return py_epm_object;
    5822             : }
    5823             : 
    5824           0 : static int py_epm_InqObject_in_set_epm_object(PyObject *py_obj, PyObject *value, void *closure)
    5825             : {
    5826           0 :         struct epm_InqObject *object = pytalloc_get_ptr(py_obj);
    5827           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.epm_object));
    5828           0 :         if (value == NULL) {
    5829           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.epm_object");
    5830           0 :                 return -1;
    5831             :         }
    5832           0 :         object->in.epm_object = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.epm_object);
    5833           0 :         if (object->in.epm_object == NULL) {
    5834           0 :                 PyErr_NoMemory();
    5835           0 :                 return -1;
    5836             :         }
    5837           0 :         PY_CHECK_TYPE(GUID_Type, value, return -1;);
    5838           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5839           0 :                 PyErr_NoMemory();
    5840           0 :                 return -1;
    5841             :         }
    5842           0 :         object->in.epm_object = (struct GUID *)pytalloc_get_ptr(value);
    5843           0 :         return 0;
    5844             : }
    5845             : 
    5846           0 : static PyObject *py_epm_InqObject_get_result(PyObject *obj, void *closure)
    5847             : {
    5848           0 :         struct epm_InqObject *object = pytalloc_get_ptr(obj);
    5849           0 :         PyObject *py_result;
    5850           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    5851           0 :         return py_result;
    5852             : }
    5853             : 
    5854           0 : static int py_epm_InqObject_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5855             : {
    5856           0 :         struct epm_InqObject *object = pytalloc_get_ptr(py_obj);
    5857           0 :         if (value == NULL) {
    5858           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    5859           0 :                 return -1;
    5860             :         }
    5861             :         {
    5862           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    5863           0 :                 if (PyLong_Check(value)) {
    5864           0 :                         unsigned long long test_var;
    5865           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5866           0 :                         if (PyErr_Occurred() != NULL) {
    5867           0 :                                 return -1;
    5868             :                         }
    5869           0 :                         if (test_var > uint_max) {
    5870           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5871             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5872           0 :                                 return -1;
    5873             :                         }
    5874           0 :                         object->out.result = test_var;
    5875             :                 } else {
    5876           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5877             :                           PyLong_Type.tp_name);
    5878           0 :                         return -1;
    5879             :                 }
    5880             :         }
    5881           0 :         return 0;
    5882             : }
    5883             : 
    5884             : static PyGetSetDef py_epm_InqObject_getsetters[] = {
    5885             :         {
    5886             :                 .name = discard_const_p(char, "in_epm_object"),
    5887             :                 .get = py_epm_InqObject_in_get_epm_object,
    5888             :                 .set = py_epm_InqObject_in_set_epm_object,
    5889             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    5890             :         },
    5891             :         {
    5892             :                 .name = discard_const_p(char, "result"),
    5893             :                 .get = py_epm_InqObject_get_result,
    5894             :                 .set = py_epm_InqObject_set_result,
    5895             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    5896             :         },
    5897             :         { .name = NULL }
    5898             : };
    5899             : 
    5900           0 : static PyObject *py_epm_InqObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5901             : {
    5902           0 :         PyObject *self = pytalloc_new(struct epm_InqObject, type);
    5903           0 :         struct epm_InqObject *_self = (struct epm_InqObject *)pytalloc_get_ptr(self);
    5904           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    5905           0 :         _self->in.epm_object = talloc_zero(mem_ctx, struct GUID);
    5906           0 :         return self;
    5907             : }
    5908             : 
    5909           0 : static PyObject *py_epm_InqObject_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5910             : {
    5911             : 
    5912             : 
    5913           0 :         return PyLong_FromLong(5);
    5914             : }
    5915             : 
    5916           0 : static PyObject *py_epm_InqObject_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    5917             : {
    5918           0 :         const struct ndr_interface_call *call = NULL;
    5919           0 :         struct epm_InqObject *object = pytalloc_get_ptr(py_obj);
    5920           0 :         PyObject *ret = NULL;
    5921           0 :         struct ndr_push *push = NULL;
    5922           0 :         DATA_BLOB blob;
    5923           0 :         enum ndr_err_code err;
    5924             : 
    5925           0 :         if (ndr_table_epmapper.num_calls < 6) {
    5926           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_InqObject_ndr_pack");
    5927           0 :                 return NULL;
    5928             :         }
    5929           0 :         call = &ndr_table_epmapper.calls[5];
    5930             : 
    5931           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5932           0 :         if (push == NULL) {
    5933           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5934           0 :                 return NULL;
    5935             :         }
    5936             : 
    5937           0 :         push->flags |= ndr_push_flags;
    5938             : 
    5939           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5940           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5941           0 :                 TALLOC_FREE(push);
    5942           0 :                 PyErr_SetNdrError(err);
    5943           0 :                 return NULL;
    5944             :         }
    5945           0 :         blob = ndr_push_blob(push);
    5946           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5947           0 :         TALLOC_FREE(push);
    5948           0 :         return ret;
    5949             : }
    5950             : 
    5951           0 : static PyObject *py_epm_InqObject_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5952             : {
    5953           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5954           0 :         PyObject *bigendian_obj = NULL;
    5955           0 :         PyObject *ndr64_obj = NULL;
    5956           0 :         libndr_flags ndr_push_flags = 0;
    5957             : 
    5958           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5959             :                 discard_const_p(char *, kwnames),
    5960             :                 &bigendian_obj,
    5961             :                 &ndr64_obj)) {
    5962           0 :                 return NULL;
    5963             :         }
    5964             : 
    5965           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5966           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5967             :         }
    5968           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5969           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5970             :         }
    5971             : 
    5972           0 :         return py_epm_InqObject_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5973             : }
    5974             : 
    5975           0 : static PyObject *py_epm_InqObject_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5976             : {
    5977           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5978           0 :         PyObject *bigendian_obj = NULL;
    5979           0 :         PyObject *ndr64_obj = NULL;
    5980           0 :         libndr_flags ndr_push_flags = 0;
    5981             : 
    5982           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5983             :                 discard_const_p(char *, kwnames),
    5984             :                 &bigendian_obj,
    5985             :                 &ndr64_obj)) {
    5986           0 :                 return NULL;
    5987             :         }
    5988             : 
    5989           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5990           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5991             :         }
    5992           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5993           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5994             :         }
    5995             : 
    5996           0 :         return py_epm_InqObject_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5997             : }
    5998             : 
    5999           0 : static PyObject *py_epm_InqObject_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    6000             : {
    6001           0 :         const struct ndr_interface_call *call = NULL;
    6002           0 :         struct epm_InqObject *object = pytalloc_get_ptr(py_obj);
    6003           0 :         struct ndr_pull *pull = NULL;
    6004           0 :         enum ndr_err_code err;
    6005             : 
    6006           0 :         if (ndr_table_epmapper.num_calls < 6) {
    6007           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_InqObject_ndr_unpack");
    6008           0 :                 return NULL;
    6009             :         }
    6010           0 :         call = &ndr_table_epmapper.calls[5];
    6011             : 
    6012           0 :         pull = ndr_pull_init_blob(blob, object);
    6013           0 :         if (pull == NULL) {
    6014           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6015           0 :                 return NULL;
    6016             :         }
    6017             : 
    6018           0 :         pull->flags |= ndr_pull_flags;
    6019             : 
    6020           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6021           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6022           0 :                 TALLOC_FREE(pull);
    6023           0 :                 PyErr_SetNdrError(err);
    6024           0 :                 return NULL;
    6025             :         }
    6026           0 :         if (!allow_remaining) {
    6027           0 :                 uint32_t highest_ofs;
    6028             : 
    6029           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6030           0 :                         highest_ofs = pull->offset;
    6031             :                 } else {
    6032           0 :                         highest_ofs = pull->relative_highest_offset;
    6033             :                 }
    6034           0 :                 if (highest_ofs < pull->data_size) {
    6035           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6036             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6037             :                                 highest_ofs, pull->data_size);
    6038           0 :                         TALLOC_FREE(pull);
    6039           0 :                         PyErr_SetNdrError(err);
    6040           0 :                         return NULL;
    6041             :                 }
    6042             :         }
    6043             : 
    6044           0 :         TALLOC_FREE(pull);
    6045           0 :         Py_RETURN_NONE;
    6046             : }
    6047             : 
    6048           0 : static PyObject *py_epm_InqObject_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6049             : {
    6050           0 :         DATA_BLOB blob;
    6051           0 :         Py_ssize_t blob_length = 0;
    6052           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6053           0 :         PyObject *bigendian_obj = NULL;
    6054           0 :         PyObject *ndr64_obj = NULL;
    6055           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6056           0 :         PyObject *allow_remaining_obj = NULL;
    6057           0 :         bool allow_remaining = false;
    6058             : 
    6059           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6060             :                 discard_const_p(char *, kwnames),
    6061             :                 &blob.data, &blob_length,
    6062             :                 &bigendian_obj,
    6063             :                 &ndr64_obj,
    6064             :                 &allow_remaining_obj)) {
    6065           0 :                 return NULL;
    6066             :         }
    6067           0 :         blob.length = blob_length;
    6068             : 
    6069           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6070           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6071             :         }
    6072           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6073           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6074             :         }
    6075             : 
    6076           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6077           0 :                 allow_remaining = true;
    6078             :         }
    6079             : 
    6080           0 :         return py_epm_InqObject_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6081             : }
    6082             : 
    6083           0 : static PyObject *py_epm_InqObject_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6084             : {
    6085           0 :         DATA_BLOB blob;
    6086           0 :         Py_ssize_t blob_length = 0;
    6087           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6088           0 :         PyObject *bigendian_obj = NULL;
    6089           0 :         PyObject *ndr64_obj = NULL;
    6090           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6091           0 :         PyObject *allow_remaining_obj = NULL;
    6092           0 :         bool allow_remaining = false;
    6093             : 
    6094           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6095             :                 discard_const_p(char *, kwnames),
    6096             :                 &blob.data, &blob_length,
    6097             :                 &bigendian_obj,
    6098             :                 &ndr64_obj,
    6099             :                 &allow_remaining_obj)) {
    6100           0 :                 return NULL;
    6101             :         }
    6102           0 :         blob.length = blob_length;
    6103             : 
    6104           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6105           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6106             :         }
    6107           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6108           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6109             :         }
    6110             : 
    6111           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6112           0 :                 allow_remaining = true;
    6113             :         }
    6114             : 
    6115           0 :         return py_epm_InqObject_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6116             : }
    6117             : 
    6118           0 : static PyObject *py_epm_InqObject_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    6119             : {
    6120           0 :         const struct ndr_interface_call *call = NULL;
    6121           0 :         struct epm_InqObject *object = pytalloc_get_ptr(py_obj);
    6122           0 :         PyObject *ret;
    6123           0 :         char *retstr;
    6124             : 
    6125           0 :         if (ndr_table_epmapper.num_calls < 6) {
    6126           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_InqObject_ndr_print");
    6127           0 :                 return NULL;
    6128             :         }
    6129           0 :         call = &ndr_table_epmapper.calls[5];
    6130             : 
    6131           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6132           0 :         ret = PyUnicode_FromString(retstr);
    6133           0 :         TALLOC_FREE(retstr);
    6134             : 
    6135           0 :         return ret;
    6136             : }
    6137             : 
    6138           0 : static PyObject *py_epm_InqObject_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6139             : {
    6140           0 :         return py_epm_InqObject_ndr_print(py_obj, "epm_InqObject_in", NDR_IN);
    6141             : }
    6142             : 
    6143           0 : static PyObject *py_epm_InqObject_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6144             : {
    6145           0 :         return py_epm_InqObject_ndr_print(py_obj, "epm_InqObject_out", NDR_OUT);
    6146             : }
    6147             : 
    6148             : static PyMethodDef py_epm_InqObject_methods[] = {
    6149             :         { "opnum", (PyCFunction)py_epm_InqObject_ndr_opnum, METH_NOARGS|METH_CLASS,
    6150             :                 "epmapper.epm_InqObject.opnum() -> 5 (0x05) " },
    6151             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6152             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6153             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6154             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6155             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6156             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6157             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6158             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6159             :         { "__ndr_print_in__", (PyCFunction)py_epm_InqObject_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6160             :         { "__ndr_print_out__", (PyCFunction)py_epm_InqObject_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6161             :         { NULL, NULL, 0, NULL }
    6162             : };
    6163             : 
    6164             : 
    6165             : static PyTypeObject epm_InqObject_Type = {
    6166             :         PyVarObject_HEAD_INIT(NULL, 0)
    6167             :         .tp_name = "epmapper.epm_InqObject",
    6168             :         .tp_getset = py_epm_InqObject_getsetters,
    6169             :         .tp_methods = py_epm_InqObject_methods,
    6170             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6171             :         .tp_new = py_epm_InqObject_new,
    6172             : };
    6173             : 
    6174           0 : static bool pack_py_epm_InqObject_args_in(PyObject *args, PyObject *kwargs, struct epm_InqObject *r)
    6175             : {
    6176           0 :         PyObject *py_epm_object;
    6177           0 :         const char *kwnames[] = {
    6178             :                 "epm_object", NULL
    6179             :         };
    6180             : 
    6181           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_InqObject", discard_const_p(char *, kwnames), &py_epm_object)) {
    6182           0 :                 return false;
    6183             :         }
    6184             : 
    6185           0 :         if (py_epm_object == NULL) {
    6186           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.epm_object");
    6187           0 :                 return false;
    6188             :         }
    6189           0 :         r->in.epm_object = talloc_ptrtype(r, r->in.epm_object);
    6190           0 :         if (r->in.epm_object == NULL) {
    6191           0 :                 PyErr_NoMemory();
    6192           0 :                 return false;
    6193             :         }
    6194           0 :         PY_CHECK_TYPE(GUID_Type, py_epm_object, return false;);
    6195           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_epm_object)) == NULL) {
    6196           0 :                 PyErr_NoMemory();
    6197           0 :                 return false;
    6198             :         }
    6199           0 :         r->in.epm_object = (struct GUID *)pytalloc_get_ptr(py_epm_object);
    6200           0 :         return true;
    6201             : }
    6202             : 
    6203           0 : static PyObject *unpack_py_epm_InqObject_args_out(struct epm_InqObject *r)
    6204             : {
    6205           0 :         PyObject *result;
    6206           0 :         result = PyLong_FromUnsignedLongLong((uint32_t)(r->out.result));
    6207           0 :         return result;
    6208             : }
    6209             : 
    6210             : 
    6211           0 : static PyObject *py_epm_MgmtDelete_in_get_object_speced(PyObject *obj, void *closure)
    6212             : {
    6213           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(obj);
    6214           0 :         PyObject *py_object_speced;
    6215           0 :         py_object_speced = PyLong_FromUnsignedLongLong((uint32_t)(object->in.object_speced));
    6216           0 :         return py_object_speced;
    6217             : }
    6218             : 
    6219           0 : static int py_epm_MgmtDelete_in_set_object_speced(PyObject *py_obj, PyObject *value, void *closure)
    6220             : {
    6221           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6222           0 :         if (value == NULL) {
    6223           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.object_speced");
    6224           0 :                 return -1;
    6225             :         }
    6226             :         {
    6227           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.object_speced));
    6228           0 :                 if (PyLong_Check(value)) {
    6229           0 :                         unsigned long long test_var;
    6230           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6231           0 :                         if (PyErr_Occurred() != NULL) {
    6232           0 :                                 return -1;
    6233             :                         }
    6234           0 :                         if (test_var > uint_max) {
    6235           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    6236             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6237           0 :                                 return -1;
    6238             :                         }
    6239           0 :                         object->in.object_speced = test_var;
    6240             :                 } else {
    6241           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    6242             :                           PyLong_Type.tp_name);
    6243           0 :                         return -1;
    6244             :                 }
    6245             :         }
    6246           0 :         return 0;
    6247             : }
    6248             : 
    6249           0 : static PyObject *py_epm_MgmtDelete_in_get_object(PyObject *obj, void *closure)
    6250             : {
    6251           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(obj);
    6252           0 :         PyObject *py_object;
    6253           0 :         if (object->in.object == NULL) {
    6254           0 :                 Py_RETURN_NONE;
    6255             :         }
    6256           0 :         if (object->in.object == NULL) {
    6257           0 :                 py_object = Py_None;
    6258           0 :                 Py_INCREF(py_object);
    6259             :         } else {
    6260           0 :                 py_object = pytalloc_reference_ex(GUID_Type, object->in.object, object->in.object);
    6261             :         }
    6262           0 :         return py_object;
    6263             : }
    6264             : 
    6265           0 : static int py_epm_MgmtDelete_in_set_object(PyObject *py_obj, PyObject *value, void *closure)
    6266             : {
    6267           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6268           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.object));
    6269           0 :         if (value == NULL) {
    6270           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.object");
    6271           0 :                 return -1;
    6272             :         }
    6273           0 :         if (value == Py_None) {
    6274           0 :                 object->in.object = NULL;
    6275             :         } else {
    6276           0 :                 object->in.object = NULL;
    6277           0 :                 PY_CHECK_TYPE(GUID_Type, value, return -1;);
    6278           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6279           0 :                         PyErr_NoMemory();
    6280           0 :                         return -1;
    6281             :                 }
    6282           0 :                 object->in.object = (struct GUID *)pytalloc_get_ptr(value);
    6283             :         }
    6284           0 :         return 0;
    6285             : }
    6286             : 
    6287           0 : static PyObject *py_epm_MgmtDelete_in_get_tower(PyObject *obj, void *closure)
    6288             : {
    6289           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(obj);
    6290           0 :         PyObject *py_tower;
    6291           0 :         if (object->in.tower == NULL) {
    6292           0 :                 Py_RETURN_NONE;
    6293             :         }
    6294           0 :         if (object->in.tower == NULL) {
    6295           0 :                 py_tower = Py_None;
    6296           0 :                 Py_INCREF(py_tower);
    6297             :         } else {
    6298           0 :                 py_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->in.tower, object->in.tower);
    6299             :         }
    6300           0 :         return py_tower;
    6301             : }
    6302             : 
    6303           0 : static int py_epm_MgmtDelete_in_set_tower(PyObject *py_obj, PyObject *value, void *closure)
    6304             : {
    6305           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6306           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.tower));
    6307           0 :         if (value == NULL) {
    6308           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.tower");
    6309           0 :                 return -1;
    6310             :         }
    6311           0 :         if (value == Py_None) {
    6312           0 :                 object->in.tower = NULL;
    6313             :         } else {
    6314           0 :                 object->in.tower = NULL;
    6315           0 :                 PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
    6316           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6317           0 :                         PyErr_NoMemory();
    6318           0 :                         return -1;
    6319             :                 }
    6320           0 :                 object->in.tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
    6321             :         }
    6322           0 :         return 0;
    6323             : }
    6324             : 
    6325           0 : static PyObject *py_epm_MgmtDelete_get_result(PyObject *obj, void *closure)
    6326             : {
    6327           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(obj);
    6328           0 :         PyObject *py_result;
    6329           0 :         py_result = PyLong_FromUnsignedLongLong((uint32_t)(object->out.result));
    6330           0 :         return py_result;
    6331             : }
    6332             : 
    6333           0 : static int py_epm_MgmtDelete_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6334             : {
    6335           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6336           0 :         if (value == NULL) {
    6337           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
    6338           0 :                 return -1;
    6339             :         }
    6340             :         {
    6341           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
    6342           0 :                 if (PyLong_Check(value)) {
    6343           0 :                         unsigned long long test_var;
    6344           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6345           0 :                         if (PyErr_Occurred() != NULL) {
    6346           0 :                                 return -1;
    6347             :                         }
    6348           0 :                         if (test_var > uint_max) {
    6349           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    6350             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6351           0 :                                 return -1;
    6352             :                         }
    6353           0 :                         object->out.result = test_var;
    6354             :                 } else {
    6355           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    6356             :                           PyLong_Type.tp_name);
    6357           0 :                         return -1;
    6358             :                 }
    6359             :         }
    6360           0 :         return 0;
    6361             : }
    6362             : 
    6363             : static PyGetSetDef py_epm_MgmtDelete_getsetters[] = {
    6364             :         {
    6365             :                 .name = discard_const_p(char, "in_object_speced"),
    6366             :                 .get = py_epm_MgmtDelete_in_get_object_speced,
    6367             :                 .set = py_epm_MgmtDelete_in_set_object_speced,
    6368             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6369             :         },
    6370             :         {
    6371             :                 .name = discard_const_p(char, "in_object"),
    6372             :                 .get = py_epm_MgmtDelete_in_get_object,
    6373             :                 .set = py_epm_MgmtDelete_in_set_object,
    6374             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
    6375             :         },
    6376             :         {
    6377             :                 .name = discard_const_p(char, "in_tower"),
    6378             :                 .get = py_epm_MgmtDelete_in_get_tower,
    6379             :                 .set = py_epm_MgmtDelete_in_set_tower,
    6380             :                 .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
    6381             :         },
    6382             :         {
    6383             :                 .name = discard_const_p(char, "result"),
    6384             :                 .get = py_epm_MgmtDelete_get_result,
    6385             :                 .set = py_epm_MgmtDelete_set_result,
    6386             :                 .doc = discard_const_p(char, "PIDL-generated element of type uint32")
    6387             :         },
    6388             :         { .name = NULL }
    6389             : };
    6390             : 
    6391           0 : static PyObject *py_epm_MgmtDelete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6392             : {
    6393           0 :         PyObject *self = pytalloc_new(struct epm_MgmtDelete, type);
    6394           0 :         return self;
    6395             : }
    6396             : 
    6397           0 : static PyObject *py_epm_MgmtDelete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6398             : {
    6399             : 
    6400             : 
    6401           0 :         return PyLong_FromLong(6);
    6402             : }
    6403             : 
    6404           0 : static PyObject *py_epm_MgmtDelete_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
    6405             : {
    6406           0 :         const struct ndr_interface_call *call = NULL;
    6407           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6408           0 :         PyObject *ret = NULL;
    6409           0 :         struct ndr_push *push = NULL;
    6410           0 :         DATA_BLOB blob;
    6411           0 :         enum ndr_err_code err;
    6412             : 
    6413           0 :         if (ndr_table_epmapper.num_calls < 7) {
    6414           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_MgmtDelete_ndr_pack");
    6415           0 :                 return NULL;
    6416             :         }
    6417           0 :         call = &ndr_table_epmapper.calls[6];
    6418             : 
    6419           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6420           0 :         if (push == NULL) {
    6421           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6422           0 :                 return NULL;
    6423             :         }
    6424             : 
    6425           0 :         push->flags |= ndr_push_flags;
    6426             : 
    6427           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6428           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6429           0 :                 TALLOC_FREE(push);
    6430           0 :                 PyErr_SetNdrError(err);
    6431           0 :                 return NULL;
    6432             :         }
    6433           0 :         blob = ndr_push_blob(push);
    6434           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6435           0 :         TALLOC_FREE(push);
    6436           0 :         return ret;
    6437             : }
    6438             : 
    6439           0 : static PyObject *py_epm_MgmtDelete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6440             : {
    6441           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6442           0 :         PyObject *bigendian_obj = NULL;
    6443           0 :         PyObject *ndr64_obj = NULL;
    6444           0 :         libndr_flags ndr_push_flags = 0;
    6445             : 
    6446           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6447             :                 discard_const_p(char *, kwnames),
    6448             :                 &bigendian_obj,
    6449             :                 &ndr64_obj)) {
    6450           0 :                 return NULL;
    6451             :         }
    6452             : 
    6453           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6454           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6455             :         }
    6456           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6457           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6458             :         }
    6459             : 
    6460           0 :         return py_epm_MgmtDelete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6461             : }
    6462             : 
    6463           0 : static PyObject *py_epm_MgmtDelete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6464             : {
    6465           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6466           0 :         PyObject *bigendian_obj = NULL;
    6467           0 :         PyObject *ndr64_obj = NULL;
    6468           0 :         libndr_flags ndr_push_flags = 0;
    6469             : 
    6470           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6471             :                 discard_const_p(char *, kwnames),
    6472             :                 &bigendian_obj,
    6473             :                 &ndr64_obj)) {
    6474           0 :                 return NULL;
    6475             :         }
    6476             : 
    6477           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6478           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6479             :         }
    6480           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6481           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6482             :         }
    6483             : 
    6484           0 :         return py_epm_MgmtDelete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6485             : }
    6486             : 
    6487           0 : static PyObject *py_epm_MgmtDelete_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
    6488             : {
    6489           0 :         const struct ndr_interface_call *call = NULL;
    6490           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6491           0 :         struct ndr_pull *pull = NULL;
    6492           0 :         enum ndr_err_code err;
    6493             : 
    6494           0 :         if (ndr_table_epmapper.num_calls < 7) {
    6495           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_MgmtDelete_ndr_unpack");
    6496           0 :                 return NULL;
    6497             :         }
    6498           0 :         call = &ndr_table_epmapper.calls[6];
    6499             : 
    6500           0 :         pull = ndr_pull_init_blob(blob, object);
    6501           0 :         if (pull == NULL) {
    6502           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6503           0 :                 return NULL;
    6504             :         }
    6505             : 
    6506           0 :         pull->flags |= ndr_pull_flags;
    6507             : 
    6508           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6509           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6510           0 :                 TALLOC_FREE(pull);
    6511           0 :                 PyErr_SetNdrError(err);
    6512           0 :                 return NULL;
    6513             :         }
    6514           0 :         if (!allow_remaining) {
    6515           0 :                 uint32_t highest_ofs;
    6516             : 
    6517           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6518           0 :                         highest_ofs = pull->offset;
    6519             :                 } else {
    6520           0 :                         highest_ofs = pull->relative_highest_offset;
    6521             :                 }
    6522           0 :                 if (highest_ofs < pull->data_size) {
    6523           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6524             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6525             :                                 highest_ofs, pull->data_size);
    6526           0 :                         TALLOC_FREE(pull);
    6527           0 :                         PyErr_SetNdrError(err);
    6528           0 :                         return NULL;
    6529             :                 }
    6530             :         }
    6531             : 
    6532           0 :         TALLOC_FREE(pull);
    6533           0 :         Py_RETURN_NONE;
    6534             : }
    6535             : 
    6536           0 : static PyObject *py_epm_MgmtDelete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6537             : {
    6538           0 :         DATA_BLOB blob;
    6539           0 :         Py_ssize_t blob_length = 0;
    6540           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6541           0 :         PyObject *bigendian_obj = NULL;
    6542           0 :         PyObject *ndr64_obj = NULL;
    6543           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6544           0 :         PyObject *allow_remaining_obj = NULL;
    6545           0 :         bool allow_remaining = false;
    6546             : 
    6547           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6548             :                 discard_const_p(char *, kwnames),
    6549             :                 &blob.data, &blob_length,
    6550             :                 &bigendian_obj,
    6551             :                 &ndr64_obj,
    6552             :                 &allow_remaining_obj)) {
    6553           0 :                 return NULL;
    6554             :         }
    6555           0 :         blob.length = blob_length;
    6556             : 
    6557           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6558           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6559             :         }
    6560           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6561           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6562             :         }
    6563             : 
    6564           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6565           0 :                 allow_remaining = true;
    6566             :         }
    6567             : 
    6568           0 :         return py_epm_MgmtDelete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6569             : }
    6570             : 
    6571           0 : static PyObject *py_epm_MgmtDelete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6572             : {
    6573           0 :         DATA_BLOB blob;
    6574           0 :         Py_ssize_t blob_length = 0;
    6575           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6576           0 :         PyObject *bigendian_obj = NULL;
    6577           0 :         PyObject *ndr64_obj = NULL;
    6578           0 :         libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6579           0 :         PyObject *allow_remaining_obj = NULL;
    6580           0 :         bool allow_remaining = false;
    6581             : 
    6582           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6583             :                 discard_const_p(char *, kwnames),
    6584             :                 &blob.data, &blob_length,
    6585             :                 &bigendian_obj,
    6586             :                 &ndr64_obj,
    6587             :                 &allow_remaining_obj)) {
    6588           0 :                 return NULL;
    6589             :         }
    6590           0 :         blob.length = blob_length;
    6591             : 
    6592           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6593           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6594             :         }
    6595           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6596           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6597             :         }
    6598             : 
    6599           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6600           0 :                 allow_remaining = true;
    6601             :         }
    6602             : 
    6603           0 :         return py_epm_MgmtDelete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6604             : }
    6605             : 
    6606           0 : static PyObject *py_epm_MgmtDelete_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
    6607             : {
    6608           0 :         const struct ndr_interface_call *call = NULL;
    6609           0 :         struct epm_MgmtDelete *object = pytalloc_get_ptr(py_obj);
    6610           0 :         PyObject *ret;
    6611           0 :         char *retstr;
    6612             : 
    6613           0 :         if (ndr_table_epmapper.num_calls < 7) {
    6614           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_MgmtDelete_ndr_print");
    6615           0 :                 return NULL;
    6616             :         }
    6617           0 :         call = &ndr_table_epmapper.calls[6];
    6618             : 
    6619           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6620           0 :         ret = PyUnicode_FromString(retstr);
    6621           0 :         TALLOC_FREE(retstr);
    6622             : 
    6623           0 :         return ret;
    6624             : }
    6625             : 
    6626           0 : static PyObject *py_epm_MgmtDelete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6627             : {
    6628           0 :         return py_epm_MgmtDelete_ndr_print(py_obj, "epm_MgmtDelete_in", NDR_IN);
    6629             : }
    6630             : 
    6631           0 : static PyObject *py_epm_MgmtDelete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6632             : {
    6633           0 :         return py_epm_MgmtDelete_ndr_print(py_obj, "epm_MgmtDelete_out", NDR_OUT);
    6634             : }
    6635             : 
    6636             : static PyMethodDef py_epm_MgmtDelete_methods[] = {
    6637             :         { "opnum", (PyCFunction)py_epm_MgmtDelete_ndr_opnum, METH_NOARGS|METH_CLASS,
    6638             :                 "epmapper.epm_MgmtDelete.opnum() -> 6 (0x06) " },
    6639             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6640             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6641             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6642             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6643             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6644             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6645             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6646             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6647             :         { "__ndr_print_in__", (PyCFunction)py_epm_MgmtDelete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6648             :         { "__ndr_print_out__", (PyCFunction)py_epm_MgmtDelete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6649             :         { NULL, NULL, 0, NULL }
    6650             : };
    6651             : 
    6652             : 
    6653             : static PyTypeObject epm_MgmtDelete_Type = {
    6654             :         PyVarObject_HEAD_INIT(NULL, 0)
    6655             :         .tp_name = "epmapper.epm_MgmtDelete",
    6656             :         .tp_getset = py_epm_MgmtDelete_getsetters,
    6657             :         .tp_methods = py_epm_MgmtDelete_methods,
    6658             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6659             :         .tp_new = py_epm_MgmtDelete_new,
    6660             : };
    6661             : 
    6662           0 : static bool pack_py_epm_MgmtDelete_args_in(PyObject *args, PyObject *kwargs, struct epm_MgmtDelete *r)
    6663             : {
    6664           0 :         PyObject *py_object_speced;
    6665           0 :         PyObject *py_object;
    6666           0 :         PyObject *py_tower;
    6667           0 :         const char *kwnames[] = {
    6668             :                 "object_speced", "object", "tower", NULL
    6669             :         };
    6670             : 
    6671           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:epm_MgmtDelete", discard_const_p(char *, kwnames), &py_object_speced, &py_object, &py_tower)) {
    6672           0 :                 return false;
    6673             :         }
    6674             : 
    6675           0 :         if (py_object_speced == NULL) {
    6676           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.object_speced");
    6677           0 :                 return false;
    6678             :         }
    6679             :         {
    6680           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.object_speced));
    6681           0 :                 if (PyLong_Check(py_object_speced)) {
    6682           0 :                         unsigned long long test_var;
    6683           0 :                         test_var = PyLong_AsUnsignedLongLong(py_object_speced);
    6684           0 :                         if (PyErr_Occurred() != NULL) {
    6685           0 :                                 return false;
    6686             :                         }
    6687           0 :                         if (test_var > uint_max) {
    6688           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    6689             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6690           0 :                                 return false;
    6691             :                         }
    6692           0 :                         r->in.object_speced = test_var;
    6693             :                 } else {
    6694           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    6695             :                           PyLong_Type.tp_name);
    6696           0 :                         return false;
    6697             :                 }
    6698             :         }
    6699           0 :         if (py_object == NULL) {
    6700           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.object");
    6701           0 :                 return false;
    6702             :         }
    6703           0 :         if (py_object == Py_None) {
    6704           0 :                 r->in.object = NULL;
    6705             :         } else {
    6706           0 :                 r->in.object = NULL;
    6707           0 :                 PY_CHECK_TYPE(GUID_Type, py_object, return false;);
    6708           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
    6709           0 :                         PyErr_NoMemory();
    6710           0 :                         return false;
    6711             :                 }
    6712           0 :                 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
    6713             :         }
    6714           0 :         if (py_tower == NULL) {
    6715           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.tower");
    6716           0 :                 return false;
    6717             :         }
    6718           0 :         if (py_tower == Py_None) {
    6719           0 :                 r->in.tower = NULL;
    6720             :         } else {
    6721           0 :                 r->in.tower = NULL;
    6722           0 :                 PY_CHECK_TYPE(&epm_twr_t_Type, py_tower, return false;);
    6723           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_tower)) == NULL) {
    6724           0 :                         PyErr_NoMemory();
    6725           0 :                         return false;
    6726             :                 }
    6727           0 :                 r->in.tower = (struct epm_twr_t *)pytalloc_get_ptr(py_tower);
    6728             :         }
    6729           0 :         return true;
    6730             : }
    6731             : 
    6732           0 : static PyObject *unpack_py_epm_MgmtDelete_args_out(struct epm_MgmtDelete *r)
    6733             : {
    6734           0 :         PyObject *result;
    6735           0 :         result = PyLong_FromUnsignedLongLong((uint32_t)(r->out.result));
    6736           0 :         return result;
    6737             : }
    6738             : 
    6739             : const struct PyNdrRpcMethodDef py_ndr_epmapper_methods[] = {
    6740             :         { "epm_Insert", "S.epm_Insert(entries, replace) -> result", (py_dcerpc_call_fn)dcerpc_epm_Insert_r, (py_data_pack_fn)pack_py_epm_Insert_args_in, (py_data_unpack_fn)unpack_py_epm_Insert_args_out, 0, &ndr_table_epmapper },
    6741             :         { "epm_Delete", "S.epm_Delete(entries) -> result", (py_dcerpc_call_fn)dcerpc_epm_Delete_r, (py_data_pack_fn)pack_py_epm_Delete_args_in, (py_data_unpack_fn)unpack_py_epm_Delete_args_out, 1, &ndr_table_epmapper },
    6742             :         { "epm_Lookup", "S.epm_Lookup(inquiry_type, object, interface_id, vers_option, entry_handle, max_ents) -> (entry_handle, entries, result)", (py_dcerpc_call_fn)dcerpc_epm_Lookup_r, (py_data_pack_fn)pack_py_epm_Lookup_args_in, (py_data_unpack_fn)unpack_py_epm_Lookup_args_out, 2, &ndr_table_epmapper },
    6743             :         { "epm_Map", "S.epm_Map(object, map_tower, entry_handle, max_towers) -> (entry_handle, towers, result)", (py_dcerpc_call_fn)dcerpc_epm_Map_r, (py_data_pack_fn)pack_py_epm_Map_args_in, (py_data_unpack_fn)unpack_py_epm_Map_args_out, 3, &ndr_table_epmapper },
    6744             :         { "epm_LookupHandleFree", "S.epm_LookupHandleFree(entry_handle) -> (entry_handle, result)", (py_dcerpc_call_fn)dcerpc_epm_LookupHandleFree_r, (py_data_pack_fn)pack_py_epm_LookupHandleFree_args_in, (py_data_unpack_fn)unpack_py_epm_LookupHandleFree_args_out, 4, &ndr_table_epmapper },
    6745             :         { "epm_InqObject", "S.epm_InqObject(epm_object) -> result", (py_dcerpc_call_fn)dcerpc_epm_InqObject_r, (py_data_pack_fn)pack_py_epm_InqObject_args_in, (py_data_unpack_fn)unpack_py_epm_InqObject_args_out, 5, &ndr_table_epmapper },
    6746             :         { "epm_MgmtDelete", "S.epm_MgmtDelete(object_speced, object, tower) -> result", (py_dcerpc_call_fn)dcerpc_epm_MgmtDelete_r, (py_data_pack_fn)pack_py_epm_MgmtDelete_args_in, (py_data_unpack_fn)unpack_py_epm_MgmtDelete_args_out, 6, &ndr_table_epmapper },
    6747             :         {0}
    6748             : };
    6749             : 
    6750           0 : static PyObject *interface_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6751             : {
    6752           0 :         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_epmapper);
    6753             : }
    6754             : 
    6755             : #define PY_DOC_EPMAPPER "EndPoint Mapper"
    6756             : static PyTypeObject epmapper_InterfaceType = {
    6757             :         PyVarObject_HEAD_INIT(NULL, 0)
    6758             :         .tp_name = "epmapper.epmapper",
    6759             :         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
    6760             :         .tp_doc = "epmapper(binding, lp_ctx=None, credentials=None) -> connection\n"
    6761             : "\n"
    6762             : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
    6763             : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
    6764             : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_EPMAPPER,
    6765             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6766             :         .tp_new = interface_epmapper_new,
    6767             : };
    6768             : 
    6769          57 : static PyObject *syntax_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6770             : {
    6771          57 :         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_epmapper.syntax_id);
    6772             : }
    6773             : 
    6774             : #define PY_DOC_EPMAPPER_SYNTAX "EndPoint Mapper"
    6775             : static PyTypeObject epmapper_SyntaxType = {
    6776             :         PyVarObject_HEAD_INIT(NULL, 0)
    6777             :         .tp_name = "epmapper.epmapper_abstract_syntax",
    6778             :         .tp_doc = "epmapper_abstract_syntax()\n"PY_DOC_EPMAPPER_SYNTAX,
    6779             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6780             :         .tp_new = syntax_epmapper_new,
    6781             : };
    6782             : 
    6783             : static PyMethodDef epmapper_methods[] = {
    6784             :         { NULL, NULL, 0, NULL }
    6785             : };
    6786             : 
    6787             : static struct PyModuleDef moduledef = {
    6788             :         PyModuleDef_HEAD_INIT,
    6789             :         .m_name = "epmapper",
    6790             :         .m_doc = "epmapper DCE/RPC",
    6791             :         .m_size = -1,
    6792             :         .m_methods = epmapper_methods,
    6793             : };
    6794         698 : MODULE_INIT_FUNC(epmapper)
    6795             : {
    6796         698 :         PyObject *m = NULL;
    6797         698 :         PyObject *dep_samba_dcerpc_misc = NULL;
    6798         698 :         PyObject *dep_talloc = NULL;
    6799         698 :         PyObject *dep_samba_dcerpc_base = NULL;
    6800             : 
    6801         698 :         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
    6802         698 :         if (dep_samba_dcerpc_misc == NULL)
    6803           0 :                 goto out;
    6804             : 
    6805         698 :         dep_talloc = PyImport_ImportModule("talloc");
    6806         698 :         if (dep_talloc == NULL)
    6807           0 :                 goto out;
    6808             : 
    6809         698 :         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
    6810         698 :         if (dep_samba_dcerpc_base == NULL)
    6811           0 :                 goto out;
    6812             : 
    6813         698 :         BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
    6814         698 :         if (BaseObject_Type == NULL)
    6815           0 :                 goto out;
    6816             : 
    6817         698 :         GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
    6818         698 :         if (GUID_Type == NULL)
    6819           0 :                 goto out;
    6820             : 
    6821         698 :         policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
    6822         698 :         if (policy_handle_Type == NULL)
    6823           0 :                 goto out;
    6824             : 
    6825         698 :         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
    6826         698 :         if (ClientConnection_Type == NULL)
    6827           0 :                 goto out;
    6828             : 
    6829         698 :         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
    6830         698 :         if (ndr_syntax_id_Type == NULL)
    6831           0 :                 goto out;
    6832             : 
    6833         698 :         epm_rhs_dnet_nsp_Type.tp_base = BaseObject_Type;
    6834         698 :         epm_rhs_dnet_nsp_Type.tp_basicsize = pytalloc_BaseObject_size();
    6835             : 
    6836         698 :         epm_rhs_osi_tp4_Type.tp_base = BaseObject_Type;
    6837         698 :         epm_rhs_osi_tp4_Type.tp_basicsize = pytalloc_BaseObject_size();
    6838             : 
    6839         698 :         epm_rhs_osi_clns_Type.tp_base = BaseObject_Type;
    6840         698 :         epm_rhs_osi_clns_Type.tp_basicsize = pytalloc_BaseObject_size();
    6841             : 
    6842         698 :         epm_rhs_udp_Type.tp_base = BaseObject_Type;
    6843         698 :         epm_rhs_udp_Type.tp_basicsize = pytalloc_BaseObject_size();
    6844             : 
    6845         698 :         epm_rhs_tcp_Type.tp_base = BaseObject_Type;
    6846         698 :         epm_rhs_tcp_Type.tp_basicsize = pytalloc_BaseObject_size();
    6847             : 
    6848         698 :         epm_rhs_ip_Type.tp_base = BaseObject_Type;
    6849         698 :         epm_rhs_ip_Type.tp_basicsize = pytalloc_BaseObject_size();
    6850             : 
    6851         698 :         epm_rhs_ncadg_Type.tp_base = BaseObject_Type;
    6852         698 :         epm_rhs_ncadg_Type.tp_basicsize = pytalloc_BaseObject_size();
    6853             : 
    6854         698 :         epm_rhs_ncacn_Type.tp_base = BaseObject_Type;
    6855         698 :         epm_rhs_ncacn_Type.tp_basicsize = pytalloc_BaseObject_size();
    6856             : 
    6857         698 :         epm_rhs_uuid_Type.tp_base = BaseObject_Type;
    6858         698 :         epm_rhs_uuid_Type.tp_basicsize = pytalloc_BaseObject_size();
    6859             : 
    6860         698 :         epm_rhs_ipx_Type.tp_base = BaseObject_Type;
    6861         698 :         epm_rhs_ipx_Type.tp_basicsize = pytalloc_BaseObject_size();
    6862             : 
    6863         698 :         epm_rhs_smb_Type.tp_base = BaseObject_Type;
    6864         698 :         epm_rhs_smb_Type.tp_basicsize = pytalloc_BaseObject_size();
    6865             : 
    6866         698 :         epm_rhs_named_pipe_Type.tp_base = BaseObject_Type;
    6867         698 :         epm_rhs_named_pipe_Type.tp_basicsize = pytalloc_BaseObject_size();
    6868             : 
    6869         698 :         epm_rhs_netbios_Type.tp_base = BaseObject_Type;
    6870         698 :         epm_rhs_netbios_Type.tp_basicsize = pytalloc_BaseObject_size();
    6871             : 
    6872         698 :         epm_rhs_netbeui_Type.tp_base = BaseObject_Type;
    6873         698 :         epm_rhs_netbeui_Type.tp_basicsize = pytalloc_BaseObject_size();
    6874             : 
    6875         698 :         epm_rhs_spx_Type.tp_base = BaseObject_Type;
    6876         698 :         epm_rhs_spx_Type.tp_basicsize = pytalloc_BaseObject_size();
    6877             : 
    6878         698 :         epm_rhs_nb_ipx_Type.tp_base = BaseObject_Type;
    6879         698 :         epm_rhs_nb_ipx_Type.tp_basicsize = pytalloc_BaseObject_size();
    6880             : 
    6881         698 :         epm_rhs_http_Type.tp_base = BaseObject_Type;
    6882         698 :         epm_rhs_http_Type.tp_basicsize = pytalloc_BaseObject_size();
    6883             : 
    6884         698 :         epm_rhs_unix_ds_Type.tp_base = BaseObject_Type;
    6885         698 :         epm_rhs_unix_ds_Type.tp_basicsize = pytalloc_BaseObject_size();
    6886             : 
    6887         698 :         epm_rhs_null_Type.tp_base = BaseObject_Type;
    6888         698 :         epm_rhs_null_Type.tp_basicsize = pytalloc_BaseObject_size();
    6889             : 
    6890         698 :         epm_rhs_ncalrpc_Type.tp_base = BaseObject_Type;
    6891         698 :         epm_rhs_ncalrpc_Type.tp_basicsize = pytalloc_BaseObject_size();
    6892             : 
    6893         698 :         epm_rhs_appletalk_Type.tp_base = BaseObject_Type;
    6894         698 :         epm_rhs_appletalk_Type.tp_basicsize = pytalloc_BaseObject_size();
    6895             : 
    6896         698 :         epm_rhs_atalk_stream_Type.tp_base = BaseObject_Type;
    6897         698 :         epm_rhs_atalk_stream_Type.tp_basicsize = pytalloc_BaseObject_size();
    6898             : 
    6899         698 :         epm_rhs_atalk_datagram_Type.tp_base = BaseObject_Type;
    6900         698 :         epm_rhs_atalk_datagram_Type.tp_basicsize = pytalloc_BaseObject_size();
    6901             : 
    6902         698 :         epm_rhs_vines_spp_Type.tp_base = BaseObject_Type;
    6903         698 :         epm_rhs_vines_spp_Type.tp_basicsize = pytalloc_BaseObject_size();
    6904             : 
    6905         698 :         epm_rhs_vines_ipc_Type.tp_base = BaseObject_Type;
    6906         698 :         epm_rhs_vines_ipc_Type.tp_basicsize = pytalloc_BaseObject_size();
    6907             : 
    6908         698 :         epm_rhs_streettalk_Type.tp_base = BaseObject_Type;
    6909         698 :         epm_rhs_streettalk_Type.tp_basicsize = pytalloc_BaseObject_size();
    6910             : 
    6911         698 :         epm_rhs_Type.tp_base = BaseObject_Type;
    6912         698 :         epm_rhs_Type.tp_basicsize = pytalloc_BaseObject_size();
    6913             : 
    6914         698 :         epm_lhs_Type.tp_base = BaseObject_Type;
    6915         698 :         epm_lhs_Type.tp_basicsize = pytalloc_BaseObject_size();
    6916             : 
    6917         698 :         epm_floor_Type.tp_base = BaseObject_Type;
    6918         698 :         epm_floor_Type.tp_basicsize = pytalloc_BaseObject_size();
    6919             : 
    6920         698 :         epm_tower_Type.tp_base = BaseObject_Type;
    6921         698 :         epm_tower_Type.tp_basicsize = pytalloc_BaseObject_size();
    6922             : 
    6923         698 :         epm_twr_t_Type.tp_base = BaseObject_Type;
    6924         698 :         epm_twr_t_Type.tp_basicsize = pytalloc_BaseObject_size();
    6925             : 
    6926         698 :         epm_entry_t_Type.tp_base = BaseObject_Type;
    6927         698 :         epm_entry_t_Type.tp_basicsize = pytalloc_BaseObject_size();
    6928             : 
    6929         698 :         rpc_if_id_t_Type.tp_base = BaseObject_Type;
    6930         698 :         rpc_if_id_t_Type.tp_basicsize = pytalloc_BaseObject_size();
    6931             : 
    6932         698 :         epm_twr_p_t_Type.tp_base = BaseObject_Type;
    6933         698 :         epm_twr_p_t_Type.tp_basicsize = pytalloc_BaseObject_size();
    6934             : 
    6935         698 :         epm_Insert_Type.tp_base = BaseObject_Type;
    6936         698 :         epm_Insert_Type.tp_basicsize = pytalloc_BaseObject_size();
    6937             : 
    6938         698 :         epm_Delete_Type.tp_base = BaseObject_Type;
    6939         698 :         epm_Delete_Type.tp_basicsize = pytalloc_BaseObject_size();
    6940             : 
    6941         698 :         epm_Lookup_Type.tp_base = BaseObject_Type;
    6942         698 :         epm_Lookup_Type.tp_basicsize = pytalloc_BaseObject_size();
    6943             : 
    6944         698 :         epm_Map_Type.tp_base = BaseObject_Type;
    6945         698 :         epm_Map_Type.tp_basicsize = pytalloc_BaseObject_size();
    6946             : 
    6947         698 :         epm_LookupHandleFree_Type.tp_base = BaseObject_Type;
    6948         698 :         epm_LookupHandleFree_Type.tp_basicsize = pytalloc_BaseObject_size();
    6949             : 
    6950         698 :         epm_InqObject_Type.tp_base = BaseObject_Type;
    6951         698 :         epm_InqObject_Type.tp_basicsize = pytalloc_BaseObject_size();
    6952             : 
    6953         698 :         epm_MgmtDelete_Type.tp_base = BaseObject_Type;
    6954         698 :         epm_MgmtDelete_Type.tp_basicsize = pytalloc_BaseObject_size();
    6955             : 
    6956         698 :         epmapper_InterfaceType.tp_base = ClientConnection_Type;
    6957             : 
    6958         698 :         epmapper_SyntaxType.tp_base = ndr_syntax_id_Type;
    6959         698 :         epmapper_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
    6960             : 
    6961         698 :         if (PyType_Ready(&epm_rhs_dnet_nsp_Type) < 0)
    6962           0 :                 goto out;
    6963         698 :         if (PyType_Ready(&epm_rhs_osi_tp4_Type) < 0)
    6964           0 :                 goto out;
    6965         698 :         if (PyType_Ready(&epm_rhs_osi_clns_Type) < 0)
    6966           0 :                 goto out;
    6967         698 :         if (PyType_Ready(&epm_rhs_udp_Type) < 0)
    6968           0 :                 goto out;
    6969         698 :         if (PyType_Ready(&epm_rhs_tcp_Type) < 0)
    6970           0 :                 goto out;
    6971         698 :         if (PyType_Ready(&epm_rhs_ip_Type) < 0)
    6972           0 :                 goto out;
    6973         698 :         if (PyType_Ready(&epm_rhs_ncadg_Type) < 0)
    6974           0 :                 goto out;
    6975         698 :         if (PyType_Ready(&epm_rhs_ncacn_Type) < 0)
    6976           0 :                 goto out;
    6977         698 :         if (PyType_Ready(&epm_rhs_uuid_Type) < 0)
    6978           0 :                 goto out;
    6979         698 :         if (PyType_Ready(&epm_rhs_ipx_Type) < 0)
    6980           0 :                 goto out;
    6981         698 :         if (PyType_Ready(&epm_rhs_smb_Type) < 0)
    6982           0 :                 goto out;
    6983         698 :         if (PyType_Ready(&epm_rhs_named_pipe_Type) < 0)
    6984           0 :                 goto out;
    6985         698 :         if (PyType_Ready(&epm_rhs_netbios_Type) < 0)
    6986           0 :                 goto out;
    6987         698 :         if (PyType_Ready(&epm_rhs_netbeui_Type) < 0)
    6988           0 :                 goto out;
    6989         698 :         if (PyType_Ready(&epm_rhs_spx_Type) < 0)
    6990           0 :                 goto out;
    6991         698 :         if (PyType_Ready(&epm_rhs_nb_ipx_Type) < 0)
    6992           0 :                 goto out;
    6993         698 :         if (PyType_Ready(&epm_rhs_http_Type) < 0)
    6994           0 :                 goto out;
    6995         698 :         if (PyType_Ready(&epm_rhs_unix_ds_Type) < 0)
    6996           0 :                 goto out;
    6997         698 :         if (PyType_Ready(&epm_rhs_null_Type) < 0)
    6998           0 :                 goto out;
    6999         698 :         if (PyType_Ready(&epm_rhs_ncalrpc_Type) < 0)
    7000           0 :                 goto out;
    7001         698 :         if (PyType_Ready(&epm_rhs_appletalk_Type) < 0)
    7002           0 :                 goto out;
    7003         698 :         if (PyType_Ready(&epm_rhs_atalk_stream_Type) < 0)
    7004           0 :                 goto out;
    7005         698 :         if (PyType_Ready(&epm_rhs_atalk_datagram_Type) < 0)
    7006           0 :                 goto out;
    7007         698 :         if (PyType_Ready(&epm_rhs_vines_spp_Type) < 0)
    7008           0 :                 goto out;
    7009         698 :         if (PyType_Ready(&epm_rhs_vines_ipc_Type) < 0)
    7010           0 :                 goto out;
    7011         698 :         if (PyType_Ready(&epm_rhs_streettalk_Type) < 0)
    7012           0 :                 goto out;
    7013         698 :         if (PyType_Ready(&epm_rhs_Type) < 0)
    7014           0 :                 goto out;
    7015         698 :         if (PyType_Ready(&epm_lhs_Type) < 0)
    7016           0 :                 goto out;
    7017         698 :         if (PyType_Ready(&epm_floor_Type) < 0)
    7018           0 :                 goto out;
    7019         698 :         if (PyType_Ready(&epm_tower_Type) < 0)
    7020           0 :                 goto out;
    7021         698 :         if (PyType_Ready(&epm_twr_t_Type) < 0)
    7022           0 :                 goto out;
    7023         698 :         if (PyType_Ready(&epm_entry_t_Type) < 0)
    7024           0 :                 goto out;
    7025         698 :         if (PyType_Ready(&rpc_if_id_t_Type) < 0)
    7026           0 :                 goto out;
    7027         698 :         if (PyType_Ready(&epm_twr_p_t_Type) < 0)
    7028           0 :                 goto out;
    7029         698 :         if (PyType_Ready(&epm_Insert_Type) < 0)
    7030           0 :                 goto out;
    7031         698 :         if (PyType_Ready(&epm_Delete_Type) < 0)
    7032           0 :                 goto out;
    7033         698 :         if (PyType_Ready(&epm_Lookup_Type) < 0)
    7034           0 :                 goto out;
    7035         698 :         if (PyType_Ready(&epm_Map_Type) < 0)
    7036           0 :                 goto out;
    7037         698 :         if (PyType_Ready(&epm_LookupHandleFree_Type) < 0)
    7038           0 :                 goto out;
    7039         698 :         if (PyType_Ready(&epm_InqObject_Type) < 0)
    7040           0 :                 goto out;
    7041         698 :         if (PyType_Ready(&epm_MgmtDelete_Type) < 0)
    7042           0 :                 goto out;
    7043         698 :         if (PyType_Ready(&epmapper_InterfaceType) < 0)
    7044           0 :                 goto out;
    7045         698 :         if (PyType_Ready(&epmapper_SyntaxType) < 0)
    7046           0 :                 goto out;
    7047         698 :         if (!PyInterface_AddNdrRpcMethods(&epmapper_InterfaceType, py_ndr_epmapper_methods))
    7048           0 :                 return NULL;
    7049             : 
    7050             : #ifdef PY_EPM_RHS_DNET_NSP_PATCH
    7051             :         PY_EPM_RHS_DNET_NSP_PATCH(&epm_rhs_dnet_nsp_Type);
    7052             : #endif
    7053             : #ifdef PY_EPM_RHS_OSI_TP4_PATCH
    7054             :         PY_EPM_RHS_OSI_TP4_PATCH(&epm_rhs_osi_tp4_Type);
    7055             : #endif
    7056             : #ifdef PY_EPM_RHS_OSI_CLNS_PATCH
    7057             :         PY_EPM_RHS_OSI_CLNS_PATCH(&epm_rhs_osi_clns_Type);
    7058             : #endif
    7059             : #ifdef PY_EPM_RHS_UDP_PATCH
    7060             :         PY_EPM_RHS_UDP_PATCH(&epm_rhs_udp_Type);
    7061             : #endif
    7062             : #ifdef PY_EPM_RHS_TCP_PATCH
    7063             :         PY_EPM_RHS_TCP_PATCH(&epm_rhs_tcp_Type);
    7064             : #endif
    7065             : #ifdef PY_EPM_RHS_IP_PATCH
    7066             :         PY_EPM_RHS_IP_PATCH(&epm_rhs_ip_Type);
    7067             : #endif
    7068             : #ifdef PY_EPM_RHS_NCADG_PATCH
    7069             :         PY_EPM_RHS_NCADG_PATCH(&epm_rhs_ncadg_Type);
    7070             : #endif
    7071             : #ifdef PY_EPM_RHS_NCACN_PATCH
    7072             :         PY_EPM_RHS_NCACN_PATCH(&epm_rhs_ncacn_Type);
    7073             : #endif
    7074             : #ifdef PY_EPM_RHS_UUID_PATCH
    7075             :         PY_EPM_RHS_UUID_PATCH(&epm_rhs_uuid_Type);
    7076             : #endif
    7077             : #ifdef PY_EPM_RHS_IPX_PATCH
    7078             :         PY_EPM_RHS_IPX_PATCH(&epm_rhs_ipx_Type);
    7079             : #endif
    7080             : #ifdef PY_EPM_RHS_SMB_PATCH
    7081             :         PY_EPM_RHS_SMB_PATCH(&epm_rhs_smb_Type);
    7082             : #endif
    7083             : #ifdef PY_EPM_RHS_NAMED_PIPE_PATCH
    7084             :         PY_EPM_RHS_NAMED_PIPE_PATCH(&epm_rhs_named_pipe_Type);
    7085             : #endif
    7086             : #ifdef PY_EPM_RHS_NETBIOS_PATCH
    7087             :         PY_EPM_RHS_NETBIOS_PATCH(&epm_rhs_netbios_Type);
    7088             : #endif
    7089             : #ifdef PY_EPM_RHS_NETBEUI_PATCH
    7090             :         PY_EPM_RHS_NETBEUI_PATCH(&epm_rhs_netbeui_Type);
    7091             : #endif
    7092             : #ifdef PY_EPM_RHS_SPX_PATCH
    7093             :         PY_EPM_RHS_SPX_PATCH(&epm_rhs_spx_Type);
    7094             : #endif
    7095             : #ifdef PY_EPM_RHS_NB_IPX_PATCH
    7096             :         PY_EPM_RHS_NB_IPX_PATCH(&epm_rhs_nb_ipx_Type);
    7097             : #endif
    7098             : #ifdef PY_EPM_RHS_HTTP_PATCH
    7099             :         PY_EPM_RHS_HTTP_PATCH(&epm_rhs_http_Type);
    7100             : #endif
    7101             : #ifdef PY_EPM_RHS_UNIX_DS_PATCH
    7102             :         PY_EPM_RHS_UNIX_DS_PATCH(&epm_rhs_unix_ds_Type);
    7103             : #endif
    7104             : #ifdef PY_EPM_RHS_NULL_PATCH
    7105             :         PY_EPM_RHS_NULL_PATCH(&epm_rhs_null_Type);
    7106             : #endif
    7107             : #ifdef PY_EPM_RHS_NCALRPC_PATCH
    7108             :         PY_EPM_RHS_NCALRPC_PATCH(&epm_rhs_ncalrpc_Type);
    7109             : #endif
    7110             : #ifdef PY_EPM_RHS_APPLETALK_PATCH
    7111             :         PY_EPM_RHS_APPLETALK_PATCH(&epm_rhs_appletalk_Type);
    7112             : #endif
    7113             : #ifdef PY_EPM_RHS_ATALK_STREAM_PATCH
    7114             :         PY_EPM_RHS_ATALK_STREAM_PATCH(&epm_rhs_atalk_stream_Type);
    7115             : #endif
    7116             : #ifdef PY_EPM_RHS_ATALK_DATAGRAM_PATCH
    7117             :         PY_EPM_RHS_ATALK_DATAGRAM_PATCH(&epm_rhs_atalk_datagram_Type);
    7118             : #endif
    7119             : #ifdef PY_EPM_RHS_VINES_SPP_PATCH
    7120             :         PY_EPM_RHS_VINES_SPP_PATCH(&epm_rhs_vines_spp_Type);
    7121             : #endif
    7122             : #ifdef PY_EPM_RHS_VINES_IPC_PATCH
    7123             :         PY_EPM_RHS_VINES_IPC_PATCH(&epm_rhs_vines_ipc_Type);
    7124             : #endif
    7125             : #ifdef PY_EPM_RHS_STREETTALK_PATCH
    7126             :         PY_EPM_RHS_STREETTALK_PATCH(&epm_rhs_streettalk_Type);
    7127             : #endif
    7128             : #ifdef PY_EPM_RHS_PATCH
    7129             :         PY_EPM_RHS_PATCH(&epm_rhs_Type);
    7130             : #endif
    7131             : #ifdef PY_EPM_LHS_PATCH
    7132             :         PY_EPM_LHS_PATCH(&epm_lhs_Type);
    7133             : #endif
    7134             : #ifdef PY_EPM_FLOOR_PATCH
    7135             :         PY_EPM_FLOOR_PATCH(&epm_floor_Type);
    7136             : #endif
    7137             : #ifdef PY_EPM_TOWER_PATCH
    7138             :         PY_EPM_TOWER_PATCH(&epm_tower_Type);
    7139             : #endif
    7140             : #ifdef PY_EPM_TWR_T_PATCH
    7141             :         PY_EPM_TWR_T_PATCH(&epm_twr_t_Type);
    7142             : #endif
    7143             : #ifdef PY_EPM_ENTRY_T_PATCH
    7144             :         PY_EPM_ENTRY_T_PATCH(&epm_entry_t_Type);
    7145             : #endif
    7146             : #ifdef PY_RPC_IF_ID_T_PATCH
    7147             :         PY_RPC_IF_ID_T_PATCH(&rpc_if_id_t_Type);
    7148             : #endif
    7149             : #ifdef PY_EPM_TWR_P_T_PATCH
    7150             :         PY_EPM_TWR_P_T_PATCH(&epm_twr_p_t_Type);
    7151             : #endif
    7152             : #ifdef PY_EPM_INSERT_PATCH
    7153             :         PY_EPM_INSERT_PATCH(&epm_Insert_Type);
    7154             : #endif
    7155             : #ifdef PY_EPM_DELETE_PATCH
    7156             :         PY_EPM_DELETE_PATCH(&epm_Delete_Type);
    7157             : #endif
    7158             : #ifdef PY_EPM_LOOKUP_PATCH
    7159             :         PY_EPM_LOOKUP_PATCH(&epm_Lookup_Type);
    7160             : #endif
    7161             : #ifdef PY_EPM_MAP_PATCH
    7162             :         PY_EPM_MAP_PATCH(&epm_Map_Type);
    7163             : #endif
    7164             : #ifdef PY_EPM_LOOKUPHANDLEFREE_PATCH
    7165             :         PY_EPM_LOOKUPHANDLEFREE_PATCH(&epm_LookupHandleFree_Type);
    7166             : #endif
    7167             : #ifdef PY_EPM_INQOBJECT_PATCH
    7168             :         PY_EPM_INQOBJECT_PATCH(&epm_InqObject_Type);
    7169             : #endif
    7170             : #ifdef PY_EPM_MGMTDELETE_PATCH
    7171             :         PY_EPM_MGMTDELETE_PATCH(&epm_MgmtDelete_Type);
    7172             : #endif
    7173             : #ifdef PY_EPMAPPER_PATCH
    7174             :         PY_EPMAPPER_PATCH(&epmapper_InterfaceType);
    7175             : #endif
    7176             : #ifdef PY_EPMAPPER_ABSTRACT_SYNTAX_PATCH
    7177             :         PY_EPMAPPER_ABSTRACT_SYNTAX_PATCH(&epmapper_SyntaxType);
    7178             : #endif
    7179             : #ifdef PY_ABSTRACT_SYNTAX_PATCH
    7180             :         PY_ABSTRACT_SYNTAX_PATCH(&epmapper_SyntaxType);
    7181             : #endif
    7182             : 
    7183         698 :         m = PyModule_Create(&moduledef);
    7184         698 :         if (m == NULL)
    7185           0 :                 goto out;
    7186             : 
    7187         698 :         PyModule_AddObject(m, "EPMAPPER_STATUS_CANT_PERFORM_OP", PyLong_FromUnsignedLongLong(0x6d8));
    7188         698 :         PyModule_AddObject(m, "EPMAPPER_STATUS_NO_MORE_ENTRIES", PyLong_FromUnsignedLongLong(0x16c9a0d6));
    7189         698 :         PyModule_AddObject(m, "EPMAPPER_STATUS_NO_MEMORY", PyLong_FromUnsignedLongLong(0x16C9A012));
    7190         698 :         PyModule_AddObject(m, "EPMAPPER_STATUS_OK", PyLong_FromUnsignedLongLong(0));
    7191         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_DNET_NSP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_DNET_NSP)));
    7192         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_OSI_TP4", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_OSI_TP4)));
    7193         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_OSI_CLNS", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_OSI_CLNS)));
    7194         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_TCP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_TCP)));
    7195         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_UDP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_UDP)));
    7196         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_IP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_IP)));
    7197         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NCADG", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NCADG)));
    7198         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NCACN", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NCACN)));
    7199         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NCALRPC", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NCALRPC)));
    7200         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_UUID", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_UUID)));
    7201         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_IPX", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_IPX)));
    7202         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_SMB", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_SMB)));
    7203         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NAMED_PIPE", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NAMED_PIPE)));
    7204         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NETBIOS", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NETBIOS)));
    7205         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NETBEUI", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NETBEUI)));
    7206         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_SPX", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_SPX)));
    7207         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NB_IPX", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NB_IPX)));
    7208         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_DSP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_DSP)));
    7209         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_DDP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_DDP)));
    7210         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_APPLETALK", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_APPLETALK)));
    7211         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_VINES_SPP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_VINES_SPP)));
    7212         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_VINES_IPC", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_VINES_IPC)));
    7213         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_STREETTALK", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_STREETTALK)));
    7214         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_HTTP", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_HTTP)));
    7215         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_UNIX_DS", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_UNIX_DS)));
    7216         698 :         PyModule_AddObject(m, "EPM_PROTOCOL_NULL", PyLong_FromLong((uint16_t)(EPM_PROTOCOL_NULL)));
    7217         698 :         PyModule_AddObject(m, "RPC_C_EP_ALL_ELTS", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_EP_ALL_ELTS)));
    7218         698 :         PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_IF", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_EP_MATCH_BY_IF)));
    7219         698 :         PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_OBJ", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_EP_MATCH_BY_OBJ)));
    7220         698 :         PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_BOTH", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_EP_MATCH_BY_BOTH)));
    7221         698 :         PyModule_AddObject(m, "RPC_C_VERS_ALL", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_VERS_ALL)));
    7222         698 :         PyModule_AddObject(m, "RPC_C_VERS_COMPATIBLE", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_VERS_COMPATIBLE)));
    7223         698 :         PyModule_AddObject(m, "RPC_C_VERS_EXACT", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_VERS_EXACT)));
    7224         698 :         PyModule_AddObject(m, "RPC_C_VERS_MAJOR_ONLY", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_VERS_MAJOR_ONLY)));
    7225         698 :         PyModule_AddObject(m, "RPC_C_VERS_UPTO", PyLong_FromUnsignedLongLong((uint32_t)(RPC_C_VERS_UPTO)));
    7226         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_dnet_nsp_Type);
    7227         698 :         PyModule_AddObject(m, "epm_rhs_dnet_nsp", (PyObject *)(void *)&epm_rhs_dnet_nsp_Type);
    7228         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_osi_tp4_Type);
    7229         698 :         PyModule_AddObject(m, "epm_rhs_osi_tp4", (PyObject *)(void *)&epm_rhs_osi_tp4_Type);
    7230         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_osi_clns_Type);
    7231         698 :         PyModule_AddObject(m, "epm_rhs_osi_clns", (PyObject *)(void *)&epm_rhs_osi_clns_Type);
    7232         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_udp_Type);
    7233         698 :         PyModule_AddObject(m, "epm_rhs_udp", (PyObject *)(void *)&epm_rhs_udp_Type);
    7234         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_tcp_Type);
    7235         698 :         PyModule_AddObject(m, "epm_rhs_tcp", (PyObject *)(void *)&epm_rhs_tcp_Type);
    7236         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_ip_Type);
    7237         698 :         PyModule_AddObject(m, "epm_rhs_ip", (PyObject *)(void *)&epm_rhs_ip_Type);
    7238         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_ncadg_Type);
    7239         698 :         PyModule_AddObject(m, "epm_rhs_ncadg", (PyObject *)(void *)&epm_rhs_ncadg_Type);
    7240         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_ncacn_Type);
    7241         698 :         PyModule_AddObject(m, "epm_rhs_ncacn", (PyObject *)(void *)&epm_rhs_ncacn_Type);
    7242         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_uuid_Type);
    7243         698 :         PyModule_AddObject(m, "epm_rhs_uuid", (PyObject *)(void *)&epm_rhs_uuid_Type);
    7244         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_ipx_Type);
    7245         698 :         PyModule_AddObject(m, "epm_rhs_ipx", (PyObject *)(void *)&epm_rhs_ipx_Type);
    7246         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_smb_Type);
    7247         698 :         PyModule_AddObject(m, "epm_rhs_smb", (PyObject *)(void *)&epm_rhs_smb_Type);
    7248         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_named_pipe_Type);
    7249         698 :         PyModule_AddObject(m, "epm_rhs_named_pipe", (PyObject *)(void *)&epm_rhs_named_pipe_Type);
    7250         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_netbios_Type);
    7251         698 :         PyModule_AddObject(m, "epm_rhs_netbios", (PyObject *)(void *)&epm_rhs_netbios_Type);
    7252         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_netbeui_Type);
    7253         698 :         PyModule_AddObject(m, "epm_rhs_netbeui", (PyObject *)(void *)&epm_rhs_netbeui_Type);
    7254         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_spx_Type);
    7255         698 :         PyModule_AddObject(m, "epm_rhs_spx", (PyObject *)(void *)&epm_rhs_spx_Type);
    7256         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_nb_ipx_Type);
    7257         698 :         PyModule_AddObject(m, "epm_rhs_nb_ipx", (PyObject *)(void *)&epm_rhs_nb_ipx_Type);
    7258         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_http_Type);
    7259         698 :         PyModule_AddObject(m, "epm_rhs_http", (PyObject *)(void *)&epm_rhs_http_Type);
    7260         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_unix_ds_Type);
    7261         698 :         PyModule_AddObject(m, "epm_rhs_unix_ds", (PyObject *)(void *)&epm_rhs_unix_ds_Type);
    7262         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_null_Type);
    7263         698 :         PyModule_AddObject(m, "epm_rhs_null", (PyObject *)(void *)&epm_rhs_null_Type);
    7264         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_ncalrpc_Type);
    7265         698 :         PyModule_AddObject(m, "epm_rhs_ncalrpc", (PyObject *)(void *)&epm_rhs_ncalrpc_Type);
    7266         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_appletalk_Type);
    7267         698 :         PyModule_AddObject(m, "epm_rhs_appletalk", (PyObject *)(void *)&epm_rhs_appletalk_Type);
    7268         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_atalk_stream_Type);
    7269         698 :         PyModule_AddObject(m, "epm_rhs_atalk_stream", (PyObject *)(void *)&epm_rhs_atalk_stream_Type);
    7270         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_atalk_datagram_Type);
    7271         698 :         PyModule_AddObject(m, "epm_rhs_atalk_datagram", (PyObject *)(void *)&epm_rhs_atalk_datagram_Type);
    7272         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_vines_spp_Type);
    7273         698 :         PyModule_AddObject(m, "epm_rhs_vines_spp", (PyObject *)(void *)&epm_rhs_vines_spp_Type);
    7274         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_vines_ipc_Type);
    7275         698 :         PyModule_AddObject(m, "epm_rhs_vines_ipc", (PyObject *)(void *)&epm_rhs_vines_ipc_Type);
    7276         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_streettalk_Type);
    7277         698 :         PyModule_AddObject(m, "epm_rhs_streettalk", (PyObject *)(void *)&epm_rhs_streettalk_Type);
    7278         522 :         Py_INCREF((PyObject *)(void *)&epm_rhs_Type);
    7279         698 :         PyModule_AddObject(m, "epm_rhs", (PyObject *)(void *)&epm_rhs_Type);
    7280         522 :         Py_INCREF((PyObject *)(void *)&epm_lhs_Type);
    7281         698 :         PyModule_AddObject(m, "epm_lhs", (PyObject *)(void *)&epm_lhs_Type);
    7282         522 :         Py_INCREF((PyObject *)(void *)&epm_floor_Type);
    7283         698 :         PyModule_AddObject(m, "epm_floor", (PyObject *)(void *)&epm_floor_Type);
    7284         522 :         Py_INCREF((PyObject *)(void *)&epm_tower_Type);
    7285         698 :         PyModule_AddObject(m, "epm_tower", (PyObject *)(void *)&epm_tower_Type);
    7286         522 :         Py_INCREF((PyObject *)(void *)&epm_twr_t_Type);
    7287         698 :         PyModule_AddObject(m, "epm_twr_t", (PyObject *)(void *)&epm_twr_t_Type);
    7288         522 :         Py_INCREF((PyObject *)(void *)&epm_entry_t_Type);
    7289         698 :         PyModule_AddObject(m, "epm_entry_t", (PyObject *)(void *)&epm_entry_t_Type);
    7290         522 :         Py_INCREF((PyObject *)(void *)&rpc_if_id_t_Type);
    7291         698 :         PyModule_AddObject(m, "rpc_if_id_t", (PyObject *)(void *)&rpc_if_id_t_Type);
    7292         522 :         Py_INCREF((PyObject *)(void *)&epm_twr_p_t_Type);
    7293         698 :         PyModule_AddObject(m, "epm_twr_p_t", (PyObject *)(void *)&epm_twr_p_t_Type);
    7294         522 :         Py_INCREF((PyObject *)(void *)&epm_Insert_Type);
    7295         698 :         PyModule_AddObject(m, "epm_Insert", (PyObject *)(void *)&epm_Insert_Type);
    7296         522 :         Py_INCREF((PyObject *)(void *)&epm_Delete_Type);
    7297         698 :         PyModule_AddObject(m, "epm_Delete", (PyObject *)(void *)&epm_Delete_Type);
    7298         522 :         Py_INCREF((PyObject *)(void *)&epm_Lookup_Type);
    7299         698 :         PyModule_AddObject(m, "epm_Lookup", (PyObject *)(void *)&epm_Lookup_Type);
    7300         522 :         Py_INCREF((PyObject *)(void *)&epm_Map_Type);
    7301         698 :         PyModule_AddObject(m, "epm_Map", (PyObject *)(void *)&epm_Map_Type);
    7302         522 :         Py_INCREF((PyObject *)(void *)&epm_LookupHandleFree_Type);
    7303         698 :         PyModule_AddObject(m, "epm_LookupHandleFree", (PyObject *)(void *)&epm_LookupHandleFree_Type);
    7304         522 :         Py_INCREF((PyObject *)(void *)&epm_InqObject_Type);
    7305         698 :         PyModule_AddObject(m, "epm_InqObject", (PyObject *)(void *)&epm_InqObject_Type);
    7306         522 :         Py_INCREF((PyObject *)(void *)&epm_MgmtDelete_Type);
    7307         698 :         PyModule_AddObject(m, "epm_MgmtDelete", (PyObject *)(void *)&epm_MgmtDelete_Type);
    7308         522 :         Py_INCREF((PyObject *)(void *)&epmapper_InterfaceType);
    7309         698 :         PyModule_AddObject(m, "epmapper", (PyObject *)(void *)&epmapper_InterfaceType);
    7310         522 :         Py_INCREF((PyObject *)(void *)&epmapper_SyntaxType);
    7311         698 :         PyModule_AddObject(m, "epmapper_abstract_syntax", (PyObject *)(void *)&epmapper_SyntaxType);
    7312         522 :         Py_INCREF((PyObject *)(void *)&epmapper_SyntaxType);
    7313         698 :         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&epmapper_SyntaxType);
    7314             : #ifdef PY_MOD_EPMAPPER_PATCH
    7315             :         PY_MOD_EPMAPPER_PATCH(m);
    7316             : #endif
    7317         698 :         out:
    7318         698 :         Py_XDECREF(dep_samba_dcerpc_misc);
    7319         698 :         Py_XDECREF(dep_talloc);
    7320         698 :         Py_XDECREF(dep_samba_dcerpc_base);
    7321         632 :         return m;
    7322             : 
    7323             : }

Generated by: LCOV version 1.14