/* Python wrapper functions auto-generated by pidl */ #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */ #include #include "python/py3compat.h" #include "includes.h" #include "python/modules.h" #include #include "librpc/rpc/pyrpc.h" #include "librpc/rpc/pyrpc_util.h" #include "bin/default/librpc/gen_ndr/ndr_winbind.h" #include "bin/default/librpc/gen_ndr/ndr_winbind_c.h" /* * Suppress compiler warnings if the generated code does not call these * functions */ #ifndef _MAYBE_UNUSED_ #ifdef __has_attribute #if __has_attribute(unused) #define _MAYBE_UNUSED_ __attribute__ ((unused)) #else #define _MAYBE_UNUSED_ #endif #endif #endif /* * These functions are here to ensure they can be optimized out by * the compiler based on the constant input values */ static inline unsigned long long ndr_sizeof2uintmax(size_t var_size) { switch (var_size) { case 8: return UINT64_MAX; case 4: return UINT32_MAX; case 2: return UINT16_MAX; case 1: return UINT8_MAX; } return 0; } static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size) { switch (var_size) { case 8: return INT64_MAX; case 4: return INT32_MAX; case 2: return INT16_MAX; case 1: return INT8_MAX; } return 0; } #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/netlogon.h" #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/idmap.h" static PyTypeObject wbint_TransID_Type; static PyTypeObject wbint_TransIDArray_Type; static PyTypeObject wbint_userinfo_Type; static PyTypeObject wbint_SidArray_Type; static PyTypeObject wbint_RidArray_Type; static PyTypeObject wbint_Principal_Type; static PyTypeObject wbint_Principals_Type; static PyTypeObject wbint_userinfos_Type; static PyTypeObject winbind_InterfaceType; static PyTypeObject wbint_Ping_Type; static PyTypeObject wbint_LookupSid_Type; static PyTypeObject wbint_LookupSids_Type; static PyTypeObject wbint_LookupName_Type; static PyTypeObject wbint_Sids2UnixIDs_Type; static PyTypeObject wbint_UnixIDs2Sids_Type; static PyTypeObject wbint_AllocateUid_Type; static PyTypeObject wbint_AllocateGid_Type; static PyTypeObject wbint_GetNssInfo_Type; static PyTypeObject wbint_LookupUserAliases_Type; static PyTypeObject wbint_LookupUserGroups_Type; static PyTypeObject wbint_QuerySequenceNumber_Type; static PyTypeObject wbint_LookupGroupMembers_Type; static PyTypeObject wbint_QueryGroupList_Type; static PyTypeObject wbint_QueryUserRidList_Type; static PyTypeObject wbint_DsGetDcName_Type; static PyTypeObject wbint_LookupRids_Type; static PyTypeObject wbint_CheckMachineAccount_Type; static PyTypeObject wbint_ChangeMachineAccount_Type; static PyTypeObject wbint_PingDc_Type; static PyTypeObject winbind_SamLogon_Type; static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type; static PyTypeObject winbind_LogonControl_Type; static PyTypeObject winbind_GetForestTrustInformation_Type; static PyTypeObject winbind_SendToSam_Type; static PyTypeObject *unixid_Type; static PyTypeObject *BaseObject_Type; static PyTypeObject *dom_sid_Type; static PyTypeObject *lsa_SidArray_Type; static PyTypeObject *lsa_RefDomainList_Type; static PyTypeObject *lsa_TransNameArray_Type; static PyTypeObject *GUID_Type; static PyTypeObject *netr_DsRGetDCNameInfo_Type; static PyTypeObject *netr_LogonLevel_Type; static PyTypeObject *netr_Validation_Type; static PyTypeObject *NL_DNS_NAME_INFO_ARRAY_Type; static PyTypeObject *netr_CONTROL_DATA_INFORMATION_Type; static PyTypeObject *netr_CONTROL_QUERY_INFORMATION_Type; static PyTypeObject *lsa_ForestTrustInformation_Type; static PyTypeObject *netr_SendToSamBase_Type; static PyTypeObject *ClientConnection_Type; static PyTypeObject *ndr_syntax_id_Type; static PyObject *py_wbint_TransID_get_type_hint(PyObject *obj, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj); PyObject *py_type_hint; py_type_hint = PyLong_FromLong((uint16_t)object->type_hint); return py_type_hint; } static int py_wbint_TransID_set_type_hint(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type_hint"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type_hint)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->type_hint = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_TransID_get_domain_index(PyObject *obj, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj); PyObject *py_domain_index; py_domain_index = PyLong_FromUnsignedLongLong((uint32_t)object->domain_index); return py_domain_index; } static int py_wbint_TransID_set_domain_index(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_index"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_index)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->domain_index = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_TransID_get_rid(PyObject *obj, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_wbint_TransID_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_TransID_get_xid(PyObject *obj, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj); PyObject *py_xid; py_xid = pytalloc_reference_ex(unixid_Type, pytalloc_get_mem_ctx(obj), &object->xid); return py_xid; } static int py_wbint_TransID_set_xid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->xid"); return -1; } PY_CHECK_TYPE(unixid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->xid = *(struct unixid *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_wbint_TransID_getsetters[] = { { .name = discard_const_p(char, "type_hint"), .get = py_wbint_TransID_get_type_hint, .set = py_wbint_TransID_set_type_hint, .doc = discard_const_p(char, "PIDL-generated element of base type id_type") }, { .name = discard_const_p(char, "domain_index"), .get = py_wbint_TransID_get_domain_index, .set = py_wbint_TransID_set_domain_index, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rid"), .get = py_wbint_TransID_get_rid, .set = py_wbint_TransID_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "xid"), .get = py_wbint_TransID_get_xid, .set = py_wbint_TransID_set_xid, .doc = discard_const_p(char, "PIDL-generated element of base type unixid") }, { .name = NULL } }; static PyObject *py_wbint_TransID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_TransID, type); } static PyTypeObject wbint_TransID_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_TransID", .tp_getset = py_wbint_TransID_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_TransID_new, }; static PyObject *py_wbint_TransIDArray_get_num_ids(PyObject *obj, void *closure) { struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(obj); PyObject *py_num_ids; py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)object->num_ids); return py_num_ids; } static int py_wbint_TransIDArray_set_num_ids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_ids"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_ids)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->num_ids = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_TransIDArray_get_ids(PyObject *obj, void *closure) { struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(obj); PyObject *py_ids; py_ids = PyList_New(object->num_ids); if (py_ids == NULL) { return NULL; } { int ids_cntr_0; for (ids_cntr_0 = 0; ids_cntr_0 < (object->num_ids); ids_cntr_0++) { PyObject *py_ids_0; py_ids_0 = pytalloc_reference_ex(&wbint_TransID_Type, object->ids, &object->ids[ids_cntr_0]); PyList_SetItem(py_ids, ids_cntr_0, py_ids_0); } } return py_ids; } static int py_wbint_TransIDArray_set_ids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int ids_cntr_0; object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value)); if (!object->ids) { return -1;; } talloc_set_name_const(object->ids, "ARRAY: object->ids"); for (ids_cntr_0 = 0; ids_cntr_0 < PyList_GET_SIZE(value); ids_cntr_0++) { if (PyList_GET_ITEM(value, ids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids[ids_cntr_0]"); return -1; } PY_CHECK_TYPE(&wbint_TransID_Type, PyList_GET_ITEM(value, ids_cntr_0), return -1;); if (talloc_reference(object->ids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ids_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->ids[ids_cntr_0] = *(struct wbint_TransID *)pytalloc_get_ptr(PyList_GET_ITEM(value, ids_cntr_0)); } } return 0; } static PyGetSetDef py_wbint_TransIDArray_getsetters[] = { { .name = discard_const_p(char, "num_ids"), .get = py_wbint_TransIDArray_get_num_ids, .set = py_wbint_TransIDArray_set_num_ids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "ids"), .get = py_wbint_TransIDArray_get_ids, .set = py_wbint_TransIDArray_set_ids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransID") }, { .name = NULL } }; static PyObject *py_wbint_TransIDArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_TransIDArray, type); } static PyTypeObject wbint_TransIDArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_TransIDArray", .tp_getset = py_wbint_TransIDArray_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_TransIDArray_new, }; static PyObject *py_wbint_userinfo_get_domain_name(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_domain_name; if (object->domain_name == NULL) { Py_RETURN_NONE; } if (object->domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { if (object->domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { py_domain_name = PyUnicode_Decode(object->domain_name, strlen(object->domain_name), "utf-8", "ignore"); } } return py_domain_name; } static int py_wbint_userinfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name"); return -1; } if (value == Py_None) { object->domain_name = NULL; } else { object->domain_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->domain_name = talloc_str; } } return 0; } static PyObject *py_wbint_userinfo_get_acct_name(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_acct_name; if (object->acct_name == NULL) { Py_RETURN_NONE; } if (object->acct_name == NULL) { py_acct_name = Py_None; Py_INCREF(py_acct_name); } else { if (object->acct_name == NULL) { py_acct_name = Py_None; Py_INCREF(py_acct_name); } else { py_acct_name = PyUnicode_Decode(object->acct_name, strlen(object->acct_name), "utf-8", "ignore"); } } return py_acct_name; } static int py_wbint_userinfo_set_acct_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_name"); return -1; } if (value == Py_None) { object->acct_name = NULL; } else { object->acct_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->acct_name = talloc_str; } } return 0; } static PyObject *py_wbint_userinfo_get_full_name(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_full_name; if (object->full_name == NULL) { Py_RETURN_NONE; } if (object->full_name == NULL) { py_full_name = Py_None; Py_INCREF(py_full_name); } else { if (object->full_name == NULL) { py_full_name = Py_None; Py_INCREF(py_full_name); } else { py_full_name = PyUnicode_Decode(object->full_name, strlen(object->full_name), "utf-8", "ignore"); } } return py_full_name; } static int py_wbint_userinfo_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } if (value == Py_None) { object->full_name = NULL; } else { object->full_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->full_name = talloc_str; } } return 0; } static PyObject *py_wbint_userinfo_get_homedir(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_homedir; if (object->homedir == NULL) { Py_RETURN_NONE; } if (object->homedir == NULL) { py_homedir = Py_None; Py_INCREF(py_homedir); } else { if (object->homedir == NULL) { py_homedir = Py_None; Py_INCREF(py_homedir); } else { py_homedir = PyUnicode_Decode(object->homedir, strlen(object->homedir), "utf-8", "ignore"); } } return py_homedir; } static int py_wbint_userinfo_set_homedir(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->homedir"); return -1; } if (value == Py_None) { object->homedir = NULL; } else { object->homedir = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->homedir = talloc_str; } } return 0; } static PyObject *py_wbint_userinfo_get_shell(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_shell; if (object->shell == NULL) { Py_RETURN_NONE; } if (object->shell == NULL) { py_shell = Py_None; Py_INCREF(py_shell); } else { if (object->shell == NULL) { py_shell = Py_None; Py_INCREF(py_shell); } else { py_shell = PyUnicode_Decode(object->shell, strlen(object->shell), "utf-8", "ignore"); } } return py_shell; } static int py_wbint_userinfo_set_shell(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shell"); return -1; } if (value == Py_None) { object->shell = NULL; } else { object->shell = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->shell = talloc_str; } } return 0; } static PyObject *py_wbint_userinfo_get_uid(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_uid; py_uid = PyLong_FromUnsignedLongLong(object->uid); return py_uid; } static int py_wbint_userinfo_set_uid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->uid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_userinfo_get_primary_gid(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong(object->primary_gid); return py_primary_gid; } static int py_wbint_userinfo_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->primary_gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_userinfo_get_primary_group_name(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_primary_group_name; if (object->primary_group_name == NULL) { Py_RETURN_NONE; } if (object->primary_group_name == NULL) { py_primary_group_name = Py_None; Py_INCREF(py_primary_group_name); } else { if (object->primary_group_name == NULL) { py_primary_group_name = Py_None; Py_INCREF(py_primary_group_name); } else { py_primary_group_name = PyUnicode_Decode(object->primary_group_name, strlen(object->primary_group_name), "utf-8", "ignore"); } } return py_primary_group_name; } static int py_wbint_userinfo_set_primary_group_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_group_name"); return -1; } if (value == Py_None) { object->primary_group_name = NULL; } else { object->primary_group_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->primary_group_name = talloc_str; } } return 0; } static PyObject *py_wbint_userinfo_get_user_sid(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_user_sid; py_user_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->user_sid); return py_user_sid; } static int py_wbint_userinfo_set_user_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_sid"); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->user_sid = *(struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_userinfo_get_group_sid(PyObject *obj, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj); PyObject *py_group_sid; py_group_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->group_sid); return py_group_sid; } static int py_wbint_userinfo_set_group_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_sid"); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->group_sid = *(struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_wbint_userinfo_getsetters[] = { { .name = discard_const_p(char, "domain_name"), .get = py_wbint_userinfo_get_domain_name, .set = py_wbint_userinfo_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "acct_name"), .get = py_wbint_userinfo_get_acct_name, .set = py_wbint_userinfo_set_acct_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "full_name"), .get = py_wbint_userinfo_get_full_name, .set = py_wbint_userinfo_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "homedir"), .get = py_wbint_userinfo_get_homedir, .set = py_wbint_userinfo_set_homedir, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "shell"), .get = py_wbint_userinfo_get_shell, .set = py_wbint_userinfo_set_shell, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "uid"), .get = py_wbint_userinfo_get_uid, .set = py_wbint_userinfo_set_uid, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "primary_gid"), .get = py_wbint_userinfo_get_primary_gid, .set = py_wbint_userinfo_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "primary_group_name"), .get = py_wbint_userinfo_get_primary_group_name, .set = py_wbint_userinfo_set_primary_group_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "user_sid"), .get = py_wbint_userinfo_get_user_sid, .set = py_wbint_userinfo_set_user_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "group_sid"), .get = py_wbint_userinfo_get_group_sid, .set = py_wbint_userinfo_set_group_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = NULL } }; static PyObject *py_wbint_userinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_userinfo, type); } static PyObject *py_wbint_userinfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfo); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_wbint_userinfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_wbint_userinfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfo, "wbint_userinfo", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_wbint_userinfo_methods[] = { { "__ndr_pack__", (PyCFunction)py_wbint_userinfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_userinfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_wbint_userinfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_userinfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_userinfo", .tp_getset = py_wbint_userinfo_getsetters, .tp_methods = py_wbint_userinfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_userinfo_new, }; static PyObject *py_wbint_SidArray_get_num_sids(PyObject *obj, void *closure) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(obj); PyObject *py_num_sids; py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids); return py_num_sids; } static int py_wbint_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->num_sids = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_SidArray_get_sids(PyObject *obj, void *closure) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(obj); PyObject *py_sids; py_sids = PyList_New(object->num_sids); if (py_sids == NULL) { return NULL; } { int sids_cntr_0; for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) { PyObject *py_sids_0; py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->sids, &object->sids[sids_cntr_0]); PyList_SetItem(py_sids, sids_cntr_0, py_sids_0); } } return py_sids; } static int py_wbint_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sids_cntr_0; object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value)); if (!object->sids) { return -1;; } talloc_set_name_const(object->sids, "ARRAY: object->sids"); for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) { if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_0]"); return -1; } PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;); if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0)); } } return 0; } static PyGetSetDef py_wbint_SidArray_getsetters[] = { { .name = discard_const_p(char, "num_sids"), .get = py_wbint_SidArray_get_num_sids, .set = py_wbint_SidArray_set_num_sids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sids"), .get = py_wbint_SidArray_get_sids, .set = py_wbint_SidArray_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = NULL } }; static PyObject *py_wbint_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_SidArray, type); } static PyObject *py_wbint_SidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_SidArray); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_wbint_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_wbint_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_SidArray, "wbint_SidArray", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_wbint_SidArray_methods[] = { { "__ndr_pack__", (PyCFunction)py_wbint_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_SidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_wbint_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_SidArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_SidArray", .tp_getset = py_wbint_SidArray_getsetters, .tp_methods = py_wbint_SidArray_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_SidArray_new, }; static PyObject *py_wbint_RidArray_get_num_rids(PyObject *obj, void *closure) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(obj); PyObject *py_num_rids; py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)object->num_rids); return py_num_rids; } static int py_wbint_RidArray_set_num_rids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_rids"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_rids)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->num_rids = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_RidArray_get_rids(PyObject *obj, void *closure) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(obj); PyObject *py_rids; py_rids = PyList_New(object->num_rids); if (py_rids == NULL) { return NULL; } { int rids_cntr_0; for (rids_cntr_0 = 0; rids_cntr_0 < (object->num_rids); rids_cntr_0++) { PyObject *py_rids_0; py_rids_0 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_0]); PyList_SetItem(py_rids, rids_cntr_0, py_rids_0); } } return py_rids; } static int py_wbint_RidArray_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int rids_cntr_0; object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value)); if (!object->rids) { return -1;; } talloc_set_name_const(object->rids, "ARRAY: object->rids"); for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(value); rids_cntr_0++) { if (PyList_GET_ITEM(value, rids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_0)); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->rids[rids_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_wbint_RidArray_getsetters[] = { { .name = discard_const_p(char, "num_rids"), .get = py_wbint_RidArray_get_num_rids, .set = py_wbint_RidArray_set_num_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rids"), .get = py_wbint_RidArray_get_rids, .set = py_wbint_RidArray_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_wbint_RidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_RidArray, type); } static PyObject *py_wbint_RidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_RidArray); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_wbint_RidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_wbint_RidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_RidArray, "wbint_RidArray", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_wbint_RidArray_methods[] = { { "__ndr_pack__", (PyCFunction)py_wbint_RidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_RidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_wbint_RidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_RidArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_RidArray", .tp_getset = py_wbint_RidArray_getsetters, .tp_methods = py_wbint_RidArray_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_RidArray_new, }; static PyObject *py_wbint_Principal_get_sid(PyObject *obj, void *closure) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj); PyObject *py_sid; py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid); return py_sid; } static int py_wbint_Principal_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid"); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sid = *(struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_Principal_get_type(PyObject *obj, void *closure) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj); PyObject *py_type; py_type = PyLong_FromLong((uint16_t)object->type); return py_type; } static int py_wbint_Principal_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_Principal_get_name(PyObject *obj, void *closure) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->name == NULL) { Py_RETURN_NONE; } if (object->name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { if (object->name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore"); } } return py_name; } static int py_wbint_Principal_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name"); return -1; } if (value == Py_None) { object->name = NULL; } else { object->name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->name = talloc_str; } } return 0; } static PyGetSetDef py_wbint_Principal_getsetters[] = { { .name = discard_const_p(char, "sid"), .get = py_wbint_Principal_get_sid, .set = py_wbint_Principal_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "type"), .get = py_wbint_Principal_get_type, .set = py_wbint_Principal_set_type, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType") }, { .name = discard_const_p(char, "name"), .get = py_wbint_Principal_get_name, .set = py_wbint_Principal_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_wbint_Principal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_Principal, type); } static PyObject *py_wbint_Principal_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principal); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_wbint_Principal_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_wbint_Principal_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principal, "wbint_Principal", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_wbint_Principal_methods[] = { { "__ndr_pack__", (PyCFunction)py_wbint_Principal_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Principal_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_wbint_Principal_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_Principal_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_Principal", .tp_getset = py_wbint_Principal_getsetters, .tp_methods = py_wbint_Principal_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_Principal_new, }; static PyObject *py_wbint_Principals_get_num_principals(PyObject *obj, void *closure) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(obj); PyObject *py_num_principals; py_num_principals = PyLong_FromUnsignedLongLong((uint32_t)object->num_principals); return py_num_principals; } static int py_wbint_Principals_set_num_principals(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_principals"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_principals)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->num_principals = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_Principals_get_principals(PyObject *obj, void *closure) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(obj); PyObject *py_principals; py_principals = PyList_New(object->num_principals); if (py_principals == NULL) { return NULL; } { int principals_cntr_0; for (principals_cntr_0 = 0; principals_cntr_0 < (object->num_principals); principals_cntr_0++) { PyObject *py_principals_0; py_principals_0 = pytalloc_reference_ex(&wbint_Principal_Type, object->principals, &object->principals[principals_cntr_0]); PyList_SetItem(py_principals, principals_cntr_0, py_principals_0); } } return py_principals; } static int py_wbint_Principals_set_principals(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principals"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int principals_cntr_0; object->principals = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->principals, PyList_GET_SIZE(value)); if (!object->principals) { return -1;; } talloc_set_name_const(object->principals, "ARRAY: object->principals"); for (principals_cntr_0 = 0; principals_cntr_0 < PyList_GET_SIZE(value); principals_cntr_0++) { if (PyList_GET_ITEM(value, principals_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principals[principals_cntr_0]"); return -1; } PY_CHECK_TYPE(&wbint_Principal_Type, PyList_GET_ITEM(value, principals_cntr_0), return -1;); if (talloc_reference(object->principals, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, principals_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->principals[principals_cntr_0] = *(struct wbint_Principal *)pytalloc_get_ptr(PyList_GET_ITEM(value, principals_cntr_0)); } } return 0; } static PyGetSetDef py_wbint_Principals_getsetters[] = { { .name = discard_const_p(char, "num_principals"), .get = py_wbint_Principals_get_num_principals, .set = py_wbint_Principals_set_num_principals, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "principals"), .get = py_wbint_Principals_get_principals, .set = py_wbint_Principals_set_principals, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principal") }, { .name = NULL } }; static PyObject *py_wbint_Principals_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_Principals, type); } static PyObject *py_wbint_Principals_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principals); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_wbint_Principals_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_wbint_Principals_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principals, "wbint_Principals", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_wbint_Principals_methods[] = { { "__ndr_pack__", (PyCFunction)py_wbint_Principals_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Principals_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_wbint_Principals_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_Principals_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_Principals", .tp_getset = py_wbint_Principals_getsetters, .tp_methods = py_wbint_Principals_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_Principals_new, }; static PyObject *py_wbint_userinfos_get_num_userinfos(PyObject *obj, void *closure) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(obj); PyObject *py_num_userinfos; py_num_userinfos = PyLong_FromUnsignedLongLong((uint32_t)object->num_userinfos); return py_num_userinfos; } static int py_wbint_userinfos_set_num_userinfos(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_userinfos"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_userinfos)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->num_userinfos = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_userinfos_get_userinfos(PyObject *obj, void *closure) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(obj); PyObject *py_userinfos; py_userinfos = PyList_New(object->num_userinfos); if (py_userinfos == NULL) { return NULL; } { int userinfos_cntr_0; for (userinfos_cntr_0 = 0; userinfos_cntr_0 < (object->num_userinfos); userinfos_cntr_0++) { PyObject *py_userinfos_0; py_userinfos_0 = pytalloc_reference_ex(&wbint_userinfo_Type, object->userinfos, &object->userinfos[userinfos_cntr_0]); PyList_SetItem(py_userinfos, userinfos_cntr_0, py_userinfos_0); } } return py_userinfos; } static int py_wbint_userinfos_set_userinfos(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->userinfos"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int userinfos_cntr_0; object->userinfos = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->userinfos, PyList_GET_SIZE(value)); if (!object->userinfos) { return -1;; } talloc_set_name_const(object->userinfos, "ARRAY: object->userinfos"); for (userinfos_cntr_0 = 0; userinfos_cntr_0 < PyList_GET_SIZE(value); userinfos_cntr_0++) { if (PyList_GET_ITEM(value, userinfos_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->userinfos[userinfos_cntr_0]"); return -1; } PY_CHECK_TYPE(&wbint_userinfo_Type, PyList_GET_ITEM(value, userinfos_cntr_0), return -1;); if (talloc_reference(object->userinfos, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, userinfos_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->userinfos[userinfos_cntr_0] = *(struct wbint_userinfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, userinfos_cntr_0)); } } return 0; } static PyGetSetDef py_wbint_userinfos_getsetters[] = { { .name = discard_const_p(char, "num_userinfos"), .get = py_wbint_userinfos_get_num_userinfos, .set = py_wbint_userinfos_set_num_userinfos, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "userinfos"), .get = py_wbint_userinfos_get_userinfos, .set = py_wbint_userinfos_set_userinfos, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo") }, { .name = NULL } }; static PyObject *py_wbint_userinfos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct wbint_userinfos, type); } static PyObject *py_wbint_userinfos_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfos); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_wbint_userinfos_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_wbint_userinfos_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfos, "wbint_userinfos", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_wbint_userinfos_methods[] = { { "__ndr_pack__", (PyCFunction)py_wbint_userinfos_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_userinfos_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_wbint_userinfos_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_userinfos_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_userinfos", .tp_getset = py_wbint_userinfos_getsetters, .tp_methods = py_wbint_userinfos_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_userinfos_new, }; static PyObject *py_wbint_Ping_in_get_in_data(PyObject *obj, void *closure) { struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj); PyObject *py_in_data; py_in_data = PyLong_FromUnsignedLongLong((uint32_t)object->in.in_data); return py_in_data; } static int py_wbint_Ping_in_set_in_data(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.in_data"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.in_data)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.in_data = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_Ping_out_get_out_data(PyObject *obj, void *closure) { struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj); PyObject *py_out_data; if (object->out.out_data == NULL) { Py_RETURN_NONE; } py_out_data = PyLong_FromUnsignedLongLong((uint32_t)*object->out.out_data); return py_out_data; } static int py_wbint_Ping_out_set_out_data(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.out_data"); return -1; } object->out.out_data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_data); if (object->out.out_data == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.out_data)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.out_data = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_wbint_Ping_getsetters[] = { { .name = discard_const_p(char, "in_in_data"), .get = py_wbint_Ping_in_get_in_data, .set = py_wbint_Ping_in_set_in_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_out_data"), .get = py_wbint_Ping_out_get_out_data, .set = py_wbint_Ping_out_set_out_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_wbint_Ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_Ping, type); struct wbint_Ping *_self = (struct wbint_Ping *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.out_data = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_wbint_Ping_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(0); } static PyObject *py_wbint_Ping_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[0]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_Ping_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_Ping_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_Ping_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_Ping_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_Ping_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[0]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_Ping_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_Ping_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_Ping_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[0]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_Ping_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_in", NDR_IN); } static PyObject *py_wbint_Ping_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_out", NDR_OUT); } static PyMethodDef py_wbint_Ping_methods[] = { { "opnum", (PyCFunction)py_wbint_Ping_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_Ping.opnum() -> 0 (0x00) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_Ping_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_Ping_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_Ping_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_Ping", .tp_getset = py_wbint_Ping_getsetters, .tp_methods = py_wbint_Ping_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_Ping_new, }; static bool pack_py_wbint_Ping_args_in(PyObject *args, PyObject *kwargs, struct wbint_Ping *r) { PyObject *py_in_data; const char *kwnames[] = { "in_data", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_Ping", discard_const_p(char *, kwnames), &py_in_data)) { return false; } if (py_in_data == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_data"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_data)); if (PyLong_Check(py_in_data)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_in_data); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.in_data = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_wbint_Ping_args_out(struct wbint_Ping *r) { PyObject *result; PyObject *py_out_data; py_out_data = PyLong_FromUnsignedLongLong((uint32_t)*r->out.out_data); result = py_out_data; return result; } static PyObject *py_wbint_LookupSid_in_get_sid(PyObject *obj, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_wbint_LookupSid_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupSid_out_get_type(PyObject *obj, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj); PyObject *py_type; if (object->out.type == NULL) { Py_RETURN_NONE; } py_type = PyLong_FromLong((uint16_t)*object->out.type); return py_type; } static int py_wbint_LookupSid_out_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.type"); return -1; } object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type); if (object->out.type == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_LookupSid_out_get_domain(PyObject *obj, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj); PyObject *py_domain; if (object->out.domain == NULL) { Py_RETURN_NONE; } if (*object->out.domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { if (*object->out.domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { py_domain = PyUnicode_Decode(*object->out.domain, strlen(*object->out.domain), "utf-8", "ignore"); } } return py_domain; } static int py_wbint_LookupSid_out_set_domain(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain"); return -1; } object->out.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain); if (object->out.domain == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.domain = NULL; } else { *object->out.domain = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } *object->out.domain = talloc_str; } } return 0; } static PyObject *py_wbint_LookupSid_out_get_name(PyObject *obj, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->out.name == NULL) { Py_RETURN_NONE; } if (*object->out.name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { if (*object->out.name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { py_name = PyUnicode_Decode(*object->out.name, strlen(*object->out.name), "utf-8", "ignore"); } } return py_name; } static int py_wbint_LookupSid_out_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.name"); return -1; } object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name); if (object->out.name == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.name = NULL; } else { *object->out.name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } *object->out.name = talloc_str; } } return 0; } static PyObject *py_wbint_LookupSid_get_result(PyObject *obj, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupSid_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupSid_getsetters[] = { { .name = discard_const_p(char, "in_sid"), .get = py_wbint_LookupSid_in_get_sid, .set = py_wbint_LookupSid_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "out_type"), .get = py_wbint_LookupSid_out_get_type, .set = py_wbint_LookupSid_out_set_type, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType") }, { .name = discard_const_p(char, "out_domain"), .get = py_wbint_LookupSid_out_get_domain, .set = py_wbint_LookupSid_out_set_domain, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "out_name"), .get = py_wbint_LookupSid_out_get_name, .set = py_wbint_LookupSid_out_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupSid_get_result, .set = py_wbint_LookupSid_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupSid, type); struct wbint_LookupSid *_self = (struct wbint_LookupSid *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid); _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType); return self; } static PyObject *py_wbint_LookupSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(1); } static PyObject *py_wbint_LookupSid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[1]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupSid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[1]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupSid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[1]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_in", NDR_IN); } static PyObject *py_wbint_LookupSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_out", NDR_OUT); } static PyMethodDef py_wbint_LookupSid_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupSid_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupSid.opnum() -> 1 (0x01) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupSid_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupSid", .tp_getset = py_wbint_LookupSid_getsetters, .tp_methods = py_wbint_LookupSid_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupSid_new, }; static bool pack_py_wbint_LookupSid_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSid *r) { PyObject *py_sid; const char *kwnames[] = { "sid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSid", discard_const_p(char *, kwnames), &py_sid)) { return false; } if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); return true; } static PyObject *unpack_py_wbint_LookupSid_args_out(struct wbint_LookupSid *r) { PyObject *result; PyObject *py_type; PyObject *py_domain; PyObject *py_name; result = PyTuple_New(3); py_type = PyLong_FromLong((uint16_t)*r->out.type); PyTuple_SetItem(result, 0, py_type); if (*r->out.domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { if (*r->out.domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { py_domain = PyUnicode_Decode(*r->out.domain, strlen(*r->out.domain), "utf-8", "ignore"); } } PyTuple_SetItem(result, 1, py_domain); if (*r->out.name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { if (*r->out.name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { py_name = PyUnicode_Decode(*r->out.name, strlen(*r->out.name), "utf-8", "ignore"); } } PyTuple_SetItem(result, 2, py_name); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_LookupSids_in_get_sids(PyObject *obj, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->in.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids); return py_sids; } static int py_wbint_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids"); return -1; } object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids); if (object->in.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupSids_out_get_domains(PyObject *obj, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj); PyObject *py_domains; if (object->out.domains == NULL) { Py_RETURN_NONE; } py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->out.domains, object->out.domains); return py_domains; } static int py_wbint_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains"); return -1; } object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains); if (object->out.domains == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupSids_out_get_names(PyObject *obj, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj); PyObject *py_names; if (object->out.names == NULL) { Py_RETURN_NONE; } py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, object->out.names, object->out.names); return py_names; } static int py_wbint_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names"); return -1; } object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names); if (object->out.names == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_TransNameArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupSids_get_result(PyObject *obj, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupSids_getsetters[] = { { .name = discard_const_p(char, "in_sids"), .get = py_wbint_LookupSids_in_get_sids, .set = py_wbint_LookupSids_in_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray") }, { .name = discard_const_p(char, "out_domains"), .get = py_wbint_LookupSids_out_get_domains, .set = py_wbint_LookupSids_out_set_domains, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList") }, { .name = discard_const_p(char, "out_names"), .get = py_wbint_LookupSids_out_get_names, .set = py_wbint_LookupSids_out_set_names, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupSids_get_result, .set = py_wbint_LookupSids_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupSids, type); struct wbint_LookupSids *_self = (struct wbint_LookupSids *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray); _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList); _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray); return self; } static PyObject *py_wbint_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(2); } static PyObject *py_wbint_LookupSids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[2]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupSids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[2]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupSids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[2]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_in", NDR_IN); } static PyObject *py_wbint_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_out", NDR_OUT); } static PyMethodDef py_wbint_LookupSids_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupSids.opnum() -> 2 (0x02) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupSids_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupSids", .tp_getset = py_wbint_LookupSids_getsetters, .tp_methods = py_wbint_LookupSids_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupSids_new, }; static bool pack_py_wbint_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSids *r) { PyObject *py_sids; const char *kwnames[] = { "sids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSids", discard_const_p(char *, kwnames), &py_sids)) { return false; } if (py_sids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids"); return false; } r->in.sids = talloc_ptrtype(r, r->in.sids); if (r->in.sids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) { PyErr_NoMemory(); return false; } r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids); return true; } static PyObject *unpack_py_wbint_LookupSids_args_out(struct wbint_LookupSids *r) { PyObject *result; PyObject *py_domains; PyObject *py_names; result = PyTuple_New(2); py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, r->out.domains, r->out.domains); PyTuple_SetItem(result, 0, py_domains); py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, r->out.names, r->out.names); PyTuple_SetItem(result, 1, py_names); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_LookupName_in_get_domain(PyObject *obj, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj); PyObject *py_domain; if (object->in.domain == NULL) { Py_RETURN_NONE; } if (object->in.domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore"); } return py_domain; } static int py_wbint_LookupName_in_set_domain(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain"); return -1; } object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain); if (object->in.domain == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.domain = talloc_str; } return 0; } static PyObject *py_wbint_LookupName_in_get_name(PyObject *obj, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->in.name == NULL) { Py_RETURN_NONE; } if (object->in.name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { py_name = PyUnicode_Decode(object->in.name, strlen(object->in.name), "utf-8", "ignore"); } return py_name; } static int py_wbint_LookupName_in_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name"); return -1; } object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name); if (object->in.name == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.name = talloc_str; } return 0; } static PyObject *py_wbint_LookupName_in_get_flags(PyObject *obj, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_wbint_LookupName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_LookupName_out_get_type(PyObject *obj, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj); PyObject *py_type; if (object->out.type == NULL) { Py_RETURN_NONE; } py_type = PyLong_FromLong((uint16_t)*object->out.type); return py_type; } static int py_wbint_LookupName_out_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.type"); return -1; } object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type); if (object->out.type == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_LookupName_out_get_sid(PyObject *obj, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->out.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid); return py_sid; } static int py_wbint_LookupName_out_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid"); return -1; } object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid); if (object->out.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupName_get_result(PyObject *obj, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupName_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupName_getsetters[] = { { .name = discard_const_p(char, "in_domain"), .get = py_wbint_LookupName_in_get_domain, .set = py_wbint_LookupName_in_set_domain, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_name"), .get = py_wbint_LookupName_in_get_name, .set = py_wbint_LookupName_in_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_flags"), .get = py_wbint_LookupName_in_get_flags, .set = py_wbint_LookupName_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_type"), .get = py_wbint_LookupName_out_get_type, .set = py_wbint_LookupName_out_set_type, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType") }, { .name = discard_const_p(char, "out_sid"), .get = py_wbint_LookupName_out_get_sid, .set = py_wbint_LookupName_out_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupName_get_result, .set = py_wbint_LookupName_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupName, type); struct wbint_LookupName *_self = (struct wbint_LookupName *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType); _self->out.sid = talloc_zero(mem_ctx, struct dom_sid); return self; } static PyObject *py_wbint_LookupName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(3); } static PyObject *py_wbint_LookupName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[3]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupName_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[3]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[3]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_in", NDR_IN); } static PyObject *py_wbint_LookupName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_out", NDR_OUT); } static PyMethodDef py_wbint_LookupName_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupName_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupName.opnum() -> 3 (0x03) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupName_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupName", .tp_getset = py_wbint_LookupName_getsetters, .tp_methods = py_wbint_LookupName_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupName_new, }; static bool pack_py_wbint_LookupName_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupName *r) { PyObject *py_domain; PyObject *py_name; PyObject *py_flags; const char *kwnames[] = { "domain", "name", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:wbint_LookupName", discard_const_p(char *, kwnames), &py_domain, &py_name, &py_flags)) { return false; } if (py_domain == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain"); return false; } r->in.domain = talloc_ptrtype(r, r->in.domain); if (r->in.domain == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_domain)) { unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_domain)) { test_str = PyBytes_AS_STRING(py_domain); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.domain = talloc_str; } if (py_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name"); return false; } r->in.name = talloc_ptrtype(r, r->in.name); if (r->in.name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_name)) { unicode = PyUnicode_AsEncodedString(py_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_name)) { test_str = PyBytes_AS_STRING(py_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_name)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.name = talloc_str; } if (py_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags)); if (PyLong_Check(py_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_flags); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_wbint_LookupName_args_out(struct wbint_LookupName *r) { PyObject *result; PyObject *py_type; PyObject *py_sid; result = PyTuple_New(2); py_type = PyLong_FromLong((uint16_t)*r->out.type); PyTuple_SetItem(result, 0, py_type); py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid); PyTuple_SetItem(result, 1, py_sid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_Sids2UnixIDs_in_get_domains(PyObject *obj, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj); PyObject *py_domains; if (object->in.domains == NULL) { Py_RETURN_NONE; } py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->in.domains, object->in.domains); return py_domains; } static int py_wbint_Sids2UnixIDs_in_set_domains(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domains)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domains"); return -1; } object->in.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domains); if (object->in.domains == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_Sids2UnixIDs_in_get_ids(PyObject *obj, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj); PyObject *py_ids; if (object->in.ids == NULL) { Py_RETURN_NONE; } py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->in.ids, object->in.ids); return py_ids; } static int py_wbint_Sids2UnixIDs_in_set_ids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.ids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ids"); return -1; } object->in.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ids); if (object->in.ids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_Sids2UnixIDs_out_get_ids(PyObject *obj, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj); PyObject *py_ids; if (object->out.ids == NULL) { Py_RETURN_NONE; } py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->out.ids, object->out.ids); return py_ids; } static int py_wbint_Sids2UnixIDs_out_set_ids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ids"); return -1; } object->out.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ids); if (object->out.ids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_Sids2UnixIDs_get_result(PyObject *obj, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_Sids2UnixIDs_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_Sids2UnixIDs_getsetters[] = { { .name = discard_const_p(char, "in_domains"), .get = py_wbint_Sids2UnixIDs_in_get_domains, .set = py_wbint_Sids2UnixIDs_in_set_domains, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList") }, { .name = discard_const_p(char, "in_ids"), .get = py_wbint_Sids2UnixIDs_in_get_ids, .set = py_wbint_Sids2UnixIDs_in_set_ids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray") }, { .name = discard_const_p(char, "out_ids"), .get = py_wbint_Sids2UnixIDs_out_get_ids, .set = py_wbint_Sids2UnixIDs_out_set_ids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray") }, { .name = discard_const_p(char, "result"), .get = py_wbint_Sids2UnixIDs_get_result, .set = py_wbint_Sids2UnixIDs_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_Sids2UnixIDs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_Sids2UnixIDs, type); struct wbint_Sids2UnixIDs *_self = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList); _self->in.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray); _self->out.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray); return self; } static PyObject *py_wbint_Sids2UnixIDs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(4); } static PyObject *py_wbint_Sids2UnixIDs_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[4]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[4]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_Sids2UnixIDs_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[4]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_Sids2UnixIDs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_in", NDR_IN); } static PyObject *py_wbint_Sids2UnixIDs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_out", NDR_OUT); } static PyMethodDef py_wbint_Sids2UnixIDs_methods[] = { { "opnum", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_Sids2UnixIDs.opnum() -> 4 (0x04) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_Sids2UnixIDs_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_Sids2UnixIDs", .tp_getset = py_wbint_Sids2UnixIDs_getsetters, .tp_methods = py_wbint_Sids2UnixIDs_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_Sids2UnixIDs_new, }; static bool pack_py_wbint_Sids2UnixIDs_args_in(PyObject *args, PyObject *kwargs, struct wbint_Sids2UnixIDs *r) { PyObject *py_domains; PyObject *py_ids; const char *kwnames[] = { "domains", "ids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_Sids2UnixIDs", discard_const_p(char *, kwnames), &py_domains, &py_ids)) { return false; } if (py_domains == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domains"); return false; } r->in.domains = talloc_ptrtype(r, r->in.domains); if (r->in.domains == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_RefDomainList_Type, py_domains, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domains)) == NULL) { PyErr_NoMemory(); return false; } r->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_domains); if (py_ids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ids"); return false; } r->in.ids = talloc_ptrtype(r, r->in.ids); if (r->in.ids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&wbint_TransIDArray_Type, py_ids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ids)) == NULL) { PyErr_NoMemory(); return false; } r->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_ids); return true; } static PyObject *unpack_py_wbint_Sids2UnixIDs_args_out(struct wbint_Sids2UnixIDs *r) { PyObject *result; PyObject *py_ids; py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, r->out.ids, r->out.ids); result = py_ids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_name(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_domain_name; if (object->in.domain_name == NULL) { Py_RETURN_NONE; } if (object->in.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore"); } return py_domain_name; } static int py_wbint_UnixIDs2Sids_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name); if (object->in.domain_name == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.domain_name = talloc_str; } return 0; } static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_sid(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_domain_sid; py_domain_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->in.domain_sid); return py_domain_sid; } static int py_wbint_UnixIDs2Sids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_sid"); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_UnixIDs2Sids_in_get_num_ids(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_num_ids; py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_ids); return py_num_ids; } static int py_wbint_UnixIDs2Sids_in_set_num_ids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_ids"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ids)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.num_ids = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_UnixIDs2Sids_in_get_xids(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_xids; py_xids = PyList_New(object->in.num_ids); if (py_xids == NULL) { return NULL; } { int xids_cntr_0; for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) { PyObject *py_xids_0; py_xids_0 = pytalloc_reference_ex(unixid_Type, object->in.xids, &object->in.xids[xids_cntr_0]); PyList_SetItem(py_xids, xids_cntr_0, py_xids_0); } } return py_xids; } static int py_wbint_UnixIDs2Sids_in_set_xids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.xids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int xids_cntr_0; object->in.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.xids, PyList_GET_SIZE(value)); if (!object->in.xids) { return -1;; } talloc_set_name_const(object->in.xids, "ARRAY: object->in.xids"); for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) { if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.xids[xids_cntr_0]"); return -1; } PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;); if (talloc_reference(object->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->in.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0)); } } return 0; } static PyObject *py_wbint_UnixIDs2Sids_out_get_xids(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_xids; py_xids = PyList_New(object->in.num_ids); if (py_xids == NULL) { return NULL; } { int xids_cntr_0; for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) { PyObject *py_xids_0; py_xids_0 = pytalloc_reference_ex(unixid_Type, object->out.xids, &object->out.xids[xids_cntr_0]); PyList_SetItem(py_xids, xids_cntr_0, py_xids_0); } } return py_xids; } static int py_wbint_UnixIDs2Sids_out_set_xids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.xids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int xids_cntr_0; object->out.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.xids, PyList_GET_SIZE(value)); if (!object->out.xids) { return -1;; } talloc_set_name_const(object->out.xids, "ARRAY: object->out.xids"); for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) { if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.xids[xids_cntr_0]"); return -1; } PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;); if (talloc_reference(object->out.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->out.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0)); } } return 0; } static PyObject *py_wbint_UnixIDs2Sids_out_get_sids(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_sids; py_sids = PyList_New(object->in.num_ids); if (py_sids == NULL) { return NULL; } { int sids_cntr_0; for (sids_cntr_0 = 0; sids_cntr_0 < (object->in.num_ids); sids_cntr_0++) { PyObject *py_sids_0; py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->out.sids, &object->out.sids[sids_cntr_0]); PyList_SetItem(py_sids, sids_cntr_0, py_sids_0); } } return py_sids; } static int py_wbint_UnixIDs2Sids_out_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sids_cntr_0; object->out.sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids, PyList_GET_SIZE(value)); if (!object->out.sids) { return -1;; } talloc_set_name_const(object->out.sids, "ARRAY: object->out.sids"); for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) { if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids[sids_cntr_0]"); return -1; } PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;); if (talloc_reference(object->out.sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->out.sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0)); } } return 0; } static PyObject *py_wbint_UnixIDs2Sids_get_result(PyObject *obj, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_UnixIDs2Sids_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_UnixIDs2Sids_getsetters[] = { { .name = discard_const_p(char, "in_domain_name"), .get = py_wbint_UnixIDs2Sids_in_get_domain_name, .set = py_wbint_UnixIDs2Sids_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_domain_sid"), .get = py_wbint_UnixIDs2Sids_in_get_domain_sid, .set = py_wbint_UnixIDs2Sids_in_set_domain_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "in_num_ids"), .get = py_wbint_UnixIDs2Sids_in_get_num_ids, .set = py_wbint_UnixIDs2Sids_in_set_num_ids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_xids"), .get = py_wbint_UnixIDs2Sids_in_get_xids, .set = py_wbint_UnixIDs2Sids_in_set_xids, .doc = discard_const_p(char, "PIDL-generated element of base type unixid") }, { .name = discard_const_p(char, "out_xids"), .get = py_wbint_UnixIDs2Sids_out_get_xids, .set = py_wbint_UnixIDs2Sids_out_set_xids, .doc = discard_const_p(char, "PIDL-generated element of base type unixid") }, { .name = discard_const_p(char, "out_sids"), .get = py_wbint_UnixIDs2Sids_out_get_sids, .set = py_wbint_UnixIDs2Sids_out_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "result"), .get = py_wbint_UnixIDs2Sids_get_result, .set = py_wbint_UnixIDs2Sids_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_UnixIDs2Sids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_UnixIDs2Sids, type); return self; } static PyObject *py_wbint_UnixIDs2Sids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(5); } static PyObject *py_wbint_UnixIDs2Sids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[5]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[5]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_UnixIDs2Sids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[5]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_UnixIDs2Sids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_in", NDR_IN); } static PyObject *py_wbint_UnixIDs2Sids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_out", NDR_OUT); } static PyMethodDef py_wbint_UnixIDs2Sids_methods[] = { { "opnum", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_UnixIDs2Sids.opnum() -> 5 (0x05) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_UnixIDs2Sids_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_UnixIDs2Sids", .tp_getset = py_wbint_UnixIDs2Sids_getsetters, .tp_methods = py_wbint_UnixIDs2Sids_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_UnixIDs2Sids_new, }; static bool pack_py_wbint_UnixIDs2Sids_args_in(PyObject *args, PyObject *kwargs, struct wbint_UnixIDs2Sids *r) { PyObject *py_domain_name; PyObject *py_domain_sid; PyObject *py_num_ids; PyObject *py_xids; const char *kwnames[] = { "domain_name", "domain_sid", "num_ids", "xids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:wbint_UnixIDs2Sids", discard_const_p(char *, kwnames), &py_domain_name, &py_domain_sid, &py_num_ids, &py_xids)) { return false; } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } r->in.domain_name = talloc_ptrtype(r, r->in.domain_name); if (r->in.domain_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_domain_name)) { unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_domain_name)) { test_str = PyBytes_AS_STRING(py_domain_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.domain_name = talloc_str; } if (py_domain_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_sid"); return false; } PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(py_domain_sid); if (py_num_ids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.num_ids"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_ids)); if (PyLong_Check(py_num_ids)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_num_ids); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.num_ids = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_xids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.xids"); return false; } PY_CHECK_TYPE(&PyList_Type, py_xids, return false;); { int xids_cntr_0; r->in.xids = talloc_array_ptrtype(r, r->in.xids, PyList_GET_SIZE(py_xids)); if (!r->in.xids) { return false;; } talloc_set_name_const(r->in.xids, "ARRAY: r->in.xids"); for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(py_xids); xids_cntr_0++) { if (PyList_GET_ITEM(py_xids, xids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.xids[xids_cntr_0]"); return false; } PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(py_xids, xids_cntr_0), return false;); if (talloc_reference(r->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_xids, xids_cntr_0))) == NULL) { PyErr_NoMemory(); return false; } r->in.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(py_xids, xids_cntr_0)); } } return true; } static PyObject *unpack_py_wbint_UnixIDs2Sids_args_out(struct wbint_UnixIDs2Sids *r) { PyObject *result; PyObject *py_xids; PyObject *py_sids; result = PyTuple_New(2); py_xids = PyList_New(r->in.num_ids); if (py_xids == NULL) { return NULL; } { int xids_cntr_0; for (xids_cntr_0 = 0; xids_cntr_0 < (r->in.num_ids); xids_cntr_0++) { PyObject *py_xids_0; py_xids_0 = pytalloc_reference_ex(unixid_Type, r->out.xids, &r->out.xids[xids_cntr_0]); PyList_SetItem(py_xids, xids_cntr_0, py_xids_0); } } PyTuple_SetItem(result, 0, py_xids); py_sids = PyList_New(r->in.num_ids); if (py_sids == NULL) { return NULL; } { int sids_cntr_0; for (sids_cntr_0 = 0; sids_cntr_0 < (r->in.num_ids); sids_cntr_0++) { PyObject *py_sids_0; py_sids_0 = pytalloc_reference_ex(dom_sid_Type, r->out.sids, &r->out.sids[sids_cntr_0]); PyList_SetItem(py_sids, sids_cntr_0, py_sids_0); } } PyTuple_SetItem(result, 1, py_sids); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_AllocateUid_out_get_uid(PyObject *obj, void *closure) { struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(obj); PyObject *py_uid; if (object->out.uid == NULL) { Py_RETURN_NONE; } py_uid = PyLong_FromUnsignedLongLong(*object->out.uid); return py_uid; } static int py_wbint_AllocateUid_out_set_uid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.uid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.uid"); return -1; } object->out.uid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.uid); if (object->out.uid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.uid)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.uid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_AllocateUid_get_result(PyObject *obj, void *closure) { struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_AllocateUid_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_AllocateUid_getsetters[] = { { .name = discard_const_p(char, "out_uid"), .get = py_wbint_AllocateUid_out_get_uid, .set = py_wbint_AllocateUid_out_set_uid, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "result"), .get = py_wbint_AllocateUid_get_result, .set = py_wbint_AllocateUid_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_AllocateUid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_AllocateUid, type); struct wbint_AllocateUid *_self = (struct wbint_AllocateUid *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.uid = talloc_zero(mem_ctx, uint64_t); return self; } static PyObject *py_wbint_AllocateUid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(6); } static PyObject *py_wbint_AllocateUid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[6]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_AllocateUid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_AllocateUid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_AllocateUid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[6]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_AllocateUid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_AllocateUid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_AllocateUid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[6]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_AllocateUid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_in", NDR_IN); } static PyObject *py_wbint_AllocateUid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_out", NDR_OUT); } static PyMethodDef py_wbint_AllocateUid_methods[] = { { "opnum", (PyCFunction)py_wbint_AllocateUid_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_AllocateUid.opnum() -> 6 (0x06) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateUid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateUid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_AllocateUid_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_AllocateUid", .tp_getset = py_wbint_AllocateUid_getsetters, .tp_methods = py_wbint_AllocateUid_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_AllocateUid_new, }; static bool pack_py_wbint_AllocateUid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateUid *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateUid", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_AllocateUid_args_out(struct wbint_AllocateUid *r) { PyObject *result; PyObject *py_uid; py_uid = PyLong_FromUnsignedLongLong(*r->out.uid); result = py_uid; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_AllocateGid_out_get_gid(PyObject *obj, void *closure) { struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(obj); PyObject *py_gid; if (object->out.gid == NULL) { Py_RETURN_NONE; } py_gid = PyLong_FromUnsignedLongLong(*object->out.gid); return py_gid; } static int py_wbint_AllocateGid_out_set_gid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.gid"); return -1; } object->out.gid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gid); if (object->out.gid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.gid)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_AllocateGid_get_result(PyObject *obj, void *closure) { struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_AllocateGid_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_AllocateGid_getsetters[] = { { .name = discard_const_p(char, "out_gid"), .get = py_wbint_AllocateGid_out_get_gid, .set = py_wbint_AllocateGid_out_set_gid, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "result"), .get = py_wbint_AllocateGid_get_result, .set = py_wbint_AllocateGid_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_AllocateGid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_AllocateGid, type); struct wbint_AllocateGid *_self = (struct wbint_AllocateGid *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.gid = talloc_zero(mem_ctx, uint64_t); return self; } static PyObject *py_wbint_AllocateGid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(7); } static PyObject *py_wbint_AllocateGid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[7]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_AllocateGid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_AllocateGid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_AllocateGid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[7]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_AllocateGid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_AllocateGid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_AllocateGid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[7]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_AllocateGid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_in", NDR_IN); } static PyObject *py_wbint_AllocateGid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_out", NDR_OUT); } static PyMethodDef py_wbint_AllocateGid_methods[] = { { "opnum", (PyCFunction)py_wbint_AllocateGid_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_AllocateGid.opnum() -> 7 (0x07) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateGid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateGid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_AllocateGid_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_AllocateGid", .tp_getset = py_wbint_AllocateGid_getsetters, .tp_methods = py_wbint_AllocateGid_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_AllocateGid_new, }; static bool pack_py_wbint_AllocateGid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateGid *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateGid", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_AllocateGid_args_out(struct wbint_AllocateGid *r) { PyObject *result; PyObject *py_gid; py_gid = PyLong_FromUnsignedLongLong(*r->out.gid); result = py_gid; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_GetNssInfo_in_get_info(PyObject *obj, void *closure) { struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->in.info == NULL) { Py_RETURN_NONE; } py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->in.info, object->in.info); return py_info; } static int py_wbint_GetNssInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info"); return -1; } object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info); if (object->in.info == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_GetNssInfo_out_get_info(PyObject *obj, void *closure) { struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->out.info, object->out.info); return py_info; } static int py_wbint_GetNssInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.info = (struct wbint_userinfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_GetNssInfo_get_result(PyObject *obj, void *closure) { struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_GetNssInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_GetNssInfo_getsetters[] = { { .name = discard_const_p(char, "in_info"), .get = py_wbint_GetNssInfo_in_get_info, .set = py_wbint_GetNssInfo_in_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo") }, { .name = discard_const_p(char, "out_info"), .get = py_wbint_GetNssInfo_out_get_info, .set = py_wbint_GetNssInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo") }, { .name = discard_const_p(char, "result"), .get = py_wbint_GetNssInfo_get_result, .set = py_wbint_GetNssInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_GetNssInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_GetNssInfo, type); struct wbint_GetNssInfo *_self = (struct wbint_GetNssInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.info = talloc_zero(mem_ctx, struct wbint_userinfo); _self->out.info = talloc_zero(mem_ctx, struct wbint_userinfo); return self; } static PyObject *py_wbint_GetNssInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(8); } static PyObject *py_wbint_GetNssInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[8]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_GetNssInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_GetNssInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_GetNssInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[8]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_GetNssInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_GetNssInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_GetNssInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[8]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_GetNssInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_in", NDR_IN); } static PyObject *py_wbint_GetNssInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_out", NDR_OUT); } static PyMethodDef py_wbint_GetNssInfo_methods[] = { { "opnum", (PyCFunction)py_wbint_GetNssInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_GetNssInfo.opnum() -> 8 (0x08) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_GetNssInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_GetNssInfo", .tp_getset = py_wbint_GetNssInfo_getsetters, .tp_methods = py_wbint_GetNssInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_GetNssInfo_new, }; static bool pack_py_wbint_GetNssInfo_args_in(PyObject *args, PyObject *kwargs, struct wbint_GetNssInfo *r) { PyObject *py_info; const char *kwnames[] = { "info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_GetNssInfo", discard_const_p(char *, kwnames), &py_info)) { return false; } if (py_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info"); return false; } r->in.info = talloc_ptrtype(r, r->in.info); if (r->in.info == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&wbint_userinfo_Type, py_info, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) { PyErr_NoMemory(); return false; } r->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(py_info); return true; } static PyObject *unpack_py_wbint_GetNssInfo_args_out(struct wbint_GetNssInfo *r) { PyObject *result; PyObject *py_info; py_info = pytalloc_reference_ex(&wbint_userinfo_Type, r->out.info, r->out.info); result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_LookupUserAliases_in_get_sids(PyObject *obj, void *closure) { struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->in.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.sids, object->in.sids); return py_sids; } static int py_wbint_LookupUserAliases_in_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids"); return -1; } object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids); if (object->in.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupUserAliases_out_get_rids(PyObject *obj, void *closure) { struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->out.rids == NULL) { Py_RETURN_NONE; } py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids); return py_rids; } static int py_wbint_LookupUserAliases_out_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids"); return -1; } object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids); if (object->out.rids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupUserAliases_get_result(PyObject *obj, void *closure) { struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupUserAliases_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupUserAliases_getsetters[] = { { .name = discard_const_p(char, "in_sids"), .get = py_wbint_LookupUserAliases_in_get_sids, .set = py_wbint_LookupUserAliases_in_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray") }, { .name = discard_const_p(char, "out_rids"), .get = py_wbint_LookupUserAliases_out_get_rids, .set = py_wbint_LookupUserAliases_out_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupUserAliases_get_result, .set = py_wbint_LookupUserAliases_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupUserAliases_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupUserAliases, type); struct wbint_LookupUserAliases *_self = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.sids = talloc_zero(mem_ctx, struct wbint_SidArray); _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray); return self; } static PyObject *py_wbint_LookupUserAliases_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(9); } static PyObject *py_wbint_LookupUserAliases_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[9]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupUserAliases_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupUserAliases_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupUserAliases_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[9]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupUserAliases_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupUserAliases_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupUserAliases_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[9]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupUserAliases_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_in", NDR_IN); } static PyObject *py_wbint_LookupUserAliases_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_out", NDR_OUT); } static PyMethodDef py_wbint_LookupUserAliases_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupUserAliases_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupUserAliases.opnum() -> 9 (0x09) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupUserAliases_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupUserAliases", .tp_getset = py_wbint_LookupUserAliases_getsetters, .tp_methods = py_wbint_LookupUserAliases_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupUserAliases_new, }; static bool pack_py_wbint_LookupUserAliases_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserAliases *r) { PyObject *py_sids; const char *kwnames[] = { "sids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserAliases", discard_const_p(char *, kwnames), &py_sids)) { return false; } if (py_sids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids"); return false; } r->in.sids = talloc_ptrtype(r, r->in.sids); if (r->in.sids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&wbint_SidArray_Type, py_sids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) { PyErr_NoMemory(); return false; } r->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(py_sids); return true; } static PyObject *unpack_py_wbint_LookupUserAliases_args_out(struct wbint_LookupUserAliases *r) { PyObject *result; PyObject *py_rids; py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids); result = py_rids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_LookupUserGroups_in_get_sid(PyObject *obj, void *closure) { struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_wbint_LookupUserGroups_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupUserGroups_out_get_sids(PyObject *obj, void *closure) { struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->out.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->out.sids, object->out.sids); return py_sids; } static int py_wbint_LookupUserGroups_out_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids"); return -1; } object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids); if (object->out.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupUserGroups_get_result(PyObject *obj, void *closure) { struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupUserGroups_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupUserGroups_getsetters[] = { { .name = discard_const_p(char, "in_sid"), .get = py_wbint_LookupUserGroups_in_get_sid, .set = py_wbint_LookupUserGroups_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "out_sids"), .get = py_wbint_LookupUserGroups_out_get_sids, .set = py_wbint_LookupUserGroups_out_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupUserGroups_get_result, .set = py_wbint_LookupUserGroups_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupUserGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupUserGroups, type); struct wbint_LookupUserGroups *_self = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid); _self->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray); return self; } static PyObject *py_wbint_LookupUserGroups_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(10); } static PyObject *py_wbint_LookupUserGroups_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[10]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupUserGroups_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupUserGroups_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupUserGroups_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[10]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupUserGroups_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupUserGroups_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupUserGroups_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[10]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupUserGroups_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_in", NDR_IN); } static PyObject *py_wbint_LookupUserGroups_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_out", NDR_OUT); } static PyMethodDef py_wbint_LookupUserGroups_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupUserGroups_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupUserGroups.opnum() -> 10 (0x0a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupUserGroups_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupUserGroups", .tp_getset = py_wbint_LookupUserGroups_getsetters, .tp_methods = py_wbint_LookupUserGroups_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupUserGroups_new, }; static bool pack_py_wbint_LookupUserGroups_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserGroups *r) { PyObject *py_sid; const char *kwnames[] = { "sid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserGroups", discard_const_p(char *, kwnames), &py_sid)) { return false; } if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); return true; } static PyObject *unpack_py_wbint_LookupUserGroups_args_out(struct wbint_LookupUserGroups *r) { PyObject *result; PyObject *py_sids; py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, r->out.sids, r->out.sids); result = py_sids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_QuerySequenceNumber_out_get_sequence(PyObject *obj, void *closure) { struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(obj); PyObject *py_sequence; if (object->out.sequence == NULL) { Py_RETURN_NONE; } py_sequence = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sequence); return py_sequence; } static int py_wbint_QuerySequenceNumber_out_set_sequence(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sequence)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sequence"); return -1; } object->out.sequence = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sequence); if (object->out.sequence == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sequence)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.sequence = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_QuerySequenceNumber_get_result(PyObject *obj, void *closure) { struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_QuerySequenceNumber_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_QuerySequenceNumber_getsetters[] = { { .name = discard_const_p(char, "out_sequence"), .get = py_wbint_QuerySequenceNumber_out_get_sequence, .set = py_wbint_QuerySequenceNumber_out_set_sequence, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_wbint_QuerySequenceNumber_get_result, .set = py_wbint_QuerySequenceNumber_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_QuerySequenceNumber_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_QuerySequenceNumber, type); struct wbint_QuerySequenceNumber *_self = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.sequence = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_wbint_QuerySequenceNumber_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(11); } static PyObject *py_wbint_QuerySequenceNumber_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[11]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[11]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_QuerySequenceNumber_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[11]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_QuerySequenceNumber_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_in", NDR_IN); } static PyObject *py_wbint_QuerySequenceNumber_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_out", NDR_OUT); } static PyMethodDef py_wbint_QuerySequenceNumber_methods[] = { { "opnum", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_QuerySequenceNumber.opnum() -> 11 (0x0b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_QuerySequenceNumber_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_QuerySequenceNumber", .tp_getset = py_wbint_QuerySequenceNumber_getsetters, .tp_methods = py_wbint_QuerySequenceNumber_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_QuerySequenceNumber_new, }; static bool pack_py_wbint_QuerySequenceNumber_args_in(PyObject *args, PyObject *kwargs, struct wbint_QuerySequenceNumber *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QuerySequenceNumber", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_QuerySequenceNumber_args_out(struct wbint_QuerySequenceNumber *r) { PyObject *result; PyObject *py_sequence; py_sequence = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sequence); result = py_sequence; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_LookupGroupMembers_in_get_sid(PyObject *obj, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_wbint_LookupGroupMembers_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupGroupMembers_in_get_type(PyObject *obj, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj); PyObject *py_type; py_type = PyLong_FromLong((uint16_t)object->in.type); return py_type; } static int py_wbint_LookupGroupMembers_in_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_LookupGroupMembers_out_get_members(PyObject *obj, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj); PyObject *py_members; if (object->out.members == NULL) { Py_RETURN_NONE; } py_members = pytalloc_reference_ex(&wbint_Principals_Type, object->out.members, object->out.members); return py_members; } static int py_wbint_LookupGroupMembers_out_set_members(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.members)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.members"); return -1; } object->out.members = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.members); if (object->out.members == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.members = (struct wbint_Principals *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupGroupMembers_get_result(PyObject *obj, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupGroupMembers_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupGroupMembers_getsetters[] = { { .name = discard_const_p(char, "in_sid"), .get = py_wbint_LookupGroupMembers_in_get_sid, .set = py_wbint_LookupGroupMembers_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "in_type"), .get = py_wbint_LookupGroupMembers_in_get_type, .set = py_wbint_LookupGroupMembers_in_set_type, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType") }, { .name = discard_const_p(char, "out_members"), .get = py_wbint_LookupGroupMembers_out_get_members, .set = py_wbint_LookupGroupMembers_out_set_members, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupGroupMembers_get_result, .set = py_wbint_LookupGroupMembers_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupGroupMembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupGroupMembers, type); struct wbint_LookupGroupMembers *_self = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid); _self->out.members = talloc_zero(mem_ctx, struct wbint_Principals); return self; } static PyObject *py_wbint_LookupGroupMembers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(12); } static PyObject *py_wbint_LookupGroupMembers_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[12]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupGroupMembers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupGroupMembers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupGroupMembers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[12]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupGroupMembers_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[12]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupGroupMembers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_in", NDR_IN); } static PyObject *py_wbint_LookupGroupMembers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_out", NDR_OUT); } static PyMethodDef py_wbint_LookupGroupMembers_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupGroupMembers_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupGroupMembers.opnum() -> 12 (0x0c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupGroupMembers_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupGroupMembers", .tp_getset = py_wbint_LookupGroupMembers_getsetters, .tp_methods = py_wbint_LookupGroupMembers_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupGroupMembers_new, }; static bool pack_py_wbint_LookupGroupMembers_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupGroupMembers *r) { PyObject *py_sid; PyObject *py_type; const char *kwnames[] = { "sid", "type", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupGroupMembers", discard_const_p(char *, kwnames), &py_sid, &py_type)) { return false; } if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); if (py_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type)); if (PyLong_Check(py_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_type); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_wbint_LookupGroupMembers_args_out(struct wbint_LookupGroupMembers *r) { PyObject *result; PyObject *py_members; py_members = pytalloc_reference_ex(&wbint_Principals_Type, r->out.members, r->out.members); result = py_members; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_QueryGroupList_out_get_groups(PyObject *obj, void *closure) { struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(obj); PyObject *py_groups; if (object->out.groups == NULL) { Py_RETURN_NONE; } py_groups = pytalloc_reference_ex(&wbint_Principals_Type, object->out.groups, object->out.groups); return py_groups; } static int py_wbint_QueryGroupList_out_set_groups(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.groups)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.groups"); return -1; } object->out.groups = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.groups); if (object->out.groups == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.groups = (struct wbint_Principals *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_QueryGroupList_get_result(PyObject *obj, void *closure) { struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_QueryGroupList_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_QueryGroupList_getsetters[] = { { .name = discard_const_p(char, "out_groups"), .get = py_wbint_QueryGroupList_out_get_groups, .set = py_wbint_QueryGroupList_out_set_groups, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals") }, { .name = discard_const_p(char, "result"), .get = py_wbint_QueryGroupList_get_result, .set = py_wbint_QueryGroupList_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_QueryGroupList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_QueryGroupList, type); struct wbint_QueryGroupList *_self = (struct wbint_QueryGroupList *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.groups = talloc_zero(mem_ctx, struct wbint_Principals); return self; } static PyObject *py_wbint_QueryGroupList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(13); } static PyObject *py_wbint_QueryGroupList_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[13]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_QueryGroupList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_QueryGroupList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_QueryGroupList_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[13]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_QueryGroupList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_QueryGroupList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_QueryGroupList_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[13]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_QueryGroupList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_in", NDR_IN); } static PyObject *py_wbint_QueryGroupList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_out", NDR_OUT); } static PyMethodDef py_wbint_QueryGroupList_methods[] = { { "opnum", (PyCFunction)py_wbint_QueryGroupList_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_QueryGroupList.opnum() -> 13 (0x0d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_QueryGroupList_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_QueryGroupList", .tp_getset = py_wbint_QueryGroupList_getsetters, .tp_methods = py_wbint_QueryGroupList_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_QueryGroupList_new, }; static bool pack_py_wbint_QueryGroupList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryGroupList *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryGroupList", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_QueryGroupList_args_out(struct wbint_QueryGroupList *r) { PyObject *result; PyObject *py_groups; py_groups = pytalloc_reference_ex(&wbint_Principals_Type, r->out.groups, r->out.groups); result = py_groups; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_QueryUserRidList_out_get_rids(PyObject *obj, void *closure) { struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->out.rids == NULL) { Py_RETURN_NONE; } py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids); return py_rids; } static int py_wbint_QueryUserRidList_out_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids"); return -1; } object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids); if (object->out.rids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_QueryUserRidList_get_result(PyObject *obj, void *closure) { struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_QueryUserRidList_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_QueryUserRidList_getsetters[] = { { .name = discard_const_p(char, "out_rids"), .get = py_wbint_QueryUserRidList_out_get_rids, .set = py_wbint_QueryUserRidList_out_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray") }, { .name = discard_const_p(char, "result"), .get = py_wbint_QueryUserRidList_get_result, .set = py_wbint_QueryUserRidList_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_QueryUserRidList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_QueryUserRidList, type); struct wbint_QueryUserRidList *_self = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray); return self; } static PyObject *py_wbint_QueryUserRidList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(14); } static PyObject *py_wbint_QueryUserRidList_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[14]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_QueryUserRidList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_QueryUserRidList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_QueryUserRidList_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[14]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_QueryUserRidList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_QueryUserRidList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_QueryUserRidList_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[14]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_QueryUserRidList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_in", NDR_IN); } static PyObject *py_wbint_QueryUserRidList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_out", NDR_OUT); } static PyMethodDef py_wbint_QueryUserRidList_methods[] = { { "opnum", (PyCFunction)py_wbint_QueryUserRidList_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_QueryUserRidList.opnum() -> 14 (0x0e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_QueryUserRidList_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_QueryUserRidList", .tp_getset = py_wbint_QueryUserRidList_getsetters, .tp_methods = py_wbint_QueryUserRidList_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_QueryUserRidList_new, }; static bool pack_py_wbint_QueryUserRidList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryUserRidList *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryUserRidList", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_QueryUserRidList_args_out(struct wbint_QueryUserRidList *r) { PyObject *result; PyObject *py_rids; py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids); result = py_rids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_DsGetDcName_in_get_domain_name(PyObject *obj, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj); PyObject *py_domain_name; if (object->in.domain_name == NULL) { Py_RETURN_NONE; } if (object->in.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore"); } return py_domain_name; } static int py_wbint_DsGetDcName_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name); if (object->in.domain_name == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.domain_name = talloc_str; } return 0; } static PyObject *py_wbint_DsGetDcName_in_get_domain_guid(PyObject *obj, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj); PyObject *py_domain_guid; if (object->in.domain_guid == NULL) { Py_RETURN_NONE; } if (object->in.domain_guid == NULL) { py_domain_guid = Py_None; Py_INCREF(py_domain_guid); } else { py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid); } return py_domain_guid; } static int py_wbint_DsGetDcName_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid"); return -1; } if (value == Py_None) { object->in.domain_guid = NULL; } else { object->in.domain_guid = NULL; PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_wbint_DsGetDcName_in_get_site_name(PyObject *obj, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj); PyObject *py_site_name; if (object->in.site_name == NULL) { Py_RETURN_NONE; } if (object->in.site_name == NULL) { py_site_name = Py_None; Py_INCREF(py_site_name); } else { if (object->in.site_name == NULL) { py_site_name = Py_None; Py_INCREF(py_site_name); } else { py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore"); } } return py_site_name; } static int py_wbint_DsGetDcName_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name"); return -1; } if (value == Py_None) { object->in.site_name = NULL; } else { object->in.site_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.site_name = talloc_str; } } return 0; } static PyObject *py_wbint_DsGetDcName_in_get_flags(PyObject *obj, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_wbint_DsGetDcName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_wbint_DsGetDcName_out_get_dc_info(PyObject *obj, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj); PyObject *py_dc_info; if (object->out.dc_info == NULL) { Py_RETURN_NONE; } if (*object->out.dc_info == NULL) { py_dc_info = Py_None; Py_INCREF(py_dc_info); } else { py_dc_info = pytalloc_reference_ex(netr_DsRGetDCNameInfo_Type, *object->out.dc_info, *object->out.dc_info); } return py_dc_info; } static int py_wbint_DsGetDcName_out_set_dc_info(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dc_info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dc_info"); return -1; } object->out.dc_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dc_info); if (object->out.dc_info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.dc_info = NULL; } else { *object->out.dc_info = NULL; PY_CHECK_TYPE(netr_DsRGetDCNameInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } *object->out.dc_info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_wbint_DsGetDcName_get_result(PyObject *obj, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_DsGetDcName_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_DsGetDcName_getsetters[] = { { .name = discard_const_p(char, "in_domain_name"), .get = py_wbint_DsGetDcName_in_get_domain_name, .set = py_wbint_DsGetDcName_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_domain_guid"), .get = py_wbint_DsGetDcName_in_get_domain_guid, .set = py_wbint_DsGetDcName_in_set_domain_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_site_name"), .get = py_wbint_DsGetDcName_in_get_site_name, .set = py_wbint_DsGetDcName_in_set_site_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_flags"), .get = py_wbint_DsGetDcName_in_get_flags, .set = py_wbint_DsGetDcName_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_dc_info"), .get = py_wbint_DsGetDcName_out_get_dc_info, .set = py_wbint_DsGetDcName_out_set_dc_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo") }, { .name = discard_const_p(char, "result"), .get = py_wbint_DsGetDcName_get_result, .set = py_wbint_DsGetDcName_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_DsGetDcName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_DsGetDcName, type); struct wbint_DsGetDcName *_self = (struct wbint_DsGetDcName *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.dc_info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *); return self; } static PyObject *py_wbint_DsGetDcName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(15); } static PyObject *py_wbint_DsGetDcName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[15]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_DsGetDcName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_DsGetDcName_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_DsGetDcName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_DsGetDcName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_DsGetDcName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[15]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_DsGetDcName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_DsGetDcName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_DsGetDcName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_DsGetDcName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_DsGetDcName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[15]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_DsGetDcName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_DsGetDcName_ndr_print(py_obj, "wbint_DsGetDcName_in", NDR_IN); } static PyObject *py_wbint_DsGetDcName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_DsGetDcName_ndr_print(py_obj, "wbint_DsGetDcName_out", NDR_OUT); } static PyMethodDef py_wbint_DsGetDcName_methods[] = { { "opnum", (PyCFunction)py_wbint_DsGetDcName_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_DsGetDcName.opnum() -> 15 (0x0f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_DsGetDcName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_DsGetDcName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_DsGetDcName_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_DsGetDcName", .tp_getset = py_wbint_DsGetDcName_getsetters, .tp_methods = py_wbint_DsGetDcName_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_DsGetDcName_new, }; static bool pack_py_wbint_DsGetDcName_args_in(PyObject *args, PyObject *kwargs, struct wbint_DsGetDcName *r) { PyObject *py_domain_name; PyObject *py_domain_guid; PyObject *py_site_name; PyObject *py_flags; const char *kwnames[] = { "domain_name", "domain_guid", "site_name", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:wbint_DsGetDcName", discard_const_p(char *, kwnames), &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) { return false; } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } r->in.domain_name = talloc_ptrtype(r, r->in.domain_name); if (r->in.domain_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_domain_name)) { unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_domain_name)) { test_str = PyBytes_AS_STRING(py_domain_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.domain_name = talloc_str; } if (py_domain_guid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_guid"); return false; } if (py_domain_guid == Py_None) { r->in.domain_guid = NULL; } else { r->in.domain_guid = NULL; PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid); } if (py_site_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name"); return false; } if (py_site_name == Py_None) { r->in.site_name = NULL; } else { r->in.site_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_site_name)) { unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_site_name)) { test_str = PyBytes_AS_STRING(py_site_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.site_name = talloc_str; } } if (py_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags)); if (PyLong_Check(py_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_flags); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_wbint_DsGetDcName_args_out(struct wbint_DsGetDcName *r) { PyObject *result; PyObject *py_dc_info; if (*r->out.dc_info == NULL) { py_dc_info = Py_None; Py_INCREF(py_dc_info); } else { py_dc_info = pytalloc_reference_ex(netr_DsRGetDCNameInfo_Type, *r->out.dc_info, *r->out.dc_info); } result = py_dc_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_LookupRids_in_get_domain_sid(PyObject *obj, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_domain_sid; if (object->in.domain_sid == NULL) { Py_RETURN_NONE; } py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->in.domain_sid, object->in.domain_sid); return py_domain_sid; } static int py_wbint_LookupRids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_sid"); return -1; } object->in.domain_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_sid); if (object->in.domain_sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupRids_in_get_rids(PyObject *obj, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->in.rids == NULL) { Py_RETURN_NONE; } py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->in.rids, object->in.rids); return py_rids; } static int py_wbint_LookupRids_in_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rids"); return -1; } object->in.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rids); if (object->in.rids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupRids_out_get_domain_name(PyObject *obj, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_domain_name; if (object->out.domain_name == NULL) { Py_RETURN_NONE; } if (*object->out.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { if (*object->out.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { py_domain_name = PyUnicode_Decode(*object->out.domain_name, strlen(*object->out.domain_name), "utf-8", "ignore"); } } return py_domain_name; } static int py_wbint_LookupRids_out_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain_name"); return -1; } object->out.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain_name); if (object->out.domain_name == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.domain_name = NULL; } else { *object->out.domain_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } *object->out.domain_name = talloc_str; } } return 0; } static PyObject *py_wbint_LookupRids_out_get_names(PyObject *obj, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_names; if (object->out.names == NULL) { Py_RETURN_NONE; } py_names = pytalloc_reference_ex(&wbint_Principals_Type, object->out.names, object->out.names); return py_names; } static int py_wbint_LookupRids_out_set_names(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names"); return -1; } object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names); if (object->out.names == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.names = (struct wbint_Principals *)pytalloc_get_ptr(value); return 0; } static PyObject *py_wbint_LookupRids_get_result(PyObject *obj, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_LookupRids_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_LookupRids_getsetters[] = { { .name = discard_const_p(char, "in_domain_sid"), .get = py_wbint_LookupRids_in_get_domain_sid, .set = py_wbint_LookupRids_in_set_domain_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid") }, { .name = discard_const_p(char, "in_rids"), .get = py_wbint_LookupRids_in_get_rids, .set = py_wbint_LookupRids_in_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray") }, { .name = discard_const_p(char, "out_domain_name"), .get = py_wbint_LookupRids_out_get_domain_name, .set = py_wbint_LookupRids_out_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "out_names"), .get = py_wbint_LookupRids_out_get_names, .set = py_wbint_LookupRids_out_set_names, .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals") }, { .name = discard_const_p(char, "result"), .get = py_wbint_LookupRids_get_result, .set = py_wbint_LookupRids_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_LookupRids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_LookupRids, type); struct wbint_LookupRids *_self = (struct wbint_LookupRids *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_sid = talloc_zero(mem_ctx, struct dom_sid); _self->in.rids = talloc_zero(mem_ctx, struct wbint_RidArray); _self->out.names = talloc_zero(mem_ctx, struct wbint_Principals); return self; } static PyObject *py_wbint_LookupRids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(16); } static PyObject *py_wbint_LookupRids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[16]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_LookupRids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupRids_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_LookupRids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_LookupRids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_LookupRids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[16]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_LookupRids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupRids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupRids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_LookupRids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_LookupRids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[16]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_LookupRids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupRids_ndr_print(py_obj, "wbint_LookupRids_in", NDR_IN); } static PyObject *py_wbint_LookupRids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_LookupRids_ndr_print(py_obj, "wbint_LookupRids_out", NDR_OUT); } static PyMethodDef py_wbint_LookupRids_methods[] = { { "opnum", (PyCFunction)py_wbint_LookupRids_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_LookupRids.opnum() -> 16 (0x10) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_LookupRids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_LookupRids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_LookupRids_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_LookupRids", .tp_getset = py_wbint_LookupRids_getsetters, .tp_methods = py_wbint_LookupRids_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_LookupRids_new, }; static bool pack_py_wbint_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupRids *r) { PyObject *py_domain_sid; PyObject *py_rids; const char *kwnames[] = { "domain_sid", "rids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupRids", discard_const_p(char *, kwnames), &py_domain_sid, &py_rids)) { return false; } if (py_domain_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_sid"); return false; } r->in.domain_sid = talloc_ptrtype(r, r->in.domain_sid); if (r->in.domain_sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(py_domain_sid); if (py_rids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rids"); return false; } r->in.rids = talloc_ptrtype(r, r->in.rids); if (r->in.rids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&wbint_RidArray_Type, py_rids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_rids)) == NULL) { PyErr_NoMemory(); return false; } r->in.rids = (struct wbint_RidArray *)pytalloc_get_ptr(py_rids); return true; } static PyObject *unpack_py_wbint_LookupRids_args_out(struct wbint_LookupRids *r) { PyObject *result; PyObject *py_domain_name; PyObject *py_names; result = PyTuple_New(2); if (*r->out.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { if (*r->out.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { py_domain_name = PyUnicode_Decode(*r->out.domain_name, strlen(*r->out.domain_name), "utf-8", "ignore"); } } PyTuple_SetItem(result, 0, py_domain_name); py_names = pytalloc_reference_ex(&wbint_Principals_Type, r->out.names, r->out.names); PyTuple_SetItem(result, 1, py_names); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_CheckMachineAccount_get_result(PyObject *obj, void *closure) { struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_CheckMachineAccount_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_CheckMachineAccount_getsetters[] = { { .name = discard_const_p(char, "result"), .get = py_wbint_CheckMachineAccount_get_result, .set = py_wbint_CheckMachineAccount_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_CheckMachineAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_CheckMachineAccount, type); return self; } static PyObject *py_wbint_CheckMachineAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(17); } static PyObject *py_wbint_CheckMachineAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[17]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_CheckMachineAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_CheckMachineAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_CheckMachineAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_CheckMachineAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_CheckMachineAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[17]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_CheckMachineAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_CheckMachineAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_CheckMachineAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_CheckMachineAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_CheckMachineAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[17]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_CheckMachineAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_CheckMachineAccount_ndr_print(py_obj, "wbint_CheckMachineAccount_in", NDR_IN); } static PyObject *py_wbint_CheckMachineAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_CheckMachineAccount_ndr_print(py_obj, "wbint_CheckMachineAccount_out", NDR_OUT); } static PyMethodDef py_wbint_CheckMachineAccount_methods[] = { { "opnum", (PyCFunction)py_wbint_CheckMachineAccount_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_CheckMachineAccount.opnum() -> 17 (0x11) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_CheckMachineAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_CheckMachineAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_CheckMachineAccount_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_CheckMachineAccount", .tp_getset = py_wbint_CheckMachineAccount_getsetters, .tp_methods = py_wbint_CheckMachineAccount_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_CheckMachineAccount_new, }; static bool pack_py_wbint_CheckMachineAccount_args_in(PyObject *args, PyObject *kwargs, struct wbint_CheckMachineAccount *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_CheckMachineAccount", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_CheckMachineAccount_args_out(struct wbint_CheckMachineAccount *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_ChangeMachineAccount_get_result(PyObject *obj, void *closure) { struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_ChangeMachineAccount_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_ChangeMachineAccount_getsetters[] = { { .name = discard_const_p(char, "result"), .get = py_wbint_ChangeMachineAccount_get_result, .set = py_wbint_ChangeMachineAccount_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_ChangeMachineAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_ChangeMachineAccount, type); return self; } static PyObject *py_wbint_ChangeMachineAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(18); } static PyObject *py_wbint_ChangeMachineAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[18]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_ChangeMachineAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_ChangeMachineAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_ChangeMachineAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_ChangeMachineAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[18]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_ChangeMachineAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_ChangeMachineAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_ChangeMachineAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[18]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_ChangeMachineAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_ChangeMachineAccount_ndr_print(py_obj, "wbint_ChangeMachineAccount_in", NDR_IN); } static PyObject *py_wbint_ChangeMachineAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_ChangeMachineAccount_ndr_print(py_obj, "wbint_ChangeMachineAccount_out", NDR_OUT); } static PyMethodDef py_wbint_ChangeMachineAccount_methods[] = { { "opnum", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_ChangeMachineAccount.opnum() -> 18 (0x12) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_ChangeMachineAccount_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_ChangeMachineAccount", .tp_getset = py_wbint_ChangeMachineAccount_getsetters, .tp_methods = py_wbint_ChangeMachineAccount_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_ChangeMachineAccount_new, }; static bool pack_py_wbint_ChangeMachineAccount_args_in(PyObject *args, PyObject *kwargs, struct wbint_ChangeMachineAccount *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_ChangeMachineAccount", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_ChangeMachineAccount_args_out(struct wbint_ChangeMachineAccount *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_wbint_PingDc_out_get_dcname(PyObject *obj, void *closure) { struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(obj); PyObject *py_dcname; if (object->out.dcname == NULL) { Py_RETURN_NONE; } if (*object->out.dcname == NULL) { py_dcname = Py_None; Py_INCREF(py_dcname); } else { if (*object->out.dcname == NULL) { py_dcname = Py_None; Py_INCREF(py_dcname); } else { py_dcname = PyUnicode_Decode(*object->out.dcname, strlen(*object->out.dcname), "utf-8", "ignore"); } } return py_dcname; } static int py_wbint_PingDc_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dcname)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dcname"); return -1; } object->out.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dcname); if (object->out.dcname == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.dcname = NULL; } else { *object->out.dcname = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } *object->out.dcname = talloc_str; } } return 0; } static PyObject *py_wbint_PingDc_get_result(PyObject *obj, void *closure) { struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_wbint_PingDc_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_wbint_PingDc_getsetters[] = { { .name = discard_const_p(char, "out_dcname"), .get = py_wbint_PingDc_out_get_dcname, .set = py_wbint_PingDc_out_set_dcname, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "result"), .get = py_wbint_PingDc_get_result, .set = py_wbint_PingDc_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_wbint_PingDc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct wbint_PingDc, type); return self; } static PyObject *py_wbint_PingDc_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(19); } static PyObject *py_wbint_PingDc_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[19]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_wbint_PingDc_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_PingDc_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_wbint_PingDc_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_wbint_PingDc_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_wbint_PingDc_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[19]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_wbint_PingDc_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_PingDc_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_PingDc_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_wbint_PingDc_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_wbint_PingDc_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[19]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_wbint_PingDc_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_PingDc_ndr_print(py_obj, "wbint_PingDc_in", NDR_IN); } static PyObject *py_wbint_PingDc_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_wbint_PingDc_ndr_print(py_obj, "wbint_PingDc_out", NDR_OUT); } static PyMethodDef py_wbint_PingDc_methods[] = { { "opnum", (PyCFunction)py_wbint_PingDc_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.wbint_PingDc.opnum() -> 19 (0x13) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_wbint_PingDc_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_wbint_PingDc_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject wbint_PingDc_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.wbint_PingDc", .tp_getset = py_wbint_PingDc_getsetters, .tp_methods = py_wbint_PingDc_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_wbint_PingDc_new, }; static bool pack_py_wbint_PingDc_args_in(PyObject *args, PyObject *kwargs, struct wbint_PingDc *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_PingDc", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_wbint_PingDc_args_out(struct wbint_PingDc *r) { PyObject *result; PyObject *py_dcname; if (*r->out.dcname == NULL) { py_dcname = Py_None; Py_INCREF(py_dcname); } else { if (*r->out.dcname == NULL) { py_dcname = Py_None; Py_INCREF(py_dcname); } else { py_dcname = PyUnicode_Decode(*r->out.dcname, strlen(*r->out.dcname), "utf-8", "ignore"); } } result = py_dcname; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_winbind_SamLogon_in_get_logon_level(PyObject *obj, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj); PyObject *py_logon_level; py_logon_level = PyLong_FromLong((uint16_t)object->in.logon_level); return py_logon_level; } static int py_winbind_SamLogon_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_level"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.logon_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_SamLogon_in_get_logon(PyObject *obj, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj); PyObject *py_logon; py_logon = pyrpc_import_union(netr_LogonLevel_Type, pytalloc_get_mem_ctx(obj), object->in.logon_level, &object->in.logon, "union netr_LogonLevel"); if (py_logon == NULL) { return NULL; } return py_logon; } static int py_winbind_SamLogon_in_set_logon(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon"); return -1; } { union netr_LogonLevel *logon_switch_0; logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(netr_LogonLevel_Type, pytalloc_get_mem_ctx(py_obj), object->in.logon_level, value, "union netr_LogonLevel"); if (logon_switch_0 == NULL) { return -1; } object->in.logon = *logon_switch_0; } return 0; } static PyObject *py_winbind_SamLogon_in_get_validation_level(PyObject *obj, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj); PyObject *py_validation_level; py_validation_level = PyLong_FromLong((uint16_t)object->in.validation_level); return py_validation_level; } static int py_winbind_SamLogon_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.validation_level"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.validation_level)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.validation_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_SamLogon_out_get_validation(PyObject *obj, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj); PyObject *py_validation; py_validation = pyrpc_import_union(netr_Validation_Type, pytalloc_get_mem_ctx(obj), object->in.validation_level, &object->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } return py_validation; } static int py_winbind_SamLogon_out_set_validation(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation"); return -1; } { union netr_Validation *validation_switch_0; validation_switch_0 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->in.validation_level, value, "union netr_Validation"); if (validation_switch_0 == NULL) { return -1; } object->out.validation = *validation_switch_0; } return 0; } static PyObject *py_winbind_SamLogon_out_get_authoritative(PyObject *obj, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj); PyObject *py_authoritative; py_authoritative = PyLong_FromLong((uint16_t)object->out.authoritative); return py_authoritative; } static int py_winbind_SamLogon_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.authoritative)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.authoritative = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_SamLogon_get_result(PyObject *obj, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_winbind_SamLogon_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_winbind_SamLogon_getsetters[] = { { .name = discard_const_p(char, "in_logon_level"), .get = py_winbind_SamLogon_in_get_logon_level, .set = py_winbind_SamLogon_in_set_logon_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_logon"), .get = py_winbind_SamLogon_in_get_logon, .set = py_winbind_SamLogon_in_set_logon, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel") }, { .name = discard_const_p(char, "in_validation_level"), .get = py_winbind_SamLogon_in_get_validation_level, .set = py_winbind_SamLogon_in_set_validation_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_validation"), .get = py_winbind_SamLogon_out_get_validation, .set = py_winbind_SamLogon_out_set_validation, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation") }, { .name = discard_const_p(char, "out_authoritative"), .get = py_winbind_SamLogon_out_get_authoritative, .set = py_winbind_SamLogon_out_set_authoritative, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "result"), .get = py_winbind_SamLogon_get_result, .set = py_winbind_SamLogon_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_winbind_SamLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct winbind_SamLogon, type); return self; } static PyObject *py_winbind_SamLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(20); } static PyObject *py_winbind_SamLogon_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[20]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_winbind_SamLogon_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_SamLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_winbind_SamLogon_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_SamLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_winbind_SamLogon_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[20]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_winbind_SamLogon_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_SamLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_SamLogon_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_SamLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_SamLogon_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[20]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_winbind_SamLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_SamLogon_ndr_print(py_obj, "winbind_SamLogon_in", NDR_IN); } static PyObject *py_winbind_SamLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_SamLogon_ndr_print(py_obj, "winbind_SamLogon_out", NDR_OUT); } static PyMethodDef py_winbind_SamLogon_methods[] = { { "opnum", (PyCFunction)py_winbind_SamLogon_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.SamLogon.opnum() -> 20 (0x14) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_winbind_SamLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_winbind_SamLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject winbind_SamLogon_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.SamLogon", .tp_getset = py_winbind_SamLogon_getsetters, .tp_methods = py_winbind_SamLogon_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_winbind_SamLogon_new, }; static bool pack_py_winbind_SamLogon_args_in(PyObject *args, PyObject *kwargs, struct winbind_SamLogon *r) { PyObject *py_logon_level; PyObject *py_logon; PyObject *py_validation_level; const char *kwnames[] = { "logon_level", "logon", "validation_level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_SamLogon", discard_const_p(char *, kwnames), &py_logon_level, &py_logon, &py_validation_level)) { return false; } if (py_logon_level == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_level"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level)); if (PyLong_Check(py_logon_level)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_logon_level); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.logon_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_logon == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon"); return false; } { union netr_LogonLevel *logon_switch_0; logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel"); if (logon_switch_0 == NULL) { return false; } r->in.logon = *logon_switch_0; } if (py_validation_level == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.validation_level"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.validation_level)); if (PyLong_Check(py_validation_level)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_validation_level); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.validation_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_winbind_SamLogon_args_out(struct winbind_SamLogon *r) { PyObject *result; PyObject *py_validation; PyObject *py_authoritative; result = PyTuple_New(2); py_validation = pyrpc_import_union(netr_Validation_Type, r, r->in.validation_level, &r->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } PyTuple_SetItem(result, 0, py_validation); py_authoritative = PyLong_FromLong((uint16_t)r->out.authoritative); PyTuple_SetItem(result, 1, py_authoritative); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name(PyObject *obj, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_site_name; if (object->in.site_name == NULL) { Py_RETURN_NONE; } if (object->in.site_name == NULL) { py_site_name = Py_None; Py_INCREF(py_site_name); } else { if (object->in.site_name == NULL) { py_site_name = Py_None; Py_INCREF(py_site_name); } else { py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore"); } } return py_site_name; } static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name"); return -1; } if (value == Py_None) { object->in.site_name = NULL; } else { object->in.site_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.site_name = talloc_str; } } return 0; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl(PyObject *obj, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_dns_ttl; py_dns_ttl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dns_ttl); return py_dns_ttl; } static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_ttl"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dns_ttl)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.dns_ttl = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names(PyObject *obj, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_dns_names; if (object->in.dns_names == NULL) { Py_RETURN_NONE; } py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->in.dns_names, object->in.dns_names); return py_dns_names; } static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dns_names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_names"); return -1; } object->in.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_names); if (object->in.dns_names == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value); return 0; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names(PyObject *obj, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_dns_names; if (object->out.dns_names == NULL) { Py_RETURN_NONE; } py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->out.dns_names, object->out.dns_names); return py_dns_names; } static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dns_names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dns_names"); return -1; } object->out.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dns_names); if (object->out.dns_names == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value); return 0; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_get_result(PyObject *obj, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_winbind_DsrUpdateReadOnlyServerDnsRecords_getsetters[] = { { .name = discard_const_p(char, "in_site_name"), .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name, .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_dns_ttl"), .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl, .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_dns_names"), .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names, .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names, .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY") }, { .name = discard_const_p(char, "out_dns_names"), .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names, .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names, .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY") }, { .name = discard_const_p(char, "result"), .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_get_result, .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct winbind_DsrUpdateReadOnlyServerDnsRecords, type); struct winbind_DsrUpdateReadOnlyServerDnsRecords *_self = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY); _self->out.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY); return self; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(21); } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[21]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[21]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[21]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "winbind_DsrUpdateReadOnlyServerDnsRecords_in", NDR_IN); } static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "winbind_DsrUpdateReadOnlyServerDnsRecords_out", NDR_OUT); } static PyMethodDef py_winbind_DsrUpdateReadOnlyServerDnsRecords_methods[] = { { "opnum", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.DsrUpdateReadOnlyServerDnsRecords.opnum() -> 21 (0x15) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.DsrUpdateReadOnlyServerDnsRecords", .tp_getset = py_winbind_DsrUpdateReadOnlyServerDnsRecords_getsetters, .tp_methods = py_winbind_DsrUpdateReadOnlyServerDnsRecords_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_winbind_DsrUpdateReadOnlyServerDnsRecords_new, }; static bool pack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_in(PyObject *args, PyObject *kwargs, struct winbind_DsrUpdateReadOnlyServerDnsRecords *r) { PyObject *py_site_name; PyObject *py_dns_ttl; PyObject *py_dns_names; const char *kwnames[] = { "site_name", "dns_ttl", "dns_names", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_DsrUpdateReadOnlyServerDnsRecords", discard_const_p(char *, kwnames), &py_site_name, &py_dns_ttl, &py_dns_names)) { return false; } if (py_site_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name"); return false; } if (py_site_name == Py_None) { r->in.site_name = NULL; } else { r->in.site_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_site_name)) { unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_site_name)) { test_str = PyBytes_AS_STRING(py_site_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.site_name = talloc_str; } } if (py_dns_ttl == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_ttl"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dns_ttl)); if (PyLong_Check(py_dns_ttl)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_dns_ttl); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.dns_ttl = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_dns_names == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_names"); return false; } r->in.dns_names = talloc_ptrtype(r, r->in.dns_names); if (r->in.dns_names == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, py_dns_names, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_dns_names)) == NULL) { PyErr_NoMemory(); return false; } r->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_dns_names); return true; } static PyObject *unpack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_out(struct winbind_DsrUpdateReadOnlyServerDnsRecords *r) { PyObject *result; PyObject *py_dns_names; py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, r->out.dns_names, r->out.dns_names); result = py_dns_names; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_winbind_LogonControl_in_get_function_code(PyObject *obj, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_function_code; py_function_code = PyLong_FromUnsignedLongLong((uint32_t)object->in.function_code); return py_function_code; } static int py_winbind_LogonControl_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.function_code"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.function_code)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.function_code = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_LogonControl_in_get_level(PyObject *obj, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_winbind_LogonControl_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_LogonControl_in_get_data(PyObject *obj, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->in.data == NULL) { Py_RETURN_NONE; } py_data = pyrpc_import_union(netr_CONTROL_DATA_INFORMATION_Type, object->in.data, object->in.function_code, object->in.data, "union netr_CONTROL_DATA_INFORMATION"); if (py_data == NULL) { return NULL; } return py_data; } static int py_winbind_LogonControl_in_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.data"); return -1; } object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data); if (object->in.data == NULL) { PyErr_NoMemory(); return -1; } { union netr_CONTROL_DATA_INFORMATION *data_switch_1; data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(netr_CONTROL_DATA_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.function_code, value, "union netr_CONTROL_DATA_INFORMATION"); if (data_switch_1 == NULL) { return -1; } object->in.data = data_switch_1; } return 0; } static PyObject *py_winbind_LogonControl_out_get_query(PyObject *obj, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_query; if (object->out.query == NULL) { Py_RETURN_NONE; } py_query = pyrpc_import_union(netr_CONTROL_QUERY_INFORMATION_Type, object->out.query, object->in.level, object->out.query, "union netr_CONTROL_QUERY_INFORMATION"); if (py_query == NULL) { return NULL; } return py_query; } static int py_winbind_LogonControl_out_set_query(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query"); return -1; } object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query); if (object->out.query == NULL) { PyErr_NoMemory(); return -1; } { union netr_CONTROL_QUERY_INFORMATION *query_switch_1; query_switch_1 = (union netr_CONTROL_QUERY_INFORMATION *)pyrpc_export_union(netr_CONTROL_QUERY_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_CONTROL_QUERY_INFORMATION"); if (query_switch_1 == NULL) { return -1; } object->out.query = query_switch_1; } return 0; } static PyObject *py_winbind_LogonControl_get_result(PyObject *obj, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_winbind_LogonControl_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = W_ERROR(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_winbind_LogonControl_getsetters[] = { { .name = discard_const_p(char, "in_function_code"), .get = py_winbind_LogonControl_in_get_function_code, .set = py_winbind_LogonControl_in_set_function_code, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonControlCode") }, { .name = discard_const_p(char, "in_level"), .get = py_winbind_LogonControl_in_get_level, .set = py_winbind_LogonControl_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_data"), .get = py_winbind_LogonControl_in_get_data, .set = py_winbind_LogonControl_in_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_DATA_INFORMATION") }, { .name = discard_const_p(char, "out_query"), .get = py_winbind_LogonControl_out_get_query, .set = py_winbind_LogonControl_out_set_query, .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_QUERY_INFORMATION") }, { .name = discard_const_p(char, "result"), .get = py_winbind_LogonControl_get_result, .set = py_winbind_LogonControl_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_winbind_LogonControl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct winbind_LogonControl, type); struct winbind_LogonControl *_self = (struct winbind_LogonControl *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.data = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION); _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION); return self; } static PyObject *py_winbind_LogonControl_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(22); } static PyObject *py_winbind_LogonControl_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 23) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[22]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_winbind_LogonControl_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_LogonControl_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_winbind_LogonControl_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_LogonControl_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_winbind_LogonControl_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 23) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[22]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_winbind_LogonControl_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_LogonControl_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_LogonControl_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_LogonControl_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_LogonControl_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 23) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[22]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_winbind_LogonControl_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_LogonControl_ndr_print(py_obj, "winbind_LogonControl_in", NDR_IN); } static PyObject *py_winbind_LogonControl_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_LogonControl_ndr_print(py_obj, "winbind_LogonControl_out", NDR_OUT); } static PyMethodDef py_winbind_LogonControl_methods[] = { { "opnum", (PyCFunction)py_winbind_LogonControl_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.LogonControl.opnum() -> 22 (0x16) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_winbind_LogonControl_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_winbind_LogonControl_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject winbind_LogonControl_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.LogonControl", .tp_getset = py_winbind_LogonControl_getsetters, .tp_methods = py_winbind_LogonControl_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_winbind_LogonControl_new, }; static bool pack_py_winbind_LogonControl_args_in(PyObject *args, PyObject *kwargs, struct winbind_LogonControl *r) { PyObject *py_function_code; PyObject *py_level; PyObject *py_data; const char *kwnames[] = { "function_code", "level", "data", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_LogonControl", discard_const_p(char *, kwnames), &py_function_code, &py_level, &py_data)) { return false; } if (py_function_code == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.function_code"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.function_code)); if (PyLong_Check(py_function_code)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_function_code); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.function_code = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_level == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); if (PyLong_Check(py_level)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_level); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_data == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data"); return false; } r->in.data = talloc_ptrtype(r, r->in.data); if (r->in.data == NULL) { PyErr_NoMemory(); return false; } { union netr_CONTROL_DATA_INFORMATION *data_switch_1; data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(netr_CONTROL_DATA_INFORMATION_Type, r, r->in.function_code, py_data, "union netr_CONTROL_DATA_INFORMATION"); if (data_switch_1 == NULL) { return false; } r->in.data = data_switch_1; } return true; } static PyObject *unpack_py_winbind_LogonControl_args_out(struct winbind_LogonControl *r) { PyObject *result; PyObject *py_query; py_query = pyrpc_import_union(netr_CONTROL_QUERY_INFORMATION_Type, r->out.query, r->in.level, r->out.query, "union netr_CONTROL_QUERY_INFORMATION"); if (py_query == NULL) { return NULL; } result = py_query; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_winbind_GetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_trusted_domain_name; if (object->in.trusted_domain_name == NULL) { Py_RETURN_NONE; } if (object->in.trusted_domain_name == NULL) { py_trusted_domain_name = Py_None; Py_INCREF(py_trusted_domain_name); } else { if (object->in.trusted_domain_name == NULL) { py_trusted_domain_name = Py_None; Py_INCREF(py_trusted_domain_name); } else { py_trusted_domain_name = PyUnicode_Decode(object->in.trusted_domain_name, strlen(object->in.trusted_domain_name), "utf-8", "ignore"); } } return py_trusted_domain_name; } static int py_winbind_GetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name"); return -1; } if (value == Py_None) { object->in.trusted_domain_name = NULL; } else { object->in.trusted_domain_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.trusted_domain_name = talloc_str; } } return 0; } static PyObject *py_winbind_GetForestTrustInformation_in_get_flags(PyObject *obj, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_winbind_GetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_winbind_GetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_forest_trust_info; if (object->out.forest_trust_info == NULL) { Py_RETURN_NONE; } if (*object->out.forest_trust_info == NULL) { py_forest_trust_info = Py_None; Py_INCREF(py_forest_trust_info); } else { py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info); } return py_forest_trust_info; } static int py_winbind_GetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.forest_trust_info"); return -1; } object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info); if (object->out.forest_trust_info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.forest_trust_info = NULL; } else { *object->out.forest_trust_info = NULL; PY_CHECK_TYPE(lsa_ForestTrustInformation_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_winbind_GetForestTrustInformation_get_result(PyObject *obj, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_winbind_GetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = W_ERROR(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_winbind_GetForestTrustInformation_getsetters[] = { { .name = discard_const_p(char, "in_trusted_domain_name"), .get = py_winbind_GetForestTrustInformation_in_get_trusted_domain_name, .set = py_winbind_GetForestTrustInformation_in_set_trusted_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_flags"), .get = py_winbind_GetForestTrustInformation_in_get_flags, .set = py_winbind_GetForestTrustInformation_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_forest_trust_info"), .get = py_winbind_GetForestTrustInformation_out_get_forest_trust_info, .set = py_winbind_GetForestTrustInformation_out_set_forest_trust_info, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation") }, { .name = discard_const_p(char, "result"), .get = py_winbind_GetForestTrustInformation_get_result, .set = py_winbind_GetForestTrustInformation_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_winbind_GetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct winbind_GetForestTrustInformation, type); struct winbind_GetForestTrustInformation *_self = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *); return self; } static PyObject *py_winbind_GetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(23); } static PyObject *py_winbind_GetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[23]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_winbind_GetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_GetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_winbind_GetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_GetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[23]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_GetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[23]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_winbind_GetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_GetForestTrustInformation_ndr_print(py_obj, "winbind_GetForestTrustInformation_in", NDR_IN); } static PyObject *py_winbind_GetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_GetForestTrustInformation_ndr_print(py_obj, "winbind_GetForestTrustInformation_out", NDR_OUT); } static PyMethodDef py_winbind_GetForestTrustInformation_methods[] = { { "opnum", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.GetForestTrustInformation.opnum() -> 23 (0x17) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject winbind_GetForestTrustInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.GetForestTrustInformation", .tp_getset = py_winbind_GetForestTrustInformation_getsetters, .tp_methods = py_winbind_GetForestTrustInformation_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_winbind_GetForestTrustInformation_new, }; static bool pack_py_winbind_GetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct winbind_GetForestTrustInformation *r) { PyObject *py_trusted_domain_name; PyObject *py_flags; const char *kwnames[] = { "trusted_domain_name", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winbind_GetForestTrustInformation", discard_const_p(char *, kwnames), &py_trusted_domain_name, &py_flags)) { return false; } if (py_trusted_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name"); return false; } if (py_trusted_domain_name == Py_None) { r->in.trusted_domain_name = NULL; } else { r->in.trusted_domain_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_trusted_domain_name)) { unicode = PyUnicode_AsEncodedString(py_trusted_domain_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_trusted_domain_name)) { test_str = PyBytes_AS_STRING(py_trusted_domain_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_trusted_domain_name)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.trusted_domain_name = talloc_str; } } if (py_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags)); if (PyLong_Check(py_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_flags); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_winbind_GetForestTrustInformation_args_out(struct winbind_GetForestTrustInformation *r) { PyObject *result; PyObject *py_forest_trust_info; if (*r->out.forest_trust_info == NULL) { py_forest_trust_info = Py_None; Py_INCREF(py_forest_trust_info); } else { py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info); } result = py_forest_trust_info; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_winbind_SendToSam_in_get_message(PyObject *obj, void *closure) { struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(obj); PyObject *py_message; py_message = pytalloc_reference_ex(netr_SendToSamBase_Type, pytalloc_get_mem_ctx(obj), &object->in.message); return py_message; } static int py_winbind_SendToSam_in_set_message(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.message"); return -1; } PY_CHECK_TYPE(netr_SendToSamBase_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.message = *(struct netr_SendToSamBase *)pytalloc_get_ptr(value); return 0; } static PyObject *py_winbind_SendToSam_get_result(PyObject *obj, void *closure) { struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_winbind_SendToSam_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_winbind_SendToSam_getsetters[] = { { .name = discard_const_p(char, "in_message"), .get = py_winbind_SendToSam_in_get_message, .set = py_winbind_SendToSam_in_set_message, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamBase") }, { .name = discard_const_p(char, "result"), .get = py_winbind_SendToSam_get_result, .set = py_winbind_SendToSam_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_winbind_SendToSam_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct winbind_SendToSam, type); return self; } static PyObject *py_winbind_SendToSam_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(24); } static PyObject *py_winbind_SendToSam_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 25) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_pack"); return NULL; } call = &ndr_table_winbind.calls[24]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_winbind_SendToSam_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_SendToSam_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_winbind_SendToSam_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_winbind_SendToSam_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_winbind_SendToSam_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_winbind.num_calls < 25) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_unpack"); return NULL; } call = &ndr_table_winbind.calls[24]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_winbind_SendToSam_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_SendToSam_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_SendToSam_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_winbind_SendToSam_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_winbind_SendToSam_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_winbind.num_calls < 25) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_print"); return NULL; } call = &ndr_table_winbind.calls[24]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_winbind_SendToSam_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_SendToSam_ndr_print(py_obj, "winbind_SendToSam_in", NDR_IN); } static PyObject *py_winbind_SendToSam_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_winbind_SendToSam_ndr_print(py_obj, "winbind_SendToSam_out", NDR_OUT); } static PyMethodDef py_winbind_SendToSam_methods[] = { { "opnum", (PyCFunction)py_winbind_SendToSam_ndr_opnum, METH_NOARGS|METH_CLASS, "winbind.SendToSam.opnum() -> 24 (0x18) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_winbind_SendToSam_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_winbind_SendToSam_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject winbind_SendToSam_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.SendToSam", .tp_getset = py_winbind_SendToSam_getsetters, .tp_methods = py_winbind_SendToSam_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_winbind_SendToSam_new, }; static bool pack_py_winbind_SendToSam_args_in(PyObject *args, PyObject *kwargs, struct winbind_SendToSam *r) { PyObject *py_message; const char *kwnames[] = { "message", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winbind_SendToSam", discard_const_p(char *, kwnames), &py_message)) { return false; } if (py_message == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.message"); return false; } PY_CHECK_TYPE(netr_SendToSamBase_Type, py_message, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_message)) == NULL) { PyErr_NoMemory(); return false; } r->in.message = *(struct netr_SendToSamBase *)pytalloc_get_ptr(py_message); return true; } static PyObject *unpack_py_winbind_SendToSam_args_out(struct winbind_SendToSam *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } const struct PyNdrRpcMethodDef py_ndr_winbind_methods[] = { { "wbint_Ping", "S.wbint_Ping(in_data) -> out_data", (py_dcerpc_call_fn)dcerpc_wbint_Ping_r, (py_data_pack_fn)pack_py_wbint_Ping_args_in, (py_data_unpack_fn)unpack_py_wbint_Ping_args_out, 0, &ndr_table_winbind }, { "wbint_LookupSid", "S.wbint_LookupSid(sid) -> (type, domain, name)", (py_dcerpc_call_fn)dcerpc_wbint_LookupSid_r, (py_data_pack_fn)pack_py_wbint_LookupSid_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupSid_args_out, 1, &ndr_table_winbind }, { "wbint_LookupSids", "S.wbint_LookupSids(sids) -> (domains, names)", (py_dcerpc_call_fn)dcerpc_wbint_LookupSids_r, (py_data_pack_fn)pack_py_wbint_LookupSids_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupSids_args_out, 2, &ndr_table_winbind }, { "wbint_LookupName", "S.wbint_LookupName(domain, name, flags) -> (type, sid)", (py_dcerpc_call_fn)dcerpc_wbint_LookupName_r, (py_data_pack_fn)pack_py_wbint_LookupName_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupName_args_out, 3, &ndr_table_winbind }, { "wbint_Sids2UnixIDs", "S.wbint_Sids2UnixIDs(domains, ids) -> ids", (py_dcerpc_call_fn)dcerpc_wbint_Sids2UnixIDs_r, (py_data_pack_fn)pack_py_wbint_Sids2UnixIDs_args_in, (py_data_unpack_fn)unpack_py_wbint_Sids2UnixIDs_args_out, 4, &ndr_table_winbind }, { "wbint_UnixIDs2Sids", "S.wbint_UnixIDs2Sids(domain_name, domain_sid, num_ids, xids) -> (xids, sids)", (py_dcerpc_call_fn)dcerpc_wbint_UnixIDs2Sids_r, (py_data_pack_fn)pack_py_wbint_UnixIDs2Sids_args_in, (py_data_unpack_fn)unpack_py_wbint_UnixIDs2Sids_args_out, 5, &ndr_table_winbind }, { "wbint_AllocateUid", "S.wbint_AllocateUid() -> uid", (py_dcerpc_call_fn)dcerpc_wbint_AllocateUid_r, (py_data_pack_fn)pack_py_wbint_AllocateUid_args_in, (py_data_unpack_fn)unpack_py_wbint_AllocateUid_args_out, 6, &ndr_table_winbind }, { "wbint_AllocateGid", "S.wbint_AllocateGid() -> gid", (py_dcerpc_call_fn)dcerpc_wbint_AllocateGid_r, (py_data_pack_fn)pack_py_wbint_AllocateGid_args_in, (py_data_unpack_fn)unpack_py_wbint_AllocateGid_args_out, 7, &ndr_table_winbind }, { "wbint_GetNssInfo", "S.wbint_GetNssInfo(info) -> info", (py_dcerpc_call_fn)dcerpc_wbint_GetNssInfo_r, (py_data_pack_fn)pack_py_wbint_GetNssInfo_args_in, (py_data_unpack_fn)unpack_py_wbint_GetNssInfo_args_out, 8, &ndr_table_winbind }, { "wbint_LookupUserAliases", "S.wbint_LookupUserAliases(sids) -> rids", (py_dcerpc_call_fn)dcerpc_wbint_LookupUserAliases_r, (py_data_pack_fn)pack_py_wbint_LookupUserAliases_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupUserAliases_args_out, 9, &ndr_table_winbind }, { "wbint_LookupUserGroups", "S.wbint_LookupUserGroups(sid) -> sids", (py_dcerpc_call_fn)dcerpc_wbint_LookupUserGroups_r, (py_data_pack_fn)pack_py_wbint_LookupUserGroups_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupUserGroups_args_out, 10, &ndr_table_winbind }, { "wbint_QuerySequenceNumber", "S.wbint_QuerySequenceNumber() -> sequence", (py_dcerpc_call_fn)dcerpc_wbint_QuerySequenceNumber_r, (py_data_pack_fn)pack_py_wbint_QuerySequenceNumber_args_in, (py_data_unpack_fn)unpack_py_wbint_QuerySequenceNumber_args_out, 11, &ndr_table_winbind }, { "wbint_LookupGroupMembers", "S.wbint_LookupGroupMembers(sid, type) -> members", (py_dcerpc_call_fn)dcerpc_wbint_LookupGroupMembers_r, (py_data_pack_fn)pack_py_wbint_LookupGroupMembers_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupGroupMembers_args_out, 12, &ndr_table_winbind }, { "wbint_QueryGroupList", "S.wbint_QueryGroupList() -> groups", (py_dcerpc_call_fn)dcerpc_wbint_QueryGroupList_r, (py_data_pack_fn)pack_py_wbint_QueryGroupList_args_in, (py_data_unpack_fn)unpack_py_wbint_QueryGroupList_args_out, 13, &ndr_table_winbind }, { "wbint_QueryUserRidList", "S.wbint_QueryUserRidList() -> rids", (py_dcerpc_call_fn)dcerpc_wbint_QueryUserRidList_r, (py_data_pack_fn)pack_py_wbint_QueryUserRidList_args_in, (py_data_unpack_fn)unpack_py_wbint_QueryUserRidList_args_out, 14, &ndr_table_winbind }, { "wbint_DsGetDcName", "S.wbint_DsGetDcName(domain_name, domain_guid, site_name, flags) -> dc_info", (py_dcerpc_call_fn)dcerpc_wbint_DsGetDcName_r, (py_data_pack_fn)pack_py_wbint_DsGetDcName_args_in, (py_data_unpack_fn)unpack_py_wbint_DsGetDcName_args_out, 15, &ndr_table_winbind }, { "wbint_LookupRids", "S.wbint_LookupRids(domain_sid, rids) -> (domain_name, names)", (py_dcerpc_call_fn)dcerpc_wbint_LookupRids_r, (py_data_pack_fn)pack_py_wbint_LookupRids_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupRids_args_out, 16, &ndr_table_winbind }, { "wbint_CheckMachineAccount", "S.wbint_CheckMachineAccount() -> None", (py_dcerpc_call_fn)dcerpc_wbint_CheckMachineAccount_r, (py_data_pack_fn)pack_py_wbint_CheckMachineAccount_args_in, (py_data_unpack_fn)unpack_py_wbint_CheckMachineAccount_args_out, 17, &ndr_table_winbind }, { "wbint_ChangeMachineAccount", "S.wbint_ChangeMachineAccount() -> None", (py_dcerpc_call_fn)dcerpc_wbint_ChangeMachineAccount_r, (py_data_pack_fn)pack_py_wbint_ChangeMachineAccount_args_in, (py_data_unpack_fn)unpack_py_wbint_ChangeMachineAccount_args_out, 18, &ndr_table_winbind }, { "wbint_PingDc", "S.wbint_PingDc() -> dcname", (py_dcerpc_call_fn)dcerpc_wbint_PingDc_r, (py_data_pack_fn)pack_py_wbint_PingDc_args_in, (py_data_unpack_fn)unpack_py_wbint_PingDc_args_out, 19, &ndr_table_winbind }, { "SamLogon", "S.SamLogon(logon_level, logon, validation_level) -> (validation, authoritative)", (py_dcerpc_call_fn)dcerpc_winbind_SamLogon_r, (py_data_pack_fn)pack_py_winbind_SamLogon_args_in, (py_data_unpack_fn)unpack_py_winbind_SamLogon_args_out, 20, &ndr_table_winbind }, { "DsrUpdateReadOnlyServerDnsRecords", "S.DsrUpdateReadOnlyServerDnsRecords(site_name, dns_ttl, dns_names) -> dns_names", (py_dcerpc_call_fn)dcerpc_winbind_DsrUpdateReadOnlyServerDnsRecords_r, (py_data_pack_fn)pack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_in, (py_data_unpack_fn)unpack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_out, 21, &ndr_table_winbind }, { "LogonControl", "S.LogonControl(function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_winbind_LogonControl_r, (py_data_pack_fn)pack_py_winbind_LogonControl_args_in, (py_data_unpack_fn)unpack_py_winbind_LogonControl_args_out, 22, &ndr_table_winbind }, { "GetForestTrustInformation", "S.GetForestTrustInformation(trusted_domain_name, flags) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_winbind_GetForestTrustInformation_r, (py_data_pack_fn)pack_py_winbind_GetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_winbind_GetForestTrustInformation_args_out, 23, &ndr_table_winbind }, { "SendToSam", "S.SendToSam(message) -> None", (py_dcerpc_call_fn)dcerpc_winbind_SendToSam_r, (py_data_pack_fn)pack_py_winbind_SendToSam_args_in, (py_data_unpack_fn)unpack_py_winbind_SendToSam_args_out, 24, &ndr_table_winbind }, {0} }; static PyObject *interface_winbind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_winbind); } #define PY_DOC_WINBIND "winbind parent-child protocol" static PyTypeObject winbind_InterfaceType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.winbind", .tp_basicsize = sizeof(dcerpc_InterfaceObject), .tp_doc = "winbind(binding, lp_ctx=None, credentials=None) -> connection\n" "\n" "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n" "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n" "credentials should be a credentials.Credentials object.\n\n"PY_DOC_WINBIND, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = interface_winbind_new, }; static PyObject *syntax_winbind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_winbind.syntax_id); } #define PY_DOC_WINBIND_SYNTAX "winbind parent-child protocol" static PyTypeObject winbind_SyntaxType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "winbind.winbind_abstract_syntax", .tp_doc = "winbind_abstract_syntax()\n"PY_DOC_WINBIND_SYNTAX, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = syntax_winbind_new, }; static PyMethodDef winbind_methods[] = { { NULL, NULL, 0, NULL } }; static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, .m_name = "winbind", .m_doc = "winbind DCE/RPC", .m_size = -1, .m_methods = winbind_methods, }; MODULE_INIT_FUNC(winbind) { PyObject *m = NULL; PyObject *dep_samba_dcerpc_lsa = NULL; PyObject *dep_samba_dcerpc_netlogon = NULL; PyObject *dep_samba_dcerpc_misc = NULL; PyObject *dep_samba_dcerpc_security = NULL; PyObject *dep_samba_dcerpc_idmap = NULL; PyObject *dep_talloc = NULL; PyObject *dep_samba_dcerpc_base = NULL; dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa"); if (dep_samba_dcerpc_lsa == NULL) goto out; dep_samba_dcerpc_netlogon = PyImport_ImportModule("samba.dcerpc.netlogon"); if (dep_samba_dcerpc_netlogon == NULL) goto out; dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc"); if (dep_samba_dcerpc_misc == NULL) goto out; dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security"); if (dep_samba_dcerpc_security == NULL) goto out; dep_samba_dcerpc_idmap = PyImport_ImportModule("samba.dcerpc.idmap"); if (dep_samba_dcerpc_idmap == NULL) goto out; dep_talloc = PyImport_ImportModule("talloc"); if (dep_talloc == NULL) goto out; dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base"); if (dep_samba_dcerpc_base == NULL) goto out; unixid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_idmap, "unixid"); if (unixid_Type == NULL) goto out; BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject"); if (BaseObject_Type == NULL) goto out; dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid"); if (dom_sid_Type == NULL) goto out; lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray"); if (lsa_SidArray_Type == NULL) goto out; lsa_RefDomainList_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "RefDomainList"); if (lsa_RefDomainList_Type == NULL) goto out; lsa_TransNameArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "TransNameArray"); if (lsa_TransNameArray_Type == NULL) goto out; GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID"); if (GUID_Type == NULL) goto out; netr_DsRGetDCNameInfo_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_DsRGetDCNameInfo"); if (netr_DsRGetDCNameInfo_Type == NULL) goto out; netr_LogonLevel_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_LogonLevel"); if (netr_LogonLevel_Type == NULL) goto out; netr_Validation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_Validation"); if (netr_Validation_Type == NULL) goto out; NL_DNS_NAME_INFO_ARRAY_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "NL_DNS_NAME_INFO_ARRAY"); if (NL_DNS_NAME_INFO_ARRAY_Type == NULL) goto out; netr_CONTROL_DATA_INFORMATION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_CONTROL_DATA_INFORMATION"); if (netr_CONTROL_DATA_INFORMATION_Type == NULL) goto out; netr_CONTROL_QUERY_INFORMATION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_CONTROL_QUERY_INFORMATION"); if (netr_CONTROL_QUERY_INFORMATION_Type == NULL) goto out; lsa_ForestTrustInformation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "ForestTrustInformation"); if (lsa_ForestTrustInformation_Type == NULL) goto out; netr_SendToSamBase_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_SendToSamBase"); if (netr_SendToSamBase_Type == NULL) goto out; ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection"); if (ClientConnection_Type == NULL) goto out; ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id"); if (ndr_syntax_id_Type == NULL) goto out; wbint_TransID_Type.tp_base = BaseObject_Type; wbint_TransID_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_TransIDArray_Type.tp_base = BaseObject_Type; wbint_TransIDArray_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_userinfo_Type.tp_base = BaseObject_Type; wbint_userinfo_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_SidArray_Type.tp_base = BaseObject_Type; wbint_SidArray_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_RidArray_Type.tp_base = BaseObject_Type; wbint_RidArray_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_Principal_Type.tp_base = BaseObject_Type; wbint_Principal_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_Principals_Type.tp_base = BaseObject_Type; wbint_Principals_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_userinfos_Type.tp_base = BaseObject_Type; wbint_userinfos_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_Ping_Type.tp_base = BaseObject_Type; wbint_Ping_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupSid_Type.tp_base = BaseObject_Type; wbint_LookupSid_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupSids_Type.tp_base = BaseObject_Type; wbint_LookupSids_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupName_Type.tp_base = BaseObject_Type; wbint_LookupName_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_Sids2UnixIDs_Type.tp_base = BaseObject_Type; wbint_Sids2UnixIDs_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_UnixIDs2Sids_Type.tp_base = BaseObject_Type; wbint_UnixIDs2Sids_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_AllocateUid_Type.tp_base = BaseObject_Type; wbint_AllocateUid_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_AllocateGid_Type.tp_base = BaseObject_Type; wbint_AllocateGid_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_GetNssInfo_Type.tp_base = BaseObject_Type; wbint_GetNssInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupUserAliases_Type.tp_base = BaseObject_Type; wbint_LookupUserAliases_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupUserGroups_Type.tp_base = BaseObject_Type; wbint_LookupUserGroups_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_QuerySequenceNumber_Type.tp_base = BaseObject_Type; wbint_QuerySequenceNumber_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupGroupMembers_Type.tp_base = BaseObject_Type; wbint_LookupGroupMembers_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_QueryGroupList_Type.tp_base = BaseObject_Type; wbint_QueryGroupList_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_QueryUserRidList_Type.tp_base = BaseObject_Type; wbint_QueryUserRidList_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_DsGetDcName_Type.tp_base = BaseObject_Type; wbint_DsGetDcName_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_LookupRids_Type.tp_base = BaseObject_Type; wbint_LookupRids_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_CheckMachineAccount_Type.tp_base = BaseObject_Type; wbint_CheckMachineAccount_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_ChangeMachineAccount_Type.tp_base = BaseObject_Type; wbint_ChangeMachineAccount_Type.tp_basicsize = pytalloc_BaseObject_size(); wbint_PingDc_Type.tp_base = BaseObject_Type; wbint_PingDc_Type.tp_basicsize = pytalloc_BaseObject_size(); winbind_SamLogon_Type.tp_base = BaseObject_Type; winbind_SamLogon_Type.tp_basicsize = pytalloc_BaseObject_size(); winbind_DsrUpdateReadOnlyServerDnsRecords_Type.tp_base = BaseObject_Type; winbind_DsrUpdateReadOnlyServerDnsRecords_Type.tp_basicsize = pytalloc_BaseObject_size(); winbind_LogonControl_Type.tp_base = BaseObject_Type; winbind_LogonControl_Type.tp_basicsize = pytalloc_BaseObject_size(); winbind_GetForestTrustInformation_Type.tp_base = BaseObject_Type; winbind_GetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); winbind_SendToSam_Type.tp_base = BaseObject_Type; winbind_SendToSam_Type.tp_basicsize = pytalloc_BaseObject_size(); winbind_InterfaceType.tp_base = ClientConnection_Type; winbind_SyntaxType.tp_base = ndr_syntax_id_Type; winbind_SyntaxType.tp_basicsize = pytalloc_BaseObject_size(); if (PyType_Ready(&wbint_TransID_Type) < 0) goto out; if (PyType_Ready(&wbint_TransIDArray_Type) < 0) goto out; if (PyType_Ready(&wbint_userinfo_Type) < 0) goto out; if (PyType_Ready(&wbint_SidArray_Type) < 0) goto out; if (PyType_Ready(&wbint_RidArray_Type) < 0) goto out; if (PyType_Ready(&wbint_Principal_Type) < 0) goto out; if (PyType_Ready(&wbint_Principals_Type) < 0) goto out; if (PyType_Ready(&wbint_userinfos_Type) < 0) goto out; if (PyType_Ready(&wbint_Ping_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupSid_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupSids_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupName_Type) < 0) goto out; if (PyType_Ready(&wbint_Sids2UnixIDs_Type) < 0) goto out; if (PyType_Ready(&wbint_UnixIDs2Sids_Type) < 0) goto out; if (PyType_Ready(&wbint_AllocateUid_Type) < 0) goto out; if (PyType_Ready(&wbint_AllocateGid_Type) < 0) goto out; if (PyType_Ready(&wbint_GetNssInfo_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupUserAliases_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupUserGroups_Type) < 0) goto out; if (PyType_Ready(&wbint_QuerySequenceNumber_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupGroupMembers_Type) < 0) goto out; if (PyType_Ready(&wbint_QueryGroupList_Type) < 0) goto out; if (PyType_Ready(&wbint_QueryUserRidList_Type) < 0) goto out; if (PyType_Ready(&wbint_DsGetDcName_Type) < 0) goto out; if (PyType_Ready(&wbint_LookupRids_Type) < 0) goto out; if (PyType_Ready(&wbint_CheckMachineAccount_Type) < 0) goto out; if (PyType_Ready(&wbint_ChangeMachineAccount_Type) < 0) goto out; if (PyType_Ready(&wbint_PingDc_Type) < 0) goto out; if (PyType_Ready(&winbind_SamLogon_Type) < 0) goto out; if (PyType_Ready(&winbind_DsrUpdateReadOnlyServerDnsRecords_Type) < 0) goto out; if (PyType_Ready(&winbind_LogonControl_Type) < 0) goto out; if (PyType_Ready(&winbind_GetForestTrustInformation_Type) < 0) goto out; if (PyType_Ready(&winbind_SendToSam_Type) < 0) goto out; if (PyType_Ready(&winbind_InterfaceType) < 0) goto out; if (PyType_Ready(&winbind_SyntaxType) < 0) goto out; if (!PyInterface_AddNdrRpcMethods(&winbind_InterfaceType, py_ndr_winbind_methods)) return NULL; #ifdef PY_WBINT_TRANSID_PATCH PY_WBINT_TRANSID_PATCH(&wbint_TransID_Type); #endif #ifdef PY_WBINT_TRANSIDARRAY_PATCH PY_WBINT_TRANSIDARRAY_PATCH(&wbint_TransIDArray_Type); #endif #ifdef PY_WBINT_USERINFO_PATCH PY_WBINT_USERINFO_PATCH(&wbint_userinfo_Type); #endif #ifdef PY_WBINT_SIDARRAY_PATCH PY_WBINT_SIDARRAY_PATCH(&wbint_SidArray_Type); #endif #ifdef PY_WBINT_RIDARRAY_PATCH PY_WBINT_RIDARRAY_PATCH(&wbint_RidArray_Type); #endif #ifdef PY_WBINT_PRINCIPAL_PATCH PY_WBINT_PRINCIPAL_PATCH(&wbint_Principal_Type); #endif #ifdef PY_WBINT_PRINCIPALS_PATCH PY_WBINT_PRINCIPALS_PATCH(&wbint_Principals_Type); #endif #ifdef PY_WBINT_USERINFOS_PATCH PY_WBINT_USERINFOS_PATCH(&wbint_userinfos_Type); #endif #ifdef PY_WBINT_PING_PATCH PY_WBINT_PING_PATCH(&wbint_Ping_Type); #endif #ifdef PY_WBINT_LOOKUPSID_PATCH PY_WBINT_LOOKUPSID_PATCH(&wbint_LookupSid_Type); #endif #ifdef PY_WBINT_LOOKUPSIDS_PATCH PY_WBINT_LOOKUPSIDS_PATCH(&wbint_LookupSids_Type); #endif #ifdef PY_WBINT_LOOKUPNAME_PATCH PY_WBINT_LOOKUPNAME_PATCH(&wbint_LookupName_Type); #endif #ifdef PY_WBINT_SIDS2UNIXIDS_PATCH PY_WBINT_SIDS2UNIXIDS_PATCH(&wbint_Sids2UnixIDs_Type); #endif #ifdef PY_WBINT_UNIXIDS2SIDS_PATCH PY_WBINT_UNIXIDS2SIDS_PATCH(&wbint_UnixIDs2Sids_Type); #endif #ifdef PY_WBINT_ALLOCATEUID_PATCH PY_WBINT_ALLOCATEUID_PATCH(&wbint_AllocateUid_Type); #endif #ifdef PY_WBINT_ALLOCATEGID_PATCH PY_WBINT_ALLOCATEGID_PATCH(&wbint_AllocateGid_Type); #endif #ifdef PY_WBINT_GETNSSINFO_PATCH PY_WBINT_GETNSSINFO_PATCH(&wbint_GetNssInfo_Type); #endif #ifdef PY_WBINT_LOOKUPUSERALIASES_PATCH PY_WBINT_LOOKUPUSERALIASES_PATCH(&wbint_LookupUserAliases_Type); #endif #ifdef PY_WBINT_LOOKUPUSERGROUPS_PATCH PY_WBINT_LOOKUPUSERGROUPS_PATCH(&wbint_LookupUserGroups_Type); #endif #ifdef PY_WBINT_QUERYSEQUENCENUMBER_PATCH PY_WBINT_QUERYSEQUENCENUMBER_PATCH(&wbint_QuerySequenceNumber_Type); #endif #ifdef PY_WBINT_LOOKUPGROUPMEMBERS_PATCH PY_WBINT_LOOKUPGROUPMEMBERS_PATCH(&wbint_LookupGroupMembers_Type); #endif #ifdef PY_WBINT_QUERYGROUPLIST_PATCH PY_WBINT_QUERYGROUPLIST_PATCH(&wbint_QueryGroupList_Type); #endif #ifdef PY_WBINT_QUERYUSERRIDLIST_PATCH PY_WBINT_QUERYUSERRIDLIST_PATCH(&wbint_QueryUserRidList_Type); #endif #ifdef PY_WBINT_DSGETDCNAME_PATCH PY_WBINT_DSGETDCNAME_PATCH(&wbint_DsGetDcName_Type); #endif #ifdef PY_WBINT_LOOKUPRIDS_PATCH PY_WBINT_LOOKUPRIDS_PATCH(&wbint_LookupRids_Type); #endif #ifdef PY_WBINT_CHECKMACHINEACCOUNT_PATCH PY_WBINT_CHECKMACHINEACCOUNT_PATCH(&wbint_CheckMachineAccount_Type); #endif #ifdef PY_WBINT_CHANGEMACHINEACCOUNT_PATCH PY_WBINT_CHANGEMACHINEACCOUNT_PATCH(&wbint_ChangeMachineAccount_Type); #endif #ifdef PY_WBINT_PINGDC_PATCH PY_WBINT_PINGDC_PATCH(&wbint_PingDc_Type); #endif #ifdef PY_SAMLOGON_PATCH PY_SAMLOGON_PATCH(&winbind_SamLogon_Type); #endif #ifdef PY_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH PY_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH(&winbind_DsrUpdateReadOnlyServerDnsRecords_Type); #endif #ifdef PY_LOGONCONTROL_PATCH PY_LOGONCONTROL_PATCH(&winbind_LogonControl_Type); #endif #ifdef PY_GETFORESTTRUSTINFORMATION_PATCH PY_GETFORESTTRUSTINFORMATION_PATCH(&winbind_GetForestTrustInformation_Type); #endif #ifdef PY_SENDTOSAM_PATCH PY_SENDTOSAM_PATCH(&winbind_SendToSam_Type); #endif #ifdef PY_WINBIND_PATCH PY_WINBIND_PATCH(&winbind_InterfaceType); #endif #ifdef PY_WINBIND_ABSTRACT_SYNTAX_PATCH PY_WINBIND_ABSTRACT_SYNTAX_PATCH(&winbind_SyntaxType); #endif #ifdef PY_ABSTRACT_SYNTAX_PATCH PY_ABSTRACT_SYNTAX_PATCH(&winbind_SyntaxType); #endif m = PyModule_Create(&moduledef); if (m == NULL) goto out; Py_INCREF((PyObject *)(void *)&wbint_TransID_Type); PyModule_AddObject(m, "wbint_TransID", (PyObject *)(void *)&wbint_TransID_Type); Py_INCREF((PyObject *)(void *)&wbint_TransIDArray_Type); PyModule_AddObject(m, "wbint_TransIDArray", (PyObject *)(void *)&wbint_TransIDArray_Type); Py_INCREF((PyObject *)(void *)&wbint_userinfo_Type); PyModule_AddObject(m, "wbint_userinfo", (PyObject *)(void *)&wbint_userinfo_Type); Py_INCREF((PyObject *)(void *)&wbint_SidArray_Type); PyModule_AddObject(m, "wbint_SidArray", (PyObject *)(void *)&wbint_SidArray_Type); Py_INCREF((PyObject *)(void *)&wbint_RidArray_Type); PyModule_AddObject(m, "wbint_RidArray", (PyObject *)(void *)&wbint_RidArray_Type); Py_INCREF((PyObject *)(void *)&wbint_Principal_Type); PyModule_AddObject(m, "wbint_Principal", (PyObject *)(void *)&wbint_Principal_Type); Py_INCREF((PyObject *)(void *)&wbint_Principals_Type); PyModule_AddObject(m, "wbint_Principals", (PyObject *)(void *)&wbint_Principals_Type); Py_INCREF((PyObject *)(void *)&wbint_userinfos_Type); PyModule_AddObject(m, "wbint_userinfos", (PyObject *)(void *)&wbint_userinfos_Type); Py_INCREF((PyObject *)(void *)&wbint_Ping_Type); PyModule_AddObject(m, "wbint_Ping", (PyObject *)(void *)&wbint_Ping_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupSid_Type); PyModule_AddObject(m, "wbint_LookupSid", (PyObject *)(void *)&wbint_LookupSid_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupSids_Type); PyModule_AddObject(m, "wbint_LookupSids", (PyObject *)(void *)&wbint_LookupSids_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupName_Type); PyModule_AddObject(m, "wbint_LookupName", (PyObject *)(void *)&wbint_LookupName_Type); Py_INCREF((PyObject *)(void *)&wbint_Sids2UnixIDs_Type); PyModule_AddObject(m, "wbint_Sids2UnixIDs", (PyObject *)(void *)&wbint_Sids2UnixIDs_Type); Py_INCREF((PyObject *)(void *)&wbint_UnixIDs2Sids_Type); PyModule_AddObject(m, "wbint_UnixIDs2Sids", (PyObject *)(void *)&wbint_UnixIDs2Sids_Type); Py_INCREF((PyObject *)(void *)&wbint_AllocateUid_Type); PyModule_AddObject(m, "wbint_AllocateUid", (PyObject *)(void *)&wbint_AllocateUid_Type); Py_INCREF((PyObject *)(void *)&wbint_AllocateGid_Type); PyModule_AddObject(m, "wbint_AllocateGid", (PyObject *)(void *)&wbint_AllocateGid_Type); Py_INCREF((PyObject *)(void *)&wbint_GetNssInfo_Type); PyModule_AddObject(m, "wbint_GetNssInfo", (PyObject *)(void *)&wbint_GetNssInfo_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupUserAliases_Type); PyModule_AddObject(m, "wbint_LookupUserAliases", (PyObject *)(void *)&wbint_LookupUserAliases_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupUserGroups_Type); PyModule_AddObject(m, "wbint_LookupUserGroups", (PyObject *)(void *)&wbint_LookupUserGroups_Type); Py_INCREF((PyObject *)(void *)&wbint_QuerySequenceNumber_Type); PyModule_AddObject(m, "wbint_QuerySequenceNumber", (PyObject *)(void *)&wbint_QuerySequenceNumber_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupGroupMembers_Type); PyModule_AddObject(m, "wbint_LookupGroupMembers", (PyObject *)(void *)&wbint_LookupGroupMembers_Type); Py_INCREF((PyObject *)(void *)&wbint_QueryGroupList_Type); PyModule_AddObject(m, "wbint_QueryGroupList", (PyObject *)(void *)&wbint_QueryGroupList_Type); Py_INCREF((PyObject *)(void *)&wbint_QueryUserRidList_Type); PyModule_AddObject(m, "wbint_QueryUserRidList", (PyObject *)(void *)&wbint_QueryUserRidList_Type); Py_INCREF((PyObject *)(void *)&wbint_DsGetDcName_Type); PyModule_AddObject(m, "wbint_DsGetDcName", (PyObject *)(void *)&wbint_DsGetDcName_Type); Py_INCREF((PyObject *)(void *)&wbint_LookupRids_Type); PyModule_AddObject(m, "wbint_LookupRids", (PyObject *)(void *)&wbint_LookupRids_Type); Py_INCREF((PyObject *)(void *)&wbint_CheckMachineAccount_Type); PyModule_AddObject(m, "wbint_CheckMachineAccount", (PyObject *)(void *)&wbint_CheckMachineAccount_Type); Py_INCREF((PyObject *)(void *)&wbint_ChangeMachineAccount_Type); PyModule_AddObject(m, "wbint_ChangeMachineAccount", (PyObject *)(void *)&wbint_ChangeMachineAccount_Type); Py_INCREF((PyObject *)(void *)&wbint_PingDc_Type); PyModule_AddObject(m, "wbint_PingDc", (PyObject *)(void *)&wbint_PingDc_Type); Py_INCREF((PyObject *)(void *)&winbind_SamLogon_Type); PyModule_AddObject(m, "SamLogon", (PyObject *)(void *)&winbind_SamLogon_Type); Py_INCREF((PyObject *)(void *)&winbind_DsrUpdateReadOnlyServerDnsRecords_Type); PyModule_AddObject(m, "DsrUpdateReadOnlyServerDnsRecords", (PyObject *)(void *)&winbind_DsrUpdateReadOnlyServerDnsRecords_Type); Py_INCREF((PyObject *)(void *)&winbind_LogonControl_Type); PyModule_AddObject(m, "LogonControl", (PyObject *)(void *)&winbind_LogonControl_Type); Py_INCREF((PyObject *)(void *)&winbind_GetForestTrustInformation_Type); PyModule_AddObject(m, "GetForestTrustInformation", (PyObject *)(void *)&winbind_GetForestTrustInformation_Type); Py_INCREF((PyObject *)(void *)&winbind_SendToSam_Type); PyModule_AddObject(m, "SendToSam", (PyObject *)(void *)&winbind_SendToSam_Type); Py_INCREF((PyObject *)(void *)&winbind_InterfaceType); PyModule_AddObject(m, "winbind", (PyObject *)(void *)&winbind_InterfaceType); Py_INCREF((PyObject *)(void *)&winbind_SyntaxType); PyModule_AddObject(m, "winbind_abstract_syntax", (PyObject *)(void *)&winbind_SyntaxType); Py_INCREF((PyObject *)(void *)&winbind_SyntaxType); PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&winbind_SyntaxType); #ifdef PY_MOD_WINBIND_PATCH PY_MOD_WINBIND_PATCH(m); #endif out: Py_XDECREF(dep_samba_dcerpc_lsa); Py_XDECREF(dep_samba_dcerpc_netlogon); Py_XDECREF(dep_samba_dcerpc_misc); Py_XDECREF(dep_samba_dcerpc_security); Py_XDECREF(dep_samba_dcerpc_idmap); Py_XDECREF(dep_talloc); Py_XDECREF(dep_samba_dcerpc_base); return m; }