/* 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_netlogon.h" #include "bin/default/librpc/gen_ndr/ndr_netlogon_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/misc.h" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/samr.h" #include "librpc/gen_ndr/security.h" static PyTypeObject netr_UasInfo_Type; static PyTypeObject netr_UasLogoffInfo_Type; static PyTypeObject netr_AcctLockStr_Type; static PyTypeObject netr_IdentityInfo_Type; static PyTypeObject netr_PasswordInfo_Type; static PyTypeObject netr_ChallengeResponse_Type; static PyTypeObject netr_NetworkInfo_Type; static PyTypeObject netr_GenericInfo_Type; static PyTypeObject netr_LogonLevel_Type; static PyTypeObject netr_UserSessionKey_Type; static PyTypeObject netr_LMSessionKey_Type; static PyTypeObject netr_SamBaseInfo_Type; static PyTypeObject netr_SamInfo2_Type; static PyTypeObject netr_SidAttr_Type; static PyTypeObject netr_SamInfo3_Type; static PyTypeObject netr_SamInfo6_Type; static PyTypeObject netr_PacInfo_Type; static PyTypeObject netr_GenericInfo2_Type; static PyTypeObject netr_Validation_Type; static PyTypeObject netr_Credential_Type; static PyTypeObject netr_Authenticator_Type; static PyTypeObject netr_DELTA_DELETE_USER_Type; static PyTypeObject netr_USER_KEY16_Type; static PyTypeObject netr_PasswordHistory_Type; static PyTypeObject netr_USER_KEYS2_Type; static PyTypeObject netr_USER_KEY_UNION_Type; static PyTypeObject netr_USER_KEYS_Type; static PyTypeObject netr_USER_PRIVATE_INFO_Type; static PyTypeObject netr_DELTA_USER_Type; static PyTypeObject netr_DELTA_DOMAIN_Type; static PyTypeObject netr_DELTA_GROUP_Type; static PyTypeObject netr_DELTA_RENAME_Type; static PyTypeObject netr_DELTA_GROUP_MEMBER_Type; static PyTypeObject netr_DELTA_ALIAS_Type; static PyTypeObject netr_DELTA_ALIAS_MEMBER_Type; static PyTypeObject netr_QUOTA_LIMITS_Type; static PyTypeObject netr_DELTA_POLICY_Type; static PyTypeObject netr_DELTA_TRUSTED_DOMAIN_Type; static PyTypeObject netr_DELTA_ACCOUNT_Type; static PyTypeObject netr_CIPHER_VALUE_Type; static PyTypeObject netr_DELTA_SECRET_Type; static PyTypeObject netr_DELTA_UNION_Type; static PyTypeObject netr_DELTA_ID_UNION_Type; static PyTypeObject netr_DELTA_ENUM_Type; static PyTypeObject netr_DELTA_ENUM_ARRAY_Type; static PyTypeObject netr_UAS_INFO_0_Type; static PyTypeObject netr_AccountBuffer_Type; static PyTypeObject netr_NETLOGON_INFO_1_Type; static PyTypeObject netr_NETLOGON_INFO_2_Type; static PyTypeObject netr_NETLOGON_INFO_3_Type; static PyTypeObject netr_NETLOGON_INFO_4_Type; static PyTypeObject netr_CONTROL_QUERY_INFORMATION_Type; static PyTypeObject netr_CONTROL_DATA_INFORMATION_Type; static PyTypeObject netr_ChangeLogObject_Type; static PyTypeObject netr_ChangeLogEntry_Type; static PyTypeObject netr_Blob_Type; static PyTypeObject netr_DsRGetDCNameInfo_Type; static PyTypeObject netr_Capabilities_Type; static PyTypeObject netr_LsaPolicyInformation_Type; static PyTypeObject netr_OsVersionInfoEx_Type; static PyTypeObject netr_OsVersion_Type; static PyTypeObject netr_OsVersionContainer_Type; static PyTypeObject netr_WorkstationInformation_Type; static PyTypeObject netr_WorkstationInfo_Type; static PyTypeObject netr_trust_extension_info_Type; static PyTypeObject netr_trust_extension_Type; static PyTypeObject netr_trust_extension_container_Type; static PyTypeObject netr_OneDomainInfo_Type; static PyTypeObject netr_DomainInformation_Type; static PyTypeObject netr_DomainInfo_Type; static PyTypeObject NL_PASSWORD_VERSION_Type; static PyTypeObject netr_CryptPassword_Type; static PyTypeObject netr_SendToSamResetBadPasswordCount_Type; static PyTypeObject netr_SendToSamMessage_Type; static PyTypeObject netr_SendToSamBase_Type; static PyTypeObject netr_DsRAddressToSitenamesWCtr_Type; static PyTypeObject netr_DsRAddress_Type; static PyTypeObject netr_DomainTrust_Type; static PyTypeObject netr_DomainTrustList_Type; static PyTypeObject netr_DsRAddressToSitenamesExWCtr_Type; static PyTypeObject DcSitesCtr_Type; static PyTypeObject netr_TrustInfo_Type; static PyTypeObject NL_DNS_NAME_INFO_Type; static PyTypeObject NL_DNS_NAME_INFO_ARRAY_Type; static PyTypeObject netlogon_InterfaceType; static PyTypeObject netr_LogonUasLogon_Type; static PyTypeObject netr_LogonUasLogoff_Type; static PyTypeObject netr_LogonSamLogon_Type; static PyTypeObject netr_LogonSamLogoff_Type; static PyTypeObject netr_ServerReqChallenge_Type; static PyTypeObject netr_ServerAuthenticate_Type; static PyTypeObject netr_ServerPasswordSet_Type; static PyTypeObject netr_DatabaseDeltas_Type; static PyTypeObject netr_DatabaseSync_Type; static PyTypeObject netr_AccountDeltas_Type; static PyTypeObject netr_AccountSync_Type; static PyTypeObject netr_GetDcName_Type; static PyTypeObject netr_LogonControl_Type; static PyTypeObject netr_GetAnyDCName_Type; static PyTypeObject netr_LogonControl2_Type; static PyTypeObject netr_ServerAuthenticate2_Type; static PyTypeObject netr_DatabaseSync2_Type; static PyTypeObject netr_DatabaseRedo_Type; static PyTypeObject netr_LogonControl2Ex_Type; static PyTypeObject netr_NetrEnumerateTrustedDomains_Type; static PyTypeObject netr_DsRGetDCName_Type; static PyTypeObject netr_LogonGetCapabilities_Type; static PyTypeObject netr_LogonGetTrustRid_Type; static PyTypeObject netr_ServerAuthenticate3_Type; static PyTypeObject netr_DsRGetDCNameEx_Type; static PyTypeObject netr_DsRGetSiteName_Type; static PyTypeObject netr_LogonGetDomainInfo_Type; static PyTypeObject netr_ServerPasswordSet2_Type; static PyTypeObject netr_ServerPasswordGet_Type; static PyTypeObject netr_NetrLogonSendToSam_Type; static PyTypeObject netr_DsRAddressToSitenamesW_Type; static PyTypeObject netr_DsRGetDCNameEx2_Type; static PyTypeObject netr_NetrEnumerateTrustedDomainsEx_Type; static PyTypeObject netr_DsRAddressToSitenamesExW_Type; static PyTypeObject netr_DsrGetDcSiteCoverageW_Type; static PyTypeObject netr_LogonSamLogonEx_Type; static PyTypeObject netr_DsrEnumerateDomainTrusts_Type; static PyTypeObject netr_DsrDeregisterDNSHostRecords_Type; static PyTypeObject netr_ServerTrustPasswordsGet_Type; static PyTypeObject netr_DsRGetForestTrustInformation_Type; static PyTypeObject netr_GetForestTrustInformation_Type; static PyTypeObject netr_LogonSamLogonWithFlags_Type; static PyTypeObject netr_ServerGetTrustInfo_Type; static PyTypeObject netr_Unused47_Type; static PyTypeObject netr_DsrUpdateReadOnlyServerDnsRecords_Type; static PyTypeObject *BaseObject_Type; static PyTypeObject *lsa_String_Type; static PyTypeObject *samr_Password_Type; static PyTypeObject *samr_RidWithAttributeArray_Type; static PyTypeObject *lsa_StringLarge_Type; static PyTypeObject *dom_sid_Type; static PyTypeObject *samr_LogonHours_Type; static PyTypeObject *lsa_BinaryString_Type; static PyTypeObject *sec_desc_buf_Type; static PyTypeObject *lsa_SidArray_Type; static PyTypeObject *GUID_Type; static PyTypeObject *lsa_ForestTrustInformation_Type; static PyTypeObject *ClientConnection_Type; static PyTypeObject *ndr_syntax_id_Type; static PyObject *py_netr_UasInfo_get_account_name(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->account_name == NULL) { Py_RETURN_NONE; } if (object->account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { if (object->account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore"); } } return py_account_name; } static int py_netr_UasInfo_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } if (value == Py_None) { object->account_name = NULL; } else { object->account_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->account_name = talloc_str; } } return 0; } static PyObject *py_netr_UasInfo_get_priv(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_priv; py_priv = PyLong_FromUnsignedLongLong((uint32_t)object->priv); return py_priv; } static int py_netr_UasInfo_set_priv(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priv"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priv)); 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->priv = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_auth_flags(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_auth_flags; py_auth_flags = PyLong_FromUnsignedLongLong((uint32_t)object->auth_flags); return py_auth_flags; } static int py_netr_UasInfo_set_auth_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_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->auth_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_logon_count(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromUnsignedLongLong((uint32_t)object->logon_count); return py_logon_count; } static int py_netr_UasInfo_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_bad_pw_count(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_bad_pw_count; py_bad_pw_count = PyLong_FromUnsignedLongLong((uint32_t)object->bad_pw_count); return py_bad_pw_count; } static int py_netr_UasInfo_set_bad_pw_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_pw_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_pw_count)); 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->bad_pw_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_last_logon(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_last_logon; py_last_logon = PyLong_FromLong(object->last_logon); return py_last_logon; } static int py_netr_UasInfo_set_last_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->last_logon)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->last_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_last_logoff(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_last_logoff; py_last_logoff = PyLong_FromLong(object->last_logoff); return py_last_logoff; } static int py_netr_UasInfo_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->last_logoff)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->last_logoff = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_logoff_time(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_logoff_time; py_logoff_time = PyLong_FromLong(object->logoff_time); return py_logoff_time; } static int py_netr_UasInfo_set_logoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logoff_time"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->logoff_time)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->logoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_kickoff_time(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_kickoff_time; py_kickoff_time = PyLong_FromLong(object->kickoff_time); return py_kickoff_time; } static int py_netr_UasInfo_set_kickoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->kickoff_time"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->kickoff_time)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->kickoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_password_age(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_password_age; py_password_age = PyLong_FromUnsignedLongLong((uint32_t)object->password_age); return py_password_age; } static int py_netr_UasInfo_set_password_age(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_age"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_age)); 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->password_age = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_pw_can_change(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_pw_can_change; py_pw_can_change = PyLong_FromLong(object->pw_can_change); return py_pw_can_change; } static int py_netr_UasInfo_set_pw_can_change(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pw_can_change"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->pw_can_change)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->pw_can_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_pw_must_change(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_pw_must_change; py_pw_must_change = PyLong_FromLong(object->pw_must_change); return py_pw_must_change; } static int py_netr_UasInfo_set_pw_must_change(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pw_must_change"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->pw_must_change)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->pw_must_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasInfo_get_computer(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_computer; if (object->computer == NULL) { Py_RETURN_NONE; } if (object->computer == NULL) { py_computer = Py_None; Py_INCREF(py_computer); } else { if (object->computer == NULL) { py_computer = Py_None; Py_INCREF(py_computer); } else { py_computer = PyUnicode_Decode(object->computer, strlen(object->computer), "utf-8", "ignore"); } } return py_computer; } static int py_netr_UasInfo_set_computer(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer"); return -1; } if (value == Py_None) { object->computer = NULL; } else { object->computer = 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->computer = talloc_str; } } return 0; } static PyObject *py_netr_UasInfo_get_domain(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_domain; if (object->domain == NULL) { Py_RETURN_NONE; } if (object->domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { if (object->domain == NULL) { py_domain = Py_None; Py_INCREF(py_domain); } else { py_domain = PyUnicode_Decode(object->domain, strlen(object->domain), "utf-8", "ignore"); } } return py_domain; } static int py_netr_UasInfo_set_domain(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain"); return -1; } if (value == Py_None) { object->domain = NULL; } else { object->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->domain = talloc_str; } } return 0; } static PyObject *py_netr_UasInfo_get_script_path(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_script_path; if (object->script_path == NULL) { Py_RETURN_NONE; } if (object->script_path == NULL) { py_script_path = Py_None; Py_INCREF(py_script_path); } else { if (object->script_path == NULL) { py_script_path = Py_None; Py_INCREF(py_script_path); } else { py_script_path = PyUnicode_Decode(object->script_path, strlen(object->script_path), "utf-8", "ignore"); } } return py_script_path; } static int py_netr_UasInfo_set_script_path(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->script_path"); return -1; } if (value == Py_None) { object->script_path = NULL; } else { object->script_path = 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->script_path = talloc_str; } } return 0; } static PyObject *py_netr_UasInfo_get_unknown(PyObject *obj, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj); PyObject *py_unknown; py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown); return py_unknown; } static int py_netr_UasInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown)); 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->unknown = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_UasInfo_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_netr_UasInfo_get_account_name, .set = py_netr_UasInfo_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "priv"), .get = py_netr_UasInfo_get_priv, .set = py_netr_UasInfo_set_priv, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "auth_flags"), .get = py_netr_UasInfo_get_auth_flags, .set = py_netr_UasInfo_set_auth_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "logon_count"), .get = py_netr_UasInfo_get_logon_count, .set = py_netr_UasInfo_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "bad_pw_count"), .get = py_netr_UasInfo_get_bad_pw_count, .set = py_netr_UasInfo_set_bad_pw_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "last_logon"), .get = py_netr_UasInfo_get_last_logon, .set = py_netr_UasInfo_set_last_logon, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = discard_const_p(char, "last_logoff"), .get = py_netr_UasInfo_get_last_logoff, .set = py_netr_UasInfo_set_last_logoff, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = discard_const_p(char, "logoff_time"), .get = py_netr_UasInfo_get_logoff_time, .set = py_netr_UasInfo_set_logoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = discard_const_p(char, "kickoff_time"), .get = py_netr_UasInfo_get_kickoff_time, .set = py_netr_UasInfo_set_kickoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = discard_const_p(char, "password_age"), .get = py_netr_UasInfo_get_password_age, .set = py_netr_UasInfo_set_password_age, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "pw_can_change"), .get = py_netr_UasInfo_get_pw_can_change, .set = py_netr_UasInfo_set_pw_can_change, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = discard_const_p(char, "pw_must_change"), .get = py_netr_UasInfo_get_pw_must_change, .set = py_netr_UasInfo_set_pw_must_change, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = discard_const_p(char, "computer"), .get = py_netr_UasInfo_get_computer, .set = py_netr_UasInfo_set_computer, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "domain"), .get = py_netr_UasInfo_get_domain, .set = py_netr_UasInfo_set_domain, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "script_path"), .get = py_netr_UasInfo_get_script_path, .set = py_netr_UasInfo_set_script_path, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "unknown"), .get = py_netr_UasInfo_get_unknown, .set = py_netr_UasInfo_set_unknown, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_UasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_UasInfo, type); } static PyTypeObject netr_UasInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_UasInfo", .tp_getset = py_netr_UasInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_UasInfo_new, }; static PyObject *py_netr_UasLogoffInfo_get_duration(PyObject *obj, void *closure) { struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(obj); PyObject *py_duration; py_duration = PyLong_FromUnsignedLongLong((uint32_t)object->duration); return py_duration; } static int py_netr_UasLogoffInfo_set_duration(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->duration"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->duration)); 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->duration = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UasLogoffInfo_get_logon_count(PyObject *obj, void *closure) { struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromLong((uint16_t)object->logon_count); return py_logon_count; } static int py_netr_UasLogoffInfo_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_UasLogoffInfo_getsetters[] = { { .name = discard_const_p(char, "duration"), .get = py_netr_UasLogoffInfo_get_duration, .set = py_netr_UasLogoffInfo_set_duration, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "logon_count"), .get = py_netr_UasLogoffInfo_get_logon_count, .set = py_netr_UasLogoffInfo_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = NULL } }; static PyObject *py_netr_UasLogoffInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_UasLogoffInfo, type); } static PyTypeObject netr_UasLogoffInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_UasLogoffInfo", .tp_getset = py_netr_UasLogoffInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_UasLogoffInfo_new, }; static PyObject *py_netr_AcctLockStr_get_lockout_duration(PyObject *obj, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj); PyObject *py_lockout_duration; py_lockout_duration = PyLong_FromLongLong(object->lockout_duration); return py_lockout_duration; } static int py_netr_AcctLockStr_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_duration"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->lockout_duration)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->lockout_duration = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AcctLockStr_get_reset_count(PyObject *obj, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj); PyObject *py_reset_count; py_reset_count = PyLong_FromUnsignedLongLong(object->reset_count); return py_reset_count; } static int py_netr_AcctLockStr_set_reset_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reset_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reset_count)); 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->reset_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AcctLockStr_get_bad_attempt_lockout(PyObject *obj, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj); PyObject *py_bad_attempt_lockout; py_bad_attempt_lockout = PyLong_FromUnsignedLongLong((uint32_t)object->bad_attempt_lockout); return py_bad_attempt_lockout; } static int py_netr_AcctLockStr_set_bad_attempt_lockout(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_attempt_lockout"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_attempt_lockout)); 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->bad_attempt_lockout = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AcctLockStr_get_dummy(PyObject *obj, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj); PyObject *py_dummy; py_dummy = PyLong_FromUnsignedLongLong((uint32_t)object->dummy); return py_dummy; } static int py_netr_AcctLockStr_set_dummy(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy)); 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->dummy = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_AcctLockStr_getsetters[] = { { .name = discard_const_p(char, "lockout_duration"), .get = py_netr_AcctLockStr_get_lockout_duration, .set = py_netr_AcctLockStr_set_lockout_duration, .doc = discard_const_p(char, "PIDL-generated element of base type dlong") }, { .name = discard_const_p(char, "reset_count"), .get = py_netr_AcctLockStr_get_reset_count, .set = py_netr_AcctLockStr_set_reset_count, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "bad_attempt_lockout"), .get = py_netr_AcctLockStr_get_bad_attempt_lockout, .set = py_netr_AcctLockStr_set_bad_attempt_lockout, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dummy"), .get = py_netr_AcctLockStr_get_dummy, .set = py_netr_AcctLockStr_set_dummy, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_AcctLockStr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_AcctLockStr, type); } static PyObject *py_netr_AcctLockStr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)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_netr_AcctLockStr); 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_netr_AcctLockStr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)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_netr_AcctLockStr); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_AcctLockStr); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_AcctLockStr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)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_netr_AcctLockStr, "netr_AcctLockStr", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_AcctLockStr_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_AcctLockStr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AcctLockStr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_AcctLockStr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_AcctLockStr_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_AcctLockStr", .tp_getset = py_netr_AcctLockStr_getsetters, .tp_methods = py_netr_AcctLockStr_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_AcctLockStr_new, }; static PyObject *py_netr_IdentityInfo_get_domain_name(PyObject *obj, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_name; py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name); return py_domain_name; } static int py_netr_IdentityInfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_IdentityInfo_get_parameter_control(PyObject *obj, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj); PyObject *py_parameter_control; py_parameter_control = PyLong_FromUnsignedLongLong((uint32_t)object->parameter_control); return py_parameter_control; } static int py_netr_IdentityInfo_set_parameter_control(PyObject *py_obj, PyObject *value, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameter_control"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->parameter_control)); 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->parameter_control = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_IdentityInfo_get_logon_id(PyObject *obj, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_id; py_logon_id = PyLong_FromUnsignedLongLong(object->logon_id); return py_logon_id; } static int py_netr_IdentityInfo_set_logon_id(PyObject *py_obj, PyObject *value, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_id"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_id)); 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->logon_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_IdentityInfo_get_account_name(PyObject *obj, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_netr_IdentityInfo_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_IdentityInfo_get_workstation(PyObject *obj, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj); PyObject *py_workstation; py_workstation = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstation); return py_workstation; } static int py_netr_IdentityInfo_set_workstation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstation"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->workstation = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_IdentityInfo_getsetters[] = { { .name = discard_const_p(char, "domain_name"), .get = py_netr_IdentityInfo_get_domain_name, .set = py_netr_IdentityInfo_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "parameter_control"), .get = py_netr_IdentityInfo_get_parameter_control, .set = py_netr_IdentityInfo_set_parameter_control, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonParameterControl") }, { .name = discard_const_p(char, "logon_id"), .get = py_netr_IdentityInfo_get_logon_id, .set = py_netr_IdentityInfo_set_logon_id, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "account_name"), .get = py_netr_IdentityInfo_get_account_name, .set = py_netr_IdentityInfo_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "workstation"), .get = py_netr_IdentityInfo_get_workstation, .set = py_netr_IdentityInfo_set_workstation, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_netr_IdentityInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_IdentityInfo, type); } static PyTypeObject netr_IdentityInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_IdentityInfo", .tp_getset = py_netr_IdentityInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_IdentityInfo_new, }; static PyObject *py_netr_PasswordInfo_get_identity_info(PyObject *obj, void *closure) { struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_identity_info; py_identity_info = pytalloc_reference_ex(&netr_IdentityInfo_Type, pytalloc_get_mem_ctx(obj), &object->identity_info); return py_identity_info; } static int py_netr_PasswordInfo_set_identity_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->identity_info"); return -1; } PY_CHECK_TYPE(&netr_IdentityInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->identity_info = *(struct netr_IdentityInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PasswordInfo_get_lmpassword(PyObject *obj, void *closure) { struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_lmpassword; py_lmpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lmpassword); return py_lmpassword; } static int py_netr_PasswordInfo_set_lmpassword(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmpassword"); return -1; } PY_CHECK_TYPE(samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lmpassword = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PasswordInfo_get_ntpassword(PyObject *obj, void *closure) { struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_ntpassword; py_ntpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->ntpassword); return py_ntpassword; } static int py_netr_PasswordInfo_set_ntpassword(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntpassword"); return -1; } PY_CHECK_TYPE(samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->ntpassword = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_PasswordInfo_getsetters[] = { { .name = discard_const_p(char, "identity_info"), .get = py_netr_PasswordInfo_get_identity_info, .set = py_netr_PasswordInfo_set_identity_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_IdentityInfo") }, { .name = discard_const_p(char, "lmpassword"), .get = py_netr_PasswordInfo_get_lmpassword, .set = py_netr_PasswordInfo_set_lmpassword, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "ntpassword"), .get = py_netr_PasswordInfo_get_ntpassword, .set = py_netr_PasswordInfo_set_ntpassword, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = NULL } }; static PyObject *py_netr_PasswordInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_PasswordInfo, type); } static PyTypeObject netr_PasswordInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_PasswordInfo", .tp_getset = py_netr_PasswordInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_PasswordInfo_new, }; static PyObject *py_netr_ChallengeResponse_get_length(PyObject *obj, void *closure) { struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromLong((uint16_t)object->length); return py_length; } static int py_netr_ChallengeResponse_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChallengeResponse_get_size(PyObject *obj, void *closure) { struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromLong((uint16_t)object->size); return py_size; } static int py_netr_ChallengeResponse_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChallengeResponse_get_data(PyObject *obj, void *closure) { struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->data == NULL) { Py_RETURN_NONE; } if (object->data == NULL) { py_data = Py_None; Py_INCREF(py_data); } else { py_data = PyList_New(object->length); if (py_data == NULL) { return NULL; } { int data_cntr_1; for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) { PyObject *py_data_1; py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]); PyList_SetItem(py_data, data_cntr_1, py_data_1); } } } return py_data; } static int py_netr_ChallengeResponse_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } if (value == Py_None) { object->data = NULL; } else { object->data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_1; object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value)); if (!object->data) { return -1;; } talloc_set_name_const(object->data, "ARRAY: object->data"); for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) { if (PyList_GET_ITEM(value, data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1)); 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->data[data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_ChallengeResponse_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_ChallengeResponse_get_length, .set = py_netr_ChallengeResponse_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "size"), .get = py_netr_ChallengeResponse_get_size, .set = py_netr_ChallengeResponse_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "data"), .get = py_netr_ChallengeResponse_get_data, .set = py_netr_ChallengeResponse_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_ChallengeResponse_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_ChallengeResponse, type); } static PyTypeObject netr_ChallengeResponse_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ChallengeResponse", .tp_getset = py_netr_ChallengeResponse_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ChallengeResponse_new, }; static PyObject *py_netr_NetworkInfo_get_identity_info(PyObject *obj, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj); PyObject *py_identity_info; py_identity_info = pytalloc_reference_ex(&netr_IdentityInfo_Type, pytalloc_get_mem_ctx(obj), &object->identity_info); return py_identity_info; } static int py_netr_NetworkInfo_set_identity_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->identity_info"); return -1; } PY_CHECK_TYPE(&netr_IdentityInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->identity_info = *(struct netr_IdentityInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_NetworkInfo_get_challenge(PyObject *obj, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj); PyObject *py_challenge; py_challenge = PyList_New(8); if (py_challenge == NULL) { return NULL; } { int challenge_cntr_0; for (challenge_cntr_0 = 0; challenge_cntr_0 < (8); challenge_cntr_0++) { PyObject *py_challenge_0; py_challenge_0 = PyLong_FromLong((uint16_t)object->challenge[challenge_cntr_0]); PyList_SetItem(py_challenge, challenge_cntr_0, py_challenge_0); } } return py_challenge; } static int py_netr_NetworkInfo_set_challenge(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->challenge"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int challenge_cntr_0; if (ARRAY_SIZE(object->challenge) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->challenge), PyList_GET_SIZE(value)); return -1; } for (challenge_cntr_0 = 0; challenge_cntr_0 < PyList_GET_SIZE(value); challenge_cntr_0++) { if (PyList_GET_ITEM(value, challenge_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->challenge[challenge_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->challenge[challenge_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, challenge_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, challenge_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->challenge[challenge_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_netr_NetworkInfo_get_nt(PyObject *obj, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj); PyObject *py_nt; py_nt = pytalloc_reference_ex(&netr_ChallengeResponse_Type, pytalloc_get_mem_ctx(obj), &object->nt); return py_nt; } static int py_netr_NetworkInfo_set_nt(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt"); return -1; } PY_CHECK_TYPE(&netr_ChallengeResponse_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->nt = *(struct netr_ChallengeResponse *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_NetworkInfo_get_lm(PyObject *obj, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj); PyObject *py_lm; py_lm = pytalloc_reference_ex(&netr_ChallengeResponse_Type, pytalloc_get_mem_ctx(obj), &object->lm); return py_lm; } static int py_netr_NetworkInfo_set_lm(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm"); return -1; } PY_CHECK_TYPE(&netr_ChallengeResponse_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lm = *(struct netr_ChallengeResponse *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_NetworkInfo_getsetters[] = { { .name = discard_const_p(char, "identity_info"), .get = py_netr_NetworkInfo_get_identity_info, .set = py_netr_NetworkInfo_set_identity_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_IdentityInfo") }, { .name = discard_const_p(char, "challenge"), .get = py_netr_NetworkInfo_get_challenge, .set = py_netr_NetworkInfo_set_challenge, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "nt"), .get = py_netr_NetworkInfo_get_nt, .set = py_netr_NetworkInfo_set_nt, .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChallengeResponse") }, { .name = discard_const_p(char, "lm"), .get = py_netr_NetworkInfo_get_lm, .set = py_netr_NetworkInfo_set_lm, .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChallengeResponse") }, { .name = NULL } }; static PyObject *py_netr_NetworkInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_NetworkInfo, type); } static PyTypeObject netr_NetworkInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NetworkInfo", .tp_getset = py_netr_NetworkInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NetworkInfo_new, }; static PyObject *py_netr_GenericInfo_get_identity_info(PyObject *obj, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj); PyObject *py_identity_info; py_identity_info = pytalloc_reference_ex(&netr_IdentityInfo_Type, pytalloc_get_mem_ctx(obj), &object->identity_info); return py_identity_info; } static int py_netr_GenericInfo_set_identity_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->identity_info"); return -1; } PY_CHECK_TYPE(&netr_IdentityInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->identity_info = *(struct netr_IdentityInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_GenericInfo_get_package_name(PyObject *obj, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj); PyObject *py_package_name; py_package_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->package_name); return py_package_name; } static int py_netr_GenericInfo_set_package_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->package_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->package_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_GenericInfo_get_length(PyObject *obj, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_netr_GenericInfo_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_GenericInfo_get_data(PyObject *obj, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->data == NULL) { Py_RETURN_NONE; } if (object->data == NULL) { py_data = Py_None; Py_INCREF(py_data); } else { py_data = PyList_New(object->length); if (py_data == NULL) { return NULL; } { int data_cntr_1; for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) { PyObject *py_data_1; py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]); PyList_SetItem(py_data, data_cntr_1, py_data_1); } } } return py_data; } static int py_netr_GenericInfo_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } if (value == Py_None) { object->data = NULL; } else { object->data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_1; object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value)); if (!object->data) { return -1;; } talloc_set_name_const(object->data, "ARRAY: object->data"); for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) { if (PyList_GET_ITEM(value, data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1)); 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->data[data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_GenericInfo_getsetters[] = { { .name = discard_const_p(char, "identity_info"), .get = py_netr_GenericInfo_get_identity_info, .set = py_netr_GenericInfo_set_identity_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_IdentityInfo") }, { .name = discard_const_p(char, "package_name"), .get = py_netr_GenericInfo_get_package_name, .set = py_netr_GenericInfo_set_package_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "length"), .get = py_netr_GenericInfo_get_length, .set = py_netr_GenericInfo_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "data"), .get = py_netr_GenericInfo_get_data, .set = py_netr_GenericInfo_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_GenericInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_GenericInfo, type); } static PyTypeObject netr_GenericInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_GenericInfo", .tp_getset = py_netr_GenericInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_GenericInfo_new, }; static PyObject *py_import_netr_LogonLevel(TALLOC_CTX *mem_ctx, int level, union netr_LogonLevel *in) { PyObject *ret; switch (level) { case NetlogonInteractiveInformation: if (in->password == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password); } return ret; case NetlogonNetworkInformation: if (in->network == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_NetworkInfo_Type, in->network, in->network); } return ret; case NetlogonServiceInformation: if (in->password == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password); } return ret; case NetlogonGenericInformation: if (in->generic == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_GenericInfo_Type, in->generic, in->generic); } return ret; case NetlogonInteractiveTransitiveInformation: if (in->password == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password); } return ret; case NetlogonNetworkTransitiveInformation: if (in->network == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_NetworkInfo_Type, in->network, in->network); } return ret; case NetlogonServiceTransitiveInformation: if (in->password == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password); } return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_LogonLevel *py_export_netr_LogonLevel(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_LogonLevel *ret = talloc_zero(mem_ctx, union netr_LogonLevel); switch (level) { case NetlogonInteractiveInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->password = NULL; } else { ret->password = NULL; PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in); } break; case NetlogonNetworkInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->network"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->network = NULL; } else { ret->network = NULL; PY_CHECK_TYPE(&netr_NetworkInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->network = (struct netr_NetworkInfo *)pytalloc_get_ptr(in); } break; case NetlogonServiceInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->password = NULL; } else { ret->password = NULL; PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in); } break; case NetlogonGenericInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->generic"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->generic = NULL; } else { ret->generic = NULL; PY_CHECK_TYPE(&netr_GenericInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->generic = (struct netr_GenericInfo *)pytalloc_get_ptr(in); } break; case NetlogonInteractiveTransitiveInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->password = NULL; } else { ret->password = NULL; PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in); } break; case NetlogonNetworkTransitiveInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->network"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->network = NULL; } else { ret->network = NULL; PY_CHECK_TYPE(&netr_NetworkInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->network = (struct netr_NetworkInfo *)pytalloc_get_ptr(in); } break; case NetlogonServiceTransitiveInformation: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->password = NULL; } else { ret->password = NULL; PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in); } break; default: break; } return ret; } static PyObject *py_netr_LogonLevel_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_LogonLevel *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_LogonLevel *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_LogonLevel!"); return NULL; } return py_import_netr_LogonLevel(mem_ctx, level, in); } static PyObject *py_netr_LogonLevel_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_LogonLevel *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_LogonLevel(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_LogonLevel_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonLevel_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonLevel_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_LogonLevel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_LogonLevel_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonLevel", .tp_getset = NULL, .tp_methods = py_netr_LogonLevel_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonLevel_new, }; static PyObject *py_netr_UserSessionKey_get_key(PyObject *obj, void *closure) { struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(obj); PyObject *py_key; py_key = PyList_New(16); if (py_key == NULL) { return NULL; } { int key_cntr_0; for (key_cntr_0 = 0; key_cntr_0 < (16); key_cntr_0++) { PyObject *py_key_0; py_key_0 = PyLong_FromLong((uint16_t)object->key[key_cntr_0]); PyList_SetItem(py_key, key_cntr_0, py_key_0); } } return py_key; } static int py_netr_UserSessionKey_set_key(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int key_cntr_0; if (ARRAY_SIZE(object->key) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->key), PyList_GET_SIZE(value)); return -1; } for (key_cntr_0 = 0; key_cntr_0 < PyList_GET_SIZE(value); key_cntr_0++) { if (PyList_GET_ITEM(value, key_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key[key_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->key[key_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, key_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, key_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->key[key_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_netr_UserSessionKey_getsetters[] = { { .name = discard_const_p(char, "key"), .get = py_netr_UserSessionKey_get_key, .set = py_netr_UserSessionKey_set_key, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_UserSessionKey_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_UserSessionKey, type); } static PyObject *py_netr_UserSessionKey_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)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_netr_UserSessionKey); 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_netr_UserSessionKey_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)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_netr_UserSessionKey); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_UserSessionKey); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_UserSessionKey_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)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_netr_UserSessionKey, "netr_UserSessionKey", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_UserSessionKey_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_UserSessionKey_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_UserSessionKey_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_UserSessionKey_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_UserSessionKey_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_UserSessionKey", .tp_getset = py_netr_UserSessionKey_getsetters, .tp_methods = py_netr_UserSessionKey_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_UserSessionKey_new, }; static PyObject *py_netr_LMSessionKey_get_key(PyObject *obj, void *closure) { struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(obj); PyObject *py_key; py_key = PyList_New(8); if (py_key == NULL) { return NULL; } { int key_cntr_0; for (key_cntr_0 = 0; key_cntr_0 < (8); key_cntr_0++) { PyObject *py_key_0; py_key_0 = PyLong_FromLong((uint16_t)object->key[key_cntr_0]); PyList_SetItem(py_key, key_cntr_0, py_key_0); } } return py_key; } static int py_netr_LMSessionKey_set_key(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int key_cntr_0; if (ARRAY_SIZE(object->key) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->key), PyList_GET_SIZE(value)); return -1; } for (key_cntr_0 = 0; key_cntr_0 < PyList_GET_SIZE(value); key_cntr_0++) { if (PyList_GET_ITEM(value, key_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key[key_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->key[key_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, key_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, key_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->key[key_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_netr_LMSessionKey_getsetters[] = { { .name = discard_const_p(char, "key"), .get = py_netr_LMSessionKey_get_key, .set = py_netr_LMSessionKey_set_key, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_LMSessionKey_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_LMSessionKey, type); } static PyObject *py_netr_LMSessionKey_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)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_netr_LMSessionKey); 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_netr_LMSessionKey_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)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_netr_LMSessionKey); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_LMSessionKey); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_LMSessionKey_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)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_netr_LMSessionKey, "netr_LMSessionKey", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_LMSessionKey_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_LMSessionKey_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LMSessionKey_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_LMSessionKey_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LMSessionKey_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LMSessionKey", .tp_getset = py_netr_LMSessionKey_getsetters, .tp_methods = py_netr_LMSessionKey_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LMSessionKey_new, }; static PyObject *py_netr_SamBaseInfo_get_logon_time(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_time; py_logon_time = PyLong_FromUnsignedLongLong(object->logon_time); return py_logon_time; } static int py_netr_SamBaseInfo_set_logon_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_time)); 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->logon_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_logoff_time(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_logoff_time; py_logoff_time = PyLong_FromUnsignedLongLong(object->logoff_time); return py_logoff_time; } static int py_netr_SamBaseInfo_set_logoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logoff_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logoff_time)); 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->logoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_kickoff_time(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_kickoff_time; py_kickoff_time = PyLong_FromUnsignedLongLong(object->kickoff_time); return py_kickoff_time; } static int py_netr_SamBaseInfo_set_kickoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->kickoff_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->kickoff_time)); 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->kickoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_last_password_change(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_last_password_change; py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change); return py_last_password_change; } static int py_netr_SamBaseInfo_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change)); 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->last_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_allow_password_change(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_allow_password_change; py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change); return py_allow_password_change; } static int py_netr_SamBaseInfo_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change)); 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->allow_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_force_password_change(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_force_password_change; py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change); return py_force_password_change; } static int py_netr_SamBaseInfo_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change)); 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->force_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_account_name(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_netr_SamBaseInfo_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_full_name(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_netr_SamBaseInfo_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_logon_script(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_script; py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script); return py_logon_script; } static int py_netr_SamBaseInfo_set_logon_script(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_profile_path(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_profile_path; py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path); return py_profile_path; } static int py_netr_SamBaseInfo_set_profile_path(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_home_directory(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_home_directory; py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory); return py_home_directory; } static int py_netr_SamBaseInfo_set_home_directory(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_home_drive(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_home_drive; py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive); return py_home_drive; } static int py_netr_SamBaseInfo_set_home_drive(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_logon_count(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromLong((uint16_t)object->logon_count); return py_logon_count; } static int py_netr_SamBaseInfo_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_bad_password_count(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_bad_password_count; py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count); return py_bad_password_count; } static int py_netr_SamBaseInfo_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count)); 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->bad_password_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_rid(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_netr_SamBaseInfo_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)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_netr_SamBaseInfo_get_primary_gid(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_netr_SamBaseInfo_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)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_netr_SamBaseInfo_get_groups(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_groups; py_groups = pytalloc_reference_ex(samr_RidWithAttributeArray_Type, pytalloc_get_mem_ctx(obj), &object->groups); return py_groups; } static int py_netr_SamBaseInfo_set_groups(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups"); return -1; } PY_CHECK_TYPE(samr_RidWithAttributeArray_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->groups = *(struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_user_flags(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_user_flags; py_user_flags = PyLong_FromUnsignedLongLong((uint32_t)object->user_flags); return py_user_flags; } static int py_netr_SamBaseInfo_set_user_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_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->user_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_key(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_key; py_key = pytalloc_reference_ex(&netr_UserSessionKey_Type, pytalloc_get_mem_ctx(obj), &object->key); return py_key; } static int py_netr_SamBaseInfo_set_key(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key"); return -1; } PY_CHECK_TYPE(&netr_UserSessionKey_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->key = *(struct netr_UserSessionKey *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_logon_server(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_server; py_logon_server = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->logon_server); return py_logon_server; } static int py_netr_SamBaseInfo_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_server"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_server = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_logon_domain(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_domain; py_logon_domain = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->logon_domain); return py_logon_domain; } static int py_netr_SamBaseInfo_set_logon_domain(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_domain"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_domain_sid(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_sid; if (object->domain_sid == NULL) { Py_RETURN_NONE; } if (object->domain_sid == NULL) { py_domain_sid = Py_None; Py_INCREF(py_domain_sid); } else { py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid); } return py_domain_sid; } static int py_netr_SamBaseInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid"); return -1; } if (value == Py_None) { object->domain_sid = NULL; } else { object->domain_sid = NULL; 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->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_SamBaseInfo_get_LMSessKey(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_LMSessKey; py_LMSessKey = pytalloc_reference_ex(&netr_LMSessionKey_Type, pytalloc_get_mem_ctx(obj), &object->LMSessKey); return py_LMSessKey; } static int py_netr_SamBaseInfo_set_LMSessKey(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->LMSessKey"); return -1; } PY_CHECK_TYPE(&netr_LMSessionKey_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->LMSessKey = *(struct netr_LMSessionKey *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamBaseInfo_get_acct_flags(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_netr_SamBaseInfo_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_sub_auth_status(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_sub_auth_status; py_sub_auth_status = PyLong_FromUnsignedLongLong((uint32_t)object->sub_auth_status); return py_sub_auth_status; } static int py_netr_SamBaseInfo_set_sub_auth_status(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub_auth_status"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sub_auth_status)); 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->sub_auth_status = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_last_successful_logon(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_last_successful_logon; py_last_successful_logon = PyLong_FromUnsignedLongLong(object->last_successful_logon); return py_last_successful_logon; } static int py_netr_SamBaseInfo_set_last_successful_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_successful_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_successful_logon)); 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->last_successful_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_last_failed_logon(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_last_failed_logon; py_last_failed_logon = PyLong_FromUnsignedLongLong(object->last_failed_logon); return py_last_failed_logon; } static int py_netr_SamBaseInfo_set_last_failed_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_failed_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_failed_logon)); 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->last_failed_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_failed_logon_count(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_failed_logon_count; py_failed_logon_count = PyLong_FromUnsignedLongLong((uint32_t)object->failed_logon_count); return py_failed_logon_count; } static int py_netr_SamBaseInfo_set_failed_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->failed_logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->failed_logon_count)); 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->failed_logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamBaseInfo_get_reserved(PyObject *obj, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj); PyObject *py_reserved; py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved); return py_reserved; } static int py_netr_SamBaseInfo_set_reserved(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved)); 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->reserved = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_SamBaseInfo_getsetters[] = { { .name = discard_const_p(char, "logon_time"), .get = py_netr_SamBaseInfo_get_logon_time, .set = py_netr_SamBaseInfo_set_logon_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "logoff_time"), .get = py_netr_SamBaseInfo_get_logoff_time, .set = py_netr_SamBaseInfo_set_logoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "kickoff_time"), .get = py_netr_SamBaseInfo_get_kickoff_time, .set = py_netr_SamBaseInfo_set_kickoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_password_change"), .get = py_netr_SamBaseInfo_get_last_password_change, .set = py_netr_SamBaseInfo_set_last_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "allow_password_change"), .get = py_netr_SamBaseInfo_get_allow_password_change, .set = py_netr_SamBaseInfo_set_allow_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "force_password_change"), .get = py_netr_SamBaseInfo_get_force_password_change, .set = py_netr_SamBaseInfo_set_force_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "account_name"), .get = py_netr_SamBaseInfo_get_account_name, .set = py_netr_SamBaseInfo_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_netr_SamBaseInfo_get_full_name, .set = py_netr_SamBaseInfo_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_script"), .get = py_netr_SamBaseInfo_get_logon_script, .set = py_netr_SamBaseInfo_set_logon_script, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "profile_path"), .get = py_netr_SamBaseInfo_get_profile_path, .set = py_netr_SamBaseInfo_set_profile_path, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_directory"), .get = py_netr_SamBaseInfo_get_home_directory, .set = py_netr_SamBaseInfo_set_home_directory, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_drive"), .get = py_netr_SamBaseInfo_get_home_drive, .set = py_netr_SamBaseInfo_set_home_drive, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_count"), .get = py_netr_SamBaseInfo_get_logon_count, .set = py_netr_SamBaseInfo_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "bad_password_count"), .get = py_netr_SamBaseInfo_get_bad_password_count, .set = py_netr_SamBaseInfo_set_bad_password_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "rid"), .get = py_netr_SamBaseInfo_get_rid, .set = py_netr_SamBaseInfo_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "primary_gid"), .get = py_netr_SamBaseInfo_get_primary_gid, .set = py_netr_SamBaseInfo_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "groups"), .get = py_netr_SamBaseInfo_get_groups, .set = py_netr_SamBaseInfo_set_groups, .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray") }, { .name = discard_const_p(char, "user_flags"), .get = py_netr_SamBaseInfo_get_user_flags, .set = py_netr_SamBaseInfo_set_user_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UserFlags") }, { .name = discard_const_p(char, "key"), .get = py_netr_SamBaseInfo_get_key, .set = py_netr_SamBaseInfo_set_key, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UserSessionKey") }, { .name = discard_const_p(char, "logon_server"), .get = py_netr_SamBaseInfo_get_logon_server, .set = py_netr_SamBaseInfo_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "logon_domain"), .get = py_netr_SamBaseInfo_get_logon_domain, .set = py_netr_SamBaseInfo_set_logon_domain, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "domain_sid"), .get = py_netr_SamBaseInfo_get_domain_sid, .set = py_netr_SamBaseInfo_set_domain_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "LMSessKey"), .get = py_netr_SamBaseInfo_get_LMSessKey, .set = py_netr_SamBaseInfo_set_LMSessKey, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LMSessionKey") }, { .name = discard_const_p(char, "acct_flags"), .get = py_netr_SamBaseInfo_get_acct_flags, .set = py_netr_SamBaseInfo_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "sub_auth_status"), .get = py_netr_SamBaseInfo_get_sub_auth_status, .set = py_netr_SamBaseInfo_set_sub_auth_status, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "last_successful_logon"), .get = py_netr_SamBaseInfo_get_last_successful_logon, .set = py_netr_SamBaseInfo_set_last_successful_logon, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_failed_logon"), .get = py_netr_SamBaseInfo_get_last_failed_logon, .set = py_netr_SamBaseInfo_set_last_failed_logon, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "failed_logon_count"), .get = py_netr_SamBaseInfo_get_failed_logon_count, .set = py_netr_SamBaseInfo_set_failed_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "reserved"), .get = py_netr_SamBaseInfo_get_reserved, .set = py_netr_SamBaseInfo_set_reserved, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_SamBaseInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SamBaseInfo, type); } static PyTypeObject netr_SamBaseInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SamBaseInfo", .tp_getset = py_netr_SamBaseInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SamBaseInfo_new, }; static PyObject *py_netr_SamInfo2_get_base(PyObject *obj, void *closure) { struct netr_SamInfo2 *object = (struct netr_SamInfo2 *)pytalloc_get_ptr(obj); PyObject *py_base; py_base = pytalloc_reference_ex(&netr_SamBaseInfo_Type, pytalloc_get_mem_ctx(obj), &object->base); return py_base; } static int py_netr_SamInfo2_set_base(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo2 *object = (struct netr_SamInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->base"); return -1; } PY_CHECK_TYPE(&netr_SamBaseInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->base = *(struct netr_SamBaseInfo *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_SamInfo2_getsetters[] = { { .name = discard_const_p(char, "base"), .get = py_netr_SamInfo2_get_base, .set = py_netr_SamInfo2_set_base, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamBaseInfo") }, { .name = NULL } }; static PyObject *py_netr_SamInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SamInfo2, type); } static PyTypeObject netr_SamInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SamInfo2", .tp_getset = py_netr_SamInfo2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SamInfo2_new, }; static PyObject *py_netr_SidAttr_get_sid(PyObject *obj, void *closure) { struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->sid == NULL) { Py_RETURN_NONE; } if (object->sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid); } return py_sid; } static int py_netr_SidAttr_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid"); return -1; } if (value == Py_None) { object->sid = NULL; } else { object->sid = NULL; 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_netr_SidAttr_get_attributes(PyObject *obj, void *closure) { struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(obj); PyObject *py_attributes; py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes); return py_attributes; } static int py_netr_SidAttr_set_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes)); 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->attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_SidAttr_getsetters[] = { { .name = discard_const_p(char, "sid"), .get = py_netr_SidAttr_get_sid, .set = py_netr_SidAttr_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "attributes"), .get = py_netr_SidAttr_get_attributes, .set = py_netr_SidAttr_set_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs") }, { .name = NULL } }; static PyObject *py_netr_SidAttr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SidAttr, type); } static PyObject *py_netr_SidAttr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_SidAttr *object = (struct netr_SidAttr *)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_netr_SidAttr); 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_netr_SidAttr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_SidAttr *object = (struct netr_SidAttr *)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_netr_SidAttr); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SidAttr); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_SidAttr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_SidAttr *object = (struct netr_SidAttr *)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_netr_SidAttr, "netr_SidAttr", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_SidAttr_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_SidAttr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SidAttr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_SidAttr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_SidAttr_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SidAttr", .tp_getset = py_netr_SidAttr_getsetters, .tp_methods = py_netr_SidAttr_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SidAttr_new, }; static PyObject *py_netr_SamInfo3_get_base(PyObject *obj, void *closure) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(obj); PyObject *py_base; py_base = pytalloc_reference_ex(&netr_SamBaseInfo_Type, pytalloc_get_mem_ctx(obj), &object->base); return py_base; } static int py_netr_SamInfo3_set_base(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->base"); return -1; } PY_CHECK_TYPE(&netr_SamBaseInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->base = *(struct netr_SamBaseInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamInfo3_get_sidcount(PyObject *obj, void *closure) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(obj); PyObject *py_sidcount; py_sidcount = PyLong_FromUnsignedLongLong((uint32_t)object->sidcount); return py_sidcount; } static int py_netr_SamInfo3_set_sidcount(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sidcount"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sidcount)); 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->sidcount = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamInfo3_get_sids(PyObject *obj, void *closure) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->sids == NULL) { Py_RETURN_NONE; } if (object->sids == NULL) { py_sids = Py_None; Py_INCREF(py_sids); } else { py_sids = PyList_New(object->sidcount); if (py_sids == NULL) { return NULL; } { int sids_cntr_1; for (sids_cntr_1 = 0; sids_cntr_1 < (object->sidcount); sids_cntr_1++) { PyObject *py_sids_1; py_sids_1 = pytalloc_reference_ex(&netr_SidAttr_Type, object->sids, &object->sids[sids_cntr_1]); PyList_SetItem(py_sids, sids_cntr_1, py_sids_1); } } } return py_sids; } static int py_netr_SamInfo3_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids"); return -1; } if (value == Py_None) { object->sids = NULL; } else { object->sids = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sids_cntr_1; 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_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) { if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_SidAttr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;); if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->sids[sids_cntr_1] = *(struct netr_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1)); } } } return 0; } static PyGetSetDef py_netr_SamInfo3_getsetters[] = { { .name = discard_const_p(char, "base"), .get = py_netr_SamInfo3_get_base, .set = py_netr_SamInfo3_set_base, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamBaseInfo") }, { .name = discard_const_p(char, "sidcount"), .get = py_netr_SamInfo3_get_sidcount, .set = py_netr_SamInfo3_set_sidcount, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sids"), .get = py_netr_SamInfo3_get_sids, .set = py_netr_SamInfo3_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SidAttr") }, { .name = NULL } }; static PyObject *py_netr_SamInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SamInfo3, type); } static PyObject *py_netr_SamInfo3_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)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_netr_SamInfo3); 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_netr_SamInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)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_netr_SamInfo3); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SamInfo3); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_SamInfo3_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)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_netr_SamInfo3, "netr_SamInfo3", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_SamInfo3_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_SamInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SamInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_SamInfo3_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_SamInfo3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SamInfo3", .tp_getset = py_netr_SamInfo3_getsetters, .tp_methods = py_netr_SamInfo3_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SamInfo3_new, }; static PyObject *py_netr_SamInfo6_get_base(PyObject *obj, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj); PyObject *py_base; py_base = pytalloc_reference_ex(&netr_SamBaseInfo_Type, pytalloc_get_mem_ctx(obj), &object->base); return py_base; } static int py_netr_SamInfo6_set_base(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->base"); return -1; } PY_CHECK_TYPE(&netr_SamBaseInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->base = *(struct netr_SamBaseInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamInfo6_get_sidcount(PyObject *obj, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj); PyObject *py_sidcount; py_sidcount = PyLong_FromUnsignedLongLong((uint32_t)object->sidcount); return py_sidcount; } static int py_netr_SamInfo6_set_sidcount(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sidcount"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sidcount)); 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->sidcount = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SamInfo6_get_sids(PyObject *obj, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->sids == NULL) { Py_RETURN_NONE; } if (object->sids == NULL) { py_sids = Py_None; Py_INCREF(py_sids); } else { py_sids = PyList_New(object->sidcount); if (py_sids == NULL) { return NULL; } { int sids_cntr_1; for (sids_cntr_1 = 0; sids_cntr_1 < (object->sidcount); sids_cntr_1++) { PyObject *py_sids_1; py_sids_1 = pytalloc_reference_ex(&netr_SidAttr_Type, object->sids, &object->sids[sids_cntr_1]); PyList_SetItem(py_sids, sids_cntr_1, py_sids_1); } } } return py_sids; } static int py_netr_SamInfo6_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids"); return -1; } if (value == Py_None) { object->sids = NULL; } else { object->sids = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sids_cntr_1; 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_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) { if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_SidAttr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;); if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->sids[sids_cntr_1] = *(struct netr_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1)); } } } return 0; } static PyObject *py_netr_SamInfo6_get_dns_domainname(PyObject *obj, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj); PyObject *py_dns_domainname; py_dns_domainname = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->dns_domainname); return py_dns_domainname; } static int py_netr_SamInfo6_set_dns_domainname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domainname"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dns_domainname = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamInfo6_get_principal_name(PyObject *obj, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj); PyObject *py_principal_name; py_principal_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->principal_name); return py_principal_name; } static int py_netr_SamInfo6_set_principal_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principal_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->principal_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_SamInfo6_get_unknown4(PyObject *obj, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = PyList_New(20); if (py_unknown4 == NULL) { return NULL; } { int unknown4_cntr_0; for (unknown4_cntr_0 = 0; unknown4_cntr_0 < (20); unknown4_cntr_0++) { PyObject *py_unknown4_0; py_unknown4_0 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4[unknown4_cntr_0]); PyList_SetItem(py_unknown4, unknown4_cntr_0, py_unknown4_0); } } return py_unknown4; } static int py_netr_SamInfo6_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int unknown4_cntr_0; if (ARRAY_SIZE(object->unknown4) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unknown4), PyList_GET_SIZE(value)); return -1; } for (unknown4_cntr_0 = 0; unknown4_cntr_0 < PyList_GET_SIZE(value); unknown4_cntr_0++) { if (PyList_GET_ITEM(value, unknown4_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4[unknown4_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4[unknown4_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, unknown4_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unknown4_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->unknown4[unknown4_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_netr_SamInfo6_getsetters[] = { { .name = discard_const_p(char, "base"), .get = py_netr_SamInfo6_get_base, .set = py_netr_SamInfo6_set_base, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamBaseInfo") }, { .name = discard_const_p(char, "sidcount"), .get = py_netr_SamInfo6_get_sidcount, .set = py_netr_SamInfo6_set_sidcount, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sids"), .get = py_netr_SamInfo6_get_sids, .set = py_netr_SamInfo6_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SidAttr") }, { .name = discard_const_p(char, "dns_domainname"), .get = py_netr_SamInfo6_get_dns_domainname, .set = py_netr_SamInfo6_set_dns_domainname, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "principal_name"), .get = py_netr_SamInfo6_get_principal_name, .set = py_netr_SamInfo6_set_principal_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_SamInfo6_get_unknown4, .set = py_netr_SamInfo6_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_SamInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SamInfo6, type); } static PyTypeObject netr_SamInfo6_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SamInfo6", .tp_getset = py_netr_SamInfo6_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SamInfo6_new, }; static PyObject *py_netr_PacInfo_get_pac_size(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_pac_size; py_pac_size = PyLong_FromUnsignedLongLong((uint32_t)object->pac_size); return py_pac_size; } static int py_netr_PacInfo_set_pac_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pac_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pac_size)); 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->pac_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PacInfo_get_pac(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_pac; if (object->pac == NULL) { Py_RETURN_NONE; } if (object->pac == NULL) { py_pac = Py_None; Py_INCREF(py_pac); } else { py_pac = PyList_New(object->pac_size); if (py_pac == NULL) { return NULL; } { int pac_cntr_1; for (pac_cntr_1 = 0; pac_cntr_1 < (object->pac_size); pac_cntr_1++) { PyObject *py_pac_1; py_pac_1 = PyLong_FromLong((uint16_t)object->pac[pac_cntr_1]); PyList_SetItem(py_pac, pac_cntr_1, py_pac_1); } } } return py_pac; } static int py_netr_PacInfo_set_pac(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pac)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pac"); return -1; } if (value == Py_None) { object->pac = NULL; } else { object->pac = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int pac_cntr_1; object->pac = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pac, PyList_GET_SIZE(value)); if (!object->pac) { return -1;; } talloc_set_name_const(object->pac, "ARRAY: object->pac"); for (pac_cntr_1 = 0; pac_cntr_1 < PyList_GET_SIZE(value); pac_cntr_1++) { if (PyList_GET_ITEM(value, pac_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pac[pac_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pac[pac_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, pac_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pac_cntr_1)); 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->pac[pac_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_PacInfo_get_logon_domain(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_domain; py_logon_domain = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_domain); return py_logon_domain; } static int py_netr_PacInfo_set_logon_domain(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_domain"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_domain = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_logon_server(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_logon_server; py_logon_server = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_server); return py_logon_server; } static int py_netr_PacInfo_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_server"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_server = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_principal_name(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_principal_name; py_principal_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->principal_name); return py_principal_name; } static int py_netr_PacInfo_set_principal_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principal_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->principal_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_auth_size(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_auth_size; py_auth_size = PyLong_FromUnsignedLongLong((uint32_t)object->auth_size); return py_auth_size; } static int py_netr_PacInfo_set_auth_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_size)); 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->auth_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PacInfo_get_auth(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_auth; if (object->auth == NULL) { Py_RETURN_NONE; } if (object->auth == NULL) { py_auth = Py_None; Py_INCREF(py_auth); } else { py_auth = PyList_New(object->auth_size); if (py_auth == NULL) { return NULL; } { int auth_cntr_1; for (auth_cntr_1 = 0; auth_cntr_1 < (object->auth_size); auth_cntr_1++) { PyObject *py_auth_1; py_auth_1 = PyLong_FromLong((uint16_t)object->auth[auth_cntr_1]); PyList_SetItem(py_auth, auth_cntr_1, py_auth_1); } } } return py_auth; } static int py_netr_PacInfo_set_auth(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->auth)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth"); return -1; } if (value == Py_None) { object->auth = NULL; } else { object->auth = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int auth_cntr_1; object->auth = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->auth, PyList_GET_SIZE(value)); if (!object->auth) { return -1;; } talloc_set_name_const(object->auth, "ARRAY: object->auth"); for (auth_cntr_1 = 0; auth_cntr_1 < PyList_GET_SIZE(value); auth_cntr_1++) { if (PyList_GET_ITEM(value, auth_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth[auth_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth[auth_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, auth_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, auth_cntr_1)); 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->auth[auth_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_PacInfo_get_user_session_key(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_user_session_key; py_user_session_key = pytalloc_reference_ex(&netr_UserSessionKey_Type, pytalloc_get_mem_ctx(obj), &object->user_session_key); return py_user_session_key; } static int py_netr_PacInfo_set_user_session_key(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_session_key"); return -1; } PY_CHECK_TYPE(&netr_UserSessionKey_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_session_key = *(struct netr_UserSessionKey *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_expansionroom(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_expansionroom; py_expansionroom = PyList_New(10); if (py_expansionroom == NULL) { return NULL; } { int expansionroom_cntr_0; for (expansionroom_cntr_0 = 0; expansionroom_cntr_0 < (10); expansionroom_cntr_0++) { PyObject *py_expansionroom_0; py_expansionroom_0 = PyLong_FromUnsignedLongLong((uint32_t)object->expansionroom[expansionroom_cntr_0]); PyList_SetItem(py_expansionroom, expansionroom_cntr_0, py_expansionroom_0); } } return py_expansionroom; } static int py_netr_PacInfo_set_expansionroom(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->expansionroom"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int expansionroom_cntr_0; if (ARRAY_SIZE(object->expansionroom) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->expansionroom), PyList_GET_SIZE(value)); return -1; } for (expansionroom_cntr_0 = 0; expansionroom_cntr_0 < PyList_GET_SIZE(value); expansionroom_cntr_0++) { if (PyList_GET_ITEM(value, expansionroom_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->expansionroom[expansionroom_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->expansionroom[expansionroom_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, expansionroom_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, expansionroom_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->expansionroom[expansionroom_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_netr_PacInfo_get_unknown1(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_PacInfo_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_unknown2(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_PacInfo_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_unknown3(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_PacInfo_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_PacInfo_get_unknown4(PyObject *obj, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_PacInfo_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_PacInfo_getsetters[] = { { .name = discard_const_p(char, "pac_size"), .get = py_netr_PacInfo_get_pac_size, .set = py_netr_PacInfo_set_pac_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "pac"), .get = py_netr_PacInfo_get_pac, .set = py_netr_PacInfo_set_pac, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "logon_domain"), .get = py_netr_PacInfo_get_logon_domain, .set = py_netr_PacInfo_set_logon_domain, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_server"), .get = py_netr_PacInfo_get_logon_server, .set = py_netr_PacInfo_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "principal_name"), .get = py_netr_PacInfo_get_principal_name, .set = py_netr_PacInfo_set_principal_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "auth_size"), .get = py_netr_PacInfo_get_auth_size, .set = py_netr_PacInfo_set_auth_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "auth"), .get = py_netr_PacInfo_get_auth, .set = py_netr_PacInfo_set_auth, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "user_session_key"), .get = py_netr_PacInfo_get_user_session_key, .set = py_netr_PacInfo_set_user_session_key, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UserSessionKey") }, { .name = discard_const_p(char, "expansionroom"), .get = py_netr_PacInfo_get_expansionroom, .set = py_netr_PacInfo_set_expansionroom, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_PacInfo_get_unknown1, .set = py_netr_PacInfo_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_PacInfo_get_unknown2, .set = py_netr_PacInfo_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_PacInfo_get_unknown3, .set = py_netr_PacInfo_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_PacInfo_get_unknown4, .set = py_netr_PacInfo_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_netr_PacInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_PacInfo, type); } static PyTypeObject netr_PacInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_PacInfo", .tp_getset = py_netr_PacInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_PacInfo_new, }; static PyObject *py_netr_GenericInfo2_get_length(PyObject *obj, void *closure) { struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_netr_GenericInfo2_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_GenericInfo2_get_data(PyObject *obj, void *closure) { struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->data == NULL) { Py_RETURN_NONE; } if (object->data == NULL) { py_data = Py_None; Py_INCREF(py_data); } else { py_data = PyList_New(object->length); if (py_data == NULL) { return NULL; } { int data_cntr_1; for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) { PyObject *py_data_1; py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]); PyList_SetItem(py_data, data_cntr_1, py_data_1); } } } return py_data; } static int py_netr_GenericInfo2_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } if (value == Py_None) { object->data = NULL; } else { object->data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_1; object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value)); if (!object->data) { return -1;; } talloc_set_name_const(object->data, "ARRAY: object->data"); for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) { if (PyList_GET_ITEM(value, data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1)); 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->data[data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_GenericInfo2_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_GenericInfo2_get_length, .set = py_netr_GenericInfo2_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "data"), .get = py_netr_GenericInfo2_get_data, .set = py_netr_GenericInfo2_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_GenericInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_GenericInfo2, type); } static PyTypeObject netr_GenericInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_GenericInfo2", .tp_getset = py_netr_GenericInfo2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_GenericInfo2_new, }; static PyObject *py_import_netr_Validation(TALLOC_CTX *mem_ctx, int level, union netr_Validation *in) { PyObject *ret; switch (level) { case NetlogonValidationSamInfo: if (in->sam2 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_SamInfo2_Type, in->sam2, in->sam2); } return ret; case NetlogonValidationSamInfo2: if (in->sam3 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_SamInfo3_Type, in->sam3, in->sam3); } return ret; case 4: if (in->pac == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_PacInfo_Type, in->pac, in->pac); } return ret; case NetlogonValidationGenericInfo2: if (in->generic == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_GenericInfo2_Type, in->generic, in->generic); } return ret; case NetlogonValidationSamInfo4: if (in->sam6 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_SamInfo6_Type, in->sam6, in->sam6); } return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_Validation *py_export_netr_Validation(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_Validation *ret = talloc_zero(mem_ctx, union netr_Validation); switch (level) { case NetlogonValidationSamInfo: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam2"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sam2 = NULL; } else { ret->sam2 = NULL; PY_CHECK_TYPE(&netr_SamInfo2_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sam2 = (struct netr_SamInfo2 *)pytalloc_get_ptr(in); } break; case NetlogonValidationSamInfo2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam3"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sam3 = NULL; } else { ret->sam3 = NULL; PY_CHECK_TYPE(&netr_SamInfo3_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sam3 = (struct netr_SamInfo3 *)pytalloc_get_ptr(in); } break; case 4: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pac"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->pac = NULL; } else { ret->pac = NULL; PY_CHECK_TYPE(&netr_PacInfo_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->pac = (struct netr_PacInfo *)pytalloc_get_ptr(in); } break; case NetlogonValidationGenericInfo2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->generic"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->generic = NULL; } else { ret->generic = NULL; PY_CHECK_TYPE(&netr_GenericInfo2_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->generic = (struct netr_GenericInfo2 *)pytalloc_get_ptr(in); } break; case NetlogonValidationSamInfo4: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam6"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sam6 = NULL; } else { ret->sam6 = NULL; PY_CHECK_TYPE(&netr_SamInfo6_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sam6 = (struct netr_SamInfo6 *)pytalloc_get_ptr(in); } break; default: break; } return ret; } static PyObject *py_netr_Validation_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_Validation *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_Validation *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_Validation!"); return NULL; } return py_import_netr_Validation(mem_ctx, level, in); } static PyObject *py_netr_Validation_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_Validation *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_Validation(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_Validation_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Validation_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Validation_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_Validation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_Validation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_Validation", .tp_getset = NULL, .tp_methods = py_netr_Validation_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_Validation_new, }; static PyObject *py_netr_Credential_get_data(PyObject *obj, void *closure) { struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(obj); PyObject *py_data; py_data = PyList_New(8); if (py_data == NULL) { return NULL; } { int data_cntr_0; for (data_cntr_0 = 0; data_cntr_0 < (8); data_cntr_0++) { PyObject *py_data_0; py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]); PyList_SetItem(py_data, data_cntr_0, py_data_0); } } return py_data; } static int py_netr_Credential_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_0; if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value)); return -1; } for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) { if (PyList_GET_ITEM(value, data_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_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->data[data_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_netr_Credential_getsetters[] = { { .name = discard_const_p(char, "data"), .get = py_netr_Credential_get_data, .set = py_netr_Credential_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_Credential_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_Credential, type); } static PyObject *py_netr_Credential_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_Credential *object = (struct netr_Credential *)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_netr_Credential); 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_netr_Credential_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_Credential *object = (struct netr_Credential *)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_netr_Credential); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_Credential); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_Credential_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_Credential *object = (struct netr_Credential *)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_netr_Credential, "netr_Credential", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_Credential_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_Credential_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Credential_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_Credential_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_Credential_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_Credential", .tp_getset = py_netr_Credential_getsetters, .tp_methods = py_netr_Credential_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_Credential_new, }; static PyObject *py_netr_Authenticator_get_cred(PyObject *obj, void *closure) { struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(obj); PyObject *py_cred; py_cred = pytalloc_reference_ex(&netr_Credential_Type, pytalloc_get_mem_ctx(obj), &object->cred); return py_cred; } static int py_netr_Authenticator_set_cred(PyObject *py_obj, PyObject *value, void *closure) { struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cred"); return -1; } PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->cred = *(struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_Authenticator_get_timestamp(PyObject *obj, void *closure) { struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(obj); PyObject *py_timestamp; py_timestamp = PyLong_FromLong(object->timestamp); return py_timestamp; } static int py_netr_Authenticator_set_timestamp(PyObject *py_obj, PyObject *value, void *closure) { struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->timestamp = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_Authenticator_getsetters[] = { { .name = discard_const_p(char, "cred"), .get = py_netr_Authenticator_get_cred, .set = py_netr_Authenticator_set_cred, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "timestamp"), .get = py_netr_Authenticator_get_timestamp, .set = py_netr_Authenticator_set_timestamp, .doc = discard_const_p(char, "PIDL-generated element of base type time_t") }, { .name = NULL } }; static PyObject *py_netr_Authenticator_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_Authenticator, type); } static PyObject *py_netr_Authenticator_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_Authenticator *object = (struct netr_Authenticator *)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_netr_Authenticator); 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_netr_Authenticator_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_Authenticator *object = (struct netr_Authenticator *)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_netr_Authenticator); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_Authenticator); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_Authenticator_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_Authenticator *object = (struct netr_Authenticator *)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_netr_Authenticator, "netr_Authenticator", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_Authenticator_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_Authenticator_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Authenticator_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_Authenticator_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_Authenticator_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_Authenticator", .tp_getset = py_netr_Authenticator_getsetters, .tp_methods = py_netr_Authenticator_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_Authenticator_new, }; static PyObject *py_netr_DELTA_DELETE_USER_get_account_name(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->account_name == NULL) { Py_RETURN_NONE; } if (object->account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { if (object->account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore"); } } return py_account_name; } static int py_netr_DELTA_DELETE_USER_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } if (value == Py_None) { object->account_name = NULL; } else { object->account_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->account_name = talloc_str; } } return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_DELETE_USER_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_DELETE_USER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_DELETE_USER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_DELETE_USER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_DELETE_USER_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_DELETE_USER_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_DELETE_USER_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DELETE_USER_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_DELETE_USER_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_DELETE_USER_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_netr_DELTA_DELETE_USER_get_account_name, .set = py_netr_DELTA_DELETE_USER_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_DELETE_USER_get_unknown1, .set = py_netr_DELTA_DELETE_USER_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_DELETE_USER_get_unknown2, .set = py_netr_DELTA_DELETE_USER_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_DELETE_USER_get_unknown3, .set = py_netr_DELTA_DELETE_USER_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_DELETE_USER_get_unknown4, .set = py_netr_DELTA_DELETE_USER_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_DELETE_USER_get_unknown5, .set = py_netr_DELTA_DELETE_USER_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_DELETE_USER_get_unknown6, .set = py_netr_DELTA_DELETE_USER_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_DELETE_USER_get_unknown7, .set = py_netr_DELTA_DELETE_USER_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_DELETE_USER_get_unknown8, .set = py_netr_DELTA_DELETE_USER_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_DELETE_USER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_DELETE_USER, type); } static PyTypeObject netr_DELTA_DELETE_USER_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_DELETE_USER", .tp_getset = py_netr_DELTA_DELETE_USER_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_DELETE_USER_new, }; static PyObject *py_netr_USER_KEY16_get_length(PyObject *obj, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromLong((uint16_t)object->length); return py_length; } static int py_netr_USER_KEY16_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_USER_KEY16_get_size(PyObject *obj, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromLong((uint16_t)object->size); return py_size; } static int py_netr_USER_KEY16_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_USER_KEY16_get_flags(PyObject *obj, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags); return py_flags; } static int py_netr_USER_KEY16_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_USER_KEY16_get_pwd(PyObject *obj, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj); PyObject *py_pwd; py_pwd = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->pwd); return py_pwd; } static int py_netr_USER_KEY16_set_pwd(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd"); return -1; } PY_CHECK_TYPE(samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->pwd = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_USER_KEY16_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_USER_KEY16_get_length, .set = py_netr_USER_KEY16_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "size"), .get = py_netr_USER_KEY16_get_size, .set = py_netr_USER_KEY16_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "flags"), .get = py_netr_USER_KEY16_get_flags, .set = py_netr_USER_KEY16_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "pwd"), .get = py_netr_USER_KEY16_get_pwd, .set = py_netr_USER_KEY16_set_pwd, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = NULL } }; static PyObject *py_netr_USER_KEY16_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_USER_KEY16, type); } static PyTypeObject netr_USER_KEY16_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_USER_KEY16", .tp_getset = py_netr_USER_KEY16_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_USER_KEY16_new, }; static PyObject *py_netr_PasswordHistory_get_nt_length(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_nt_length; py_nt_length = PyLong_FromLong((uint16_t)object->nt_length); return py_nt_length; } static int py_netr_PasswordHistory_set_nt_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_length)); 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->nt_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PasswordHistory_get_nt_size(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_nt_size; py_nt_size = PyLong_FromLong((uint16_t)object->nt_size); return py_nt_size; } static int py_netr_PasswordHistory_set_nt_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_size)); 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->nt_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PasswordHistory_get_nt_flags(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_nt_flags; py_nt_flags = PyLong_FromUnsignedLongLong((uint32_t)object->nt_flags); return py_nt_flags; } static int py_netr_PasswordHistory_set_nt_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_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->nt_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PasswordHistory_get_lm_length(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_lm_length; py_lm_length = PyLong_FromLong((uint16_t)object->lm_length); return py_lm_length; } static int py_netr_PasswordHistory_set_lm_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_length)); 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->lm_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PasswordHistory_get_lm_size(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_lm_size; py_lm_size = PyLong_FromLong((uint16_t)object->lm_size); return py_lm_size; } static int py_netr_PasswordHistory_set_lm_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_size)); 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->lm_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PasswordHistory_get_lm_flags(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_lm_flags; py_lm_flags = PyLong_FromUnsignedLongLong((uint32_t)object->lm_flags); return py_lm_flags; } static int py_netr_PasswordHistory_set_lm_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_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->lm_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_PasswordHistory_get_nt_history(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_nt_history; py_nt_history = PyList_New(object->nt_length); if (py_nt_history == NULL) { return NULL; } { int nt_history_cntr_0; for (nt_history_cntr_0 = 0; nt_history_cntr_0 < (object->nt_length); nt_history_cntr_0++) { PyObject *py_nt_history_0; py_nt_history_0 = PyLong_FromLong((uint16_t)object->nt_history[nt_history_cntr_0]); PyList_SetItem(py_nt_history, nt_history_cntr_0, py_nt_history_0); } } return py_nt_history; } static int py_netr_PasswordHistory_set_nt_history(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_history"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int nt_history_cntr_0; object->nt_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nt_history, PyList_GET_SIZE(value)); if (!object->nt_history) { return -1;; } talloc_set_name_const(object->nt_history, "ARRAY: object->nt_history"); for (nt_history_cntr_0 = 0; nt_history_cntr_0 < PyList_GET_SIZE(value); nt_history_cntr_0++) { if (PyList_GET_ITEM(value, nt_history_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_history[nt_history_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_history[nt_history_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, nt_history_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, nt_history_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->nt_history[nt_history_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_netr_PasswordHistory_get_lm_history(PyObject *obj, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj); PyObject *py_lm_history; py_lm_history = PyList_New(object->lm_length); if (py_lm_history == NULL) { return NULL; } { int lm_history_cntr_0; for (lm_history_cntr_0 = 0; lm_history_cntr_0 < (object->lm_length); lm_history_cntr_0++) { PyObject *py_lm_history_0; py_lm_history_0 = PyLong_FromLong((uint16_t)object->lm_history[lm_history_cntr_0]); PyList_SetItem(py_lm_history, lm_history_cntr_0, py_lm_history_0); } } return py_lm_history; } static int py_netr_PasswordHistory_set_lm_history(PyObject *py_obj, PyObject *value, void *closure) { struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_history"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int lm_history_cntr_0; object->lm_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->lm_history, PyList_GET_SIZE(value)); if (!object->lm_history) { return -1;; } talloc_set_name_const(object->lm_history, "ARRAY: object->lm_history"); for (lm_history_cntr_0 = 0; lm_history_cntr_0 < PyList_GET_SIZE(value); lm_history_cntr_0++) { if (PyList_GET_ITEM(value, lm_history_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_history[lm_history_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_history[lm_history_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, lm_history_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lm_history_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->lm_history[lm_history_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_netr_PasswordHistory_getsetters[] = { { .name = discard_const_p(char, "nt_length"), .get = py_netr_PasswordHistory_get_nt_length, .set = py_netr_PasswordHistory_set_nt_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "nt_size"), .get = py_netr_PasswordHistory_get_nt_size, .set = py_netr_PasswordHistory_set_nt_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "nt_flags"), .get = py_netr_PasswordHistory_get_nt_flags, .set = py_netr_PasswordHistory_set_nt_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "lm_length"), .get = py_netr_PasswordHistory_get_lm_length, .set = py_netr_PasswordHistory_set_lm_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "lm_size"), .get = py_netr_PasswordHistory_get_lm_size, .set = py_netr_PasswordHistory_set_lm_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "lm_flags"), .get = py_netr_PasswordHistory_get_lm_flags, .set = py_netr_PasswordHistory_set_lm_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "nt_history"), .get = py_netr_PasswordHistory_get_nt_history, .set = py_netr_PasswordHistory_set_nt_history, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "lm_history"), .get = py_netr_PasswordHistory_get_lm_history, .set = py_netr_PasswordHistory_set_lm_history, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_PasswordHistory_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_PasswordHistory, type); } static PyTypeObject netr_PasswordHistory_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_PasswordHistory", .tp_getset = py_netr_PasswordHistory_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_PasswordHistory_new, }; static PyObject *py_netr_USER_KEYS2_get_lmpassword(PyObject *obj, void *closure) { struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(obj); PyObject *py_lmpassword; py_lmpassword = pytalloc_reference_ex(&netr_USER_KEY16_Type, pytalloc_get_mem_ctx(obj), &object->lmpassword); return py_lmpassword; } static int py_netr_USER_KEYS2_set_lmpassword(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmpassword"); return -1; } PY_CHECK_TYPE(&netr_USER_KEY16_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lmpassword = *(struct netr_USER_KEY16 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_USER_KEYS2_get_ntpassword(PyObject *obj, void *closure) { struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(obj); PyObject *py_ntpassword; py_ntpassword = pytalloc_reference_ex(&netr_USER_KEY16_Type, pytalloc_get_mem_ctx(obj), &object->ntpassword); return py_ntpassword; } static int py_netr_USER_KEYS2_set_ntpassword(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntpassword"); return -1; } PY_CHECK_TYPE(&netr_USER_KEY16_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->ntpassword = *(struct netr_USER_KEY16 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_USER_KEYS2_get_history(PyObject *obj, void *closure) { struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(obj); PyObject *py_history; py_history = pytalloc_reference_ex(&netr_PasswordHistory_Type, pytalloc_get_mem_ctx(obj), &object->history); return py_history; } static int py_netr_USER_KEYS2_set_history(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->history"); return -1; } PY_CHECK_TYPE(&netr_PasswordHistory_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->history = *(struct netr_PasswordHistory *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_USER_KEYS2_getsetters[] = { { .name = discard_const_p(char, "lmpassword"), .get = py_netr_USER_KEYS2_get_lmpassword, .set = py_netr_USER_KEYS2_set_lmpassword, .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEY16") }, { .name = discard_const_p(char, "ntpassword"), .get = py_netr_USER_KEYS2_get_ntpassword, .set = py_netr_USER_KEYS2_set_ntpassword, .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEY16") }, { .name = discard_const_p(char, "history"), .get = py_netr_USER_KEYS2_get_history, .set = py_netr_USER_KEYS2_set_history, .doc = discard_const_p(char, "PIDL-generated element of base type netr_PasswordHistory") }, { .name = NULL } }; static PyObject *py_netr_USER_KEYS2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_USER_KEYS2, type); } static PyTypeObject netr_USER_KEYS2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_USER_KEYS2", .tp_getset = py_netr_USER_KEYS2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_USER_KEYS2_new, }; static PyObject *py_netr_USER_KEY_UNION_get_keys2(PyObject *obj, void *closure) { struct netr_USER_KEY_UNION *object = (struct netr_USER_KEY_UNION *)pytalloc_get_ptr(obj); PyObject *py_keys2; py_keys2 = pytalloc_reference_ex(&netr_USER_KEYS2_Type, pytalloc_get_mem_ctx(obj), &object->keys2); return py_keys2; } static int py_netr_USER_KEY_UNION_set_keys2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEY_UNION *object = (struct netr_USER_KEY_UNION *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys2"); return -1; } PY_CHECK_TYPE(&netr_USER_KEYS2_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->keys2 = *(struct netr_USER_KEYS2 *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_USER_KEY_UNION_getsetters[] = { { .name = discard_const_p(char, "keys2"), .get = py_netr_USER_KEY_UNION_get_keys2, .set = py_netr_USER_KEY_UNION_set_keys2, .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEYS2") }, { .name = NULL } }; static PyObject *py_netr_USER_KEY_UNION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_USER_KEY_UNION, type); } static PyTypeObject netr_USER_KEY_UNION_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_USER_KEY_UNION", .tp_getset = py_netr_USER_KEY_UNION_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_USER_KEY_UNION_new, }; static PyObject *py_netr_USER_KEYS_get_version(PyObject *obj, void *closure) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(obj); PyObject *py_version; py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version); return py_version; } static int py_netr_USER_KEYS_set_version(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version)); 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->version = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_USER_KEYS_get_keys(PyObject *obj, void *closure) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(obj); PyObject *py_keys; py_keys = pytalloc_reference_ex(&netr_USER_KEY_UNION_Type, pytalloc_get_mem_ctx(obj), &object->keys); return py_keys; } static int py_netr_USER_KEYS_set_keys(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys"); return -1; } PY_CHECK_TYPE(&netr_USER_KEY_UNION_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->keys = *(struct netr_USER_KEY_UNION *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_USER_KEYS_getsetters[] = { { .name = discard_const_p(char, "version"), .get = py_netr_USER_KEYS_get_version, .set = py_netr_USER_KEYS_set_version, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "keys"), .get = py_netr_USER_KEYS_get_keys, .set = py_netr_USER_KEYS_set_keys, .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEY_UNION") }, { .name = NULL } }; static PyObject *py_netr_USER_KEYS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_USER_KEYS, type); } static PyObject *py_netr_USER_KEYS_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)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_netr_USER_KEYS); 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_netr_USER_KEYS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)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_netr_USER_KEYS); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_USER_KEYS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)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_netr_USER_KEYS, "netr_USER_KEYS", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_USER_KEYS_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_USER_KEYS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_USER_KEYS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_USER_KEYS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_USER_KEYS_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_USER_KEYS", .tp_getset = py_netr_USER_KEYS_getsetters, .tp_methods = py_netr_USER_KEYS_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_USER_KEYS_new, }; static PyObject *py_netr_USER_PRIVATE_INFO_get_SensitiveDataFlag(PyObject *obj, void *closure) { struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(obj); PyObject *py_SensitiveDataFlag; py_SensitiveDataFlag = PyLong_FromLong((uint16_t)object->SensitiveDataFlag); return py_SensitiveDataFlag; } static int py_netr_USER_PRIVATE_INFO_set_SensitiveDataFlag(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SensitiveDataFlag"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SensitiveDataFlag)); 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->SensitiveDataFlag = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_USER_PRIVATE_INFO_get_DataLength(PyObject *obj, void *closure) { struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(obj); PyObject *py_DataLength; py_DataLength = PyLong_FromUnsignedLongLong((uint32_t)object->DataLength); return py_DataLength; } static int py_netr_USER_PRIVATE_INFO_set_DataLength(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->DataLength"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->DataLength)); 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->DataLength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_USER_PRIVATE_INFO_get_SensitiveData(PyObject *obj, void *closure) { struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(obj); PyObject *py_SensitiveData; if (object->SensitiveData == NULL) { Py_RETURN_NONE; } if (object->SensitiveData == NULL) { py_SensitiveData = Py_None; Py_INCREF(py_SensitiveData); } else { py_SensitiveData = PyList_New(object->DataLength); if (py_SensitiveData == NULL) { return NULL; } { int SensitiveData_cntr_1; for (SensitiveData_cntr_1 = 0; SensitiveData_cntr_1 < (object->DataLength); SensitiveData_cntr_1++) { PyObject *py_SensitiveData_1; py_SensitiveData_1 = PyLong_FromLong((uint16_t)object->SensitiveData[SensitiveData_cntr_1]); PyList_SetItem(py_SensitiveData, SensitiveData_cntr_1, py_SensitiveData_1); } } } return py_SensitiveData; } static int py_netr_USER_PRIVATE_INFO_set_SensitiveData(PyObject *py_obj, PyObject *value, void *closure) { struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->SensitiveData)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SensitiveData"); return -1; } if (value == Py_None) { object->SensitiveData = NULL; } else { object->SensitiveData = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int SensitiveData_cntr_1; object->SensitiveData = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->SensitiveData, PyList_GET_SIZE(value)); if (!object->SensitiveData) { return -1;; } talloc_set_name_const(object->SensitiveData, "ARRAY: object->SensitiveData"); for (SensitiveData_cntr_1 = 0; SensitiveData_cntr_1 < PyList_GET_SIZE(value); SensitiveData_cntr_1++) { if (PyList_GET_ITEM(value, SensitiveData_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SensitiveData[SensitiveData_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SensitiveData[SensitiveData_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, SensitiveData_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, SensitiveData_cntr_1)); 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->SensitiveData[SensitiveData_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_USER_PRIVATE_INFO_getsetters[] = { { .name = discard_const_p(char, "SensitiveDataFlag"), .get = py_netr_USER_PRIVATE_INFO_get_SensitiveDataFlag, .set = py_netr_USER_PRIVATE_INFO_set_SensitiveDataFlag, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "DataLength"), .get = py_netr_USER_PRIVATE_INFO_get_DataLength, .set = py_netr_USER_PRIVATE_INFO_set_DataLength, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "SensitiveData"), .get = py_netr_USER_PRIVATE_INFO_get_SensitiveData, .set = py_netr_USER_PRIVATE_INFO_set_SensitiveData, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_USER_PRIVATE_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_USER_PRIVATE_INFO, type); } static PyTypeObject netr_USER_PRIVATE_INFO_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_USER_PRIVATE_INFO", .tp_getset = py_netr_USER_PRIVATE_INFO_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_USER_PRIVATE_INFO_new, }; static PyObject *py_netr_DELTA_USER_get_account_name(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_netr_DELTA_USER_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_full_name(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_netr_DELTA_USER_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_rid(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_netr_DELTA_USER_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)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_netr_DELTA_USER_get_primary_gid(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_netr_DELTA_USER_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)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_netr_DELTA_USER_get_home_directory(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_home_directory; py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory); return py_home_directory; } static int py_netr_DELTA_USER_set_home_directory(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_home_drive(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_home_drive; py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive); return py_home_drive; } static int py_netr_DELTA_USER_set_home_drive(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_logon_script(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_logon_script; py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script); return py_logon_script; } static int py_netr_DELTA_USER_set_logon_script(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_description(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_netr_DELTA_USER_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_workstations(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_workstations; py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations); return py_workstations; } static int py_netr_DELTA_USER_set_workstations(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_last_logon(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_last_logon; py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon); return py_last_logon; } static int py_netr_DELTA_USER_set_last_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon)); 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->last_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_last_logoff(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_last_logoff; py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff); return py_last_logoff; } static int py_netr_DELTA_USER_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff)); 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->last_logoff = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_logon_hours(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_logon_hours; py_logon_hours = pytalloc_reference_ex(samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours); return py_logon_hours; } static int py_netr_DELTA_USER_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours"); return -1; } PY_CHECK_TYPE(samr_LogonHours_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_bad_password_count(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_bad_password_count; py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count); return py_bad_password_count; } static int py_netr_DELTA_USER_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count)); 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->bad_password_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_logon_count(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromLong((uint16_t)object->logon_count); return py_logon_count; } static int py_netr_DELTA_USER_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_last_password_change(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_last_password_change; py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change); return py_last_password_change; } static int py_netr_DELTA_USER_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change)); 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->last_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_acct_expiry(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_acct_expiry; py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry); return py_acct_expiry; } static int py_netr_DELTA_USER_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry)); 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->acct_expiry = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_acct_flags(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_netr_DELTA_USER_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_lmpassword(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_lmpassword; py_lmpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lmpassword); return py_lmpassword; } static int py_netr_DELTA_USER_set_lmpassword(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmpassword"); return -1; } PY_CHECK_TYPE(samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lmpassword = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_ntpassword(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_ntpassword; py_ntpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->ntpassword); return py_ntpassword; } static int py_netr_DELTA_USER_set_ntpassword(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntpassword"); return -1; } PY_CHECK_TYPE(samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->ntpassword = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_nt_password_present(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_nt_password_present; py_nt_password_present = PyLong_FromLong((uint16_t)object->nt_password_present); return py_nt_password_present; } static int py_netr_DELTA_USER_set_nt_password_present(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_password_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_password_present)); 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->nt_password_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_lm_password_present(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_lm_password_present; py_lm_password_present = PyLong_FromLong((uint16_t)object->lm_password_present); return py_lm_password_present; } static int py_netr_DELTA_USER_set_lm_password_present(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_password_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_password_present)); 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->lm_password_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_password_expired(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_password_expired; py_password_expired = PyLong_FromLong((uint16_t)object->password_expired); return py_password_expired; } static int py_netr_DELTA_USER_set_password_expired(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired)); 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->password_expired = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_comment(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_comment; py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment); return py_comment; } static int py_netr_DELTA_USER_set_comment(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->comment = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_parameters(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_parameters; py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters); return py_parameters; } static int py_netr_DELTA_USER_set_parameters(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameters"); return -1; } PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_country_code(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_country_code; py_country_code = PyLong_FromLong((uint16_t)object->country_code); return py_country_code; } static int py_netr_DELTA_USER_set_country_code(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->country_code"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->country_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->country_code = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_code_page(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_code_page; py_code_page = PyLong_FromLong((uint16_t)object->code_page); return py_code_page; } static int py_netr_DELTA_USER_set_code_page(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->code_page"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->code_page)); 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->code_page = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_user_private_info(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_user_private_info; py_user_private_info = pytalloc_reference_ex(&netr_USER_PRIVATE_INFO_Type, pytalloc_get_mem_ctx(obj), &object->user_private_info); return py_user_private_info; } static int py_netr_DELTA_USER_set_user_private_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_private_info"); return -1; } PY_CHECK_TYPE(&netr_USER_PRIVATE_INFO_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_private_info = *(struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_USER_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_USER_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_profile_path(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_profile_path; py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path); return py_profile_path; } static int py_netr_DELTA_USER_set_profile_path(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_USER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_USER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_USER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_USER_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_USER_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_USER_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_USER_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_USER_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_USER_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_USER_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_netr_DELTA_USER_get_account_name, .set = py_netr_DELTA_USER_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_netr_DELTA_USER_get_full_name, .set = py_netr_DELTA_USER_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "rid"), .get = py_netr_DELTA_USER_get_rid, .set = py_netr_DELTA_USER_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "primary_gid"), .get = py_netr_DELTA_USER_get_primary_gid, .set = py_netr_DELTA_USER_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "home_directory"), .get = py_netr_DELTA_USER_get_home_directory, .set = py_netr_DELTA_USER_set_home_directory, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_drive"), .get = py_netr_DELTA_USER_get_home_drive, .set = py_netr_DELTA_USER_set_home_drive, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_script"), .get = py_netr_DELTA_USER_get_logon_script, .set = py_netr_DELTA_USER_set_logon_script, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "description"), .get = py_netr_DELTA_USER_get_description, .set = py_netr_DELTA_USER_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "workstations"), .get = py_netr_DELTA_USER_get_workstations, .set = py_netr_DELTA_USER_set_workstations, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "last_logon"), .get = py_netr_DELTA_USER_get_last_logon, .set = py_netr_DELTA_USER_set_last_logon, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_logoff"), .get = py_netr_DELTA_USER_get_last_logoff, .set = py_netr_DELTA_USER_set_last_logoff, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "logon_hours"), .get = py_netr_DELTA_USER_get_logon_hours, .set = py_netr_DELTA_USER_set_logon_hours, .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours") }, { .name = discard_const_p(char, "bad_password_count"), .get = py_netr_DELTA_USER_get_bad_password_count, .set = py_netr_DELTA_USER_set_bad_password_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "logon_count"), .get = py_netr_DELTA_USER_get_logon_count, .set = py_netr_DELTA_USER_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "last_password_change"), .get = py_netr_DELTA_USER_get_last_password_change, .set = py_netr_DELTA_USER_set_last_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "acct_expiry"), .get = py_netr_DELTA_USER_get_acct_expiry, .set = py_netr_DELTA_USER_set_acct_expiry, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "acct_flags"), .get = py_netr_DELTA_USER_get_acct_flags, .set = py_netr_DELTA_USER_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "lmpassword"), .get = py_netr_DELTA_USER_get_lmpassword, .set = py_netr_DELTA_USER_set_lmpassword, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "ntpassword"), .get = py_netr_DELTA_USER_get_ntpassword, .set = py_netr_DELTA_USER_set_ntpassword, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "nt_password_present"), .get = py_netr_DELTA_USER_get_nt_password_present, .set = py_netr_DELTA_USER_set_nt_password_present, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "lm_password_present"), .get = py_netr_DELTA_USER_get_lm_password_present, .set = py_netr_DELTA_USER_set_lm_password_present, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "password_expired"), .get = py_netr_DELTA_USER_get_password_expired, .set = py_netr_DELTA_USER_set_password_expired, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "comment"), .get = py_netr_DELTA_USER_get_comment, .set = py_netr_DELTA_USER_set_comment, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "parameters"), .get = py_netr_DELTA_USER_get_parameters, .set = py_netr_DELTA_USER_set_parameters, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString") }, { .name = discard_const_p(char, "country_code"), .get = py_netr_DELTA_USER_get_country_code, .set = py_netr_DELTA_USER_set_country_code, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "code_page"), .get = py_netr_DELTA_USER_get_code_page, .set = py_netr_DELTA_USER_set_code_page, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "user_private_info"), .get = py_netr_DELTA_USER_get_user_private_info, .set = py_netr_DELTA_USER_set_user_private_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_PRIVATE_INFO") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_USER_get_SecurityInformation, .set = py_netr_DELTA_USER_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_USER_get_sdbuf, .set = py_netr_DELTA_USER_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "profile_path"), .get = py_netr_DELTA_USER_get_profile_path, .set = py_netr_DELTA_USER_set_profile_path, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_USER_get_unknown2, .set = py_netr_DELTA_USER_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_USER_get_unknown3, .set = py_netr_DELTA_USER_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_USER_get_unknown4, .set = py_netr_DELTA_USER_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_USER_get_unknown5, .set = py_netr_DELTA_USER_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_USER_get_unknown6, .set = py_netr_DELTA_USER_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_USER_get_unknown7, .set = py_netr_DELTA_USER_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_USER_get_unknown8, .set = py_netr_DELTA_USER_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_USER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_USER, type); } static PyTypeObject netr_DELTA_USER_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_USER", .tp_getset = py_netr_DELTA_USER_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_USER_new, }; static PyObject *py_netr_DELTA_DOMAIN_get_domain_name(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_domain_name; py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name); return py_domain_name; } static int py_netr_DELTA_DOMAIN_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_oem_information(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_oem_information; py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information); return py_oem_information; } static int py_netr_DELTA_DOMAIN_set_oem_information(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->oem_information"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_force_logoff_time(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_force_logoff_time; py_force_logoff_time = PyLong_FromLongLong(object->force_logoff_time); return py_force_logoff_time; } static int py_netr_DELTA_DOMAIN_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_logoff_time"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->force_logoff_time)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->force_logoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_min_password_length(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_min_password_length; py_min_password_length = PyLong_FromLong((uint16_t)object->min_password_length); return py_min_password_length; } static int py_netr_DELTA_DOMAIN_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_password_length)); 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->min_password_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_password_history_length(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_password_history_length; py_password_history_length = PyLong_FromLong((uint16_t)object->password_history_length); return py_password_history_length; } static int py_netr_DELTA_DOMAIN_set_password_history_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_history_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_history_length)); 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->password_history_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_max_password_age(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_max_password_age; py_max_password_age = PyLong_FromLongLong(object->max_password_age); return py_max_password_age; } static int py_netr_DELTA_DOMAIN_set_max_password_age(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_password_age"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->max_password_age)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->max_password_age = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_min_password_age(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_min_password_age; py_min_password_age = PyLong_FromLongLong(object->min_password_age); return py_min_password_age; } static int py_netr_DELTA_DOMAIN_set_min_password_age(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_age"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->min_password_age)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } object->min_password_age = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_sequence_num(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num); return py_sequence_num; } static int py_netr_DELTA_DOMAIN_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num)); 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->sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_domain_create_time(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_domain_create_time; py_domain_create_time = PyLong_FromUnsignedLongLong(object->domain_create_time); return py_domain_create_time; } static int py_netr_DELTA_DOMAIN_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_create_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_create_time)); 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_create_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_DOMAIN_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_DOMAIN_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_account_lockout(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_account_lockout; py_account_lockout = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->account_lockout); return py_account_lockout; } static int py_netr_DELTA_DOMAIN_set_account_lockout(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_lockout"); return -1; } PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_lockout = *(struct lsa_BinaryString *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_DOMAIN_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_DOMAIN_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_DOMAIN_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_logon_to_chgpass(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_logon_to_chgpass; py_logon_to_chgpass = PyLong_FromUnsignedLongLong((uint32_t)object->logon_to_chgpass); return py_logon_to_chgpass; } static int py_netr_DELTA_DOMAIN_set_logon_to_chgpass(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_to_chgpass"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_to_chgpass)); 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->logon_to_chgpass = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_DOMAIN_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_DOMAIN_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_DOMAIN_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_DOMAIN_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_DOMAIN_getsetters[] = { { .name = discard_const_p(char, "domain_name"), .get = py_netr_DELTA_DOMAIN_get_domain_name, .set = py_netr_DELTA_DOMAIN_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "oem_information"), .get = py_netr_DELTA_DOMAIN_get_oem_information, .set = py_netr_DELTA_DOMAIN_set_oem_information, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "force_logoff_time"), .get = py_netr_DELTA_DOMAIN_get_force_logoff_time, .set = py_netr_DELTA_DOMAIN_set_force_logoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type dlong") }, { .name = discard_const_p(char, "min_password_length"), .get = py_netr_DELTA_DOMAIN_get_min_password_length, .set = py_netr_DELTA_DOMAIN_set_min_password_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "password_history_length"), .get = py_netr_DELTA_DOMAIN_get_password_history_length, .set = py_netr_DELTA_DOMAIN_set_password_history_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "max_password_age"), .get = py_netr_DELTA_DOMAIN_get_max_password_age, .set = py_netr_DELTA_DOMAIN_set_max_password_age, .doc = discard_const_p(char, "PIDL-generated element of base type dlong") }, { .name = discard_const_p(char, "min_password_age"), .get = py_netr_DELTA_DOMAIN_get_min_password_age, .set = py_netr_DELTA_DOMAIN_set_min_password_age, .doc = discard_const_p(char, "PIDL-generated element of base type dlong") }, { .name = discard_const_p(char, "sequence_num"), .get = py_netr_DELTA_DOMAIN_get_sequence_num, .set = py_netr_DELTA_DOMAIN_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "domain_create_time"), .get = py_netr_DELTA_DOMAIN_get_domain_create_time, .set = py_netr_DELTA_DOMAIN_set_domain_create_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_DOMAIN_get_SecurityInformation, .set = py_netr_DELTA_DOMAIN_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_DOMAIN_get_sdbuf, .set = py_netr_DELTA_DOMAIN_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "account_lockout"), .get = py_netr_DELTA_DOMAIN_get_account_lockout, .set = py_netr_DELTA_DOMAIN_set_account_lockout, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_DOMAIN_get_unknown2, .set = py_netr_DELTA_DOMAIN_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_DOMAIN_get_unknown3, .set = py_netr_DELTA_DOMAIN_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_DOMAIN_get_unknown4, .set = py_netr_DELTA_DOMAIN_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_to_chgpass"), .get = py_netr_DELTA_DOMAIN_get_logon_to_chgpass, .set = py_netr_DELTA_DOMAIN_set_logon_to_chgpass, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_DOMAIN_get_unknown6, .set = py_netr_DELTA_DOMAIN_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_DOMAIN_get_unknown7, .set = py_netr_DELTA_DOMAIN_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_DOMAIN_get_unknown8, .set = py_netr_DELTA_DOMAIN_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_DOMAIN_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_DOMAIN, type); } static PyTypeObject netr_DELTA_DOMAIN_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_DOMAIN", .tp_getset = py_netr_DELTA_DOMAIN_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_DOMAIN_new, }; static PyObject *py_netr_DELTA_GROUP_get_group_name(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_group_name; py_group_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->group_name); return py_group_name; } static int py_netr_DELTA_GROUP_set_group_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_name"); return -1; } PY_CHECK_TYPE(lsa_String_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_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_rid(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_netr_DELTA_GROUP_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)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_netr_DELTA_GROUP_get_attributes(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_attributes; py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes); return py_attributes; } static int py_netr_DELTA_GROUP_set_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes)); 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->attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_get_description(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_netr_DELTA_GROUP_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_GROUP_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_GROUP_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_GROUP_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_GROUP_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_GROUP_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_GROUP_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_GROUP_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_GROUP_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_GROUP_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_GROUP_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_GROUP_getsetters[] = { { .name = discard_const_p(char, "group_name"), .get = py_netr_DELTA_GROUP_get_group_name, .set = py_netr_DELTA_GROUP_set_group_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "rid"), .get = py_netr_DELTA_GROUP_get_rid, .set = py_netr_DELTA_GROUP_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "attributes"), .get = py_netr_DELTA_GROUP_get_attributes, .set = py_netr_DELTA_GROUP_set_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "description"), .get = py_netr_DELTA_GROUP_get_description, .set = py_netr_DELTA_GROUP_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_GROUP_get_SecurityInformation, .set = py_netr_DELTA_GROUP_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_GROUP_get_sdbuf, .set = py_netr_DELTA_GROUP_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_GROUP_get_unknown1, .set = py_netr_DELTA_GROUP_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_GROUP_get_unknown2, .set = py_netr_DELTA_GROUP_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_GROUP_get_unknown3, .set = py_netr_DELTA_GROUP_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_GROUP_get_unknown4, .set = py_netr_DELTA_GROUP_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_GROUP_get_unknown5, .set = py_netr_DELTA_GROUP_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_GROUP_get_unknown6, .set = py_netr_DELTA_GROUP_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_GROUP_get_unknown7, .set = py_netr_DELTA_GROUP_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_GROUP_get_unknown8, .set = py_netr_DELTA_GROUP_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_GROUP_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_GROUP, type); } static PyTypeObject netr_DELTA_GROUP_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_GROUP", .tp_getset = py_netr_DELTA_GROUP_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_GROUP_new, }; static PyObject *py_netr_DELTA_RENAME_get_OldName(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_OldName; py_OldName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->OldName); return py_OldName; } static int py_netr_DELTA_RENAME_set_OldName(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OldName"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->OldName = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_RENAME_get_NewName(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_NewName; py_NewName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->NewName); return py_NewName; } static int py_netr_DELTA_RENAME_set_NewName(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->NewName"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->NewName = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_RENAME_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_RENAME_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_RENAME_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_RENAME_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_RENAME_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_RENAME_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_RENAME_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_RENAME_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_RENAME_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_RENAME_getsetters[] = { { .name = discard_const_p(char, "OldName"), .get = py_netr_DELTA_RENAME_get_OldName, .set = py_netr_DELTA_RENAME_set_OldName, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "NewName"), .get = py_netr_DELTA_RENAME_get_NewName, .set = py_netr_DELTA_RENAME_set_NewName, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_RENAME_get_unknown1, .set = py_netr_DELTA_RENAME_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_RENAME_get_unknown2, .set = py_netr_DELTA_RENAME_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_RENAME_get_unknown3, .set = py_netr_DELTA_RENAME_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_RENAME_get_unknown4, .set = py_netr_DELTA_RENAME_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_RENAME_get_unknown5, .set = py_netr_DELTA_RENAME_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_RENAME_get_unknown6, .set = py_netr_DELTA_RENAME_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_RENAME_get_unknown7, .set = py_netr_DELTA_RENAME_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_RENAME_get_unknown8, .set = py_netr_DELTA_RENAME_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_RENAME_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_RENAME, type); } static PyTypeObject netr_DELTA_RENAME_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_RENAME", .tp_getset = py_netr_DELTA_RENAME_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_RENAME_new, }; static PyObject *py_netr_DELTA_GROUP_MEMBER_get_rids(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->rids == NULL) { Py_RETURN_NONE; } if (object->rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = PyList_New(object->num_rids); if (py_rids == NULL) { return NULL; } { int rids_cntr_1; for (rids_cntr_1 = 0; rids_cntr_1 < (object->num_rids); rids_cntr_1++) { PyObject *py_rids_1; py_rids_1 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_1]); PyList_SetItem(py_rids, rids_cntr_1, py_rids_1); } } } return py_rids; } static int py_netr_DELTA_GROUP_MEMBER_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids"); return -1; } if (value == Py_None) { object->rids = NULL; } else { object->rids = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int rids_cntr_1; 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_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) { if (PyList_GET_ITEM(value, rids_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_1)); 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_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_DELTA_GROUP_MEMBER_get_attribs(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_attribs; if (object->attribs == NULL) { Py_RETURN_NONE; } if (object->attribs == NULL) { py_attribs = Py_None; Py_INCREF(py_attribs); } else { py_attribs = PyList_New(object->num_rids); if (py_attribs == NULL) { return NULL; } { int attribs_cntr_1; for (attribs_cntr_1 = 0; attribs_cntr_1 < (object->num_rids); attribs_cntr_1++) { PyObject *py_attribs_1; py_attribs_1 = PyLong_FromUnsignedLongLong((uint32_t)object->attribs[attribs_cntr_1]); PyList_SetItem(py_attribs, attribs_cntr_1, py_attribs_1); } } } return py_attribs; } static int py_netr_DELTA_GROUP_MEMBER_set_attribs(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->attribs)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attribs"); return -1; } if (value == Py_None) { object->attribs = NULL; } else { object->attribs = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int attribs_cntr_1; object->attribs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->attribs, PyList_GET_SIZE(value)); if (!object->attribs) { return -1;; } talloc_set_name_const(object->attribs, "ARRAY: object->attribs"); for (attribs_cntr_1 = 0; attribs_cntr_1 < PyList_GET_SIZE(value); attribs_cntr_1++) { if (PyList_GET_ITEM(value, attribs_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attribs[attribs_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attribs[attribs_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, attribs_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, attribs_cntr_1)); 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->attribs[attribs_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_DELTA_GROUP_MEMBER_get_num_rids(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)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_netr_DELTA_GROUP_MEMBER_set_num_rids(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)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_netr_DELTA_GROUP_MEMBER_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1); return py_unknown1; } static int py_netr_DELTA_GROUP_MEMBER_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1)); 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->unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2); return py_unknown2; } static int py_netr_DELTA_GROUP_MEMBER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2)); 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->unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3); return py_unknown3; } static int py_netr_DELTA_GROUP_MEMBER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3)); 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->unknown3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4); return py_unknown4; } static int py_netr_DELTA_GROUP_MEMBER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4)); 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->unknown4 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_GROUP_MEMBER_getsetters[] = { { .name = discard_const_p(char, "rids"), .get = py_netr_DELTA_GROUP_MEMBER_get_rids, .set = py_netr_DELTA_GROUP_MEMBER_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "attribs"), .get = py_netr_DELTA_GROUP_MEMBER_get_attribs, .set = py_netr_DELTA_GROUP_MEMBER_set_attribs, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "num_rids"), .get = py_netr_DELTA_GROUP_MEMBER_get_num_rids, .set = py_netr_DELTA_GROUP_MEMBER_set_num_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_GROUP_MEMBER_get_unknown1, .set = py_netr_DELTA_GROUP_MEMBER_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_GROUP_MEMBER_get_unknown2, .set = py_netr_DELTA_GROUP_MEMBER_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_GROUP_MEMBER_get_unknown3, .set = py_netr_DELTA_GROUP_MEMBER_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_GROUP_MEMBER_get_unknown4, .set = py_netr_DELTA_GROUP_MEMBER_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_GROUP_MEMBER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_GROUP_MEMBER, type); } static PyTypeObject netr_DELTA_GROUP_MEMBER_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_GROUP_MEMBER", .tp_getset = py_netr_DELTA_GROUP_MEMBER_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_GROUP_MEMBER_new, }; static PyObject *py_netr_DELTA_ALIAS_get_alias_name(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_alias_name; py_alias_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->alias_name); return py_alias_name; } static int py_netr_DELTA_ALIAS_set_alias_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->alias_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->alias_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_get_rid(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_netr_DELTA_ALIAS_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)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_netr_DELTA_ALIAS_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_ALIAS_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_ALIAS_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_get_description(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_netr_DELTA_ALIAS_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_ALIAS_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_ALIAS_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_ALIAS_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_ALIAS_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_ALIAS_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_ALIAS_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_ALIAS_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_ALIAS_getsetters[] = { { .name = discard_const_p(char, "alias_name"), .get = py_netr_DELTA_ALIAS_get_alias_name, .set = py_netr_DELTA_ALIAS_set_alias_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "rid"), .get = py_netr_DELTA_ALIAS_get_rid, .set = py_netr_DELTA_ALIAS_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_ALIAS_get_SecurityInformation, .set = py_netr_DELTA_ALIAS_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_ALIAS_get_sdbuf, .set = py_netr_DELTA_ALIAS_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "description"), .get = py_netr_DELTA_ALIAS_get_description, .set = py_netr_DELTA_ALIAS_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_ALIAS_get_unknown2, .set = py_netr_DELTA_ALIAS_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_ALIAS_get_unknown3, .set = py_netr_DELTA_ALIAS_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_ALIAS_get_unknown4, .set = py_netr_DELTA_ALIAS_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_ALIAS_get_unknown5, .set = py_netr_DELTA_ALIAS_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_ALIAS_get_unknown6, .set = py_netr_DELTA_ALIAS_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_ALIAS_get_unknown7, .set = py_netr_DELTA_ALIAS_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_ALIAS_get_unknown8, .set = py_netr_DELTA_ALIAS_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_ALIAS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_ALIAS, type); } static PyTypeObject netr_DELTA_ALIAS_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_ALIAS", .tp_getset = py_netr_DELTA_ALIAS_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_ALIAS_new, }; static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_sids(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_sids; py_sids = pytalloc_reference_ex(lsa_SidArray_Type, pytalloc_get_mem_ctx(obj), &object->sids); return py_sids; } static int py_netr_DELTA_ALIAS_MEMBER_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids"); 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->sids = *(struct lsa_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1); return py_unknown1; } static int py_netr_DELTA_ALIAS_MEMBER_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1)); 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->unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2); return py_unknown2; } static int py_netr_DELTA_ALIAS_MEMBER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2)); 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->unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3); return py_unknown3; } static int py_netr_DELTA_ALIAS_MEMBER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3)); 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->unknown3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4); return py_unknown4; } static int py_netr_DELTA_ALIAS_MEMBER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4)); 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->unknown4 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_ALIAS_MEMBER_getsetters[] = { { .name = discard_const_p(char, "sids"), .get = py_netr_DELTA_ALIAS_MEMBER_get_sids, .set = py_netr_DELTA_ALIAS_MEMBER_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown1, .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown2, .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown3, .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown4, .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_ALIAS_MEMBER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_ALIAS_MEMBER, type); } static PyTypeObject netr_DELTA_ALIAS_MEMBER_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_ALIAS_MEMBER", .tp_getset = py_netr_DELTA_ALIAS_MEMBER_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_ALIAS_MEMBER_new, }; static PyObject *py_netr_QUOTA_LIMITS_get_pagedpoollimit(PyObject *obj, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj); PyObject *py_pagedpoollimit; py_pagedpoollimit = PyLong_FromUnsignedLongLong((uint32_t)object->pagedpoollimit); return py_pagedpoollimit; } static int py_netr_QUOTA_LIMITS_set_pagedpoollimit(PyObject *py_obj, PyObject *value, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pagedpoollimit"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagedpoollimit)); 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->pagedpoollimit = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_QUOTA_LIMITS_get_nonpagedpoollimit(PyObject *obj, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj); PyObject *py_nonpagedpoollimit; py_nonpagedpoollimit = PyLong_FromUnsignedLongLong((uint32_t)object->nonpagedpoollimit); return py_nonpagedpoollimit; } static int py_netr_QUOTA_LIMITS_set_nonpagedpoollimit(PyObject *py_obj, PyObject *value, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nonpagedpoollimit"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nonpagedpoollimit)); 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->nonpagedpoollimit = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_QUOTA_LIMITS_get_minimumworkingsetsize(PyObject *obj, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj); PyObject *py_minimumworkingsetsize; py_minimumworkingsetsize = PyLong_FromUnsignedLongLong((uint32_t)object->minimumworkingsetsize); return py_minimumworkingsetsize; } static int py_netr_QUOTA_LIMITS_set_minimumworkingsetsize(PyObject *py_obj, PyObject *value, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->minimumworkingsetsize"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minimumworkingsetsize)); 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->minimumworkingsetsize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_QUOTA_LIMITS_get_maximumworkingsetsize(PyObject *obj, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj); PyObject *py_maximumworkingsetsize; py_maximumworkingsetsize = PyLong_FromUnsignedLongLong((uint32_t)object->maximumworkingsetsize); return py_maximumworkingsetsize; } static int py_netr_QUOTA_LIMITS_set_maximumworkingsetsize(PyObject *py_obj, PyObject *value, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maximumworkingsetsize"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maximumworkingsetsize)); 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->maximumworkingsetsize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_QUOTA_LIMITS_get_pagefilelimit(PyObject *obj, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj); PyObject *py_pagefilelimit; py_pagefilelimit = PyLong_FromUnsignedLongLong((uint32_t)object->pagefilelimit); return py_pagefilelimit; } static int py_netr_QUOTA_LIMITS_set_pagefilelimit(PyObject *py_obj, PyObject *value, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pagefilelimit"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagefilelimit)); 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->pagefilelimit = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_QUOTA_LIMITS_get_timelimit(PyObject *obj, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj); PyObject *py_timelimit; py_timelimit = PyLong_FromUnsignedLongLong(object->timelimit); return py_timelimit; } static int py_netr_QUOTA_LIMITS_set_timelimit(PyObject *py_obj, PyObject *value, void *closure) { struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timelimit"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timelimit)); 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->timelimit = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_QUOTA_LIMITS_getsetters[] = { { .name = discard_const_p(char, "pagedpoollimit"), .get = py_netr_QUOTA_LIMITS_get_pagedpoollimit, .set = py_netr_QUOTA_LIMITS_set_pagedpoollimit, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "nonpagedpoollimit"), .get = py_netr_QUOTA_LIMITS_get_nonpagedpoollimit, .set = py_netr_QUOTA_LIMITS_set_nonpagedpoollimit, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "minimumworkingsetsize"), .get = py_netr_QUOTA_LIMITS_get_minimumworkingsetsize, .set = py_netr_QUOTA_LIMITS_set_minimumworkingsetsize, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "maximumworkingsetsize"), .get = py_netr_QUOTA_LIMITS_get_maximumworkingsetsize, .set = py_netr_QUOTA_LIMITS_set_maximumworkingsetsize, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "pagefilelimit"), .get = py_netr_QUOTA_LIMITS_get_pagefilelimit, .set = py_netr_QUOTA_LIMITS_set_pagefilelimit, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "timelimit"), .get = py_netr_QUOTA_LIMITS_get_timelimit, .set = py_netr_QUOTA_LIMITS_set_timelimit, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = NULL } }; static PyObject *py_netr_QUOTA_LIMITS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_QUOTA_LIMITS, type); } static PyTypeObject netr_QUOTA_LIMITS_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_QUOTA_LIMITS", .tp_getset = py_netr_QUOTA_LIMITS_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_QUOTA_LIMITS_new, }; static PyObject *py_netr_DELTA_POLICY_get_maxlogsize(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_maxlogsize; py_maxlogsize = PyLong_FromUnsignedLongLong((uint32_t)object->maxlogsize); return py_maxlogsize; } static int py_netr_DELTA_POLICY_set_maxlogsize(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maxlogsize"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxlogsize)); 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->maxlogsize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_auditretentionperiod(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_auditretentionperiod; py_auditretentionperiod = PyLong_FromUnsignedLongLong(object->auditretentionperiod); return py_auditretentionperiod; } static int py_netr_DELTA_POLICY_set_auditretentionperiod(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auditretentionperiod"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditretentionperiod)); 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->auditretentionperiod = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_auditingmode(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_auditingmode; py_auditingmode = PyLong_FromLong((uint16_t)object->auditingmode); return py_auditingmode; } static int py_netr_DELTA_POLICY_set_auditingmode(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auditingmode"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditingmode)); 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->auditingmode = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_maxauditeventcount(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_maxauditeventcount; py_maxauditeventcount = PyLong_FromUnsignedLongLong((uint32_t)object->maxauditeventcount); return py_maxauditeventcount; } static int py_netr_DELTA_POLICY_set_maxauditeventcount(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maxauditeventcount"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxauditeventcount)); 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->maxauditeventcount = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_eventauditoptions(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_eventauditoptions; if (object->eventauditoptions == NULL) { Py_RETURN_NONE; } if (object->eventauditoptions == NULL) { py_eventauditoptions = Py_None; Py_INCREF(py_eventauditoptions); } else { py_eventauditoptions = PyList_New(object->maxauditeventcount + 1); if (py_eventauditoptions == NULL) { return NULL; } { int eventauditoptions_cntr_1; for (eventauditoptions_cntr_1 = 0; eventauditoptions_cntr_1 < (object->maxauditeventcount + 1); eventauditoptions_cntr_1++) { PyObject *py_eventauditoptions_1; py_eventauditoptions_1 = PyLong_FromUnsignedLongLong((uint32_t)object->eventauditoptions[eventauditoptions_cntr_1]); PyList_SetItem(py_eventauditoptions, eventauditoptions_cntr_1, py_eventauditoptions_1); } } } return py_eventauditoptions; } static int py_netr_DELTA_POLICY_set_eventauditoptions(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->eventauditoptions)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eventauditoptions"); return -1; } if (value == Py_None) { object->eventauditoptions = NULL; } else { object->eventauditoptions = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int eventauditoptions_cntr_1; object->eventauditoptions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->eventauditoptions, PyList_GET_SIZE(value)); if (!object->eventauditoptions) { return -1;; } talloc_set_name_const(object->eventauditoptions, "ARRAY: object->eventauditoptions"); for (eventauditoptions_cntr_1 = 0; eventauditoptions_cntr_1 < PyList_GET_SIZE(value); eventauditoptions_cntr_1++) { if (PyList_GET_ITEM(value, eventauditoptions_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eventauditoptions[eventauditoptions_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->eventauditoptions[eventauditoptions_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, eventauditoptions_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, eventauditoptions_cntr_1)); 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->eventauditoptions[eventauditoptions_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_primary_domain_name(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_primary_domain_name; py_primary_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary_domain_name); return py_primary_domain_name; } static int py_netr_DELTA_POLICY_set_primary_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_domain_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->primary_domain_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_sid(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->sid == NULL) { Py_RETURN_NONE; } if (object->sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid); } return py_sid; } static int py_netr_DELTA_POLICY_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid"); return -1; } if (value == Py_None) { object->sid = NULL; } else { object->sid = NULL; 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_netr_DELTA_POLICY_get_quota_limits(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_quota_limits; py_quota_limits = pytalloc_reference_ex(&netr_QUOTA_LIMITS_Type, pytalloc_get_mem_ctx(obj), &object->quota_limits); return py_quota_limits; } static int py_netr_DELTA_POLICY_set_quota_limits(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->quota_limits"); return -1; } PY_CHECK_TYPE(&netr_QUOTA_LIMITS_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->quota_limits = *(struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_sequence_num(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num); return py_sequence_num; } static int py_netr_DELTA_POLICY_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num)); 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->sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_db_create_time(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_db_create_time; py_db_create_time = PyLong_FromUnsignedLongLong(object->db_create_time); return py_db_create_time; } static int py_netr_DELTA_POLICY_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_create_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_create_time)); 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->db_create_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_POLICY_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_POLICY_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_POLICY_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_POLICY_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_POLICY_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_POLICY_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_POLICY_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_POLICY_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_POLICY_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_POLICY_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_POLICY_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_POLICY_getsetters[] = { { .name = discard_const_p(char, "maxlogsize"), .get = py_netr_DELTA_POLICY_get_maxlogsize, .set = py_netr_DELTA_POLICY_set_maxlogsize, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "auditretentionperiod"), .get = py_netr_DELTA_POLICY_get_auditretentionperiod, .set = py_netr_DELTA_POLICY_set_auditretentionperiod, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "auditingmode"), .get = py_netr_DELTA_POLICY_get_auditingmode, .set = py_netr_DELTA_POLICY_set_auditingmode, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "maxauditeventcount"), .get = py_netr_DELTA_POLICY_get_maxauditeventcount, .set = py_netr_DELTA_POLICY_set_maxauditeventcount, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "eventauditoptions"), .get = py_netr_DELTA_POLICY_get_eventauditoptions, .set = py_netr_DELTA_POLICY_set_eventauditoptions, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "primary_domain_name"), .get = py_netr_DELTA_POLICY_get_primary_domain_name, .set = py_netr_DELTA_POLICY_set_primary_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "sid"), .get = py_netr_DELTA_POLICY_get_sid, .set = py_netr_DELTA_POLICY_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "quota_limits"), .get = py_netr_DELTA_POLICY_get_quota_limits, .set = py_netr_DELTA_POLICY_set_quota_limits, .doc = discard_const_p(char, "PIDL-generated element of base type netr_QUOTA_LIMITS") }, { .name = discard_const_p(char, "sequence_num"), .get = py_netr_DELTA_POLICY_get_sequence_num, .set = py_netr_DELTA_POLICY_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "db_create_time"), .get = py_netr_DELTA_POLICY_get_db_create_time, .set = py_netr_DELTA_POLICY_set_db_create_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_POLICY_get_SecurityInformation, .set = py_netr_DELTA_POLICY_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_POLICY_get_sdbuf, .set = py_netr_DELTA_POLICY_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_POLICY_get_unknown1, .set = py_netr_DELTA_POLICY_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_POLICY_get_unknown2, .set = py_netr_DELTA_POLICY_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_POLICY_get_unknown3, .set = py_netr_DELTA_POLICY_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_POLICY_get_unknown4, .set = py_netr_DELTA_POLICY_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_POLICY_get_unknown5, .set = py_netr_DELTA_POLICY_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_POLICY_get_unknown6, .set = py_netr_DELTA_POLICY_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_POLICY_get_unknown7, .set = py_netr_DELTA_POLICY_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_POLICY_get_unknown8, .set = py_netr_DELTA_POLICY_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_POLICY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_POLICY, type); } static PyTypeObject netr_DELTA_POLICY_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_POLICY", .tp_getset = py_netr_DELTA_POLICY_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_POLICY_new, }; static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_domain_name(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_domain_name; py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name); return py_domain_name; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_num_controllers(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_num_controllers; py_num_controllers = PyLong_FromUnsignedLongLong((uint32_t)object->num_controllers); return py_num_controllers; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_num_controllers(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_controllers"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_controllers)); 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_controllers = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_controller_names(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_controller_names; if (object->controller_names == NULL) { Py_RETURN_NONE; } if (object->controller_names == NULL) { py_controller_names = Py_None; Py_INCREF(py_controller_names); } else { py_controller_names = PyList_New(object->num_controllers); if (py_controller_names == NULL) { return NULL; } { int controller_names_cntr_1; for (controller_names_cntr_1 = 0; controller_names_cntr_1 < (object->num_controllers); controller_names_cntr_1++) { PyObject *py_controller_names_1; py_controller_names_1 = pytalloc_reference_ex(lsa_String_Type, object->controller_names, &object->controller_names[controller_names_cntr_1]); PyList_SetItem(py_controller_names, controller_names_cntr_1, py_controller_names_1); } } } return py_controller_names; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_controller_names(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->controller_names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controller_names"); return -1; } if (value == Py_None) { object->controller_names = NULL; } else { object->controller_names = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int controller_names_cntr_1; object->controller_names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->controller_names, PyList_GET_SIZE(value)); if (!object->controller_names) { return -1;; } talloc_set_name_const(object->controller_names, "ARRAY: object->controller_names"); for (controller_names_cntr_1 = 0; controller_names_cntr_1 < PyList_GET_SIZE(value); controller_names_cntr_1++) { if (PyList_GET_ITEM(value, controller_names_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controller_names[controller_names_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, controller_names_cntr_1), return -1;); if (talloc_reference(object->controller_names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, controller_names_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->controller_names[controller_names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, controller_names_cntr_1)); } } } return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_posix_offset(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_posix_offset; py_posix_offset = PyLong_FromUnsignedLongLong((uint32_t)object->posix_offset); return py_posix_offset; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->posix_offset)); 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->posix_offset = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_TRUSTED_DOMAIN_getsetters[] = { { .name = discard_const_p(char, "domain_name"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_domain_name, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "num_controllers"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_num_controllers, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_num_controllers, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "controller_names"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_controller_names, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_controller_names, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_SecurityInformation, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_sdbuf, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown1, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown2, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown3, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown4, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "posix_offset"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_posix_offset, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_posix_offset, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown6, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown7, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown8, .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_TRUSTED_DOMAIN, type); } static PyTypeObject netr_DELTA_TRUSTED_DOMAIN_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_TRUSTED_DOMAIN", .tp_getset = py_netr_DELTA_TRUSTED_DOMAIN_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_TRUSTED_DOMAIN_new, }; static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_entries(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_privilege_entries; py_privilege_entries = PyLong_FromUnsignedLongLong((uint32_t)object->privilege_entries); return py_privilege_entries; } static int py_netr_DELTA_ACCOUNT_set_privilege_entries(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_entries"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_entries)); 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->privilege_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_control(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_privilege_control; py_privilege_control = PyLong_FromUnsignedLongLong((uint32_t)object->privilege_control); return py_privilege_control; } static int py_netr_DELTA_ACCOUNT_set_privilege_control(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_control"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_control)); 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->privilege_control = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_attrib(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_privilege_attrib; if (object->privilege_attrib == NULL) { Py_RETURN_NONE; } if (object->privilege_attrib == NULL) { py_privilege_attrib = Py_None; Py_INCREF(py_privilege_attrib); } else { py_privilege_attrib = PyList_New(object->privilege_entries); if (py_privilege_attrib == NULL) { return NULL; } { int privilege_attrib_cntr_1; for (privilege_attrib_cntr_1 = 0; privilege_attrib_cntr_1 < (object->privilege_entries); privilege_attrib_cntr_1++) { PyObject *py_privilege_attrib_1; py_privilege_attrib_1 = PyLong_FromUnsignedLongLong((uint32_t)object->privilege_attrib[privilege_attrib_cntr_1]); PyList_SetItem(py_privilege_attrib, privilege_attrib_cntr_1, py_privilege_attrib_1); } } } return py_privilege_attrib; } static int py_netr_DELTA_ACCOUNT_set_privilege_attrib(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privilege_attrib)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_attrib"); return -1; } if (value == Py_None) { object->privilege_attrib = NULL; } else { object->privilege_attrib = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int privilege_attrib_cntr_1; object->privilege_attrib = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privilege_attrib, PyList_GET_SIZE(value)); if (!object->privilege_attrib) { return -1;; } talloc_set_name_const(object->privilege_attrib, "ARRAY: object->privilege_attrib"); for (privilege_attrib_cntr_1 = 0; privilege_attrib_cntr_1 < PyList_GET_SIZE(value); privilege_attrib_cntr_1++) { if (PyList_GET_ITEM(value, privilege_attrib_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_attrib[privilege_attrib_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_attrib[privilege_attrib_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, privilege_attrib_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, privilege_attrib_cntr_1)); 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->privilege_attrib[privilege_attrib_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_name(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_privilege_name; if (object->privilege_name == NULL) { Py_RETURN_NONE; } if (object->privilege_name == NULL) { py_privilege_name = Py_None; Py_INCREF(py_privilege_name); } else { py_privilege_name = PyList_New(object->privilege_entries); if (py_privilege_name == NULL) { return NULL; } { int privilege_name_cntr_1; for (privilege_name_cntr_1 = 0; privilege_name_cntr_1 < (object->privilege_entries); privilege_name_cntr_1++) { PyObject *py_privilege_name_1; py_privilege_name_1 = pytalloc_reference_ex(lsa_String_Type, object->privilege_name, &object->privilege_name[privilege_name_cntr_1]); PyList_SetItem(py_privilege_name, privilege_name_cntr_1, py_privilege_name_1); } } } return py_privilege_name; } static int py_netr_DELTA_ACCOUNT_set_privilege_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privilege_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_name"); return -1; } if (value == Py_None) { object->privilege_name = NULL; } else { object->privilege_name = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int privilege_name_cntr_1; object->privilege_name = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privilege_name, PyList_GET_SIZE(value)); if (!object->privilege_name) { return -1;; } talloc_set_name_const(object->privilege_name, "ARRAY: object->privilege_name"); for (privilege_name_cntr_1 = 0; privilege_name_cntr_1 < PyList_GET_SIZE(value); privilege_name_cntr_1++) { if (PyList_GET_ITEM(value, privilege_name_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_name[privilege_name_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, privilege_name_cntr_1), return -1;); if (talloc_reference(object->privilege_name, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, privilege_name_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->privilege_name[privilege_name_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, privilege_name_cntr_1)); } } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_quotalimits(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_quotalimits; py_quotalimits = pytalloc_reference_ex(&netr_QUOTA_LIMITS_Type, pytalloc_get_mem_ctx(obj), &object->quotalimits); return py_quotalimits; } static int py_netr_DELTA_ACCOUNT_set_quotalimits(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->quotalimits"); return -1; } PY_CHECK_TYPE(&netr_QUOTA_LIMITS_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->quotalimits = *(struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_system_flags(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_system_flags; py_system_flags = PyLong_FromUnsignedLongLong((uint32_t)object->system_flags); return py_system_flags; } static int py_netr_DELTA_ACCOUNT_set_system_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->system_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->system_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->system_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_ACCOUNT_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_ACCOUNT_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_ACCOUNT_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_ACCOUNT_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_ACCOUNT_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_ACCOUNT_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_ACCOUNT_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_ACCOUNT_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_ACCOUNT_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ACCOUNT_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_ACCOUNT_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_ACCOUNT_getsetters[] = { { .name = discard_const_p(char, "privilege_entries"), .get = py_netr_DELTA_ACCOUNT_get_privilege_entries, .set = py_netr_DELTA_ACCOUNT_set_privilege_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "privilege_control"), .get = py_netr_DELTA_ACCOUNT_get_privilege_control, .set = py_netr_DELTA_ACCOUNT_set_privilege_control, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "privilege_attrib"), .get = py_netr_DELTA_ACCOUNT_get_privilege_attrib, .set = py_netr_DELTA_ACCOUNT_set_privilege_attrib, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "privilege_name"), .get = py_netr_DELTA_ACCOUNT_get_privilege_name, .set = py_netr_DELTA_ACCOUNT_set_privilege_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "quotalimits"), .get = py_netr_DELTA_ACCOUNT_get_quotalimits, .set = py_netr_DELTA_ACCOUNT_set_quotalimits, .doc = discard_const_p(char, "PIDL-generated element of base type netr_QUOTA_LIMITS") }, { .name = discard_const_p(char, "system_flags"), .get = py_netr_DELTA_ACCOUNT_get_system_flags, .set = py_netr_DELTA_ACCOUNT_set_system_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_ACCOUNT_get_SecurityInformation, .set = py_netr_DELTA_ACCOUNT_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_ACCOUNT_get_sdbuf, .set = py_netr_DELTA_ACCOUNT_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_ACCOUNT_get_unknown1, .set = py_netr_DELTA_ACCOUNT_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_ACCOUNT_get_unknown2, .set = py_netr_DELTA_ACCOUNT_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_ACCOUNT_get_unknown3, .set = py_netr_DELTA_ACCOUNT_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_ACCOUNT_get_unknown4, .set = py_netr_DELTA_ACCOUNT_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_ACCOUNT_get_unknown5, .set = py_netr_DELTA_ACCOUNT_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_ACCOUNT_get_unknown6, .set = py_netr_DELTA_ACCOUNT_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_ACCOUNT_get_unknown7, .set = py_netr_DELTA_ACCOUNT_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_ACCOUNT_get_unknown8, .set = py_netr_DELTA_ACCOUNT_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_ACCOUNT_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_ACCOUNT, type); } static PyTypeObject netr_DELTA_ACCOUNT_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_ACCOUNT", .tp_getset = py_netr_DELTA_ACCOUNT_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_ACCOUNT_new, }; static PyObject *py_netr_CIPHER_VALUE_get_len(PyObject *obj, void *closure) { struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(obj); PyObject *py_len; py_len = PyLong_FromUnsignedLongLong((uint32_t)object->len); return py_len; } static int py_netr_CIPHER_VALUE_set_len(PyObject *py_obj, PyObject *value, void *closure) { struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->len"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len)); 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->len = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_CIPHER_VALUE_get_maxlen(PyObject *obj, void *closure) { struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(obj); PyObject *py_maxlen; py_maxlen = PyLong_FromUnsignedLongLong((uint32_t)object->maxlen); return py_maxlen; } static int py_netr_CIPHER_VALUE_set_maxlen(PyObject *py_obj, PyObject *value, void *closure) { struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maxlen"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxlen)); 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->maxlen = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_CIPHER_VALUE_get_cipher_data(PyObject *obj, void *closure) { struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(obj); PyObject *py_cipher_data; if (object->cipher_data == NULL) { Py_RETURN_NONE; } if (object->cipher_data == NULL) { py_cipher_data = Py_None; Py_INCREF(py_cipher_data); } else { py_cipher_data = PyList_New(object->len); if (py_cipher_data == NULL) { return NULL; } { int cipher_data_cntr_1; for (cipher_data_cntr_1 = 0; cipher_data_cntr_1 < (object->len); cipher_data_cntr_1++) { PyObject *py_cipher_data_1; py_cipher_data_1 = PyLong_FromLong((uint16_t)object->cipher_data[cipher_data_cntr_1]); PyList_SetItem(py_cipher_data, cipher_data_cntr_1, py_cipher_data_1); } } } return py_cipher_data; } static int py_netr_CIPHER_VALUE_set_cipher_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->cipher_data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher_data"); return -1; } if (value == Py_None) { object->cipher_data = NULL; } else { object->cipher_data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int cipher_data_cntr_1; object->cipher_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->cipher_data, PyList_GET_SIZE(value)); if (!object->cipher_data) { return -1;; } talloc_set_name_const(object->cipher_data, "ARRAY: object->cipher_data"); for (cipher_data_cntr_1 = 0; cipher_data_cntr_1 < PyList_GET_SIZE(value); cipher_data_cntr_1++) { if (PyList_GET_ITEM(value, cipher_data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher_data[cipher_data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cipher_data[cipher_data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, cipher_data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, cipher_data_cntr_1)); 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->cipher_data[cipher_data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_CIPHER_VALUE_getsetters[] = { { .name = discard_const_p(char, "len"), .get = py_netr_CIPHER_VALUE_get_len, .set = py_netr_CIPHER_VALUE_set_len, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "maxlen"), .get = py_netr_CIPHER_VALUE_get_maxlen, .set = py_netr_CIPHER_VALUE_set_maxlen, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "cipher_data"), .get = py_netr_CIPHER_VALUE_get_cipher_data, .set = py_netr_CIPHER_VALUE_set_cipher_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_CIPHER_VALUE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_CIPHER_VALUE, type); } static PyTypeObject netr_CIPHER_VALUE_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_CIPHER_VALUE", .tp_getset = py_netr_CIPHER_VALUE_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_CIPHER_VALUE_new, }; static PyObject *py_netr_DELTA_SECRET_get_current_cipher(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_current_cipher; py_current_cipher = pytalloc_reference_ex(&netr_CIPHER_VALUE_Type, pytalloc_get_mem_ctx(obj), &object->current_cipher); return py_current_cipher; } static int py_netr_DELTA_SECRET_set_current_cipher(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_cipher"); return -1; } PY_CHECK_TYPE(&netr_CIPHER_VALUE_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->current_cipher = *(struct netr_CIPHER_VALUE *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_current_cipher_set_time(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_current_cipher_set_time; py_current_cipher_set_time = PyLong_FromUnsignedLongLong(object->current_cipher_set_time); return py_current_cipher_set_time; } static int py_netr_DELTA_SECRET_set_current_cipher_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_cipher_set_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_cipher_set_time)); 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->current_cipher_set_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_SECRET_get_old_cipher(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_old_cipher; py_old_cipher = pytalloc_reference_ex(&netr_CIPHER_VALUE_Type, pytalloc_get_mem_ctx(obj), &object->old_cipher); return py_old_cipher; } static int py_netr_DELTA_SECRET_set_old_cipher(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_cipher"); return -1; } PY_CHECK_TYPE(&netr_CIPHER_VALUE_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->old_cipher = *(struct netr_CIPHER_VALUE *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_old_cipher_set_time(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_old_cipher_set_time; py_old_cipher_set_time = PyLong_FromUnsignedLongLong(object->old_cipher_set_time); return py_old_cipher_set_time; } static int py_netr_DELTA_SECRET_set_old_cipher_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_cipher_set_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->old_cipher_set_time)); 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->old_cipher_set_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_SECRET_get_SecurityInformation(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_SecurityInformation; py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation); return py_SecurityInformation; } static int py_netr_DELTA_SECRET_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation)); 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->SecurityInformation = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_SECRET_get_sdbuf(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf); return py_sdbuf; } static int py_netr_DELTA_SECRET_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf"); return -1; } PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown1(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1); return py_unknown1; } static int py_netr_DELTA_SECRET_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown2(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2); return py_unknown2; } static int py_netr_DELTA_SECRET_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown3(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3); return py_unknown3; } static int py_netr_DELTA_SECRET_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown4(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4); return py_unknown4; } static int py_netr_DELTA_SECRET_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown5(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_DELTA_SECRET_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown6(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown6; py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6); return py_unknown6; } static int py_netr_DELTA_SECRET_set_unknown6(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6)); 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->unknown6 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown7(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown7; py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7); return py_unknown7; } static int py_netr_DELTA_SECRET_set_unknown7(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7)); 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->unknown7 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_SECRET_get_unknown8(PyObject *obj, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj); PyObject *py_unknown8; py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8); return py_unknown8; } static int py_netr_DELTA_SECRET_set_unknown8(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8)); 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->unknown8 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DELTA_SECRET_getsetters[] = { { .name = discard_const_p(char, "current_cipher"), .get = py_netr_DELTA_SECRET_get_current_cipher, .set = py_netr_DELTA_SECRET_set_current_cipher, .doc = discard_const_p(char, "PIDL-generated element of base type netr_CIPHER_VALUE") }, { .name = discard_const_p(char, "current_cipher_set_time"), .get = py_netr_DELTA_SECRET_get_current_cipher_set_time, .set = py_netr_DELTA_SECRET_set_current_cipher_set_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "old_cipher"), .get = py_netr_DELTA_SECRET_get_old_cipher, .set = py_netr_DELTA_SECRET_set_old_cipher, .doc = discard_const_p(char, "PIDL-generated element of base type netr_CIPHER_VALUE") }, { .name = discard_const_p(char, "old_cipher_set_time"), .get = py_netr_DELTA_SECRET_get_old_cipher_set_time, .set = py_netr_DELTA_SECRET_set_old_cipher_set_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "SecurityInformation"), .get = py_netr_DELTA_SECRET_get_SecurityInformation, .set = py_netr_DELTA_SECRET_set_SecurityInformation, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sdbuf"), .get = py_netr_DELTA_SECRET_get_sdbuf, .set = py_netr_DELTA_SECRET_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_DELTA_SECRET_get_unknown1, .set = py_netr_DELTA_SECRET_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_DELTA_SECRET_get_unknown2, .set = py_netr_DELTA_SECRET_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_DELTA_SECRET_get_unknown3, .set = py_netr_DELTA_SECRET_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_DELTA_SECRET_get_unknown4, .set = py_netr_DELTA_SECRET_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_DELTA_SECRET_get_unknown5, .set = py_netr_DELTA_SECRET_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown6"), .get = py_netr_DELTA_SECRET_get_unknown6, .set = py_netr_DELTA_SECRET_set_unknown6, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown7"), .get = py_netr_DELTA_SECRET_get_unknown7, .set = py_netr_DELTA_SECRET_set_unknown7, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown8"), .get = py_netr_DELTA_SECRET_get_unknown8, .set = py_netr_DELTA_SECRET_set_unknown8, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DELTA_SECRET_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_SECRET, type); } static PyTypeObject netr_DELTA_SECRET_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_SECRET", .tp_getset = py_netr_DELTA_SECRET_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_SECRET_new, }; static PyObject *py_import_netr_DELTA_UNION(TALLOC_CTX *mem_ctx, int level, union netr_DELTA_UNION *in) { PyObject *ret; switch (level) { case NETR_DELTA_DOMAIN: if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_DOMAIN_Type, in->domain, in->domain); } return ret; case NETR_DELTA_GROUP: if (in->group == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_GROUP_Type, in->group, in->group); } return ret; case NETR_DELTA_DELETE_GROUP: ret = Py_None; Py_INCREF(ret); return ret; case NETR_DELTA_RENAME_GROUP: if (in->rename_group == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_RENAME_Type, in->rename_group, in->rename_group); } return ret; case NETR_DELTA_USER: if (in->user == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_USER_Type, in->user, in->user); } return ret; case NETR_DELTA_DELETE_USER: ret = Py_None; Py_INCREF(ret); return ret; case NETR_DELTA_RENAME_USER: if (in->rename_user == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_RENAME_Type, in->rename_user, in->rename_user); } return ret; case NETR_DELTA_GROUP_MEMBER: if (in->group_member == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_GROUP_MEMBER_Type, in->group_member, in->group_member); } return ret; case NETR_DELTA_ALIAS: if (in->alias == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_ALIAS_Type, in->alias, in->alias); } return ret; case NETR_DELTA_DELETE_ALIAS: ret = Py_None; Py_INCREF(ret); return ret; case NETR_DELTA_RENAME_ALIAS: if (in->rename_alias == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_RENAME_Type, in->rename_alias, in->rename_alias); } return ret; case NETR_DELTA_ALIAS_MEMBER: if (in->alias_member == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_ALIAS_MEMBER_Type, in->alias_member, in->alias_member); } return ret; case NETR_DELTA_POLICY: if (in->policy == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_POLICY_Type, in->policy, in->policy); } return ret; case NETR_DELTA_TRUSTED_DOMAIN: if (in->trusted_domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_TRUSTED_DOMAIN_Type, in->trusted_domain, in->trusted_domain); } return ret; case NETR_DELTA_DELETE_TRUST: ret = Py_None; Py_INCREF(ret); return ret; case NETR_DELTA_ACCOUNT: if (in->account == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_ACCOUNT_Type, in->account, in->account); } return ret; case NETR_DELTA_DELETE_ACCOUNT: ret = Py_None; Py_INCREF(ret); return ret; case NETR_DELTA_SECRET: if (in->secret == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_SECRET_Type, in->secret, in->secret); } return ret; case NETR_DELTA_DELETE_SECRET: ret = Py_None; Py_INCREF(ret); return ret; case NETR_DELTA_DELETE_GROUP2: if (in->delete_group == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_DELETE_USER_Type, in->delete_group, in->delete_group); } return ret; case NETR_DELTA_DELETE_USER2: if (in->delete_user == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DELTA_DELETE_USER_Type, in->delete_user, in->delete_user); } return ret; case NETR_DELTA_MODIFY_COUNT: if (in->modified_count == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyLong_FromUnsignedLongLong(*in->modified_count); } return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_DELTA_UNION *py_export_netr_DELTA_UNION(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_DELTA_UNION *ret = talloc_zero(mem_ctx, union netr_DELTA_UNION); switch (level) { case NETR_DELTA_DOMAIN: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain = NULL; } else { ret->domain = NULL; PY_CHECK_TYPE(&netr_DELTA_DOMAIN_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(in); } break; case NETR_DELTA_GROUP: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->group"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->group = NULL; } else { ret->group = NULL; PY_CHECK_TYPE(&netr_DELTA_GROUP_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->group = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_GROUP: break; case NETR_DELTA_RENAME_GROUP: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rename_group"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->rename_group = NULL; } else { ret->rename_group = NULL; PY_CHECK_TYPE(&netr_DELTA_RENAME_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->rename_group = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(in); } break; case NETR_DELTA_USER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->user"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->user = NULL; } else { ret->user = NULL; PY_CHECK_TYPE(&netr_DELTA_USER_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->user = (struct netr_DELTA_USER *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_USER: break; case NETR_DELTA_RENAME_USER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rename_user"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->rename_user = NULL; } else { ret->rename_user = NULL; PY_CHECK_TYPE(&netr_DELTA_RENAME_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->rename_user = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(in); } break; case NETR_DELTA_GROUP_MEMBER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->group_member"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->group_member = NULL; } else { ret->group_member = NULL; PY_CHECK_TYPE(&netr_DELTA_GROUP_MEMBER_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->group_member = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(in); } break; case NETR_DELTA_ALIAS: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->alias"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->alias = NULL; } else { ret->alias = NULL; PY_CHECK_TYPE(&netr_DELTA_ALIAS_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->alias = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_ALIAS: break; case NETR_DELTA_RENAME_ALIAS: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rename_alias"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->rename_alias = NULL; } else { ret->rename_alias = NULL; PY_CHECK_TYPE(&netr_DELTA_RENAME_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->rename_alias = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(in); } break; case NETR_DELTA_ALIAS_MEMBER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->alias_member"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->alias_member = NULL; } else { ret->alias_member = NULL; PY_CHECK_TYPE(&netr_DELTA_ALIAS_MEMBER_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->alias_member = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(in); } break; case NETR_DELTA_POLICY: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->policy"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->policy = NULL; } else { ret->policy = NULL; PY_CHECK_TYPE(&netr_DELTA_POLICY_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->policy = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(in); } break; case NETR_DELTA_TRUSTED_DOMAIN: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->trusted_domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->trusted_domain = NULL; } else { ret->trusted_domain = NULL; PY_CHECK_TYPE(&netr_DELTA_TRUSTED_DOMAIN_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->trusted_domain = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_TRUST: break; case NETR_DELTA_ACCOUNT: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->account"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->account = NULL; } else { ret->account = NULL; PY_CHECK_TYPE(&netr_DELTA_ACCOUNT_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->account = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_ACCOUNT: break; case NETR_DELTA_SECRET: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->secret"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->secret = NULL; } else { ret->secret = NULL; PY_CHECK_TYPE(&netr_DELTA_SECRET_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->secret = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_SECRET: break; case NETR_DELTA_DELETE_GROUP2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->delete_group"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->delete_group = NULL; } else { ret->delete_group = NULL; PY_CHECK_TYPE(&netr_DELTA_DELETE_USER_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->delete_group = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_USER2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->delete_user"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->delete_user = NULL; } else { ret->delete_user = NULL; PY_CHECK_TYPE(&netr_DELTA_DELETE_USER_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->delete_user = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(in); } break; case NETR_DELTA_MODIFY_COUNT: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->modified_count"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->modified_count = NULL; } else { ret->modified_count = talloc_ptrtype(mem_ctx, ret->modified_count); if (ret->modified_count == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*ret->modified_count)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } *ret->modified_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } } break; default: break; } return ret; } static PyObject *py_netr_DELTA_UNION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_DELTA_UNION *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_DELTA_UNION *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_DELTA_UNION!"); return NULL; } return py_import_netr_DELTA_UNION(mem_ctx, level, in); } static PyObject *py_netr_DELTA_UNION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_DELTA_UNION *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_DELTA_UNION(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_DELTA_UNION_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_UNION_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_UNION_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_DELTA_UNION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_DELTA_UNION_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_UNION", .tp_getset = NULL, .tp_methods = py_netr_DELTA_UNION_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_UNION_new, }; static PyObject *py_import_netr_DELTA_ID_UNION(TALLOC_CTX *mem_ctx, int level, union netr_DELTA_ID_UNION *in) { PyObject *ret; switch (level) { case NETR_DELTA_DOMAIN: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_GROUP: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_DELETE_GROUP: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_RENAME_GROUP: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_USER: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_DELETE_USER: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_RENAME_USER: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_GROUP_MEMBER: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_ALIAS: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_DELETE_ALIAS: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_RENAME_ALIAS: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_ALIAS_MEMBER: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_POLICY: if (in->sid == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid); } return ret; case NETR_DELTA_TRUSTED_DOMAIN: if (in->sid == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid); } return ret; case NETR_DELTA_DELETE_TRUST: if (in->sid == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid); } return ret; case NETR_DELTA_ACCOUNT: if (in->sid == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid); } return ret; case NETR_DELTA_DELETE_ACCOUNT: if (in->sid == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid); } return ret; case NETR_DELTA_SECRET: if (in->name == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->name == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->name, strlen(in->name), "utf-8", "ignore"); } } return ret; case NETR_DELTA_DELETE_SECRET: if (in->name == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->name == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->name, strlen(in->name), "utf-8", "ignore"); } } return ret; case NETR_DELTA_DELETE_GROUP2: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_DELETE_USER2: ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid); return ret; case NETR_DELTA_MODIFY_COUNT: ret = Py_None; Py_INCREF(ret); return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_DELTA_ID_UNION *py_export_netr_DELTA_ID_UNION(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_DELTA_ID_UNION *ret = talloc_zero(mem_ctx, union netr_DELTA_ID_UNION); switch (level) { case NETR_DELTA_DOMAIN: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_GROUP: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_DELETE_GROUP: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_RENAME_GROUP: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_USER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_DELETE_USER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_RENAME_USER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_GROUP_MEMBER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_ALIAS: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_DELETE_ALIAS: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_RENAME_ALIAS: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_ALIAS_MEMBER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_POLICY: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sid = NULL; } else { ret->sid = NULL; PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sid = (struct dom_sid *)pytalloc_get_ptr(in); } break; case NETR_DELTA_TRUSTED_DOMAIN: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sid = NULL; } else { ret->sid = NULL; PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sid = (struct dom_sid *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_TRUST: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sid = NULL; } else { ret->sid = NULL; PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sid = (struct dom_sid *)pytalloc_get_ptr(in); } break; case NETR_DELTA_ACCOUNT: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sid = NULL; } else { ret->sid = NULL; PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sid = (struct dom_sid *)pytalloc_get_ptr(in); } break; case NETR_DELTA_DELETE_ACCOUNT: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->sid = NULL; } else { ret->sid = NULL; PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->sid = (struct dom_sid *)pytalloc_get_ptr(in); } break; case NETR_DELTA_SECRET: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->name = NULL; } else { ret->name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->name = talloc_str; } } break; case NETR_DELTA_DELETE_SECRET: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->name = NULL; } else { ret->name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->name = talloc_str; } } break; case NETR_DELTA_DELETE_GROUP2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_DELETE_USER2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; case NETR_DELTA_MODIFY_COUNT: break; default: break; } return ret; } static PyObject *py_netr_DELTA_ID_UNION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_DELTA_ID_UNION *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_DELTA_ID_UNION *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_DELTA_ID_UNION!"); return NULL; } return py_import_netr_DELTA_ID_UNION(mem_ctx, level, in); } static PyObject *py_netr_DELTA_ID_UNION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_DELTA_ID_UNION *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_DELTA_ID_UNION(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_DELTA_ID_UNION_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_ID_UNION_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_ID_UNION_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_DELTA_ID_UNION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_DELTA_ID_UNION_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_ID_UNION", .tp_getset = NULL, .tp_methods = py_netr_DELTA_ID_UNION_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_ID_UNION_new, }; static PyObject *py_netr_DELTA_ENUM_get_delta_type(PyObject *obj, void *closure) { struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(obj); PyObject *py_delta_type; py_delta_type = PyLong_FromLong((uint16_t)object->delta_type); return py_delta_type; } static int py_netr_DELTA_ENUM_set_delta_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delta_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->delta_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ENUM_get_delta_id_union(PyObject *obj, void *closure) { struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(obj); PyObject *py_delta_id_union; py_delta_id_union = pyrpc_import_union(&netr_DELTA_ID_UNION_Type, pytalloc_get_mem_ctx(obj), object->delta_type, &object->delta_id_union, "union netr_DELTA_ID_UNION"); if (py_delta_id_union == NULL) { return NULL; } return py_delta_id_union; } static int py_netr_DELTA_ENUM_set_delta_id_union(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_id_union"); return -1; } { union netr_DELTA_ID_UNION *delta_id_union_switch_0; delta_id_union_switch_0 = (union netr_DELTA_ID_UNION *)pyrpc_export_union(&netr_DELTA_ID_UNION_Type, pytalloc_get_mem_ctx(py_obj), object->delta_type, value, "union netr_DELTA_ID_UNION"); if (delta_id_union_switch_0 == NULL) { return -1; } object->delta_id_union = *delta_id_union_switch_0; } return 0; } static PyObject *py_netr_DELTA_ENUM_get_delta_union(PyObject *obj, void *closure) { struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(obj); PyObject *py_delta_union; py_delta_union = pyrpc_import_union(&netr_DELTA_UNION_Type, pytalloc_get_mem_ctx(obj), object->delta_type, &object->delta_union, "union netr_DELTA_UNION"); if (py_delta_union == NULL) { return NULL; } return py_delta_union; } static int py_netr_DELTA_ENUM_set_delta_union(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_union"); return -1; } { union netr_DELTA_UNION *delta_union_switch_0; delta_union_switch_0 = (union netr_DELTA_UNION *)pyrpc_export_union(&netr_DELTA_UNION_Type, pytalloc_get_mem_ctx(py_obj), object->delta_type, value, "union netr_DELTA_UNION"); if (delta_union_switch_0 == NULL) { return -1; } object->delta_union = *delta_union_switch_0; } return 0; } static PyGetSetDef py_netr_DELTA_ENUM_getsetters[] = { { .name = discard_const_p(char, "delta_type"), .get = py_netr_DELTA_ENUM_get_delta_type, .set = py_netr_DELTA_ENUM_set_delta_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DeltaEnum") }, { .name = discard_const_p(char, "delta_id_union"), .get = py_netr_DELTA_ENUM_get_delta_id_union, .set = py_netr_DELTA_ENUM_set_delta_id_union, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ID_UNION") }, { .name = discard_const_p(char, "delta_union"), .get = py_netr_DELTA_ENUM_get_delta_union, .set = py_netr_DELTA_ENUM_set_delta_union, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_UNION") }, { .name = NULL } }; static PyObject *py_netr_DELTA_ENUM_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_ENUM, type); } static PyTypeObject netr_DELTA_ENUM_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_ENUM", .tp_getset = py_netr_DELTA_ENUM_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_ENUM_new, }; static PyObject *py_netr_DELTA_ENUM_ARRAY_get_num_deltas(PyObject *obj, void *closure) { struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(obj); PyObject *py_num_deltas; py_num_deltas = PyLong_FromUnsignedLongLong((uint32_t)object->num_deltas); return py_num_deltas; } static int py_netr_DELTA_ENUM_ARRAY_set_num_deltas(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_deltas"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_deltas)); 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_deltas = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DELTA_ENUM_ARRAY_get_delta_enum(PyObject *obj, void *closure) { struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(obj); PyObject *py_delta_enum; if (object->delta_enum == NULL) { Py_RETURN_NONE; } if (object->delta_enum == NULL) { py_delta_enum = Py_None; Py_INCREF(py_delta_enum); } else { py_delta_enum = PyList_New(object->num_deltas); if (py_delta_enum == NULL) { return NULL; } { int delta_enum_cntr_1; for (delta_enum_cntr_1 = 0; delta_enum_cntr_1 < (object->num_deltas); delta_enum_cntr_1++) { PyObject *py_delta_enum_1; py_delta_enum_1 = pytalloc_reference_ex(&netr_DELTA_ENUM_Type, object->delta_enum, &object->delta_enum[delta_enum_cntr_1]); PyList_SetItem(py_delta_enum, delta_enum_cntr_1, py_delta_enum_1); } } } return py_delta_enum; } static int py_netr_DELTA_ENUM_ARRAY_set_delta_enum(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->delta_enum)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_enum"); return -1; } if (value == Py_None) { object->delta_enum = NULL; } else { object->delta_enum = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int delta_enum_cntr_1; object->delta_enum = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->delta_enum, PyList_GET_SIZE(value)); if (!object->delta_enum) { return -1;; } talloc_set_name_const(object->delta_enum, "ARRAY: object->delta_enum"); for (delta_enum_cntr_1 = 0; delta_enum_cntr_1 < PyList_GET_SIZE(value); delta_enum_cntr_1++) { if (PyList_GET_ITEM(value, delta_enum_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_enum[delta_enum_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_DELTA_ENUM_Type, PyList_GET_ITEM(value, delta_enum_cntr_1), return -1;); if (talloc_reference(object->delta_enum, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, delta_enum_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->delta_enum[delta_enum_cntr_1] = *(struct netr_DELTA_ENUM *)pytalloc_get_ptr(PyList_GET_ITEM(value, delta_enum_cntr_1)); } } } return 0; } static PyGetSetDef py_netr_DELTA_ENUM_ARRAY_getsetters[] = { { .name = discard_const_p(char, "num_deltas"), .get = py_netr_DELTA_ENUM_ARRAY_get_num_deltas, .set = py_netr_DELTA_ENUM_ARRAY_set_num_deltas, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "delta_enum"), .get = py_netr_DELTA_ENUM_ARRAY_get_delta_enum, .set = py_netr_DELTA_ENUM_ARRAY_set_delta_enum, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM") }, { .name = NULL } }; static PyObject *py_netr_DELTA_ENUM_ARRAY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DELTA_ENUM_ARRAY, type); } static PyTypeObject netr_DELTA_ENUM_ARRAY_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DELTA_ENUM_ARRAY", .tp_getset = py_netr_DELTA_ENUM_ARRAY_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DELTA_ENUM_ARRAY_new, }; static PyObject *py_netr_UAS_INFO_0_get_computer_name(PyObject *obj, void *closure) { struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(obj); PyObject *py_computer_name; py_computer_name = PyList_New(16); if (py_computer_name == NULL) { return NULL; } { int computer_name_cntr_0; for (computer_name_cntr_0 = 0; computer_name_cntr_0 < (16); computer_name_cntr_0++) { PyObject *py_computer_name_0; py_computer_name_0 = PyLong_FromLong((uint16_t)object->computer_name[computer_name_cntr_0]); PyList_SetItem(py_computer_name, computer_name_cntr_0, py_computer_name_0); } } return py_computer_name; } static int py_netr_UAS_INFO_0_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int computer_name_cntr_0; if (ARRAY_SIZE(object->computer_name) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->computer_name), PyList_GET_SIZE(value)); return -1; } for (computer_name_cntr_0 = 0; computer_name_cntr_0 < PyList_GET_SIZE(value); computer_name_cntr_0++) { if (PyList_GET_ITEM(value, computer_name_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name[computer_name_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->computer_name[computer_name_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, computer_name_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, computer_name_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->computer_name[computer_name_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_netr_UAS_INFO_0_get_timecreated(PyObject *obj, void *closure) { struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(obj); PyObject *py_timecreated; py_timecreated = PyLong_FromUnsignedLongLong((uint32_t)object->timecreated); return py_timecreated; } static int py_netr_UAS_INFO_0_set_timecreated(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timecreated"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timecreated)); 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->timecreated = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_UAS_INFO_0_get_serial_number(PyObject *obj, void *closure) { struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(obj); PyObject *py_serial_number; py_serial_number = PyLong_FromUnsignedLongLong((uint32_t)object->serial_number); return py_serial_number; } static int py_netr_UAS_INFO_0_set_serial_number(PyObject *py_obj, PyObject *value, void *closure) { struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_number"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_number)); 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->serial_number = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_UAS_INFO_0_getsetters[] = { { .name = discard_const_p(char, "computer_name"), .get = py_netr_UAS_INFO_0_get_computer_name, .set = py_netr_UAS_INFO_0_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "timecreated"), .get = py_netr_UAS_INFO_0_get_timecreated, .set = py_netr_UAS_INFO_0_set_timecreated, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "serial_number"), .get = py_netr_UAS_INFO_0_get_serial_number, .set = py_netr_UAS_INFO_0_set_serial_number, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_UAS_INFO_0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_UAS_INFO_0, type); } static PyTypeObject netr_UAS_INFO_0_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_UAS_INFO_0", .tp_getset = py_netr_UAS_INFO_0_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_UAS_INFO_0_new, }; static PyObject *py_netr_AccountBuffer_get_blob(PyObject *obj, void *closure) { struct netr_AccountBuffer *object = (struct netr_AccountBuffer *)pytalloc_get_ptr(obj); PyObject *py_blob; py_blob = PyBytes_FromStringAndSize((char *)(object->blob).data, (object->blob).length); return py_blob; } static int py_netr_AccountBuffer_set_blob(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountBuffer *object = (struct netr_AccountBuffer *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blob"); return -1; } object->blob = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value)); return 0; } static PyGetSetDef py_netr_AccountBuffer_getsetters[] = { { .name = discard_const_p(char, "blob"), .get = py_netr_AccountBuffer_get_blob, .set = py_netr_AccountBuffer_set_blob, .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB") }, { .name = NULL } }; static PyObject *py_netr_AccountBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_AccountBuffer, type); } static PyTypeObject netr_AccountBuffer_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_AccountBuffer", .tp_getset = py_netr_AccountBuffer_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_AccountBuffer_new, }; static PyObject *py_netr_NETLOGON_INFO_1_get_flags(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags); return py_flags; } static int py_netr_NETLOGON_INFO_1_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_1_get_pdc_connection_status(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(obj); PyObject *py_pdc_connection_status; py_pdc_connection_status = PyErr_FromWERROR(object->pdc_connection_status); return py_pdc_connection_status; } static int py_netr_NETLOGON_INFO_1_set_pdc_connection_status(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_connection_status"); return -1; } object->pdc_connection_status = W_ERROR(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_netr_NETLOGON_INFO_1_getsetters[] = { { .name = discard_const_p(char, "flags"), .get = py_netr_NETLOGON_INFO_1_get_flags, .set = py_netr_NETLOGON_INFO_1_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_InfoFlags") }, { .name = discard_const_p(char, "pdc_connection_status"), .get = py_netr_NETLOGON_INFO_1_get_pdc_connection_status, .set = py_netr_NETLOGON_INFO_1_set_pdc_connection_status, .doc = discard_const_p(char, "PIDL-generated element of base type WERROR") }, { .name = NULL } }; static PyObject *py_netr_NETLOGON_INFO_1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_NETLOGON_INFO_1, type); } static PyTypeObject netr_NETLOGON_INFO_1_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NETLOGON_INFO_1", .tp_getset = py_netr_NETLOGON_INFO_1_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NETLOGON_INFO_1_new, }; static PyObject *py_netr_NETLOGON_INFO_2_get_flags(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags); return py_flags; } static int py_netr_NETLOGON_INFO_2_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_2_get_pdc_connection_status(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj); PyObject *py_pdc_connection_status; py_pdc_connection_status = PyErr_FromWERROR(object->pdc_connection_status); return py_pdc_connection_status; } static int py_netr_NETLOGON_INFO_2_set_pdc_connection_status(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_connection_status"); return -1; } object->pdc_connection_status = W_ERROR(PyLong_AsLong(value)); return 0; } static PyObject *py_netr_NETLOGON_INFO_2_get_trusted_dc_name(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj); PyObject *py_trusted_dc_name; if (object->trusted_dc_name == NULL) { Py_RETURN_NONE; } if (object->trusted_dc_name == NULL) { py_trusted_dc_name = Py_None; Py_INCREF(py_trusted_dc_name); } else { if (object->trusted_dc_name == NULL) { py_trusted_dc_name = Py_None; Py_INCREF(py_trusted_dc_name); } else { py_trusted_dc_name = PyUnicode_Decode(object->trusted_dc_name, strlen(object->trusted_dc_name), "utf-8", "ignore"); } } return py_trusted_dc_name; } static int py_netr_NETLOGON_INFO_2_set_trusted_dc_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_dc_name"); return -1; } if (value == Py_None) { object->trusted_dc_name = NULL; } else { object->trusted_dc_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->trusted_dc_name = talloc_str; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_2_get_tc_connection_status(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj); PyObject *py_tc_connection_status; py_tc_connection_status = PyErr_FromWERROR(object->tc_connection_status); return py_tc_connection_status; } static int py_netr_NETLOGON_INFO_2_set_tc_connection_status(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tc_connection_status"); return -1; } object->tc_connection_status = W_ERROR(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_netr_NETLOGON_INFO_2_getsetters[] = { { .name = discard_const_p(char, "flags"), .get = py_netr_NETLOGON_INFO_2_get_flags, .set = py_netr_NETLOGON_INFO_2_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_InfoFlags") }, { .name = discard_const_p(char, "pdc_connection_status"), .get = py_netr_NETLOGON_INFO_2_get_pdc_connection_status, .set = py_netr_NETLOGON_INFO_2_set_pdc_connection_status, .doc = discard_const_p(char, "PIDL-generated element of base type WERROR") }, { .name = discard_const_p(char, "trusted_dc_name"), .get = py_netr_NETLOGON_INFO_2_get_trusted_dc_name, .set = py_netr_NETLOGON_INFO_2_set_trusted_dc_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "tc_connection_status"), .get = py_netr_NETLOGON_INFO_2_get_tc_connection_status, .set = py_netr_NETLOGON_INFO_2_set_tc_connection_status, .doc = discard_const_p(char, "PIDL-generated element of base type WERROR") }, { .name = NULL } }; static PyObject *py_netr_NETLOGON_INFO_2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_NETLOGON_INFO_2, type); } static PyTypeObject netr_NETLOGON_INFO_2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NETLOGON_INFO_2", .tp_getset = py_netr_NETLOGON_INFO_2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NETLOGON_INFO_2_new, }; static PyObject *py_netr_NETLOGON_INFO_3_get_flags(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags); return py_flags; } static int py_netr_NETLOGON_INFO_3_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_3_get_logon_attempts(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_logon_attempts; py_logon_attempts = PyLong_FromUnsignedLongLong((uint32_t)object->logon_attempts); return py_logon_attempts; } static int py_netr_NETLOGON_INFO_3_set_logon_attempts(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_attempts"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_attempts)); 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->logon_attempts = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_3_get_unknown1(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1); return py_unknown1; } static int py_netr_NETLOGON_INFO_3_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1)); 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->unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_3_get_unknown2(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2); return py_unknown2; } static int py_netr_NETLOGON_INFO_3_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2)); 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->unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_3_get_unknown3(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3); return py_unknown3; } static int py_netr_NETLOGON_INFO_3_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3)); 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->unknown3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_3_get_unknown4(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_unknown4; py_unknown4 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4); return py_unknown4; } static int py_netr_NETLOGON_INFO_3_set_unknown4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4)); 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->unknown4 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_3_get_unknown5(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj); PyObject *py_unknown5; py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5); return py_unknown5; } static int py_netr_NETLOGON_INFO_3_set_unknown5(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5)); 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->unknown5 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_NETLOGON_INFO_3_getsetters[] = { { .name = discard_const_p(char, "flags"), .get = py_netr_NETLOGON_INFO_3_get_flags, .set = py_netr_NETLOGON_INFO_3_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_InfoFlags") }, { .name = discard_const_p(char, "logon_attempts"), .get = py_netr_NETLOGON_INFO_3_get_logon_attempts, .set = py_netr_NETLOGON_INFO_3_set_logon_attempts, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown1"), .get = py_netr_NETLOGON_INFO_3_get_unknown1, .set = py_netr_NETLOGON_INFO_3_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown2"), .get = py_netr_NETLOGON_INFO_3_get_unknown2, .set = py_netr_NETLOGON_INFO_3_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown3"), .get = py_netr_NETLOGON_INFO_3_get_unknown3, .set = py_netr_NETLOGON_INFO_3_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown4"), .get = py_netr_NETLOGON_INFO_3_get_unknown4, .set = py_netr_NETLOGON_INFO_3_set_unknown4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "unknown5"), .get = py_netr_NETLOGON_INFO_3_get_unknown5, .set = py_netr_NETLOGON_INFO_3_set_unknown5, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_NETLOGON_INFO_3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_NETLOGON_INFO_3, type); } static PyTypeObject netr_NETLOGON_INFO_3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NETLOGON_INFO_3", .tp_getset = py_netr_NETLOGON_INFO_3_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NETLOGON_INFO_3_new, }; static PyObject *py_netr_NETLOGON_INFO_4_get_trusted_dc_name(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(obj); PyObject *py_trusted_dc_name; if (object->trusted_dc_name == NULL) { Py_RETURN_NONE; } if (object->trusted_dc_name == NULL) { py_trusted_dc_name = Py_None; Py_INCREF(py_trusted_dc_name); } else { if (object->trusted_dc_name == NULL) { py_trusted_dc_name = Py_None; Py_INCREF(py_trusted_dc_name); } else { py_trusted_dc_name = PyUnicode_Decode(object->trusted_dc_name, strlen(object->trusted_dc_name), "utf-8", "ignore"); } } return py_trusted_dc_name; } static int py_netr_NETLOGON_INFO_4_set_trusted_dc_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_dc_name"); return -1; } if (value == Py_None) { object->trusted_dc_name = NULL; } else { object->trusted_dc_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->trusted_dc_name = talloc_str; } } return 0; } static PyObject *py_netr_NETLOGON_INFO_4_get_trusted_domain_name(PyObject *obj, void *closure) { struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(obj); PyObject *py_trusted_domain_name; if (object->trusted_domain_name == NULL) { Py_RETURN_NONE; } if (object->trusted_domain_name == NULL) { py_trusted_domain_name = Py_None; Py_INCREF(py_trusted_domain_name); } else { if (object->trusted_domain_name == NULL) { py_trusted_domain_name = Py_None; Py_INCREF(py_trusted_domain_name); } else { py_trusted_domain_name = PyUnicode_Decode(object->trusted_domain_name, strlen(object->trusted_domain_name), "utf-8", "ignore"); } } return py_trusted_domain_name; } static int py_netr_NETLOGON_INFO_4_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domain_name"); return -1; } if (value == Py_None) { object->trusted_domain_name = NULL; } else { object->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->trusted_domain_name = talloc_str; } } return 0; } static PyGetSetDef py_netr_NETLOGON_INFO_4_getsetters[] = { { .name = discard_const_p(char, "trusted_dc_name"), .get = py_netr_NETLOGON_INFO_4_get_trusted_dc_name, .set = py_netr_NETLOGON_INFO_4_set_trusted_dc_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "trusted_domain_name"), .get = py_netr_NETLOGON_INFO_4_get_trusted_domain_name, .set = py_netr_NETLOGON_INFO_4_set_trusted_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = NULL } }; static PyObject *py_netr_NETLOGON_INFO_4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_NETLOGON_INFO_4, type); } static PyTypeObject netr_NETLOGON_INFO_4_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NETLOGON_INFO_4", .tp_getset = py_netr_NETLOGON_INFO_4_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NETLOGON_INFO_4_new, }; static PyObject *py_import_netr_CONTROL_QUERY_INFORMATION(TALLOC_CTX *mem_ctx, int level, union netr_CONTROL_QUERY_INFORMATION *in) { PyObject *ret; switch (level) { case 1: if (in->info1 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_1_Type, in->info1, in->info1); } return ret; case 2: if (in->info2 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_2_Type, in->info2, in->info2); } return ret; case 3: if (in->info3 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_3_Type, in->info3, in->info3); } return ret; case 4: if (in->info4 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_4_Type, in->info4, in->info4); } return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_CONTROL_QUERY_INFORMATION *py_export_netr_CONTROL_QUERY_INFORMATION(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_CONTROL_QUERY_INFORMATION *ret = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->info1 = NULL; } else { ret->info1 = NULL; PY_CHECK_TYPE(&netr_NETLOGON_INFO_1_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->info1 = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(in); } break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->info2 = NULL; } else { ret->info2 = NULL; PY_CHECK_TYPE(&netr_NETLOGON_INFO_2_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->info2 = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(in); } break; case 3: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->info3 = NULL; } else { ret->info3 = NULL; PY_CHECK_TYPE(&netr_NETLOGON_INFO_3_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->info3 = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(in); } break; case 4: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->info4 = NULL; } else { ret->info4 = NULL; PY_CHECK_TYPE(&netr_NETLOGON_INFO_4_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->info4 = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(in); } break; default: break; } return ret; } static PyObject *py_netr_CONTROL_QUERY_INFORMATION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_CONTROL_QUERY_INFORMATION *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_CONTROL_QUERY_INFORMATION *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_CONTROL_QUERY_INFORMATION!"); return NULL; } return py_import_netr_CONTROL_QUERY_INFORMATION(mem_ctx, level, in); } static PyObject *py_netr_CONTROL_QUERY_INFORMATION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_CONTROL_QUERY_INFORMATION *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_CONTROL_QUERY_INFORMATION(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_CONTROL_QUERY_INFORMATION_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_QUERY_INFORMATION_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_QUERY_INFORMATION_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_CONTROL_QUERY_INFORMATION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_CONTROL_QUERY_INFORMATION_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_CONTROL_QUERY_INFORMATION", .tp_getset = NULL, .tp_methods = py_netr_CONTROL_QUERY_INFORMATION_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_CONTROL_QUERY_INFORMATION_new, }; static PyObject *py_import_netr_CONTROL_DATA_INFORMATION(TALLOC_CTX *mem_ctx, int level, union netr_CONTROL_DATA_INFORMATION *in) { PyObject *ret; switch (level) { case NETLOGON_CONTROL_REDISCOVER: if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore"); } } return ret; case NETLOGON_CONTROL_TC_QUERY: if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore"); } } return ret; case NETLOGON_CONTROL_TRANSPORT_NOTIFY: if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore"); } } return ret; case NETLOGON_CONTROL_CHANGE_PASSWORD: if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore"); } } return ret; case NETLOGON_CONTROL_TC_VERIFY: if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->domain == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore"); } } return ret; case NETLOGON_CONTROL_FIND_USER: if (in->user == NULL) { ret = Py_None; Py_INCREF(ret); } else { if (in->user == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = PyUnicode_Decode(in->user, strlen(in->user), "utf-8", "ignore"); } } return ret; case NETLOGON_CONTROL_SET_DBFLAG: ret = PyLong_FromUnsignedLongLong((uint32_t)in->debug_level); return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_CONTROL_DATA_INFORMATION *py_export_netr_CONTROL_DATA_INFORMATION(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_CONTROL_DATA_INFORMATION *ret = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION); switch (level) { case NETLOGON_CONTROL_REDISCOVER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain = NULL; } else { ret->domain = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain = talloc_str; } } break; case NETLOGON_CONTROL_TC_QUERY: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain = NULL; } else { ret->domain = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain = talloc_str; } } break; case NETLOGON_CONTROL_TRANSPORT_NOTIFY: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain = NULL; } else { ret->domain = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain = talloc_str; } } break; case NETLOGON_CONTROL_CHANGE_PASSWORD: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain = NULL; } else { ret->domain = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain = talloc_str; } } break; case NETLOGON_CONTROL_TC_VERIFY: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain = NULL; } else { ret->domain = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain = talloc_str; } } break; case NETLOGON_CONTROL_FIND_USER: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->user"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->user = NULL; } else { ret->user = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->user = talloc_str; } } break; case NETLOGON_CONTROL_SET_DBFLAG: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->debug_level"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->debug_level)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->debug_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; default: break; } return ret; } static PyObject *py_netr_CONTROL_DATA_INFORMATION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_CONTROL_DATA_INFORMATION *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_CONTROL_DATA_INFORMATION *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_CONTROL_DATA_INFORMATION!"); return NULL; } return py_import_netr_CONTROL_DATA_INFORMATION(mem_ctx, level, in); } static PyObject *py_netr_CONTROL_DATA_INFORMATION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_CONTROL_DATA_INFORMATION *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_CONTROL_DATA_INFORMATION(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_CONTROL_DATA_INFORMATION_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_DATA_INFORMATION_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_DATA_INFORMATION_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_CONTROL_DATA_INFORMATION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_CONTROL_DATA_INFORMATION_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_CONTROL_DATA_INFORMATION", .tp_getset = NULL, .tp_methods = py_netr_CONTROL_DATA_INFORMATION_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_CONTROL_DATA_INFORMATION_new, }; static PyObject *py_import_netr_ChangeLogObject(TALLOC_CTX *mem_ctx, int level, union netr_ChangeLogObject *in) { PyObject *ret; switch (level) { case NETR_CHANGELOG_SID_INCLUDED: ret = pytalloc_reference_ex(dom_sid_Type, mem_ctx, &in->object_sid); return ret; case NETR_CHANGELOG_NAME_INCLUDED: ret = PyString_FromStringOrNULL(in->object_name); return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_ChangeLogObject *py_export_netr_ChangeLogObject(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_ChangeLogObject *ret = talloc_zero(mem_ctx, union netr_ChangeLogObject); switch (level) { case NETR_CHANGELOG_SID_INCLUDED: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object_sid"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->object_sid = *(struct dom_sid *)pytalloc_get_ptr(in); break; case NETR_CHANGELOG_NAME_INCLUDED: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object_name"); talloc_free(ret); return NULL; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(in)) { unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(in)) { test_str = PyBytes_AS_STRING(in); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name); talloc_free(ret); return NULL; } talloc_str = talloc_strdup(mem_ctx, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->object_name = talloc_str; } break; default: break; } return ret; } static PyObject *py_netr_ChangeLogObject_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_ChangeLogObject *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_ChangeLogObject *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_ChangeLogObject!"); return NULL; } return py_import_netr_ChangeLogObject(mem_ctx, level, in); } static PyObject *py_netr_ChangeLogObject_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_ChangeLogObject *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_ChangeLogObject(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_ChangeLogObject_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ChangeLogObject_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ChangeLogObject_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_ChangeLogObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_ChangeLogObject_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ChangeLogObject", .tp_getset = NULL, .tp_methods = py_netr_ChangeLogObject_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ChangeLogObject_new, }; static PyObject *py_netr_ChangeLogEntry_get_serial_number1(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_serial_number1; py_serial_number1 = PyLong_FromUnsignedLongLong((uint32_t)object->serial_number1); return py_serial_number1; } static int py_netr_ChangeLogEntry_set_serial_number1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_number1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_number1)); 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->serial_number1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChangeLogEntry_get_serial_number2(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_serial_number2; py_serial_number2 = PyLong_FromUnsignedLongLong((uint32_t)object->serial_number2); return py_serial_number2; } static int py_netr_ChangeLogEntry_set_serial_number2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_number2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_number2)); 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->serial_number2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChangeLogEntry_get_object_rid(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_object_rid; py_object_rid = PyLong_FromUnsignedLongLong((uint32_t)object->object_rid); return py_object_rid; } static int py_netr_ChangeLogEntry_set_object_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object_rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->object_rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChangeLogEntry_get_flags(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromLong((uint16_t)object->flags); return py_flags; } static int py_netr_ChangeLogEntry_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChangeLogEntry_get_db_index(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_db_index; py_db_index = PyLong_FromLong((uint16_t)object->db_index); return py_db_index; } static int py_netr_ChangeLogEntry_set_db_index(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_index"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_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->db_index = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChangeLogEntry_get_delta_type(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_delta_type; py_delta_type = PyLong_FromLong((uint16_t)object->delta_type); return py_delta_type; } static int py_netr_ChangeLogEntry_set_delta_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delta_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->delta_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ChangeLogEntry_get_object(PyObject *obj, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj); PyObject *py_object; py_object = pyrpc_import_union(&netr_ChangeLogObject_Type, pytalloc_get_mem_ctx(obj), object->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED), &object->object, "union netr_ChangeLogObject"); if (py_object == NULL) { return NULL; } return py_object; } static int py_netr_ChangeLogEntry_set_object(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object"); return -1; } { union netr_ChangeLogObject *object_switch_0; object_switch_0 = (union netr_ChangeLogObject *)pyrpc_export_union(&netr_ChangeLogObject_Type, pytalloc_get_mem_ctx(py_obj), object->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED), value, "union netr_ChangeLogObject"); if (object_switch_0 == NULL) { return -1; } object->object = *object_switch_0; } return 0; } static PyGetSetDef py_netr_ChangeLogEntry_getsetters[] = { { .name = discard_const_p(char, "serial_number1"), .get = py_netr_ChangeLogEntry_get_serial_number1, .set = py_netr_ChangeLogEntry_set_serial_number1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "serial_number2"), .get = py_netr_ChangeLogEntry_get_serial_number2, .set = py_netr_ChangeLogEntry_set_serial_number2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "object_rid"), .get = py_netr_ChangeLogEntry_get_object_rid, .set = py_netr_ChangeLogEntry_set_object_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "flags"), .get = py_netr_ChangeLogEntry_get_flags, .set = py_netr_ChangeLogEntry_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChangeLogFlags") }, { .name = discard_const_p(char, "db_index"), .get = py_netr_ChangeLogEntry_get_db_index, .set = py_netr_ChangeLogEntry_set_db_index, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID8Bit") }, { .name = discard_const_p(char, "delta_type"), .get = py_netr_ChangeLogEntry_get_delta_type, .set = py_netr_ChangeLogEntry_set_delta_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DeltaEnum8Bit") }, { .name = discard_const_p(char, "object"), .get = py_netr_ChangeLogEntry_get_object, .set = py_netr_ChangeLogEntry_set_object, .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChangeLogObject") }, { .name = NULL } }; static PyObject *py_netr_ChangeLogEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_ChangeLogEntry, type); } static PyObject *py_netr_ChangeLogEntry_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)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_netr_ChangeLogEntry); 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_netr_ChangeLogEntry_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)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_netr_ChangeLogEntry); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_ChangeLogEntry); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_ChangeLogEntry_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)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_netr_ChangeLogEntry, "netr_ChangeLogEntry", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_ChangeLogEntry_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_ChangeLogEntry_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ChangeLogEntry_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_ChangeLogEntry_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ChangeLogEntry_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ChangeLogEntry", .tp_getset = py_netr_ChangeLogEntry_getsetters, .tp_methods = py_netr_ChangeLogEntry_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ChangeLogEntry_new, }; static PyObject *py_netr_Blob_get_length(PyObject *obj, void *closure) { struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_netr_Blob_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_Blob_get_data(PyObject *obj, void *closure) { struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->data == NULL) { Py_RETURN_NONE; } if (object->data == NULL) { py_data = Py_None; Py_INCREF(py_data); } else { py_data = PyList_New(object->length); if (py_data == NULL) { return NULL; } { int data_cntr_1; for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) { PyObject *py_data_1; py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]); PyList_SetItem(py_data, data_cntr_1, py_data_1); } } } return py_data; } static int py_netr_Blob_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } if (value == Py_None) { object->data = NULL; } else { object->data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_1; object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value)); if (!object->data) { return -1;; } talloc_set_name_const(object->data, "ARRAY: object->data"); for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) { if (PyList_GET_ITEM(value, data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1)); 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->data[data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_Blob_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_Blob_get_length, .set = py_netr_Blob_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "data"), .get = py_netr_Blob_get_data, .set = py_netr_Blob_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_Blob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_Blob, type); } static PyTypeObject netr_Blob_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_Blob", .tp_getset = py_netr_Blob_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_Blob_new, }; static PyObject *py_netr_DsRGetDCNameInfo_get_dc_unc(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_dc_unc; if (object->dc_unc == NULL) { Py_RETURN_NONE; } if (object->dc_unc == NULL) { py_dc_unc = Py_None; Py_INCREF(py_dc_unc); } else { if (object->dc_unc == NULL) { py_dc_unc = Py_None; Py_INCREF(py_dc_unc); } else { py_dc_unc = PyUnicode_Decode(object->dc_unc, strlen(object->dc_unc), "utf-8", "ignore"); } } return py_dc_unc; } static int py_netr_DsRGetDCNameInfo_set_dc_unc(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_unc"); return -1; } if (value == Py_None) { object->dc_unc = NULL; } else { object->dc_unc = 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->dc_unc = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_dc_address(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_dc_address; if (object->dc_address == NULL) { Py_RETURN_NONE; } if (object->dc_address == NULL) { py_dc_address = Py_None; Py_INCREF(py_dc_address); } else { if (object->dc_address == NULL) { py_dc_address = Py_None; Py_INCREF(py_dc_address); } else { py_dc_address = PyUnicode_Decode(object->dc_address, strlen(object->dc_address), "utf-8", "ignore"); } } return py_dc_address; } static int py_netr_DsRGetDCNameInfo_set_dc_address(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_address"); return -1; } if (value == Py_None) { object->dc_address = NULL; } else { object->dc_address = 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->dc_address = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_dc_address_type(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_dc_address_type; py_dc_address_type = PyLong_FromUnsignedLongLong((uint32_t)object->dc_address_type); return py_dc_address_type; } static int py_netr_DsRGetDCNameInfo_set_dc_address_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_address_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dc_address_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->dc_address_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_domain_guid(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_guid; py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid); return py_domain_guid; } static int py_netr_DsRGetDCNameInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_guid"); return -1; } 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->domain_guid = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_domain_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)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_netr_DsRGetDCNameInfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)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_netr_DsRGetDCNameInfo_get_forest_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_forest_name; if (object->forest_name == NULL) { Py_RETURN_NONE; } if (object->forest_name == NULL) { py_forest_name = Py_None; Py_INCREF(py_forest_name); } else { if (object->forest_name == NULL) { py_forest_name = Py_None; Py_INCREF(py_forest_name); } else { py_forest_name = PyUnicode_Decode(object->forest_name, strlen(object->forest_name), "utf-8", "ignore"); } } return py_forest_name; } static int py_netr_DsRGetDCNameInfo_set_forest_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_name"); return -1; } if (value == Py_None) { object->forest_name = NULL; } else { object->forest_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->forest_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_dc_flags(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_dc_flags; py_dc_flags = PyLong_FromUnsignedLongLong((uint32_t)object->dc_flags); return py_dc_flags; } static int py_netr_DsRGetDCNameInfo_set_dc_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dc_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->dc_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_dc_site_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_dc_site_name; if (object->dc_site_name == NULL) { Py_RETURN_NONE; } if (object->dc_site_name == NULL) { py_dc_site_name = Py_None; Py_INCREF(py_dc_site_name); } else { if (object->dc_site_name == NULL) { py_dc_site_name = Py_None; Py_INCREF(py_dc_site_name); } else { py_dc_site_name = PyUnicode_Decode(object->dc_site_name, strlen(object->dc_site_name), "utf-8", "ignore"); } } return py_dc_site_name; } static int py_netr_DsRGetDCNameInfo_set_dc_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_site_name"); return -1; } if (value == Py_None) { object->dc_site_name = NULL; } else { object->dc_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->dc_site_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameInfo_get_client_site_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj); PyObject *py_client_site_name; if (object->client_site_name == NULL) { Py_RETURN_NONE; } if (object->client_site_name == NULL) { py_client_site_name = Py_None; Py_INCREF(py_client_site_name); } else { if (object->client_site_name == NULL) { py_client_site_name = Py_None; Py_INCREF(py_client_site_name); } else { py_client_site_name = PyUnicode_Decode(object->client_site_name, strlen(object->client_site_name), "utf-8", "ignore"); } } return py_client_site_name; } static int py_netr_DsRGetDCNameInfo_set_client_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_site_name"); return -1; } if (value == Py_None) { object->client_site_name = NULL; } else { object->client_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->client_site_name = talloc_str; } } return 0; } static PyGetSetDef py_netr_DsRGetDCNameInfo_getsetters[] = { { .name = discard_const_p(char, "dc_unc"), .get = py_netr_DsRGetDCNameInfo_get_dc_unc, .set = py_netr_DsRGetDCNameInfo_set_dc_unc, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dc_address"), .get = py_netr_DsRGetDCNameInfo_get_dc_address, .set = py_netr_DsRGetDCNameInfo_set_dc_address, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dc_address_type"), .get = py_netr_DsRGetDCNameInfo_get_dc_address_type, .set = py_netr_DsRGetDCNameInfo_set_dc_address_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo_AddressType") }, { .name = discard_const_p(char, "domain_guid"), .get = py_netr_DsRGetDCNameInfo_get_domain_guid, .set = py_netr_DsRGetDCNameInfo_set_domain_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "domain_name"), .get = py_netr_DsRGetDCNameInfo_get_domain_name, .set = py_netr_DsRGetDCNameInfo_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "forest_name"), .get = py_netr_DsRGetDCNameInfo_get_forest_name, .set = py_netr_DsRGetDCNameInfo_set_forest_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dc_flags"), .get = py_netr_DsRGetDCNameInfo_get_dc_flags, .set = py_netr_DsRGetDCNameInfo_set_dc_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsR_DcFlags") }, { .name = discard_const_p(char, "dc_site_name"), .get = py_netr_DsRGetDCNameInfo_get_dc_site_name, .set = py_netr_DsRGetDCNameInfo_set_dc_site_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "client_site_name"), .get = py_netr_DsRGetDCNameInfo_get_client_site_name, .set = py_netr_DsRGetDCNameInfo_set_client_site_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = NULL } }; static PyObject *py_netr_DsRGetDCNameInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DsRGetDCNameInfo, type); } static PyObject *py_netr_DsRGetDCNameInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)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_netr_DsRGetDCNameInfo); 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_netr_DsRGetDCNameInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)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_netr_DsRGetDCNameInfo); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DsRGetDCNameInfo); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_DsRGetDCNameInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)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_netr_DsRGetDCNameInfo, "netr_DsRGetDCNameInfo", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_DsRGetDCNameInfo_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_DsRGetDCNameInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_DsRGetDCNameInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRGetDCNameInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRGetDCNameInfo", .tp_getset = py_netr_DsRGetDCNameInfo_getsetters, .tp_methods = py_netr_DsRGetDCNameInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRGetDCNameInfo_new, }; static PyObject *py_import_netr_Capabilities(TALLOC_CTX *mem_ctx, int level, union netr_Capabilities *in) { PyObject *ret; switch (level) { case 1: ret = PyLong_FromUnsignedLongLong((uint32_t)in->server_capabilities); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_Capabilities *py_export_netr_Capabilities(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_Capabilities *ret = talloc_zero(mem_ctx, union netr_Capabilities); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->server_capabilities"); talloc_free(ret); return NULL; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->server_capabilities)); if (PyLong_Check(in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(in); if (PyErr_Occurred() != NULL) { talloc_free(ret); return NULL; } 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); talloc_free(ret); return NULL; } ret->server_capabilities = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); talloc_free(ret); return NULL; } } break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_netr_Capabilities_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_Capabilities *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_Capabilities *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_Capabilities!"); return NULL; } return py_import_netr_Capabilities(mem_ctx, level, in); } static PyObject *py_netr_Capabilities_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_Capabilities *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_Capabilities(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_Capabilities_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Capabilities_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Capabilities_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_Capabilities_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_Capabilities_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_Capabilities", .tp_getset = NULL, .tp_methods = py_netr_Capabilities_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_Capabilities_new, }; static PyObject *py_netr_LsaPolicyInformation_get_policy_size(PyObject *obj, void *closure) { struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(obj); PyObject *py_policy_size; py_policy_size = PyLong_FromUnsignedLongLong((uint32_t)object->policy_size); return py_policy_size; } static int py_netr_LsaPolicyInformation_set_policy_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->policy_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->policy_size)); 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->policy_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_LsaPolicyInformation_get_policy(PyObject *obj, void *closure) { struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(obj); PyObject *py_policy; if (object->policy == NULL) { Py_RETURN_NONE; } if (object->policy == NULL) { py_policy = Py_None; Py_INCREF(py_policy); } else { py_policy = PyList_New(object->policy_size); if (py_policy == NULL) { return NULL; } { int policy_cntr_1; for (policy_cntr_1 = 0; policy_cntr_1 < (object->policy_size); policy_cntr_1++) { PyObject *py_policy_1; py_policy_1 = PyLong_FromLong((uint16_t)object->policy[policy_cntr_1]); PyList_SetItem(py_policy, policy_cntr_1, py_policy_1); } } } return py_policy; } static int py_netr_LsaPolicyInformation_set_policy(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->policy)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->policy"); return -1; } if (value == Py_None) { object->policy = NULL; } else { object->policy = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int policy_cntr_1; object->policy = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->policy, PyList_GET_SIZE(value)); if (!object->policy) { return -1;; } talloc_set_name_const(object->policy, "ARRAY: object->policy"); for (policy_cntr_1 = 0; policy_cntr_1 < PyList_GET_SIZE(value); policy_cntr_1++) { if (PyList_GET_ITEM(value, policy_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->policy[policy_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->policy[policy_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, policy_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, policy_cntr_1)); 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->policy[policy_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_netr_LsaPolicyInformation_getsetters[] = { { .name = discard_const_p(char, "policy_size"), .get = py_netr_LsaPolicyInformation_get_policy_size, .set = py_netr_LsaPolicyInformation_set_policy_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "policy"), .get = py_netr_LsaPolicyInformation_get_policy, .set = py_netr_LsaPolicyInformation_set_policy, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_LsaPolicyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_LsaPolicyInformation, type); } static PyTypeObject netr_LsaPolicyInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LsaPolicyInformation", .tp_getset = py_netr_LsaPolicyInformation_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LsaPolicyInformation_new, }; static PyObject *py_netr_OsVersionInfoEx_get_OSVersionInfoSize(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_OSVersionInfoSize; py_OSVersionInfoSize = PyLong_FromUnsignedLongLong((uint32_t)object->OSVersionInfoSize); return py_OSVersionInfoSize; } static int py_netr_OsVersionInfoEx_set_OSVersionInfoSize(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSVersionInfoSize"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSVersionInfoSize)); 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->OSVersionInfoSize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_MajorVersion(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_MajorVersion; py_MajorVersion = PyLong_FromUnsignedLongLong((uint32_t)object->MajorVersion); return py_MajorVersion; } static int py_netr_OsVersionInfoEx_set_MajorVersion(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MajorVersion"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MajorVersion)); 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->MajorVersion = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_MinorVersion(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_MinorVersion; py_MinorVersion = PyLong_FromUnsignedLongLong((uint32_t)object->MinorVersion); return py_MinorVersion; } static int py_netr_OsVersionInfoEx_set_MinorVersion(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MinorVersion"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MinorVersion)); 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->MinorVersion = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_BuildNumber(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_BuildNumber; py_BuildNumber = PyLong_FromUnsignedLongLong((uint32_t)object->BuildNumber); return py_BuildNumber; } static int py_netr_OsVersionInfoEx_set_BuildNumber(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BuildNumber"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BuildNumber)); 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->BuildNumber = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_PlatformId(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_PlatformId; py_PlatformId = PyLong_FromUnsignedLongLong((uint32_t)object->PlatformId); return py_PlatformId; } static int py_netr_OsVersionInfoEx_set_PlatformId(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PlatformId"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PlatformId)); 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->PlatformId = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_CSDVersion(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_CSDVersion; py_CSDVersion = PyString_FromStringOrNULL(object->CSDVersion); return py_CSDVersion; } static int py_netr_OsVersionInfoEx_set_CSDVersion(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CSDVersion"); 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->CSDVersion = talloc_str; } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_ServicePackMajor(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_ServicePackMajor; py_ServicePackMajor = PyLong_FromLong((uint16_t)object->ServicePackMajor); return py_ServicePackMajor; } static int py_netr_OsVersionInfoEx_set_ServicePackMajor(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServicePackMajor"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServicePackMajor)); 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->ServicePackMajor = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_ServicePackMinor(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_ServicePackMinor; py_ServicePackMinor = PyLong_FromLong((uint16_t)object->ServicePackMinor); return py_ServicePackMinor; } static int py_netr_OsVersionInfoEx_set_ServicePackMinor(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServicePackMinor"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServicePackMinor)); 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->ServicePackMinor = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_SuiteMask(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_SuiteMask; py_SuiteMask = PyLong_FromLong((uint16_t)object->SuiteMask); return py_SuiteMask; } static int py_netr_OsVersionInfoEx_set_SuiteMask(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SuiteMask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SuiteMask)); 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->SuiteMask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_ProductType(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_ProductType; py_ProductType = PyLong_FromLong((uint16_t)object->ProductType); return py_ProductType; } static int py_netr_OsVersionInfoEx_set_ProductType(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ProductType"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ProductType)); 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->ProductType = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionInfoEx_get_Reserved(PyObject *obj, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj); PyObject *py_Reserved; py_Reserved = PyLong_FromLong((uint16_t)object->Reserved); return py_Reserved; } static int py_netr_OsVersionInfoEx_set_Reserved(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Reserved"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved)); 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->Reserved = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_OsVersionInfoEx_getsetters[] = { { .name = discard_const_p(char, "OSVersionInfoSize"), .get = py_netr_OsVersionInfoEx_get_OSVersionInfoSize, .set = py_netr_OsVersionInfoEx_set_OSVersionInfoSize, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "MajorVersion"), .get = py_netr_OsVersionInfoEx_get_MajorVersion, .set = py_netr_OsVersionInfoEx_set_MajorVersion, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "MinorVersion"), .get = py_netr_OsVersionInfoEx_get_MinorVersion, .set = py_netr_OsVersionInfoEx_set_MinorVersion, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "BuildNumber"), .get = py_netr_OsVersionInfoEx_get_BuildNumber, .set = py_netr_OsVersionInfoEx_set_BuildNumber, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "PlatformId"), .get = py_netr_OsVersionInfoEx_get_PlatformId, .set = py_netr_OsVersionInfoEx_set_PlatformId, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "CSDVersion"), .get = py_netr_OsVersionInfoEx_get_CSDVersion, .set = py_netr_OsVersionInfoEx_set_CSDVersion, .doc = discard_const_p(char, "PIDL-generated element of base type string") }, { .name = discard_const_p(char, "ServicePackMajor"), .get = py_netr_OsVersionInfoEx_get_ServicePackMajor, .set = py_netr_OsVersionInfoEx_set_ServicePackMajor, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "ServicePackMinor"), .get = py_netr_OsVersionInfoEx_get_ServicePackMinor, .set = py_netr_OsVersionInfoEx_set_ServicePackMinor, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "SuiteMask"), .get = py_netr_OsVersionInfoEx_get_SuiteMask, .set = py_netr_OsVersionInfoEx_set_SuiteMask, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SuiteMask") }, { .name = discard_const_p(char, "ProductType"), .get = py_netr_OsVersionInfoEx_get_ProductType, .set = py_netr_OsVersionInfoEx_set_ProductType, .doc = discard_const_p(char, "PIDL-generated element of base type netr_ProductType") }, { .name = discard_const_p(char, "Reserved"), .get = py_netr_OsVersionInfoEx_get_Reserved, .set = py_netr_OsVersionInfoEx_set_Reserved, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_netr_OsVersionInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_OsVersionInfoEx, type); } static PyTypeObject netr_OsVersionInfoEx_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_OsVersionInfoEx", .tp_getset = py_netr_OsVersionInfoEx_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_OsVersionInfoEx_new, }; static PyObject *py_netr_OsVersion_get_length(PyObject *obj, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_netr_OsVersion_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersion_get_dummy(PyObject *obj, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj); PyObject *py_dummy; py_dummy = PyLong_FromUnsignedLongLong((uint32_t)object->dummy); return py_dummy; } static int py_netr_OsVersion_set_dummy(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy)); 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->dummy = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersion_get_size(PyObject *obj, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size); return py_size; } static int py_netr_OsVersion_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersion_get_os(PyObject *obj, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj); PyObject *py_os; py_os = pytalloc_reference_ex(&netr_OsVersionInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->os); return py_os; } static int py_netr_OsVersion_set_os(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os"); return -1; } PY_CHECK_TYPE(&netr_OsVersionInfoEx_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->os = *(struct netr_OsVersionInfoEx *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_OsVersion_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_OsVersion_get_length, .set = py_netr_OsVersion_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint3264") }, { .name = discard_const_p(char, "dummy"), .get = py_netr_OsVersion_get_dummy, .set = py_netr_OsVersion_set_dummy, .doc = discard_const_p(char, "PIDL-generated element of base type uint3264") }, { .name = discard_const_p(char, "size"), .get = py_netr_OsVersion_get_size, .set = py_netr_OsVersion_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint3264") }, { .name = discard_const_p(char, "os"), .get = py_netr_OsVersion_get_os, .set = py_netr_OsVersion_set_os, .doc = discard_const_p(char, "PIDL-generated element of base type netr_OsVersionInfoEx") }, { .name = NULL } }; static PyObject *py_netr_OsVersion_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_OsVersion, type); } static PyTypeObject netr_OsVersion_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_OsVersion", .tp_getset = py_netr_OsVersion_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_OsVersion_new, }; static PyObject *py_netr_OsVersionContainer_get_length(PyObject *obj, void *closure) { struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromLong((uint16_t)object->length); return py_length; } static int py_netr_OsVersionContainer_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionContainer_get_size(PyObject *obj, void *closure) { struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromLong((uint16_t)object->size); return py_size; } static int py_netr_OsVersionContainer_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OsVersionContainer_get_os(PyObject *obj, void *closure) { struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(obj); PyObject *py_os; if (object->os == NULL) { Py_RETURN_NONE; } if (object->os == NULL) { py_os = Py_None; Py_INCREF(py_os); } else { py_os = pytalloc_reference_ex(&netr_OsVersion_Type, object->os, object->os); } return py_os; } static int py_netr_OsVersionContainer_set_os(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->os)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os"); return -1; } if (value == Py_None) { object->os = NULL; } else { object->os = NULL; PY_CHECK_TYPE(&netr_OsVersion_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->os = (struct netr_OsVersion *)pytalloc_get_ptr(value); } return 0; } static PyGetSetDef py_netr_OsVersionContainer_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_OsVersionContainer_get_length, .set = py_netr_OsVersionContainer_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "size"), .get = py_netr_OsVersionContainer_get_size, .set = py_netr_OsVersionContainer_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "os"), .get = py_netr_OsVersionContainer_get_os, .set = py_netr_OsVersionContainer_set_os, .doc = discard_const_p(char, "PIDL-generated element of base type netr_OsVersion") }, { .name = NULL } }; static PyObject *py_netr_OsVersionContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_OsVersionContainer, type); } static PyTypeObject netr_OsVersionContainer_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_OsVersionContainer", .tp_getset = py_netr_OsVersionContainer_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_OsVersionContainer_new, }; static PyObject *py_netr_WorkstationInformation_get_lsa_policy(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_lsa_policy; py_lsa_policy = pytalloc_reference_ex(&netr_LsaPolicyInformation_Type, pytalloc_get_mem_ctx(obj), &object->lsa_policy); return py_lsa_policy; } static int py_netr_WorkstationInformation_set_lsa_policy(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lsa_policy"); return -1; } PY_CHECK_TYPE(&netr_LsaPolicyInformation_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lsa_policy = *(struct netr_LsaPolicyInformation *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_WorkstationInformation_get_dns_hostname(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dns_hostname; if (object->dns_hostname == NULL) { Py_RETURN_NONE; } if (object->dns_hostname == NULL) { py_dns_hostname = Py_None; Py_INCREF(py_dns_hostname); } else { if (object->dns_hostname == NULL) { py_dns_hostname = Py_None; Py_INCREF(py_dns_hostname); } else { py_dns_hostname = PyUnicode_Decode(object->dns_hostname, strlen(object->dns_hostname), "utf-8", "ignore"); } } return py_dns_hostname; } static int py_netr_WorkstationInformation_set_dns_hostname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_hostname"); return -1; } if (value == Py_None) { object->dns_hostname = NULL; } else { object->dns_hostname = 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->dns_hostname = talloc_str; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_sitename(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_sitename; if (object->sitename == NULL) { Py_RETURN_NONE; } if (object->sitename == NULL) { py_sitename = Py_None; Py_INCREF(py_sitename); } else { if (object->sitename == NULL) { py_sitename = Py_None; Py_INCREF(py_sitename); } else { py_sitename = PyUnicode_Decode(object->sitename, strlen(object->sitename), "utf-8", "ignore"); } } return py_sitename; } static int py_netr_WorkstationInformation_set_sitename(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename"); return -1; } if (value == Py_None) { object->sitename = NULL; } else { object->sitename = 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->sitename = talloc_str; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy1(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy1; if (object->dummy1 == NULL) { Py_RETURN_NONE; } if (object->dummy1 == NULL) { py_dummy1 = Py_None; Py_INCREF(py_dummy1); } else { if (object->dummy1 == NULL) { py_dummy1 = Py_None; Py_INCREF(py_dummy1); } else { py_dummy1 = PyUnicode_Decode(object->dummy1, strlen(object->dummy1), "utf-8", "ignore"); } } return py_dummy1; } static int py_netr_WorkstationInformation_set_dummy1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy1"); return -1; } if (value == Py_None) { object->dummy1 = NULL; } else { object->dummy1 = 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->dummy1 = talloc_str; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy2(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy2; if (object->dummy2 == NULL) { Py_RETURN_NONE; } if (object->dummy2 == NULL) { py_dummy2 = Py_None; Py_INCREF(py_dummy2); } else { if (object->dummy2 == NULL) { py_dummy2 = Py_None; Py_INCREF(py_dummy2); } else { py_dummy2 = PyUnicode_Decode(object->dummy2, strlen(object->dummy2), "utf-8", "ignore"); } } return py_dummy2; } static int py_netr_WorkstationInformation_set_dummy2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy2"); return -1; } if (value == Py_None) { object->dummy2 = NULL; } else { object->dummy2 = 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->dummy2 = talloc_str; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy3(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy3; if (object->dummy3 == NULL) { Py_RETURN_NONE; } if (object->dummy3 == NULL) { py_dummy3 = Py_None; Py_INCREF(py_dummy3); } else { if (object->dummy3 == NULL) { py_dummy3 = Py_None; Py_INCREF(py_dummy3); } else { py_dummy3 = PyUnicode_Decode(object->dummy3, strlen(object->dummy3), "utf-8", "ignore"); } } return py_dummy3; } static int py_netr_WorkstationInformation_set_dummy3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy3"); return -1; } if (value == Py_None) { object->dummy3 = NULL; } else { object->dummy3 = 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->dummy3 = talloc_str; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy4(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy4; if (object->dummy4 == NULL) { Py_RETURN_NONE; } if (object->dummy4 == NULL) { py_dummy4 = Py_None; Py_INCREF(py_dummy4); } else { if (object->dummy4 == NULL) { py_dummy4 = Py_None; Py_INCREF(py_dummy4); } else { py_dummy4 = PyUnicode_Decode(object->dummy4, strlen(object->dummy4), "utf-8", "ignore"); } } return py_dummy4; } static int py_netr_WorkstationInformation_set_dummy4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy4"); return -1; } if (value == Py_None) { object->dummy4 = NULL; } else { object->dummy4 = 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->dummy4 = talloc_str; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_os_version(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_os_version; py_os_version = pytalloc_reference_ex(&netr_OsVersionContainer_Type, pytalloc_get_mem_ctx(obj), &object->os_version); return py_os_version; } static int py_netr_WorkstationInformation_set_os_version(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os_version"); return -1; } PY_CHECK_TYPE(&netr_OsVersionContainer_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->os_version = *(struct netr_OsVersionContainer *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_WorkstationInformation_get_os_name(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_os_name; py_os_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->os_name); return py_os_name; } static int py_netr_WorkstationInformation_set_os_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->os_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy_string3(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_string3; py_dummy_string3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string3); return py_dummy_string3; } static int py_netr_WorkstationInformation_set_dummy_string3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string3"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string3 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy_string4(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_string4; py_dummy_string4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string4); return py_dummy_string4; } static int py_netr_WorkstationInformation_set_dummy_string4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string4"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string4 = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_WorkstationInformation_get_workstation_flags(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_workstation_flags; py_workstation_flags = PyLong_FromUnsignedLongLong((uint32_t)object->workstation_flags); return py_workstation_flags; } static int py_netr_WorkstationInformation_set_workstation_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstation_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->workstation_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->workstation_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_supported_enc_types(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_supported_enc_types; py_supported_enc_types = PyLong_FromUnsignedLongLong((uint32_t)object->supported_enc_types); return py_supported_enc_types; } static int py_netr_WorkstationInformation_set_supported_enc_types(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->supported_enc_types"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->supported_enc_types)); 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->supported_enc_types = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy_long3(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_long3; py_dummy_long3 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long3); return py_dummy_long3; } static int py_netr_WorkstationInformation_set_dummy_long3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long3)); 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->dummy_long3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_WorkstationInformation_get_dummy_long4(PyObject *obj, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_long4; py_dummy_long4 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long4); return py_dummy_long4; } static int py_netr_WorkstationInformation_set_dummy_long4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long4"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long4)); 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->dummy_long4 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_WorkstationInformation_getsetters[] = { { .name = discard_const_p(char, "lsa_policy"), .get = py_netr_WorkstationInformation_get_lsa_policy, .set = py_netr_WorkstationInformation_set_lsa_policy, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LsaPolicyInformation") }, { .name = discard_const_p(char, "dns_hostname"), .get = py_netr_WorkstationInformation_get_dns_hostname, .set = py_netr_WorkstationInformation_set_dns_hostname, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "sitename"), .get = py_netr_WorkstationInformation_get_sitename, .set = py_netr_WorkstationInformation_set_sitename, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dummy1"), .get = py_netr_WorkstationInformation_get_dummy1, .set = py_netr_WorkstationInformation_set_dummy1, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dummy2"), .get = py_netr_WorkstationInformation_get_dummy2, .set = py_netr_WorkstationInformation_set_dummy2, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dummy3"), .get = py_netr_WorkstationInformation_get_dummy3, .set = py_netr_WorkstationInformation_set_dummy3, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dummy4"), .get = py_netr_WorkstationInformation_get_dummy4, .set = py_netr_WorkstationInformation_set_dummy4, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "os_version"), .get = py_netr_WorkstationInformation_get_os_version, .set = py_netr_WorkstationInformation_set_os_version, .doc = discard_const_p(char, "PIDL-generated element of base type netr_OsVersionContainer") }, { .name = discard_const_p(char, "os_name"), .get = py_netr_WorkstationInformation_get_os_name, .set = py_netr_WorkstationInformation_set_os_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "dummy_string3"), .get = py_netr_WorkstationInformation_get_dummy_string3, .set = py_netr_WorkstationInformation_set_dummy_string3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "dummy_string4"), .get = py_netr_WorkstationInformation_get_dummy_string4, .set = py_netr_WorkstationInformation_set_dummy_string4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "workstation_flags"), .get = py_netr_WorkstationInformation_get_workstation_flags, .set = py_netr_WorkstationInformation_set_workstation_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_WorkstationFlags") }, { .name = discard_const_p(char, "supported_enc_types"), .get = py_netr_WorkstationInformation_get_supported_enc_types, .set = py_netr_WorkstationInformation_set_supported_enc_types, .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes") }, { .name = discard_const_p(char, "dummy_long3"), .get = py_netr_WorkstationInformation_get_dummy_long3, .set = py_netr_WorkstationInformation_set_dummy_long3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dummy_long4"), .get = py_netr_WorkstationInformation_get_dummy_long4, .set = py_netr_WorkstationInformation_set_dummy_long4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_WorkstationInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_WorkstationInformation, type); } static PyTypeObject netr_WorkstationInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_WorkstationInformation", .tp_getset = py_netr_WorkstationInformation_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_WorkstationInformation_new, }; static PyObject *py_import_netr_WorkstationInfo(TALLOC_CTX *mem_ctx, int level, union netr_WorkstationInfo *in) { PyObject *ret; switch (level) { case 1: if (in->workstation_info == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_WorkstationInformation_Type, in->workstation_info, in->workstation_info); } return ret; case 2: if (in->lsa_policy_info == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_WorkstationInformation_Type, in->lsa_policy_info, in->lsa_policy_info); } return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_WorkstationInfo *py_export_netr_WorkstationInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_WorkstationInfo *ret = talloc_zero(mem_ctx, union netr_WorkstationInfo); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->workstation_info"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->workstation_info = NULL; } else { ret->workstation_info = NULL; PY_CHECK_TYPE(&netr_WorkstationInformation_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->workstation_info = (struct netr_WorkstationInformation *)pytalloc_get_ptr(in); } break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->lsa_policy_info"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->lsa_policy_info = NULL; } else { ret->lsa_policy_info = NULL; PY_CHECK_TYPE(&netr_WorkstationInformation_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->lsa_policy_info = (struct netr_WorkstationInformation *)pytalloc_get_ptr(in); } break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_netr_WorkstationInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_WorkstationInfo *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_WorkstationInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_WorkstationInfo!"); return NULL; } return py_import_netr_WorkstationInfo(mem_ctx, level, in); } static PyObject *py_netr_WorkstationInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_WorkstationInfo *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_WorkstationInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_WorkstationInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_WorkstationInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_WorkstationInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_WorkstationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_WorkstationInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_WorkstationInfo", .tp_getset = NULL, .tp_methods = py_netr_WorkstationInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_WorkstationInfo_new, }; static PyObject *py_netr_trust_extension_info_get_flags(PyObject *obj, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags); return py_flags; } static int py_netr_trust_extension_info_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->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->flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_info_get_parent_index(PyObject *obj, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj); PyObject *py_parent_index; py_parent_index = PyLong_FromUnsignedLongLong((uint32_t)object->parent_index); return py_parent_index; } static int py_netr_trust_extension_info_set_parent_index(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parent_index"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->parent_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->parent_index = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_info_get_trust_type(PyObject *obj, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj); PyObject *py_trust_type; py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)object->trust_type); return py_trust_type; } static int py_netr_trust_extension_info_set_trust_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_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->trust_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_info_get_trust_attributes(PyObject *obj, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj); PyObject *py_trust_attributes; py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes); return py_trust_attributes; } static int py_netr_trust_extension_info_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes)); 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->trust_attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_trust_extension_info_getsetters[] = { { .name = discard_const_p(char, "flags"), .get = py_netr_trust_extension_info_get_flags, .set = py_netr_trust_extension_info_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustFlags") }, { .name = discard_const_p(char, "parent_index"), .get = py_netr_trust_extension_info_get_parent_index, .set = py_netr_trust_extension_info_set_parent_index, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "trust_type"), .get = py_netr_trust_extension_info_get_trust_type, .set = py_netr_trust_extension_info_set_trust_type, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType") }, { .name = discard_const_p(char, "trust_attributes"), .get = py_netr_trust_extension_info_get_trust_attributes, .set = py_netr_trust_extension_info_set_trust_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes") }, { .name = NULL } }; static PyObject *py_netr_trust_extension_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_trust_extension_info, type); } static PyTypeObject netr_trust_extension_info_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_trust_extension_info", .tp_getset = py_netr_trust_extension_info_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_trust_extension_info_new, }; static PyObject *py_netr_trust_extension_get_length(PyObject *obj, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_netr_trust_extension_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_get_dummy(PyObject *obj, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj); PyObject *py_dummy; py_dummy = PyLong_FromUnsignedLongLong((uint32_t)object->dummy); return py_dummy; } static int py_netr_trust_extension_set_dummy(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy)); 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->dummy = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_get_size(PyObject *obj, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size); return py_size; } static int py_netr_trust_extension_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_get_info(PyObject *obj, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&netr_trust_extension_info_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_netr_trust_extension_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&netr_trust_extension_info_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct netr_trust_extension_info *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_trust_extension_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_trust_extension_get_length, .set = py_netr_trust_extension_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint3264") }, { .name = discard_const_p(char, "dummy"), .get = py_netr_trust_extension_get_dummy, .set = py_netr_trust_extension_set_dummy, .doc = discard_const_p(char, "PIDL-generated element of base type uint3264") }, { .name = discard_const_p(char, "size"), .get = py_netr_trust_extension_get_size, .set = py_netr_trust_extension_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint3264") }, { .name = discard_const_p(char, "info"), .get = py_netr_trust_extension_get_info, .set = py_netr_trust_extension_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_trust_extension_info") }, { .name = NULL } }; static PyObject *py_netr_trust_extension_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_trust_extension, type); } static PyTypeObject netr_trust_extension_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_trust_extension", .tp_getset = py_netr_trust_extension_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_trust_extension_new, }; static PyObject *py_netr_trust_extension_container_get_length(PyObject *obj, void *closure) { struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromLong((uint16_t)object->length); return py_length; } static int py_netr_trust_extension_container_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_container_get_size(PyObject *obj, void *closure) { struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromLong((uint16_t)object->size); return py_size; } static int py_netr_trust_extension_container_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_trust_extension_container_get_info(PyObject *obj, void *closure) { struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->info == NULL) { Py_RETURN_NONE; } if (object->info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_trust_extension_Type, object->info, object->info); } return py_info; } static int py_netr_trust_extension_container_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } if (value == Py_None) { object->info = NULL; } else { object->info = NULL; PY_CHECK_TYPE(&netr_trust_extension_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = (struct netr_trust_extension *)pytalloc_get_ptr(value); } return 0; } static PyGetSetDef py_netr_trust_extension_container_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_netr_trust_extension_container_get_length, .set = py_netr_trust_extension_container_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "size"), .get = py_netr_trust_extension_container_get_size, .set = py_netr_trust_extension_container_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "info"), .get = py_netr_trust_extension_container_get_info, .set = py_netr_trust_extension_container_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_trust_extension") }, { .name = NULL } }; static PyObject *py_netr_trust_extension_container_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_trust_extension_container, type); } static PyTypeObject netr_trust_extension_container_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_trust_extension_container", .tp_getset = py_netr_trust_extension_container_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_trust_extension_container_new, }; static PyObject *py_netr_OneDomainInfo_get_domainname(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_domainname; py_domainname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->domainname); return py_domainname; } static int py_netr_OneDomainInfo_set_domainname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domainname"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->domainname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_dns_domainname(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dns_domainname; py_dns_domainname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domainname); return py_dns_domainname; } static int py_netr_OneDomainInfo_set_dns_domainname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domainname"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dns_domainname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_dns_forestname(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dns_forestname; py_dns_forestname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_forestname); return py_dns_forestname; } static int py_netr_OneDomainInfo_set_dns_forestname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_forestname"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dns_forestname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_domain_guid(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_guid; py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid); return py_domain_guid; } static int py_netr_OneDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_guid"); return -1; } 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->domain_guid = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_domain_sid(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_sid; if (object->domain_sid == NULL) { Py_RETURN_NONE; } if (object->domain_sid == NULL) { py_domain_sid = Py_None; Py_INCREF(py_domain_sid); } else { py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid); } return py_domain_sid; } static int py_netr_OneDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid"); return -1; } if (value == Py_None) { object->domain_sid = NULL; } else { object->domain_sid = NULL; 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->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_OneDomainInfo_get_trust_extension(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_trust_extension; py_trust_extension = pytalloc_reference_ex(&netr_trust_extension_container_Type, pytalloc_get_mem_ctx(obj), &object->trust_extension); return py_trust_extension; } static int py_netr_OneDomainInfo_set_trust_extension(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_extension"); return -1; } PY_CHECK_TYPE(&netr_trust_extension_container_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->trust_extension = *(struct netr_trust_extension_container *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_string2(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_string2; py_dummy_string2 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string2); return py_dummy_string2; } static int py_netr_OneDomainInfo_set_dummy_string2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string2"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string2 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_string3(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_string3; py_dummy_string3 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string3); return py_dummy_string3; } static int py_netr_OneDomainInfo_set_dummy_string3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string3"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string3 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_string4(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_string4; py_dummy_string4 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string4); return py_dummy_string4; } static int py_netr_OneDomainInfo_set_dummy_string4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string4"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string4 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_long1(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_long1; py_dummy_long1 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long1); return py_dummy_long1; } static int py_netr_OneDomainInfo_set_dummy_long1(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long1)); 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->dummy_long1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_long2(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_long2; py_dummy_long2 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long2); return py_dummy_long2; } static int py_netr_OneDomainInfo_set_dummy_long2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long2)); 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->dummy_long2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_long3(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_long3; py_dummy_long3 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long3); return py_dummy_long3; } static int py_netr_OneDomainInfo_set_dummy_long3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long3)); 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->dummy_long3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_OneDomainInfo_get_dummy_long4(PyObject *obj, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_dummy_long4; py_dummy_long4 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long4); return py_dummy_long4; } static int py_netr_OneDomainInfo_set_dummy_long4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long4"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long4)); 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->dummy_long4 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_OneDomainInfo_getsetters[] = { { .name = discard_const_p(char, "domainname"), .get = py_netr_OneDomainInfo_get_domainname, .set = py_netr_OneDomainInfo_set_domainname, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dns_domainname"), .get = py_netr_OneDomainInfo_get_dns_domainname, .set = py_netr_OneDomainInfo_set_dns_domainname, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dns_forestname"), .get = py_netr_OneDomainInfo_get_dns_forestname, .set = py_netr_OneDomainInfo_set_dns_forestname, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "domain_guid"), .get = py_netr_OneDomainInfo_get_domain_guid, .set = py_netr_OneDomainInfo_set_domain_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "domain_sid"), .get = py_netr_OneDomainInfo_get_domain_sid, .set = py_netr_OneDomainInfo_set_domain_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "trust_extension"), .get = py_netr_OneDomainInfo_get_trust_extension, .set = py_netr_OneDomainInfo_set_trust_extension, .doc = discard_const_p(char, "PIDL-generated element of base type netr_trust_extension_container") }, { .name = discard_const_p(char, "dummy_string2"), .get = py_netr_OneDomainInfo_get_dummy_string2, .set = py_netr_OneDomainInfo_set_dummy_string2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dummy_string3"), .get = py_netr_OneDomainInfo_get_dummy_string3, .set = py_netr_OneDomainInfo_set_dummy_string3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dummy_string4"), .get = py_netr_OneDomainInfo_get_dummy_string4, .set = py_netr_OneDomainInfo_set_dummy_string4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dummy_long1"), .get = py_netr_OneDomainInfo_get_dummy_long1, .set = py_netr_OneDomainInfo_set_dummy_long1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dummy_long2"), .get = py_netr_OneDomainInfo_get_dummy_long2, .set = py_netr_OneDomainInfo_set_dummy_long2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dummy_long3"), .get = py_netr_OneDomainInfo_get_dummy_long3, .set = py_netr_OneDomainInfo_set_dummy_long3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dummy_long4"), .get = py_netr_OneDomainInfo_get_dummy_long4, .set = py_netr_OneDomainInfo_set_dummy_long4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_OneDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_OneDomainInfo, type); } static PyTypeObject netr_OneDomainInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_OneDomainInfo", .tp_getset = py_netr_OneDomainInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_OneDomainInfo_new, }; static PyObject *py_netr_DomainInformation_get_primary_domain(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_primary_domain; py_primary_domain = pytalloc_reference_ex(&netr_OneDomainInfo_Type, pytalloc_get_mem_ctx(obj), &object->primary_domain); return py_primary_domain; } static int py_netr_DomainInformation_set_primary_domain(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_domain"); return -1; } PY_CHECK_TYPE(&netr_OneDomainInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->primary_domain = *(struct netr_OneDomainInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DomainInformation_get_trusted_domain_count(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_trusted_domain_count; py_trusted_domain_count = PyLong_FromUnsignedLongLong((uint32_t)object->trusted_domain_count); return py_trusted_domain_count; } static int py_netr_DomainInformation_set_trusted_domain_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domain_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trusted_domain_count)); 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->trusted_domain_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainInformation_get_trusted_domains(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_trusted_domains; if (object->trusted_domains == NULL) { Py_RETURN_NONE; } if (object->trusted_domains == NULL) { py_trusted_domains = Py_None; Py_INCREF(py_trusted_domains); } else { py_trusted_domains = PyList_New(object->trusted_domain_count); if (py_trusted_domains == NULL) { return NULL; } { int trusted_domains_cntr_1; for (trusted_domains_cntr_1 = 0; trusted_domains_cntr_1 < (object->trusted_domain_count); trusted_domains_cntr_1++) { PyObject *py_trusted_domains_1; py_trusted_domains_1 = pytalloc_reference_ex(&netr_OneDomainInfo_Type, object->trusted_domains, &object->trusted_domains[trusted_domains_cntr_1]); PyList_SetItem(py_trusted_domains, trusted_domains_cntr_1, py_trusted_domains_1); } } } return py_trusted_domains; } static int py_netr_DomainInformation_set_trusted_domains(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->trusted_domains)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domains"); return -1; } if (value == Py_None) { object->trusted_domains = NULL; } else { object->trusted_domains = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int trusted_domains_cntr_1; object->trusted_domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->trusted_domains, PyList_GET_SIZE(value)); if (!object->trusted_domains) { return -1;; } talloc_set_name_const(object->trusted_domains, "ARRAY: object->trusted_domains"); for (trusted_domains_cntr_1 = 0; trusted_domains_cntr_1 < PyList_GET_SIZE(value); trusted_domains_cntr_1++) { if (PyList_GET_ITEM(value, trusted_domains_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domains[trusted_domains_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_OneDomainInfo_Type, PyList_GET_ITEM(value, trusted_domains_cntr_1), return -1;); if (talloc_reference(object->trusted_domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, trusted_domains_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->trusted_domains[trusted_domains_cntr_1] = *(struct netr_OneDomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, trusted_domains_cntr_1)); } } } return 0; } static PyObject *py_netr_DomainInformation_get_lsa_policy(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_lsa_policy; py_lsa_policy = pytalloc_reference_ex(&netr_LsaPolicyInformation_Type, pytalloc_get_mem_ctx(obj), &object->lsa_policy); return py_lsa_policy; } static int py_netr_DomainInformation_set_lsa_policy(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lsa_policy"); return -1; } PY_CHECK_TYPE(&netr_LsaPolicyInformation_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lsa_policy = *(struct netr_LsaPolicyInformation *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DomainInformation_get_dns_hostname(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_dns_hostname; py_dns_hostname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_hostname); return py_dns_hostname; } static int py_netr_DomainInformation_set_dns_hostname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_hostname"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dns_hostname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DomainInformation_get_dummy_string2(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_string2; py_dummy_string2 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string2); return py_dummy_string2; } static int py_netr_DomainInformation_set_dummy_string2(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string2"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string2 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DomainInformation_get_dummy_string3(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_string3; py_dummy_string3 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string3); return py_dummy_string3; } static int py_netr_DomainInformation_set_dummy_string3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string3"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string3 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DomainInformation_get_dummy_string4(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_string4; py_dummy_string4 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string4); return py_dummy_string4; } static int py_netr_DomainInformation_set_dummy_string4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string4"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->dummy_string4 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DomainInformation_get_workstation_flags(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_workstation_flags; py_workstation_flags = PyLong_FromUnsignedLongLong((uint32_t)object->workstation_flags); return py_workstation_flags; } static int py_netr_DomainInformation_set_workstation_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstation_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->workstation_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->workstation_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainInformation_get_supported_enc_types(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_supported_enc_types; py_supported_enc_types = PyLong_FromUnsignedLongLong((uint32_t)object->supported_enc_types); return py_supported_enc_types; } static int py_netr_DomainInformation_set_supported_enc_types(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->supported_enc_types"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->supported_enc_types)); 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->supported_enc_types = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainInformation_get_dummy_long3(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_long3; py_dummy_long3 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long3); return py_dummy_long3; } static int py_netr_DomainInformation_set_dummy_long3(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long3)); 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->dummy_long3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainInformation_get_dummy_long4(PyObject *obj, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj); PyObject *py_dummy_long4; py_dummy_long4 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long4); return py_dummy_long4; } static int py_netr_DomainInformation_set_dummy_long4(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long4"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long4)); 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->dummy_long4 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DomainInformation_getsetters[] = { { .name = discard_const_p(char, "primary_domain"), .get = py_netr_DomainInformation_get_primary_domain, .set = py_netr_DomainInformation_set_primary_domain, .doc = discard_const_p(char, "PIDL-generated element of base type netr_OneDomainInfo") }, { .name = discard_const_p(char, "trusted_domain_count"), .get = py_netr_DomainInformation_get_trusted_domain_count, .set = py_netr_DomainInformation_set_trusted_domain_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "trusted_domains"), .get = py_netr_DomainInformation_get_trusted_domains, .set = py_netr_DomainInformation_set_trusted_domains, .doc = discard_const_p(char, "PIDL-generated element of base type netr_OneDomainInfo") }, { .name = discard_const_p(char, "lsa_policy"), .get = py_netr_DomainInformation_get_lsa_policy, .set = py_netr_DomainInformation_set_lsa_policy, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LsaPolicyInformation") }, { .name = discard_const_p(char, "dns_hostname"), .get = py_netr_DomainInformation_get_dns_hostname, .set = py_netr_DomainInformation_set_dns_hostname, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dummy_string2"), .get = py_netr_DomainInformation_get_dummy_string2, .set = py_netr_DomainInformation_set_dummy_string2, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dummy_string3"), .get = py_netr_DomainInformation_get_dummy_string3, .set = py_netr_DomainInformation_set_dummy_string3, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "dummy_string4"), .get = py_netr_DomainInformation_get_dummy_string4, .set = py_netr_DomainInformation_set_dummy_string4, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "workstation_flags"), .get = py_netr_DomainInformation_get_workstation_flags, .set = py_netr_DomainInformation_set_workstation_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_WorkstationFlags") }, { .name = discard_const_p(char, "supported_enc_types"), .get = py_netr_DomainInformation_get_supported_enc_types, .set = py_netr_DomainInformation_set_supported_enc_types, .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes") }, { .name = discard_const_p(char, "dummy_long3"), .get = py_netr_DomainInformation_get_dummy_long3, .set = py_netr_DomainInformation_set_dummy_long3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dummy_long4"), .get = py_netr_DomainInformation_get_dummy_long4, .set = py_netr_DomainInformation_set_dummy_long4, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DomainInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DomainInformation, type); } static PyTypeObject netr_DomainInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DomainInformation", .tp_getset = py_netr_DomainInformation_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DomainInformation_new, }; static PyObject *py_import_netr_DomainInfo(TALLOC_CTX *mem_ctx, int level, union netr_DomainInfo *in) { PyObject *ret; switch (level) { case 1: if (in->domain_info == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_DomainInformation_Type, in->domain_info, in->domain_info); } return ret; case 2: if (in->lsa_policy_info == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&netr_LsaPolicyInformation_Type, in->lsa_policy_info, in->lsa_policy_info); } return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_DomainInfo *py_export_netr_DomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_DomainInfo *ret = talloc_zero(mem_ctx, union netr_DomainInfo); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain_info"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->domain_info = NULL; } else { ret->domain_info = NULL; PY_CHECK_TYPE(&netr_DomainInformation_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->domain_info = (struct netr_DomainInformation *)pytalloc_get_ptr(in); } break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->lsa_policy_info"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->lsa_policy_info = NULL; } else { ret->lsa_policy_info = NULL; PY_CHECK_TYPE(&netr_LsaPolicyInformation_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->lsa_policy_info = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(in); } break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_netr_DomainInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_DomainInfo *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_DomainInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_DomainInfo!"); return NULL; } return py_import_netr_DomainInfo(mem_ctx, level, in); } static PyObject *py_netr_DomainInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_DomainInfo *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_DomainInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_DomainInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DomainInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DomainInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_DomainInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DomainInfo", .tp_getset = NULL, .tp_methods = py_netr_DomainInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DomainInfo_new, }; static PyObject *py_NL_PASSWORD_VERSION_get_ReservedField(PyObject *obj, void *closure) { struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(obj); PyObject *py_ReservedField; py_ReservedField = PyLong_FromUnsignedLongLong((uint32_t)object->ReservedField); return py_ReservedField; } static int py_NL_PASSWORD_VERSION_set_ReservedField(PyObject *py_obj, PyObject *value, void *closure) { struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ReservedField"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReservedField)); 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->ReservedField = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_PASSWORD_VERSION_get_PasswordVersionNumber(PyObject *obj, void *closure) { struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(obj); PyObject *py_PasswordVersionNumber; py_PasswordVersionNumber = PyLong_FromUnsignedLongLong((uint32_t)object->PasswordVersionNumber); return py_PasswordVersionNumber; } static int py_NL_PASSWORD_VERSION_set_PasswordVersionNumber(PyObject *py_obj, PyObject *value, void *closure) { struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PasswordVersionNumber"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PasswordVersionNumber)); 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->PasswordVersionNumber = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_PASSWORD_VERSION_get_PasswordVersionPresent(PyObject *obj, void *closure) { struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(obj); PyObject *py_PasswordVersionPresent; py_PasswordVersionPresent = PyLong_FromUnsignedLongLong((uint32_t)object->PasswordVersionPresent); return py_PasswordVersionPresent; } static int py_NL_PASSWORD_VERSION_set_PasswordVersionPresent(PyObject *py_obj, PyObject *value, void *closure) { struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PasswordVersionPresent"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PasswordVersionPresent)); 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->PasswordVersionPresent = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_NL_PASSWORD_VERSION_getsetters[] = { { .name = discard_const_p(char, "ReservedField"), .get = py_NL_PASSWORD_VERSION_get_ReservedField, .set = py_NL_PASSWORD_VERSION_set_ReservedField, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "PasswordVersionNumber"), .get = py_NL_PASSWORD_VERSION_get_PasswordVersionNumber, .set = py_NL_PASSWORD_VERSION_set_PasswordVersionNumber, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "PasswordVersionPresent"), .get = py_NL_PASSWORD_VERSION_get_PasswordVersionPresent, .set = py_NL_PASSWORD_VERSION_set_PasswordVersionPresent, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_NL_PASSWORD_VERSION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct NL_PASSWORD_VERSION, type); } static PyTypeObject NL_PASSWORD_VERSION_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.NL_PASSWORD_VERSION", .tp_getset = py_NL_PASSWORD_VERSION_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_NL_PASSWORD_VERSION_new, }; static PyObject *py_netr_CryptPassword_get_data(PyObject *obj, void *closure) { struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(obj); PyObject *py_data; py_data = PyList_New(512); if (py_data == NULL) { return NULL; } { int data_cntr_0; for (data_cntr_0 = 0; data_cntr_0 < (512); data_cntr_0++) { PyObject *py_data_0; py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]); PyList_SetItem(py_data, data_cntr_0, py_data_0); } } return py_data; } static int py_netr_CryptPassword_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_0; if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value)); return -1; } for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) { if (PyList_GET_ITEM(value, data_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_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->data[data_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_netr_CryptPassword_get_length(PyObject *obj, void *closure) { struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_netr_CryptPassword_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_CryptPassword_getsetters[] = { { .name = discard_const_p(char, "data"), .get = py_netr_CryptPassword_get_data, .set = py_netr_CryptPassword_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "length"), .get = py_netr_CryptPassword_get_length, .set = py_netr_CryptPassword_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_CryptPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_CryptPassword, type); } static PyTypeObject netr_CryptPassword_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_CryptPassword", .tp_getset = py_netr_CryptPassword_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_CryptPassword_new, }; static PyObject *py_netr_SendToSamResetBadPasswordCount_get_guid(PyObject *obj, void *closure) { struct netr_SendToSamResetBadPasswordCount *object = (struct netr_SendToSamResetBadPasswordCount *)pytalloc_get_ptr(obj); PyObject *py_guid; py_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->guid); return py_guid; } static int py_netr_SendToSamResetBadPasswordCount_set_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SendToSamResetBadPasswordCount *object = (struct netr_SendToSamResetBadPasswordCount *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->guid"); return -1; } 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->guid = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_SendToSamResetBadPasswordCount_getsetters[] = { { .name = discard_const_p(char, "guid"), .get = py_netr_SendToSamResetBadPasswordCount_get_guid, .set = py_netr_SendToSamResetBadPasswordCount_set_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = NULL } }; static PyObject *py_netr_SendToSamResetBadPasswordCount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SendToSamResetBadPasswordCount, type); } static PyTypeObject netr_SendToSamResetBadPasswordCount_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SendToSamResetBadPasswordCount", .tp_getset = py_netr_SendToSamResetBadPasswordCount_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SendToSamResetBadPasswordCount_new, }; static PyObject *py_import_netr_SendToSamMessage(TALLOC_CTX *mem_ctx, int level, union netr_SendToSamMessage *in) { PyObject *ret; switch (level) { case SendToSamResetBadPasswordCount: ret = pytalloc_reference_ex(&netr_SendToSamResetBadPasswordCount_Type, mem_ctx, &in->reset_bad_password); return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union netr_SendToSamMessage *py_export_netr_SendToSamMessage(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union netr_SendToSamMessage *ret = talloc_zero(mem_ctx, union netr_SendToSamMessage); switch (level) { case SendToSamResetBadPasswordCount: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->reset_bad_password"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&netr_SendToSamResetBadPasswordCount_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->reset_bad_password = *(struct netr_SendToSamResetBadPasswordCount *)pytalloc_get_ptr(in); break; default: break; } return ret; } static PyObject *py_netr_SendToSamMessage_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union netr_SendToSamMessage *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union netr_SendToSamMessage *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_SendToSamMessage!"); return NULL; } return py_import_netr_SendToSamMessage(mem_ctx, level, in); } static PyObject *py_netr_SendToSamMessage_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union netr_SendToSamMessage *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_netr_SendToSamMessage(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_netr_SendToSamMessage_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SendToSamMessage_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SendToSamMessage_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_netr_SendToSamMessage_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject netr_SendToSamMessage_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SendToSamMessage", .tp_getset = NULL, .tp_methods = py_netr_SendToSamMessage_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SendToSamMessage_new, }; static PyObject *py_netr_SendToSamBase_get_message_type(PyObject *obj, void *closure) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(obj); PyObject *py_message_type; py_message_type = PyLong_FromLong((uint16_t)object->message_type); return py_message_type; } static int py_netr_SendToSamBase_set_message_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_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->message_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SendToSamBase_get_message_size(PyObject *obj, void *closure) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(obj); PyObject *py_message_size; py_message_size = PyLong_FromUnsignedLongLong((uint32_t)object->message_size); return py_message_size; } static int py_netr_SendToSamBase_set_message_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_size)); 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->message_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_SendToSamBase_get_message(PyObject *obj, void *closure) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(obj); PyObject *py_message; py_message = pyrpc_import_union(&netr_SendToSamMessage_Type, pytalloc_get_mem_ctx(obj), object->message_type, &object->message, "union netr_SendToSamMessage"); if (py_message == NULL) { return NULL; } return py_message; } static int py_netr_SendToSamBase_set_message(PyObject *py_obj, PyObject *value, void *closure) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message"); return -1; } { union netr_SendToSamMessage *message_switch_1; message_switch_1 = (union netr_SendToSamMessage *)pyrpc_export_union(&netr_SendToSamMessage_Type, pytalloc_get_mem_ctx(py_obj), object->message_type, value, "union netr_SendToSamMessage"); if (message_switch_1 == NULL) { return -1; } object->message = *message_switch_1; } return 0; } static PyGetSetDef py_netr_SendToSamBase_getsetters[] = { { .name = discard_const_p(char, "message_type"), .get = py_netr_SendToSamBase_get_message_type, .set = py_netr_SendToSamBase_set_message_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamType") }, { .name = discard_const_p(char, "message_size"), .get = py_netr_SendToSamBase_get_message_size, .set = py_netr_SendToSamBase_set_message_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "message"), .get = py_netr_SendToSamBase_get_message, .set = py_netr_SendToSamBase_set_message, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamMessage") }, { .name = NULL } }; static PyObject *py_netr_SendToSamBase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_SendToSamBase, type); } static PyObject *py_netr_SendToSamBase_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)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_netr_SendToSamBase); 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_netr_SendToSamBase_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)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_netr_SendToSamBase); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SendToSamBase); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_netr_SendToSamBase_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)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_netr_SendToSamBase, "netr_SendToSamBase", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_netr_SendToSamBase_methods[] = { { "__ndr_pack__", (PyCFunction)py_netr_SendToSamBase_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SendToSamBase_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_netr_SendToSamBase_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_SendToSamBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_SendToSamBase", .tp_getset = py_netr_SendToSamBase_getsetters, .tp_methods = py_netr_SendToSamBase_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_SendToSamBase_new, }; static PyObject *py_netr_DsRAddressToSitenamesWCtr_get_count(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_netr_DsRAddressToSitenamesWCtr_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesWCtr_get_sitename(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(obj); PyObject *py_sitename; if (object->sitename == NULL) { Py_RETURN_NONE; } if (object->sitename == NULL) { py_sitename = Py_None; Py_INCREF(py_sitename); } else { py_sitename = PyList_New(object->count); if (py_sitename == NULL) { return NULL; } { int sitename_cntr_1; for (sitename_cntr_1 = 0; sitename_cntr_1 < (object->count); sitename_cntr_1++) { PyObject *py_sitename_1; py_sitename_1 = pytalloc_reference_ex(lsa_String_Type, object->sitename, &object->sitename[sitename_cntr_1]); PyList_SetItem(py_sitename, sitename_cntr_1, py_sitename_1); } } } return py_sitename; } static int py_netr_DsRAddressToSitenamesWCtr_set_sitename(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sitename)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename"); return -1; } if (value == Py_None) { object->sitename = NULL; } else { object->sitename = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sitename_cntr_1; object->sitename = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sitename, PyList_GET_SIZE(value)); if (!object->sitename) { return -1;; } talloc_set_name_const(object->sitename, "ARRAY: object->sitename"); for (sitename_cntr_1 = 0; sitename_cntr_1 < PyList_GET_SIZE(value); sitename_cntr_1++) { if (PyList_GET_ITEM(value, sitename_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename[sitename_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, sitename_cntr_1), return -1;); if (talloc_reference(object->sitename, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sitename_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->sitename[sitename_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, sitename_cntr_1)); } } } return 0; } static PyGetSetDef py_netr_DsRAddressToSitenamesWCtr_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_netr_DsRAddressToSitenamesWCtr_get_count, .set = py_netr_DsRAddressToSitenamesWCtr_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sitename"), .get = py_netr_DsRAddressToSitenamesWCtr_get_sitename, .set = py_netr_DsRAddressToSitenamesWCtr_set_sitename, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_netr_DsRAddressToSitenamesWCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DsRAddressToSitenamesWCtr, type); } static PyTypeObject netr_DsRAddressToSitenamesWCtr_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRAddressToSitenamesWCtr", .tp_getset = py_netr_DsRAddressToSitenamesWCtr_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRAddressToSitenamesWCtr_new, }; static PyObject *py_netr_DsRAddress_get_buffer(PyObject *obj, void *closure) { struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(obj); PyObject *py_buffer; if (object->buffer == NULL) { Py_RETURN_NONE; } if (object->buffer == NULL) { py_buffer = Py_None; Py_INCREF(py_buffer); } else { py_buffer = PyList_New(object->size); if (py_buffer == NULL) { return NULL; } { int buffer_cntr_1; for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->size); buffer_cntr_1++) { PyObject *py_buffer_1; py_buffer_1 = PyLong_FromLong((uint16_t)object->buffer[buffer_cntr_1]); PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1); } } } return py_buffer; } static int py_netr_DsRAddress_set_buffer(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buffer)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer"); return -1; } if (value == Py_None) { object->buffer = NULL; } else { object->buffer = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int buffer_cntr_1; object->buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffer, PyList_GET_SIZE(value)); if (!object->buffer) { return -1;; } talloc_set_name_const(object->buffer, "ARRAY: object->buffer"); for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) { if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer[buffer_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buffer[buffer_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1)); 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->buffer[buffer_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_DsRAddress_get_size(PyObject *obj, void *closure) { struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(obj); PyObject *py_size; py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size); return py_size; } static int py_netr_DsRAddress_set_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size)); 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->size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_netr_DsRAddress_getsetters[] = { { .name = discard_const_p(char, "buffer"), .get = py_netr_DsRAddress_get_buffer, .set = py_netr_DsRAddress_set_buffer, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "size"), .get = py_netr_DsRAddress_get_size, .set = py_netr_DsRAddress_set_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_netr_DsRAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DsRAddress, type); } static PyTypeObject netr_DsRAddress_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRAddress", .tp_getset = py_netr_DsRAddress_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRAddress_new, }; static PyObject *py_netr_DomainTrust_get_netbios_name(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_netbios_name; if (object->netbios_name == NULL) { Py_RETURN_NONE; } if (object->netbios_name == NULL) { py_netbios_name = Py_None; Py_INCREF(py_netbios_name); } else { if (object->netbios_name == NULL) { py_netbios_name = Py_None; Py_INCREF(py_netbios_name); } else { py_netbios_name = PyUnicode_Decode(object->netbios_name, strlen(object->netbios_name), "utf-8", "ignore"); } } return py_netbios_name; } static int py_netr_DomainTrust_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name"); return -1; } if (value == Py_None) { object->netbios_name = NULL; } else { object->netbios_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->netbios_name = talloc_str; } } return 0; } static PyObject *py_netr_DomainTrust_get_dns_name(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_dns_name; if (object->dns_name == NULL) { Py_RETURN_NONE; } if (object->dns_name == NULL) { py_dns_name = Py_None; Py_INCREF(py_dns_name); } else { if (object->dns_name == NULL) { py_dns_name = Py_None; Py_INCREF(py_dns_name); } else { py_dns_name = PyUnicode_Decode(object->dns_name, strlen(object->dns_name), "utf-8", "ignore"); } } return py_dns_name; } static int py_netr_DomainTrust_set_dns_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_name"); return -1; } if (value == Py_None) { object->dns_name = NULL; } else { object->dns_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->dns_name = talloc_str; } } return 0; } static PyObject *py_netr_DomainTrust_get_trust_flags(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_trust_flags; py_trust_flags = PyLong_FromUnsignedLongLong((uint32_t)object->trust_flags); return py_trust_flags; } static int py_netr_DomainTrust_set_trust_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_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->trust_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainTrust_get_parent_index(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_parent_index; py_parent_index = PyLong_FromUnsignedLongLong((uint32_t)object->parent_index); return py_parent_index; } static int py_netr_DomainTrust_set_parent_index(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parent_index"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->parent_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->parent_index = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainTrust_get_trust_type(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_trust_type; py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)object->trust_type); return py_trust_type; } static int py_netr_DomainTrust_set_trust_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_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->trust_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainTrust_get_trust_attributes(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_trust_attributes; py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes); return py_trust_attributes; } static int py_netr_DomainTrust_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes)); 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->trust_attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainTrust_get_sid(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->sid == NULL) { Py_RETURN_NONE; } if (object->sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid); } return py_sid; } static int py_netr_DomainTrust_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid"); return -1; } if (value == Py_None) { object->sid = NULL; } else { object->sid = NULL; 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_netr_DomainTrust_get_guid(PyObject *obj, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj); PyObject *py_guid; py_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->guid); return py_guid; } static int py_netr_DomainTrust_set_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->guid"); return -1; } 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->guid = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_netr_DomainTrust_getsetters[] = { { .name = discard_const_p(char, "netbios_name"), .get = py_netr_DomainTrust_get_netbios_name, .set = py_netr_DomainTrust_set_netbios_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dns_name"), .get = py_netr_DomainTrust_get_dns_name, .set = py_netr_DomainTrust_set_dns_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "trust_flags"), .get = py_netr_DomainTrust_get_trust_flags, .set = py_netr_DomainTrust_set_trust_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustFlags") }, { .name = discard_const_p(char, "parent_index"), .get = py_netr_DomainTrust_get_parent_index, .set = py_netr_DomainTrust_set_parent_index, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "trust_type"), .get = py_netr_DomainTrust_get_trust_type, .set = py_netr_DomainTrust_set_trust_type, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType") }, { .name = discard_const_p(char, "trust_attributes"), .get = py_netr_DomainTrust_get_trust_attributes, .set = py_netr_DomainTrust_set_trust_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes") }, { .name = discard_const_p(char, "sid"), .get = py_netr_DomainTrust_get_sid, .set = py_netr_DomainTrust_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "guid"), .get = py_netr_DomainTrust_get_guid, .set = py_netr_DomainTrust_set_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = NULL } }; static PyObject *py_netr_DomainTrust_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DomainTrust, type); } static PyTypeObject netr_DomainTrust_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DomainTrust", .tp_getset = py_netr_DomainTrust_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DomainTrust_new, }; static PyObject *py_netr_DomainTrustList_get_count(PyObject *obj, void *closure) { struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_netr_DomainTrustList_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DomainTrustList_get_array(PyObject *obj, void *closure) { struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(obj); PyObject *py_array; if (object->array == NULL) { Py_RETURN_NONE; } if (object->array == NULL) { py_array = Py_None; Py_INCREF(py_array); } else { py_array = PyList_New(object->count); if (py_array == NULL) { return NULL; } { int array_cntr_1; for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&netr_DomainTrust_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); } } } return py_array; } static int py_netr_DomainTrustList_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array"); return -1; } if (value == Py_None) { object->array = NULL; } else { object->array = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int array_cntr_1; object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value)); if (!object->array) { return -1;; } talloc_set_name_const(object->array, "ARRAY: object->array"); for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) { if (PyList_GET_ITEM(value, array_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_DomainTrust_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;); if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->array[array_cntr_1] = *(struct netr_DomainTrust *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1)); } } } return 0; } static PyGetSetDef py_netr_DomainTrustList_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_netr_DomainTrustList_get_count, .set = py_netr_DomainTrustList_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "array"), .get = py_netr_DomainTrustList_get_array, .set = py_netr_DomainTrustList_set_array, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrust") }, { .name = NULL } }; static PyObject *py_netr_DomainTrustList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DomainTrustList, type); } static PyTypeObject netr_DomainTrustList_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DomainTrustList", .tp_getset = py_netr_DomainTrustList_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DomainTrustList_new, }; static PyObject *py_netr_DsRAddressToSitenamesExWCtr_get_count(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_netr_DsRAddressToSitenamesExWCtr_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesExWCtr_get_sitename(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(obj); PyObject *py_sitename; if (object->sitename == NULL) { Py_RETURN_NONE; } if (object->sitename == NULL) { py_sitename = Py_None; Py_INCREF(py_sitename); } else { py_sitename = PyList_New(object->count); if (py_sitename == NULL) { return NULL; } { int sitename_cntr_1; for (sitename_cntr_1 = 0; sitename_cntr_1 < (object->count); sitename_cntr_1++) { PyObject *py_sitename_1; py_sitename_1 = pytalloc_reference_ex(lsa_String_Type, object->sitename, &object->sitename[sitename_cntr_1]); PyList_SetItem(py_sitename, sitename_cntr_1, py_sitename_1); } } } return py_sitename; } static int py_netr_DsRAddressToSitenamesExWCtr_set_sitename(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sitename)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename"); return -1; } if (value == Py_None) { object->sitename = NULL; } else { object->sitename = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sitename_cntr_1; object->sitename = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sitename, PyList_GET_SIZE(value)); if (!object->sitename) { return -1;; } talloc_set_name_const(object->sitename, "ARRAY: object->sitename"); for (sitename_cntr_1 = 0; sitename_cntr_1 < PyList_GET_SIZE(value); sitename_cntr_1++) { if (PyList_GET_ITEM(value, sitename_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename[sitename_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, sitename_cntr_1), return -1;); if (talloc_reference(object->sitename, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sitename_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->sitename[sitename_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, sitename_cntr_1)); } } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesExWCtr_get_subnetname(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(obj); PyObject *py_subnetname; if (object->subnetname == NULL) { Py_RETURN_NONE; } if (object->subnetname == NULL) { py_subnetname = Py_None; Py_INCREF(py_subnetname); } else { py_subnetname = PyList_New(object->count); if (py_subnetname == NULL) { return NULL; } { int subnetname_cntr_1; for (subnetname_cntr_1 = 0; subnetname_cntr_1 < (object->count); subnetname_cntr_1++) { PyObject *py_subnetname_1; py_subnetname_1 = pytalloc_reference_ex(lsa_String_Type, object->subnetname, &object->subnetname[subnetname_cntr_1]); PyList_SetItem(py_subnetname, subnetname_cntr_1, py_subnetname_1); } } } return py_subnetname; } static int py_netr_DsRAddressToSitenamesExWCtr_set_subnetname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->subnetname)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->subnetname"); return -1; } if (value == Py_None) { object->subnetname = NULL; } else { object->subnetname = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int subnetname_cntr_1; object->subnetname = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->subnetname, PyList_GET_SIZE(value)); if (!object->subnetname) { return -1;; } talloc_set_name_const(object->subnetname, "ARRAY: object->subnetname"); for (subnetname_cntr_1 = 0; subnetname_cntr_1 < PyList_GET_SIZE(value); subnetname_cntr_1++) { if (PyList_GET_ITEM(value, subnetname_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->subnetname[subnetname_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, subnetname_cntr_1), return -1;); if (talloc_reference(object->subnetname, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, subnetname_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->subnetname[subnetname_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, subnetname_cntr_1)); } } } return 0; } static PyGetSetDef py_netr_DsRAddressToSitenamesExWCtr_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_netr_DsRAddressToSitenamesExWCtr_get_count, .set = py_netr_DsRAddressToSitenamesExWCtr_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sitename"), .get = py_netr_DsRAddressToSitenamesExWCtr_get_sitename, .set = py_netr_DsRAddressToSitenamesExWCtr_set_sitename, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "subnetname"), .get = py_netr_DsRAddressToSitenamesExWCtr_get_subnetname, .set = py_netr_DsRAddressToSitenamesExWCtr_set_subnetname, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_netr_DsRAddressToSitenamesExWCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_DsRAddressToSitenamesExWCtr, type); } static PyTypeObject netr_DsRAddressToSitenamesExWCtr_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRAddressToSitenamesExWCtr", .tp_getset = py_netr_DsRAddressToSitenamesExWCtr_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRAddressToSitenamesExWCtr_new, }; static PyObject *py_DcSitesCtr_get_num_sites(PyObject *obj, void *closure) { struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(obj); PyObject *py_num_sites; py_num_sites = PyLong_FromUnsignedLongLong((uint32_t)object->num_sites); return py_num_sites; } static int py_DcSitesCtr_set_num_sites(PyObject *py_obj, PyObject *value, void *closure) { struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sites"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sites)); 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_sites = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_DcSitesCtr_get_sites(PyObject *obj, void *closure) { struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(obj); PyObject *py_sites; if (object->sites == NULL) { Py_RETURN_NONE; } if (object->sites == NULL) { py_sites = Py_None; Py_INCREF(py_sites); } else { py_sites = PyList_New(object->num_sites); if (py_sites == NULL) { return NULL; } { int sites_cntr_1; for (sites_cntr_1 = 0; sites_cntr_1 < (object->num_sites); sites_cntr_1++) { PyObject *py_sites_1; py_sites_1 = pytalloc_reference_ex(lsa_String_Type, object->sites, &object->sites[sites_cntr_1]); PyList_SetItem(py_sites, sites_cntr_1, py_sites_1); } } } return py_sites; } static int py_DcSitesCtr_set_sites(PyObject *py_obj, PyObject *value, void *closure) { struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sites)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sites"); return -1; } if (value == Py_None) { object->sites = NULL; } else { object->sites = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int sites_cntr_1; object->sites = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sites, PyList_GET_SIZE(value)); if (!object->sites) { return -1;; } talloc_set_name_const(object->sites, "ARRAY: object->sites"); for (sites_cntr_1 = 0; sites_cntr_1 < PyList_GET_SIZE(value); sites_cntr_1++) { if (PyList_GET_ITEM(value, sites_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sites[sites_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, sites_cntr_1), return -1;); if (talloc_reference(object->sites, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sites_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->sites[sites_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, sites_cntr_1)); } } } return 0; } static PyGetSetDef py_DcSitesCtr_getsetters[] = { { .name = discard_const_p(char, "num_sites"), .get = py_DcSitesCtr_get_num_sites, .set = py_DcSitesCtr_set_num_sites, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "sites"), .get = py_DcSitesCtr_get_sites, .set = py_DcSitesCtr_set_sites, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_DcSitesCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct DcSitesCtr, type); } static PyTypeObject DcSitesCtr_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.DcSitesCtr", .tp_getset = py_DcSitesCtr_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_DcSitesCtr_new, }; static PyObject *py_netr_TrustInfo_get_count(PyObject *obj, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_netr_TrustInfo_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_TrustInfo_get_data(PyObject *obj, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->data == NULL) { Py_RETURN_NONE; } if (object->data == NULL) { py_data = Py_None; Py_INCREF(py_data); } else { py_data = PyList_New(object->count); if (py_data == NULL) { return NULL; } { int data_cntr_1; for (data_cntr_1 = 0; data_cntr_1 < (object->count); data_cntr_1++) { PyObject *py_data_1; py_data_1 = PyLong_FromUnsignedLongLong((uint32_t)object->data[data_cntr_1]); PyList_SetItem(py_data, data_cntr_1, py_data_1); } } } return py_data; } static int py_netr_TrustInfo_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } if (value == Py_None) { object->data = NULL; } else { object->data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_1; object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value)); if (!object->data) { return -1;; } talloc_set_name_const(object->data, "ARRAY: object->data"); for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) { if (PyList_GET_ITEM(value, data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1)); 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->data[data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_netr_TrustInfo_get_entry_count(PyObject *obj, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj); PyObject *py_entry_count; py_entry_count = PyLong_FromUnsignedLongLong((uint32_t)object->entry_count); return py_entry_count; } static int py_netr_TrustInfo_set_entry_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entry_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entry_count)); 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->entry_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_TrustInfo_get_entries(PyObject *obj, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj); PyObject *py_entries; if (object->entries == NULL) { Py_RETURN_NONE; } if (object->entries == NULL) { py_entries = Py_None; Py_INCREF(py_entries); } else { py_entries = PyList_New(object->count); if (py_entries == NULL) { return NULL; } { int entries_cntr_1; for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) { PyObject *py_entries_1; py_entries_1 = pytalloc_reference_ex(lsa_String_Type, object->entries, &object->entries[entries_cntr_1]); PyList_SetItem(py_entries, entries_cntr_1, py_entries_1); } } } return py_entries; } static int py_netr_TrustInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure) { struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries"); return -1; } if (value == Py_None) { object->entries = NULL; } else { object->entries = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int entries_cntr_1; object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value)); if (!object->entries) { return -1;; } talloc_set_name_const(object->entries, "ARRAY: object->entries"); for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) { if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;); if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->entries[entries_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1)); } } } return 0; } static PyGetSetDef py_netr_TrustInfo_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_netr_TrustInfo_get_count, .set = py_netr_TrustInfo_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "data"), .get = py_netr_TrustInfo_get_data, .set = py_netr_TrustInfo_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entry_count"), .get = py_netr_TrustInfo_get_entry_count, .set = py_netr_TrustInfo_set_entry_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entries"), .get = py_netr_TrustInfo_get_entries, .set = py_netr_TrustInfo_set_entries, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_netr_TrustInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct netr_TrustInfo, type); } static PyTypeObject netr_TrustInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_TrustInfo", .tp_getset = py_netr_TrustInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_TrustInfo_new, }; static PyObject *py_NL_DNS_NAME_INFO_get_type(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_type; py_type = PyLong_FromLong((uint16_t)object->type); return py_type; } static int py_NL_DNS_NAME_INFO_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)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_NL_DNS_NAME_INFO_get_dns_domain_info(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_dns_domain_info; if (object->dns_domain_info == NULL) { Py_RETURN_NONE; } if (object->dns_domain_info == NULL) { py_dns_domain_info = Py_None; Py_INCREF(py_dns_domain_info); } else { if (object->dns_domain_info == NULL) { py_dns_domain_info = Py_None; Py_INCREF(py_dns_domain_info); } else { py_dns_domain_info = PyUnicode_Decode(object->dns_domain_info, strlen(object->dns_domain_info), "utf-8", "ignore"); } } return py_dns_domain_info; } static int py_NL_DNS_NAME_INFO_set_dns_domain_info(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_info"); return -1; } if (value == Py_None) { object->dns_domain_info = NULL; } else { object->dns_domain_info = 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->dns_domain_info = talloc_str; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_get_dns_domain_info_type(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_dns_domain_info_type; py_dns_domain_info_type = PyLong_FromLong((uint16_t)object->dns_domain_info_type); return py_dns_domain_info_type; } static int py_NL_DNS_NAME_INFO_set_dns_domain_info_type(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_info_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dns_domain_info_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->dns_domain_info_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_get_priority(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_priority; py_priority = PyLong_FromUnsignedLongLong((uint32_t)object->priority); return py_priority; } static int py_NL_DNS_NAME_INFO_set_priority(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priority"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority)); 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->priority = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_get_weight(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_weight; py_weight = PyLong_FromUnsignedLongLong((uint32_t)object->weight); return py_weight; } static int py_NL_DNS_NAME_INFO_set_weight(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->weight"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->weight)); 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->weight = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_get_port(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_port; py_port = PyLong_FromUnsignedLongLong((uint32_t)object->port); return py_port; } static int py_NL_DNS_NAME_INFO_set_port(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port)); 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->port = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_get_dns_register(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_dns_register; py_dns_register = PyLong_FromUnsignedLongLong((uint32_t)object->dns_register); return py_dns_register; } static int py_NL_DNS_NAME_INFO_set_dns_register(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_register"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dns_register)); 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->dns_register = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_get_status(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj); PyObject *py_status; py_status = PyLong_FromUnsignedLongLong((uint32_t)object->status); return py_status; } static int py_NL_DNS_NAME_INFO_set_status(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status)); 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->status = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_NL_DNS_NAME_INFO_getsetters[] = { { .name = discard_const_p(char, "type"), .get = py_NL_DNS_NAME_INFO_get_type, .set = py_NL_DNS_NAME_INFO_set_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DnsType") }, { .name = discard_const_p(char, "dns_domain_info"), .get = py_NL_DNS_NAME_INFO_get_dns_domain_info, .set = py_NL_DNS_NAME_INFO_set_dns_domain_info, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "dns_domain_info_type"), .get = py_NL_DNS_NAME_INFO_get_dns_domain_info_type, .set = py_NL_DNS_NAME_INFO_set_dns_domain_info_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DnsDomainInfoType") }, { .name = discard_const_p(char, "priority"), .get = py_NL_DNS_NAME_INFO_get_priority, .set = py_NL_DNS_NAME_INFO_set_priority, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "weight"), .get = py_NL_DNS_NAME_INFO_get_weight, .set = py_NL_DNS_NAME_INFO_set_weight, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "port"), .get = py_NL_DNS_NAME_INFO_get_port, .set = py_NL_DNS_NAME_INFO_set_port, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "dns_register"), .get = py_NL_DNS_NAME_INFO_get_dns_register, .set = py_NL_DNS_NAME_INFO_set_dns_register, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "status"), .get = py_NL_DNS_NAME_INFO_get_status, .set = py_NL_DNS_NAME_INFO_set_status, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_NL_DNS_NAME_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct NL_DNS_NAME_INFO, type); } static PyTypeObject NL_DNS_NAME_INFO_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.NL_DNS_NAME_INFO", .tp_getset = py_NL_DNS_NAME_INFO_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_NL_DNS_NAME_INFO_new, }; static PyObject *py_NL_DNS_NAME_INFO_ARRAY_get_count(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_NL_DNS_NAME_INFO_ARRAY_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_NL_DNS_NAME_INFO_ARRAY_get_names(PyObject *obj, void *closure) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(obj); PyObject *py_names; if (object->names == NULL) { Py_RETURN_NONE; } if (object->names == NULL) { py_names = Py_None; Py_INCREF(py_names); } else { py_names = PyList_New(object->count); if (py_names == NULL) { return NULL; } { int names_cntr_1; for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) { PyObject *py_names_1; py_names_1 = pytalloc_reference_ex(&NL_DNS_NAME_INFO_Type, object->names, &object->names[names_cntr_1]); PyList_SetItem(py_names, names_cntr_1, py_names_1); } } } return py_names; } static int py_NL_DNS_NAME_INFO_ARRAY_set_names(PyObject *py_obj, PyObject *value, void *closure) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names"); return -1; } if (value == Py_None) { object->names = NULL; } else { object->names = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int names_cntr_1; object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value)); if (!object->names) { return -1;; } talloc_set_name_const(object->names, "ARRAY: object->names"); for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) { if (PyList_GET_ITEM(value, names_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]"); return -1; } PY_CHECK_TYPE(&NL_DNS_NAME_INFO_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;); if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->names[names_cntr_1] = *(struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1)); } } } return 0; } static PyGetSetDef py_NL_DNS_NAME_INFO_ARRAY_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_NL_DNS_NAME_INFO_ARRAY_get_count, .set = py_NL_DNS_NAME_INFO_ARRAY_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "names"), .get = py_NL_DNS_NAME_INFO_ARRAY_get_names, .set = py_NL_DNS_NAME_INFO_ARRAY_set_names, .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO") }, { .name = NULL } }; static PyObject *py_NL_DNS_NAME_INFO_ARRAY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct NL_DNS_NAME_INFO_ARRAY, type); } static PyObject *py_NL_DNS_NAME_INFO_ARRAY_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)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_NL_DNS_NAME_INFO_ARRAY); 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_NL_DNS_NAME_INFO_ARRAY_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)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_NL_DNS_NAME_INFO_ARRAY); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NL_DNS_NAME_INFO_ARRAY); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_NL_DNS_NAME_INFO_ARRAY_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)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_NL_DNS_NAME_INFO_ARRAY, "NL_DNS_NAME_INFO_ARRAY", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_NL_DNS_NAME_INFO_ARRAY_methods[] = { { "__ndr_pack__", (PyCFunction)py_NL_DNS_NAME_INFO_ARRAY_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NL_DNS_NAME_INFO_ARRAY_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_NL_DNS_NAME_INFO_ARRAY_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject NL_DNS_NAME_INFO_ARRAY_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.NL_DNS_NAME_INFO_ARRAY", .tp_getset = py_NL_DNS_NAME_INFO_ARRAY_getsetters, .tp_methods = py_NL_DNS_NAME_INFO_ARRAY_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_NL_DNS_NAME_INFO_ARRAY_new, }; static PyObject *py_netr_LogonUasLogon_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonUasLogon_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonUasLogon_in_get_account_name(PyObject *obj, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_LogonUasLogon_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_LogonUasLogon_in_get_workstation(PyObject *obj, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj); PyObject *py_workstation; if (object->in.workstation == NULL) { Py_RETURN_NONE; } if (object->in.workstation == NULL) { py_workstation = Py_None; Py_INCREF(py_workstation); } else { py_workstation = PyUnicode_Decode(object->in.workstation, strlen(object->in.workstation), "utf-8", "ignore"); } return py_workstation; } static int py_netr_LogonUasLogon_in_set_workstation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.workstation"); return -1; } object->in.workstation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.workstation); if (object->in.workstation == 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.workstation = talloc_str; } return 0; } static PyObject *py_netr_LogonUasLogon_out_get_info(PyObject *obj, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_UasInfo_Type, *object->out.info, *object->out.info); } return py_info; } static int py_netr_LogonUasLogon_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)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; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; PY_CHECK_TYPE(&netr_UasInfo_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 netr_UasInfo *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonUasLogon_get_result(PyObject *obj, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_LogonUasLogon_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)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_netr_LogonUasLogon_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonUasLogon_in_get_server_name, .set = py_netr_LogonUasLogon_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_LogonUasLogon_in_get_account_name, .set = py_netr_LogonUasLogon_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_workstation"), .get = py_netr_LogonUasLogon_in_get_workstation, .set = py_netr_LogonUasLogon_in_set_workstation, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_info"), .get = py_netr_LogonUasLogon_out_get_info, .set = py_netr_LogonUasLogon_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UasInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonUasLogon_get_result, .set = py_netr_LogonUasLogon_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_LogonUasLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonUasLogon, type); struct netr_LogonUasLogon *_self = (struct netr_LogonUasLogon *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, struct netr_UasInfo *); return self; } static PyObject *py_netr_LogonUasLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(0); } static PyObject *py_netr_LogonUasLogon_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogon_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonUasLogon_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_netr_LogonUasLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonUasLogon_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_netr_LogonUasLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonUasLogon_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 netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogon_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonUasLogon_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_netr_LogonUasLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonUasLogon_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_netr_LogonUasLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonUasLogon_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogon_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonUasLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonUasLogon_ndr_print(py_obj, "netr_LogonUasLogon_in", NDR_IN); } static PyObject *py_netr_LogonUasLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonUasLogon_ndr_print(py_obj, "netr_LogonUasLogon_out", NDR_OUT); } static PyMethodDef py_netr_LogonUasLogon_methods[] = { { "opnum", (PyCFunction)py_netr_LogonUasLogon_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonUasLogon.opnum() -> 0 (0x00) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogon_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_netr_LogonUasLogon_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_netr_LogonUasLogon_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_netr_LogonUasLogon_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_netr_LogonUasLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonUasLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonUasLogon_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonUasLogon", .tp_getset = py_netr_LogonUasLogon_getsetters, .tp_methods = py_netr_LogonUasLogon_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonUasLogon_new, }; static bool pack_py_netr_LogonUasLogon_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonUasLogon *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_workstation; const char *kwnames[] = { "server_name", "account_name", "workstation", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_LogonUasLogon", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_workstation)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_workstation == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.workstation"); return false; } r->in.workstation = talloc_ptrtype(r, r->in.workstation); if (r->in.workstation == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_workstation)) { unicode = PyUnicode_AsEncodedString(py_workstation, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_workstation)) { test_str = PyBytes_AS_STRING(py_workstation); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_workstation)->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.workstation = talloc_str; } return true; } static PyObject *unpack_py_netr_LogonUasLogon_args_out(struct netr_LogonUasLogon *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_UasInfo_Type, *r->out.info, *r->out.info); } result = py_info; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonUasLogoff_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonUasLogoff_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonUasLogoff_in_get_account_name(PyObject *obj, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_LogonUasLogoff_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_LogonUasLogoff_in_get_workstation(PyObject *obj, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj); PyObject *py_workstation; if (object->in.workstation == NULL) { Py_RETURN_NONE; } if (object->in.workstation == NULL) { py_workstation = Py_None; Py_INCREF(py_workstation); } else { py_workstation = PyUnicode_Decode(object->in.workstation, strlen(object->in.workstation), "utf-8", "ignore"); } return py_workstation; } static int py_netr_LogonUasLogoff_in_set_workstation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.workstation"); return -1; } object->in.workstation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.workstation); if (object->in.workstation == 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.workstation = talloc_str; } return 0; } static PyObject *py_netr_LogonUasLogoff_out_get_info(PyObject *obj, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pytalloc_reference_ex(&netr_UasLogoffInfo_Type, object->out.info, object->out.info); return py_info; } static int py_netr_LogonUasLogoff_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)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(&netr_UasLogoffInfo_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 netr_UasLogoffInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonUasLogoff_get_result(PyObject *obj, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_LogonUasLogoff_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)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_netr_LogonUasLogoff_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonUasLogoff_in_get_server_name, .set = py_netr_LogonUasLogoff_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_LogonUasLogoff_in_get_account_name, .set = py_netr_LogonUasLogoff_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_workstation"), .get = py_netr_LogonUasLogoff_in_get_workstation, .set = py_netr_LogonUasLogoff_in_set_workstation, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_info"), .get = py_netr_LogonUasLogoff_out_get_info, .set = py_netr_LogonUasLogoff_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UasLogoffInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonUasLogoff_get_result, .set = py_netr_LogonUasLogoff_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_LogonUasLogoff_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonUasLogoff, type); struct netr_LogonUasLogoff *_self = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.info = talloc_zero(mem_ctx, struct netr_UasLogoffInfo); return self; } static PyObject *py_netr_LogonUasLogoff_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(1); } static PyObject *py_netr_LogonUasLogoff_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogoff_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonUasLogoff_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_netr_LogonUasLogoff_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonUasLogoff_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_netr_LogonUasLogoff_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonUasLogoff_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 netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogoff_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonUasLogoff_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_netr_LogonUasLogoff_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonUasLogoff_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_netr_LogonUasLogoff_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonUasLogoff_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogoff_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonUasLogoff_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonUasLogoff_ndr_print(py_obj, "netr_LogonUasLogoff_in", NDR_IN); } static PyObject *py_netr_LogonUasLogoff_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonUasLogoff_ndr_print(py_obj, "netr_LogonUasLogoff_out", NDR_OUT); } static PyMethodDef py_netr_LogonUasLogoff_methods[] = { { "opnum", (PyCFunction)py_netr_LogonUasLogoff_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonUasLogoff.opnum() -> 1 (0x01) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogoff_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_netr_LogonUasLogoff_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_netr_LogonUasLogoff_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_netr_LogonUasLogoff_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_netr_LogonUasLogoff_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonUasLogoff_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonUasLogoff_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonUasLogoff", .tp_getset = py_netr_LogonUasLogoff_getsetters, .tp_methods = py_netr_LogonUasLogoff_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonUasLogoff_new, }; static bool pack_py_netr_LogonUasLogoff_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonUasLogoff *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_workstation; const char *kwnames[] = { "server_name", "account_name", "workstation", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_LogonUasLogoff", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_workstation)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_workstation == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.workstation"); return false; } r->in.workstation = talloc_ptrtype(r, r->in.workstation); if (r->in.workstation == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_workstation)) { unicode = PyUnicode_AsEncodedString(py_workstation, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_workstation)) { test_str = PyBytes_AS_STRING(py_workstation); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_workstation)->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.workstation = talloc_str; } return true; } static PyObject *unpack_py_netr_LogonUasLogoff_args_out(struct netr_LogonUasLogoff *r) { PyObject *result; PyObject *py_info; py_info = pytalloc_reference_ex(&netr_UasLogoffInfo_Type, r->out.info, r->out.info); result = py_info; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonSamLogon_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonSamLogon_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogon_in_get_computer_name(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_LogonSamLogon_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogon_in_get_credential(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } if (object->in.credential == NULL) { py_credential = Py_None; Py_INCREF(py_credential); } else { py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); } return py_credential; } static int py_netr_LogonSamLogon_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } if (value == Py_None) { object->in.credential = NULL; } else { object->in.credential = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogon_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } if (object->in.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); } return py_return_authenticator; } static int py_netr_LogonSamLogon_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } if (value == Py_None) { object->in.return_authenticator = NULL; } else { object->in.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogon_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } if (object->out.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); } return py_return_authenticator; } static int py_netr_LogonSamLogon_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } if (value == Py_None) { object->out.return_authenticator = NULL; } else { object->out.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogon_in_get_logon_level(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)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_netr_LogonSamLogon_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)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_netr_LogonSamLogon_in_get_logon(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_logon; if (object->in.logon == NULL) { Py_RETURN_NONE; } py_logon = pyrpc_import_union(&netr_LogonLevel_Type, object->in.logon, object->in.logon_level, object->in.logon, "union netr_LogonLevel"); if (py_logon == NULL) { return NULL; } return py_logon; } static int py_netr_LogonSamLogon_in_set_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.logon)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon"); return -1; } object->in.logon = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon); if (object->in.logon == NULL) { PyErr_NoMemory(); return -1; } { union netr_LogonLevel *logon_switch_1; logon_switch_1 = (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_1 == NULL) { return -1; } object->in.logon = logon_switch_1; } return 0; } static PyObject *py_netr_LogonSamLogon_in_get_validation_level(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)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_netr_LogonSamLogon_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)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_netr_LogonSamLogon_out_get_validation(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_validation; if (object->out.validation == NULL) { Py_RETURN_NONE; } py_validation = pyrpc_import_union(&netr_Validation_Type, object->out.validation, object->in.validation_level, object->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } return py_validation; } static int py_netr_LogonSamLogon_out_set_validation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation"); return -1; } object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation); if (object->out.validation == NULL) { PyErr_NoMemory(); return -1; } { union netr_Validation *validation_switch_1; validation_switch_1 = (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_1 == NULL) { return -1; } object->out.validation = validation_switch_1; } return 0; } static PyObject *py_netr_LogonSamLogon_out_get_authoritative(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_authoritative; if (object->out.authoritative == NULL) { Py_RETURN_NONE; } py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative); return py_authoritative; } static int py_netr_LogonSamLogon_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative"); return -1; } object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative); if (object->out.authoritative == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogon_get_result(PyObject *obj, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_LogonSamLogon_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)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_netr_LogonSamLogon_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonSamLogon_in_get_server_name, .set = py_netr_LogonSamLogon_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_LogonSamLogon_in_get_computer_name, .set = py_netr_LogonSamLogon_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_LogonSamLogon_in_get_credential, .set = py_netr_LogonSamLogon_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_LogonSamLogon_in_get_return_authenticator, .set = py_netr_LogonSamLogon_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_LogonSamLogon_out_get_return_authenticator, .set = py_netr_LogonSamLogon_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_logon_level"), .get = py_netr_LogonSamLogon_in_get_logon_level, .set = py_netr_LogonSamLogon_in_set_logon_level, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass") }, { .name = discard_const_p(char, "in_logon"), .get = py_netr_LogonSamLogon_in_get_logon, .set = py_netr_LogonSamLogon_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_netr_LogonSamLogon_in_get_validation_level, .set = py_netr_LogonSamLogon_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_netr_LogonSamLogon_out_get_validation, .set = py_netr_LogonSamLogon_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_netr_LogonSamLogon_out_get_authoritative, .set = py_netr_LogonSamLogon_out_set_authoritative, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonSamLogon_get_result, .set = py_netr_LogonSamLogon_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_LogonSamLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonSamLogon, type); struct netr_LogonSamLogon *_self = (struct netr_LogonSamLogon *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.logon = talloc_zero(mem_ctx, union netr_LogonLevel); _self->out.validation = talloc_zero(mem_ctx, union netr_Validation); _self->out.authoritative = talloc_zero(mem_ctx, uint8_t); return self; } static PyObject *py_netr_LogonSamLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(2); } static PyObject *py_netr_LogonSamLogon_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogon_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonSamLogon_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_netr_LogonSamLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonSamLogon_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_netr_LogonSamLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonSamLogon_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 netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogon_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonSamLogon_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_netr_LogonSamLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogon_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_netr_LogonSamLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogon_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogon_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonSamLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogon_ndr_print(py_obj, "netr_LogonSamLogon_in", NDR_IN); } static PyObject *py_netr_LogonSamLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogon_ndr_print(py_obj, "netr_LogonSamLogon_out", NDR_OUT); } static PyMethodDef py_netr_LogonSamLogon_methods[] = { { "opnum", (PyCFunction)py_netr_LogonSamLogon_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonSamLogon.opnum() -> 2 (0x02) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogon_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_netr_LogonSamLogon_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_netr_LogonSamLogon_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_netr_LogonSamLogon_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_netr_LogonSamLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonSamLogon_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonSamLogon", .tp_getset = py_netr_LogonSamLogon_getsetters, .tp_methods = py_netr_LogonSamLogon_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonSamLogon_new, }; static bool pack_py_netr_LogonSamLogon_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogon *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_logon_level; PyObject *py_logon; PyObject *py_validation_level; const char *kwnames[] = { "server_name", "computer_name", "credential", "return_authenticator", "logon_level", "logon", "validation_level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_LogonSamLogon", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_logon_level, &py_logon, &py_validation_level)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } if (py_credential == Py_None) { r->in.credential = NULL; } else { r->in.credential = NULL; PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); } if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } if (py_return_authenticator == Py_None) { r->in.return_authenticator = NULL; } else { r->in.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); } 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; } r->in.logon = talloc_ptrtype(r, r->in.logon); if (r->in.logon == NULL) { PyErr_NoMemory(); return false; } { union netr_LogonLevel *logon_switch_1; logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel"); if (logon_switch_1 == NULL) { return false; } r->in.logon = logon_switch_1; } 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_netr_LogonSamLogon_args_out(struct netr_LogonSamLogon *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_validation; PyObject *py_authoritative; result = PyTuple_New(3); if (r->out.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); } PyTuple_SetItem(result, 0, py_return_authenticator); py_validation = pyrpc_import_union(&netr_Validation_Type, r->out.validation, r->in.validation_level, r->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } PyTuple_SetItem(result, 1, py_validation); py_authoritative = PyLong_FromLong((uint16_t)*r->out.authoritative); PyTuple_SetItem(result, 2, py_authoritative); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonSamLogoff_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonSamLogoff_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogoff_in_get_computer_name(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_LogonSamLogoff_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogoff_in_get_credential(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } if (object->in.credential == NULL) { py_credential = Py_None; Py_INCREF(py_credential); } else { py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); } return py_credential; } static int py_netr_LogonSamLogoff_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } if (value == Py_None) { object->in.credential = NULL; } else { object->in.credential = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogoff_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } if (object->in.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); } return py_return_authenticator; } static int py_netr_LogonSamLogoff_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } if (value == Py_None) { object->in.return_authenticator = NULL; } else { object->in.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogoff_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } if (object->out.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); } return py_return_authenticator; } static int py_netr_LogonSamLogoff_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } if (value == Py_None) { object->out.return_authenticator = NULL; } else { object->out.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogoff_in_get_logon_level(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)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_netr_LogonSamLogoff_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)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_netr_LogonSamLogoff_in_get_logon(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)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_netr_LogonSamLogoff_in_set_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)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_netr_LogonSamLogoff_get_result(PyObject *obj, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_LogonSamLogoff_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)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_netr_LogonSamLogoff_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonSamLogoff_in_get_server_name, .set = py_netr_LogonSamLogoff_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_LogonSamLogoff_in_get_computer_name, .set = py_netr_LogonSamLogoff_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_LogonSamLogoff_in_get_credential, .set = py_netr_LogonSamLogoff_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_LogonSamLogoff_in_get_return_authenticator, .set = py_netr_LogonSamLogoff_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_LogonSamLogoff_out_get_return_authenticator, .set = py_netr_LogonSamLogoff_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_logon_level"), .get = py_netr_LogonSamLogoff_in_get_logon_level, .set = py_netr_LogonSamLogoff_in_set_logon_level, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass") }, { .name = discard_const_p(char, "in_logon"), .get = py_netr_LogonSamLogoff_in_get_logon, .set = py_netr_LogonSamLogoff_in_set_logon, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonSamLogoff_get_result, .set = py_netr_LogonSamLogoff_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_LogonSamLogoff_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonSamLogoff, type); return self; } static PyObject *py_netr_LogonSamLogoff_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(3); } static PyObject *py_netr_LogonSamLogoff_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogoff_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonSamLogoff_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_netr_LogonSamLogoff_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonSamLogoff_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_netr_LogonSamLogoff_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonSamLogoff_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 netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogoff_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonSamLogoff_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_netr_LogonSamLogoff_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogoff_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_netr_LogonSamLogoff_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogoff_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogoff_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonSamLogoff_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogoff_ndr_print(py_obj, "netr_LogonSamLogoff_in", NDR_IN); } static PyObject *py_netr_LogonSamLogoff_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogoff_ndr_print(py_obj, "netr_LogonSamLogoff_out", NDR_OUT); } static PyMethodDef py_netr_LogonSamLogoff_methods[] = { { "opnum", (PyCFunction)py_netr_LogonSamLogoff_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonSamLogoff.opnum() -> 3 (0x03) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogoff_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_netr_LogonSamLogoff_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_netr_LogonSamLogoff_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_netr_LogonSamLogoff_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_netr_LogonSamLogoff_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogoff_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonSamLogoff_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonSamLogoff", .tp_getset = py_netr_LogonSamLogoff_getsetters, .tp_methods = py_netr_LogonSamLogoff_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonSamLogoff_new, }; static bool pack_py_netr_LogonSamLogoff_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogoff *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_logon_level; PyObject *py_logon; const char *kwnames[] = { "server_name", "computer_name", "credential", "return_authenticator", "logon_level", "logon", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_LogonSamLogoff", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_logon_level, &py_logon)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } if (py_credential == Py_None) { r->in.credential = NULL; } else { r->in.credential = NULL; PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); } if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } if (py_return_authenticator == Py_None) { r->in.return_authenticator = NULL; } else { r->in.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); } 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; } return true; } static PyObject *unpack_py_netr_LogonSamLogoff_args_out(struct netr_LogonSamLogoff *r) { PyObject *result; PyObject *py_return_authenticator; if (r->out.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); } result = py_return_authenticator; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerReqChallenge_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerReqChallenge_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerReqChallenge_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerReqChallenge_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerReqChallenge_in_get_credentials(PyObject *obj, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj); PyObject *py_credentials; if (object->in.credentials == NULL) { Py_RETURN_NONE; } py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials); return py_credentials; } static int py_netr_ServerReqChallenge_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials"); return -1; } object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials); if (object->in.credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerReqChallenge_out_get_return_credentials(PyObject *obj, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj); PyObject *py_return_credentials; if (object->out.return_credentials == NULL) { Py_RETURN_NONE; } py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials); return py_return_credentials; } static int py_netr_ServerReqChallenge_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials"); return -1; } object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials); if (object->out.return_credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerReqChallenge_get_result(PyObject *obj, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerReqChallenge_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)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_netr_ServerReqChallenge_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerReqChallenge_in_get_server_name, .set = py_netr_ServerReqChallenge_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerReqChallenge_in_get_computer_name, .set = py_netr_ServerReqChallenge_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credentials"), .get = py_netr_ServerReqChallenge_in_get_credentials, .set = py_netr_ServerReqChallenge_in_set_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "out_return_credentials"), .get = py_netr_ServerReqChallenge_out_get_return_credentials, .set = py_netr_ServerReqChallenge_out_set_return_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerReqChallenge_get_result, .set = py_netr_ServerReqChallenge_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerReqChallenge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerReqChallenge, type); struct netr_ServerReqChallenge *_self = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential); _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential); return self; } static PyObject *py_netr_ServerReqChallenge_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(4); } static PyObject *py_netr_ServerReqChallenge_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerReqChallenge_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerReqChallenge_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_netr_ServerReqChallenge_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerReqChallenge_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_netr_ServerReqChallenge_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerReqChallenge_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 netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerReqChallenge_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerReqChallenge_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_netr_ServerReqChallenge_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerReqChallenge_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_netr_ServerReqChallenge_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerReqChallenge_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerReqChallenge_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerReqChallenge_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerReqChallenge_ndr_print(py_obj, "netr_ServerReqChallenge_in", NDR_IN); } static PyObject *py_netr_ServerReqChallenge_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerReqChallenge_ndr_print(py_obj, "netr_ServerReqChallenge_out", NDR_OUT); } static PyMethodDef py_netr_ServerReqChallenge_methods[] = { { "opnum", (PyCFunction)py_netr_ServerReqChallenge_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerReqChallenge.opnum() -> 4 (0x04) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerReqChallenge_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_netr_ServerReqChallenge_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_netr_ServerReqChallenge_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_netr_ServerReqChallenge_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_netr_ServerReqChallenge_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerReqChallenge_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerReqChallenge_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerReqChallenge", .tp_getset = py_netr_ServerReqChallenge_getsetters, .tp_methods = py_netr_ServerReqChallenge_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerReqChallenge_new, }; static bool pack_py_netr_ServerReqChallenge_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerReqChallenge *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credentials; const char *kwnames[] = { "server_name", "computer_name", "credentials", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_ServerReqChallenge", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credentials)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credentials == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials"); return false; } r->in.credentials = talloc_ptrtype(r, r->in.credentials); if (r->in.credentials == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) { PyErr_NoMemory(); return false; } r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials); return true; } static PyObject *unpack_py_netr_ServerReqChallenge_args_out(struct netr_ServerReqChallenge *r) { PyObject *result; PyObject *py_return_credentials; py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials); result = py_return_credentials; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerAuthenticate_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerAuthenticate_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerAuthenticate_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerAuthenticate_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerAuthenticate_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerAuthenticate_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerAuthenticate_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerAuthenticate_in_get_credentials(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_credentials; if (object->in.credentials == NULL) { Py_RETURN_NONE; } py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials); return py_credentials; } static int py_netr_ServerAuthenticate_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials"); return -1; } object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials); if (object->in.credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerAuthenticate_out_get_return_credentials(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_return_credentials; if (object->out.return_credentials == NULL) { Py_RETURN_NONE; } py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials); return py_return_credentials; } static int py_netr_ServerAuthenticate_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials"); return -1; } object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials); if (object->out.return_credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerAuthenticate_get_result(PyObject *obj, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerAuthenticate_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)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_netr_ServerAuthenticate_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerAuthenticate_in_get_server_name, .set = py_netr_ServerAuthenticate_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerAuthenticate_in_get_account_name, .set = py_netr_ServerAuthenticate_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerAuthenticate_in_get_secure_channel_type, .set = py_netr_ServerAuthenticate_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerAuthenticate_in_get_computer_name, .set = py_netr_ServerAuthenticate_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credentials"), .get = py_netr_ServerAuthenticate_in_get_credentials, .set = py_netr_ServerAuthenticate_in_set_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "out_return_credentials"), .get = py_netr_ServerAuthenticate_out_get_return_credentials, .set = py_netr_ServerAuthenticate_out_set_return_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerAuthenticate_get_result, .set = py_netr_ServerAuthenticate_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerAuthenticate_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerAuthenticate, type); struct netr_ServerAuthenticate *_self = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential); _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential); return self; } static PyObject *py_netr_ServerAuthenticate_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(5); } static PyObject *py_netr_ServerAuthenticate_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerAuthenticate_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_netr_ServerAuthenticate_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerAuthenticate_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_netr_ServerAuthenticate_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerAuthenticate_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 netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerAuthenticate_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_netr_ServerAuthenticate_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerAuthenticate_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_netr_ServerAuthenticate_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerAuthenticate_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerAuthenticate_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerAuthenticate_ndr_print(py_obj, "netr_ServerAuthenticate_in", NDR_IN); } static PyObject *py_netr_ServerAuthenticate_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerAuthenticate_ndr_print(py_obj, "netr_ServerAuthenticate_out", NDR_OUT); } static PyMethodDef py_netr_ServerAuthenticate_methods[] = { { "opnum", (PyCFunction)py_netr_ServerAuthenticate_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerAuthenticate.opnum() -> 5 (0x05) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate_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_netr_ServerAuthenticate_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_netr_ServerAuthenticate_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_netr_ServerAuthenticate_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_netr_ServerAuthenticate_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerAuthenticate_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerAuthenticate_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerAuthenticate", .tp_getset = py_netr_ServerAuthenticate_getsetters, .tp_methods = py_netr_ServerAuthenticate_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerAuthenticate_new, }; static bool pack_py_netr_ServerAuthenticate_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerAuthenticate *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credentials; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credentials", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerAuthenticate", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credentials)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credentials == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials"); return false; } r->in.credentials = talloc_ptrtype(r, r->in.credentials); if (r->in.credentials == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) { PyErr_NoMemory(); return false; } r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials); return true; } static PyObject *unpack_py_netr_ServerAuthenticate_args_out(struct netr_ServerAuthenticate *r) { PyObject *result; PyObject *py_return_credentials; py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials); result = py_return_credentials; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerPasswordSet_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerPasswordSet_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerPasswordSet_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerPasswordSet_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerPasswordSet_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerPasswordSet_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerPasswordSet_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerPasswordSet_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerPasswordSet_in_get_credential(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_ServerPasswordSet_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordSet_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_ServerPasswordSet_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordSet_in_get_new_password(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_new_password; if (object->in.new_password == NULL) { Py_RETURN_NONE; } py_new_password = pytalloc_reference_ex(samr_Password_Type, object->in.new_password, object->in.new_password); return py_new_password; } static int py_netr_ServerPasswordSet_in_set_new_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_password"); return -1; } object->in.new_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_password); if (object->in.new_password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(samr_Password_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.new_password = (struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordSet_get_result(PyObject *obj, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerPasswordSet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)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_netr_ServerPasswordSet_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerPasswordSet_in_get_server_name, .set = py_netr_ServerPasswordSet_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerPasswordSet_in_get_account_name, .set = py_netr_ServerPasswordSet_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerPasswordSet_in_get_secure_channel_type, .set = py_netr_ServerPasswordSet_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerPasswordSet_in_get_computer_name, .set = py_netr_ServerPasswordSet_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_ServerPasswordSet_in_get_credential, .set = py_netr_ServerPasswordSet_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_ServerPasswordSet_out_get_return_authenticator, .set = py_netr_ServerPasswordSet_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_new_password"), .get = py_netr_ServerPasswordSet_in_get_new_password, .set = py_netr_ServerPasswordSet_in_set_new_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerPasswordSet_get_result, .set = py_netr_ServerPasswordSet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerPasswordSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerPasswordSet, type); struct netr_ServerPasswordSet *_self = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.new_password = talloc_zero(mem_ctx, struct samr_Password); return self; } static PyObject *py_netr_ServerPasswordSet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(6); } static PyObject *py_netr_ServerPasswordSet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerPasswordSet_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_netr_ServerPasswordSet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerPasswordSet_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_netr_ServerPasswordSet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerPasswordSet_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 netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerPasswordSet_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_netr_ServerPasswordSet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerPasswordSet_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_netr_ServerPasswordSet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerPasswordSet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerPasswordSet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerPasswordSet_ndr_print(py_obj, "netr_ServerPasswordSet_in", NDR_IN); } static PyObject *py_netr_ServerPasswordSet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerPasswordSet_ndr_print(py_obj, "netr_ServerPasswordSet_out", NDR_OUT); } static PyMethodDef py_netr_ServerPasswordSet_methods[] = { { "opnum", (PyCFunction)py_netr_ServerPasswordSet_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerPasswordSet.opnum() -> 6 (0x06) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet_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_netr_ServerPasswordSet_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_netr_ServerPasswordSet_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_netr_ServerPasswordSet_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_netr_ServerPasswordSet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerPasswordSet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerPasswordSet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerPasswordSet", .tp_getset = py_netr_ServerPasswordSet_getsetters, .tp_methods = py_netr_ServerPasswordSet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerPasswordSet_new, }; static bool pack_py_netr_ServerPasswordSet_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerPasswordSet *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_new_password; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credential", "new_password", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerPasswordSet", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential, &py_new_password)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_new_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_password"); return false; } r->in.new_password = talloc_ptrtype(r, r->in.new_password); if (r->in.new_password == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(samr_Password_Type, py_new_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.new_password = (struct samr_Password *)pytalloc_get_ptr(py_new_password); return true; } static PyObject *unpack_py_netr_ServerPasswordSet_args_out(struct netr_ServerPasswordSet *r) { PyObject *result; PyObject *py_return_authenticator; py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); result = py_return_authenticator; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DatabaseDeltas_in_get_logon_server(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } return py_logon_server; } static int py_netr_DatabaseDeltas_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server); if (object->in.logon_server == 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.logon_server = talloc_str; } return 0; } static PyObject *py_netr_DatabaseDeltas_in_get_computername(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_computername; if (object->in.computername == NULL) { Py_RETURN_NONE; } if (object->in.computername == NULL) { py_computername = Py_None; Py_INCREF(py_computername); } else { py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore"); } return py_computername; } static int py_netr_DatabaseDeltas_in_set_computername(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername"); return -1; } object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername); if (object->in.computername == 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.computername = talloc_str; } return 0; } static PyObject *py_netr_DatabaseDeltas_in_get_credential(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_DatabaseDeltas_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseDeltas_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseDeltas_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseDeltas_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseDeltas_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseDeltas_in_get_database_id(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_database_id; py_database_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.database_id); return py_database_id; } static int py_netr_DatabaseDeltas_in_set_database_id(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.database_id"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.database_id)); 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.database_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseDeltas_in_get_sequence_num(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; if (object->in.sequence_num == NULL) { Py_RETURN_NONE; } py_sequence_num = PyLong_FromUnsignedLongLong(*object->in.sequence_num); return py_sequence_num; } static int py_netr_DatabaseDeltas_in_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sequence_num)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sequence_num"); return -1; } object->in.sequence_num = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sequence_num); if (object->in.sequence_num == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.sequence_num)); 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.sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseDeltas_out_get_sequence_num(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; if (object->out.sequence_num == NULL) { Py_RETURN_NONE; } py_sequence_num = PyLong_FromUnsignedLongLong(*object->out.sequence_num); return py_sequence_num; } static int py_netr_DatabaseDeltas_out_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sequence_num)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sequence_num"); return -1; } object->out.sequence_num = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sequence_num); if (object->out.sequence_num == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sequence_num)); 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_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseDeltas_out_get_delta_enum_array(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_delta_enum_array; if (object->out.delta_enum_array == NULL) { Py_RETURN_NONE; } if (*object->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array); } return py_delta_enum_array; } static int py_netr_DatabaseDeltas_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array"); return -1; } object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array); if (object->out.delta_enum_array == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.delta_enum_array = NULL; } else { *object->out.delta_enum_array = NULL; PY_CHECK_TYPE(&netr_DELTA_ENUM_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.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DatabaseDeltas_in_get_preferredmaximumlength(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_preferredmaximumlength; py_preferredmaximumlength = PyLong_FromUnsignedLongLong((uint32_t)object->in.preferredmaximumlength); return py_preferredmaximumlength; } static int py_netr_DatabaseDeltas_in_set_preferredmaximumlength(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.preferredmaximumlength"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.preferredmaximumlength)); 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.preferredmaximumlength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseDeltas_get_result(PyObject *obj, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_DatabaseDeltas_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)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_netr_DatabaseDeltas_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_DatabaseDeltas_in_get_logon_server, .set = py_netr_DatabaseDeltas_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computername"), .get = py_netr_DatabaseDeltas_in_get_computername, .set = py_netr_DatabaseDeltas_in_set_computername, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_DatabaseDeltas_in_get_credential, .set = py_netr_DatabaseDeltas_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_DatabaseDeltas_in_get_return_authenticator, .set = py_netr_DatabaseDeltas_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_DatabaseDeltas_out_get_return_authenticator, .set = py_netr_DatabaseDeltas_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_database_id"), .get = py_netr_DatabaseDeltas_in_get_database_id, .set = py_netr_DatabaseDeltas_in_set_database_id, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID") }, { .name = discard_const_p(char, "in_sequence_num"), .get = py_netr_DatabaseDeltas_in_get_sequence_num, .set = py_netr_DatabaseDeltas_in_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "out_sequence_num"), .get = py_netr_DatabaseDeltas_out_get_sequence_num, .set = py_netr_DatabaseDeltas_out_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "out_delta_enum_array"), .get = py_netr_DatabaseDeltas_out_get_delta_enum_array, .set = py_netr_DatabaseDeltas_out_set_delta_enum_array, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY") }, { .name = discard_const_p(char, "in_preferredmaximumlength"), .get = py_netr_DatabaseDeltas_in_get_preferredmaximumlength, .set = py_netr_DatabaseDeltas_in_set_preferredmaximumlength, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_netr_DatabaseDeltas_get_result, .set = py_netr_DatabaseDeltas_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_DatabaseDeltas_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DatabaseDeltas, type); struct netr_DatabaseDeltas *_self = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.sequence_num = talloc_zero(mem_ctx, uint64_t); _self->out.sequence_num = talloc_zero(mem_ctx, uint64_t); /* a pointer to a NULL pointer */ _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *); return self; } static PyObject *py_netr_DatabaseDeltas_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(7); } static PyObject *py_netr_DatabaseDeltas_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseDeltas_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseDeltas_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_netr_DatabaseDeltas_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DatabaseDeltas_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_netr_DatabaseDeltas_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DatabaseDeltas_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 netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseDeltas_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseDeltas_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_netr_DatabaseDeltas_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseDeltas_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_netr_DatabaseDeltas_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseDeltas_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseDeltas_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseDeltas_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseDeltas_ndr_print(py_obj, "netr_DatabaseDeltas_in", NDR_IN); } static PyObject *py_netr_DatabaseDeltas_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseDeltas_ndr_print(py_obj, "netr_DatabaseDeltas_out", NDR_OUT); } static PyMethodDef py_netr_DatabaseDeltas_methods[] = { { "opnum", (PyCFunction)py_netr_DatabaseDeltas_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DatabaseDeltas.opnum() -> 7 (0x07) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseDeltas_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_netr_DatabaseDeltas_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_netr_DatabaseDeltas_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_netr_DatabaseDeltas_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_netr_DatabaseDeltas_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseDeltas_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DatabaseDeltas_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DatabaseDeltas", .tp_getset = py_netr_DatabaseDeltas_getsetters, .tp_methods = py_netr_DatabaseDeltas_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DatabaseDeltas_new, }; static bool pack_py_netr_DatabaseDeltas_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseDeltas *r) { PyObject *py_logon_server; PyObject *py_computername; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_database_id; PyObject *py_sequence_num; PyObject *py_preferredmaximumlength; const char *kwnames[] = { "logon_server", "computername", "credential", "return_authenticator", "database_id", "sequence_num", "preferredmaximumlength", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_DatabaseDeltas", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_database_id, &py_sequence_num, &py_preferredmaximumlength)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } r->in.logon_server = talloc_ptrtype(r, r->in.logon_server); if (r->in.logon_server == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } if (py_computername == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername"); return false; } r->in.computername = talloc_ptrtype(r, r->in.computername); if (r->in.computername == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computername)) { unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computername)) { test_str = PyBytes_AS_STRING(py_computername); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->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.computername = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_database_id == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.database_id"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.database_id)); if (PyLong_Check(py_database_id)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_database_id); 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.database_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_sequence_num == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sequence_num"); return false; } r->in.sequence_num = talloc_ptrtype(r, r->in.sequence_num); if (r->in.sequence_num == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.sequence_num)); if (PyLong_Check(py_sequence_num)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_sequence_num); 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.sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_preferredmaximumlength == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.preferredmaximumlength"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.preferredmaximumlength)); if (PyLong_Check(py_preferredmaximumlength)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_preferredmaximumlength); 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.preferredmaximumlength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_DatabaseDeltas_args_out(struct netr_DatabaseDeltas *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_sequence_num; PyObject *py_delta_enum_array; result = PyTuple_New(3); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_sequence_num = PyLong_FromUnsignedLongLong(*r->out.sequence_num); PyTuple_SetItem(result, 1, py_sequence_num); if (*r->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array); } PyTuple_SetItem(result, 2, py_delta_enum_array); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DatabaseSync_in_get_logon_server(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } return py_logon_server; } static int py_netr_DatabaseSync_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server); if (object->in.logon_server == 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.logon_server = talloc_str; } return 0; } static PyObject *py_netr_DatabaseSync_in_get_computername(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_computername; if (object->in.computername == NULL) { Py_RETURN_NONE; } if (object->in.computername == NULL) { py_computername = Py_None; Py_INCREF(py_computername); } else { py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore"); } return py_computername; } static int py_netr_DatabaseSync_in_set_computername(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername"); return -1; } object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername); if (object->in.computername == 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.computername = talloc_str; } return 0; } static PyObject *py_netr_DatabaseSync_in_get_credential(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_DatabaseSync_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseSync_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseSync_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseSync_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseSync_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseSync_in_get_database_id(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_database_id; py_database_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.database_id); return py_database_id; } static int py_netr_DatabaseSync_in_set_database_id(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.database_id"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.database_id)); 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.database_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync_in_get_sync_context(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_sync_context; if (object->in.sync_context == NULL) { Py_RETURN_NONE; } py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->in.sync_context); return py_sync_context; } static int py_netr_DatabaseSync_in_set_sync_context(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sync_context)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sync_context"); return -1; } object->in.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sync_context); if (object->in.sync_context == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.sync_context)); 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.sync_context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync_out_get_sync_context(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_sync_context; if (object->out.sync_context == NULL) { Py_RETURN_NONE; } py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sync_context); return py_sync_context; } static int py_netr_DatabaseSync_out_set_sync_context(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sync_context)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sync_context"); return -1; } object->out.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sync_context); if (object->out.sync_context == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sync_context)); 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.sync_context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync_out_get_delta_enum_array(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_delta_enum_array; if (object->out.delta_enum_array == NULL) { Py_RETURN_NONE; } if (*object->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array); } return py_delta_enum_array; } static int py_netr_DatabaseSync_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array"); return -1; } object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array); if (object->out.delta_enum_array == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.delta_enum_array = NULL; } else { *object->out.delta_enum_array = NULL; PY_CHECK_TYPE(&netr_DELTA_ENUM_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.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DatabaseSync_in_get_preferredmaximumlength(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_preferredmaximumlength; py_preferredmaximumlength = PyLong_FromUnsignedLongLong((uint32_t)object->in.preferredmaximumlength); return py_preferredmaximumlength; } static int py_netr_DatabaseSync_in_set_preferredmaximumlength(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.preferredmaximumlength"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.preferredmaximumlength)); 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.preferredmaximumlength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync_get_result(PyObject *obj, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_DatabaseSync_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)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_netr_DatabaseSync_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_DatabaseSync_in_get_logon_server, .set = py_netr_DatabaseSync_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computername"), .get = py_netr_DatabaseSync_in_get_computername, .set = py_netr_DatabaseSync_in_set_computername, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_DatabaseSync_in_get_credential, .set = py_netr_DatabaseSync_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_DatabaseSync_in_get_return_authenticator, .set = py_netr_DatabaseSync_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_DatabaseSync_out_get_return_authenticator, .set = py_netr_DatabaseSync_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_database_id"), .get = py_netr_DatabaseSync_in_get_database_id, .set = py_netr_DatabaseSync_in_set_database_id, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID") }, { .name = discard_const_p(char, "in_sync_context"), .get = py_netr_DatabaseSync_in_get_sync_context, .set = py_netr_DatabaseSync_in_set_sync_context, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_sync_context"), .get = py_netr_DatabaseSync_out_get_sync_context, .set = py_netr_DatabaseSync_out_set_sync_context, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_delta_enum_array"), .get = py_netr_DatabaseSync_out_get_delta_enum_array, .set = py_netr_DatabaseSync_out_set_delta_enum_array, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY") }, { .name = discard_const_p(char, "in_preferredmaximumlength"), .get = py_netr_DatabaseSync_in_get_preferredmaximumlength, .set = py_netr_DatabaseSync_in_set_preferredmaximumlength, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_netr_DatabaseSync_get_result, .set = py_netr_DatabaseSync_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_DatabaseSync_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DatabaseSync, type); struct netr_DatabaseSync *_self = (struct netr_DatabaseSync *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.sync_context = talloc_zero(mem_ctx, uint32_t); _self->out.sync_context = talloc_zero(mem_ctx, uint32_t); /* a pointer to a NULL pointer */ _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *); return self; } static PyObject *py_netr_DatabaseSync_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(8); } static PyObject *py_netr_DatabaseSync_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseSync_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_netr_DatabaseSync_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DatabaseSync_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_netr_DatabaseSync_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DatabaseSync_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 netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseSync_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_netr_DatabaseSync_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseSync_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_netr_DatabaseSync_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseSync_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseSync_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseSync_ndr_print(py_obj, "netr_DatabaseSync_in", NDR_IN); } static PyObject *py_netr_DatabaseSync_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseSync_ndr_print(py_obj, "netr_DatabaseSync_out", NDR_OUT); } static PyMethodDef py_netr_DatabaseSync_methods[] = { { "opnum", (PyCFunction)py_netr_DatabaseSync_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DatabaseSync.opnum() -> 8 (0x08) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync_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_netr_DatabaseSync_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_netr_DatabaseSync_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_netr_DatabaseSync_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_netr_DatabaseSync_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseSync_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DatabaseSync_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DatabaseSync", .tp_getset = py_netr_DatabaseSync_getsetters, .tp_methods = py_netr_DatabaseSync_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DatabaseSync_new, }; static bool pack_py_netr_DatabaseSync_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseSync *r) { PyObject *py_logon_server; PyObject *py_computername; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_database_id; PyObject *py_sync_context; PyObject *py_preferredmaximumlength; const char *kwnames[] = { "logon_server", "computername", "credential", "return_authenticator", "database_id", "sync_context", "preferredmaximumlength", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_DatabaseSync", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_database_id, &py_sync_context, &py_preferredmaximumlength)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } r->in.logon_server = talloc_ptrtype(r, r->in.logon_server); if (r->in.logon_server == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } if (py_computername == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername"); return false; } r->in.computername = talloc_ptrtype(r, r->in.computername); if (r->in.computername == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computername)) { unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computername)) { test_str = PyBytes_AS_STRING(py_computername); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->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.computername = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_database_id == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.database_id"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.database_id)); if (PyLong_Check(py_database_id)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_database_id); 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.database_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_sync_context == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sync_context"); return false; } r->in.sync_context = talloc_ptrtype(r, r->in.sync_context); if (r->in.sync_context == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.sync_context)); if (PyLong_Check(py_sync_context)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_sync_context); 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.sync_context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_preferredmaximumlength == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.preferredmaximumlength"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.preferredmaximumlength)); if (PyLong_Check(py_preferredmaximumlength)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_preferredmaximumlength); 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.preferredmaximumlength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_DatabaseSync_args_out(struct netr_DatabaseSync *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_sync_context; PyObject *py_delta_enum_array; result = PyTuple_New(3); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sync_context); PyTuple_SetItem(result, 1, py_sync_context); if (*r->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array); } PyTuple_SetItem(result, 2, py_delta_enum_array); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_AccountDeltas_in_get_logon_server(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } } return py_logon_server; } static int py_netr_AccountDeltas_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } if (value == Py_None) { object->in.logon_server = NULL; } else { object->in.logon_server = 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.logon_server = talloc_str; } } return 0; } static PyObject *py_netr_AccountDeltas_in_get_computername(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_computername; if (object->in.computername == NULL) { Py_RETURN_NONE; } if (object->in.computername == NULL) { py_computername = Py_None; Py_INCREF(py_computername); } else { py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore"); } return py_computername; } static int py_netr_AccountDeltas_in_set_computername(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername"); return -1; } object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername); if (object->in.computername == 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.computername = talloc_str; } return 0; } static PyObject *py_netr_AccountDeltas_in_get_credential(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_credential; py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, pytalloc_get_mem_ctx(obj), &object->in.credential); return py_credential; } static int py_netr_AccountDeltas_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountDeltas_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_AccountDeltas_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountDeltas_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_AccountDeltas_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountDeltas_in_get_uas(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_uas; py_uas = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, pytalloc_get_mem_ctx(obj), &object->in.uas); return py_uas; } static int py_netr_AccountDeltas_in_set_uas(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.uas"); return -1; } PY_CHECK_TYPE(&netr_UAS_INFO_0_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.uas = *(struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountDeltas_in_get_count(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.count); return py_count; } static int py_netr_AccountDeltas_in_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.count)); 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.count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountDeltas_in_get_level(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_netr_AccountDeltas_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)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_netr_AccountDeltas_in_get_buffersize(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_buffersize; py_buffersize = PyLong_FromUnsignedLongLong((uint32_t)object->in.buffersize); return py_buffersize; } static int py_netr_AccountDeltas_in_set_buffersize(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffersize"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffersize)); 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.buffersize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountDeltas_out_get_buffer(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_buffer; if (object->out.buffer == NULL) { Py_RETURN_NONE; } py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, object->out.buffer, object->out.buffer); return py_buffer; } static int py_netr_AccountDeltas_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer"); return -1; } object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer); if (object->out.buffer == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_AccountBuffer_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.buffer = (struct netr_AccountBuffer *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountDeltas_out_get_count_returned(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_count_returned; if (object->out.count_returned == NULL) { Py_RETURN_NONE; } py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count_returned); return py_count_returned; } static int py_netr_AccountDeltas_out_set_count_returned(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count_returned)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count_returned"); return -1; } object->out.count_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count_returned); if (object->out.count_returned == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count_returned)); 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.count_returned = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountDeltas_out_get_total_entries(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_total_entries; if (object->out.total_entries == NULL) { Py_RETURN_NONE; } py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_entries); return py_total_entries; } static int py_netr_AccountDeltas_out_set_total_entries(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_entries"); return -1; } object->out.total_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_entries); if (object->out.total_entries == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_entries)); 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.total_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountDeltas_out_get_recordid(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_recordid; if (object->out.recordid == NULL) { Py_RETURN_NONE; } py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, object->out.recordid, object->out.recordid); return py_recordid; } static int py_netr_AccountDeltas_out_set_recordid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.recordid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.recordid"); return -1; } object->out.recordid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.recordid); if (object->out.recordid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_UAS_INFO_0_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.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountDeltas_get_result(PyObject *obj, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_AccountDeltas_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)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_netr_AccountDeltas_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_AccountDeltas_in_get_logon_server, .set = py_netr_AccountDeltas_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computername"), .get = py_netr_AccountDeltas_in_get_computername, .set = py_netr_AccountDeltas_in_set_computername, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_AccountDeltas_in_get_credential, .set = py_netr_AccountDeltas_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_AccountDeltas_in_get_return_authenticator, .set = py_netr_AccountDeltas_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_AccountDeltas_out_get_return_authenticator, .set = py_netr_AccountDeltas_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_uas"), .get = py_netr_AccountDeltas_in_get_uas, .set = py_netr_AccountDeltas_in_set_uas, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0") }, { .name = discard_const_p(char, "in_count"), .get = py_netr_AccountDeltas_in_get_count, .set = py_netr_AccountDeltas_in_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_level"), .get = py_netr_AccountDeltas_in_get_level, .set = py_netr_AccountDeltas_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_buffersize"), .get = py_netr_AccountDeltas_in_get_buffersize, .set = py_netr_AccountDeltas_in_set_buffersize, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_buffer"), .get = py_netr_AccountDeltas_out_get_buffer, .set = py_netr_AccountDeltas_out_set_buffer, .doc = discard_const_p(char, "PIDL-generated element of base type netr_AccountBuffer") }, { .name = discard_const_p(char, "out_count_returned"), .get = py_netr_AccountDeltas_out_get_count_returned, .set = py_netr_AccountDeltas_out_set_count_returned, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_total_entries"), .get = py_netr_AccountDeltas_out_get_total_entries, .set = py_netr_AccountDeltas_out_set_total_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_recordid"), .get = py_netr_AccountDeltas_out_get_recordid, .set = py_netr_AccountDeltas_out_set_recordid, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0") }, { .name = discard_const_p(char, "result"), .get = py_netr_AccountDeltas_get_result, .set = py_netr_AccountDeltas_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_AccountDeltas_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_AccountDeltas, type); struct netr_AccountDeltas *_self = (struct netr_AccountDeltas *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer); _self->out.count_returned = talloc_zero(mem_ctx, uint32_t); _self->out.total_entries = talloc_zero(mem_ctx, uint32_t); _self->out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0); return self; } static PyObject *py_netr_AccountDeltas_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(9); } static PyObject *py_netr_AccountDeltas_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountDeltas_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_AccountDeltas_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_netr_AccountDeltas_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_AccountDeltas_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_netr_AccountDeltas_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_AccountDeltas_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 netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountDeltas_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_AccountDeltas_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_netr_AccountDeltas_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_AccountDeltas_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_netr_AccountDeltas_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_AccountDeltas_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountDeltas_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_AccountDeltas_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_AccountDeltas_ndr_print(py_obj, "netr_AccountDeltas_in", NDR_IN); } static PyObject *py_netr_AccountDeltas_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_AccountDeltas_ndr_print(py_obj, "netr_AccountDeltas_out", NDR_OUT); } static PyMethodDef py_netr_AccountDeltas_methods[] = { { "opnum", (PyCFunction)py_netr_AccountDeltas_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_AccountDeltas.opnum() -> 9 (0x09) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountDeltas_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_netr_AccountDeltas_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_netr_AccountDeltas_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_netr_AccountDeltas_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_netr_AccountDeltas_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_AccountDeltas_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_AccountDeltas_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_AccountDeltas", .tp_getset = py_netr_AccountDeltas_getsetters, .tp_methods = py_netr_AccountDeltas_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_AccountDeltas_new, }; static bool pack_py_netr_AccountDeltas_args_in(PyObject *args, PyObject *kwargs, struct netr_AccountDeltas *r) { PyObject *py_logon_server; PyObject *py_computername; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_uas; PyObject *py_count; PyObject *py_level; PyObject *py_buffersize; const char *kwnames[] = { "logon_server", "computername", "credential", "return_authenticator", "uas", "count", "level", "buffersize", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_AccountDeltas", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_uas, &py_count, &py_level, &py_buffersize)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } if (py_logon_server == Py_None) { r->in.logon_server = NULL; } else { r->in.logon_server = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } } if (py_computername == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername"); return false; } r->in.computername = talloc_ptrtype(r, r->in.computername); if (r->in.computername == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computername)) { unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computername)) { test_str = PyBytes_AS_STRING(py_computername); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->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.computername = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_uas == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.uas"); return false; } PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, py_uas, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_uas)) == NULL) { PyErr_NoMemory(); return false; } r->in.uas = *(struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_uas); if (py_count == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.count)); if (PyLong_Check(py_count)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_count); 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.count = 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_buffersize == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffersize"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffersize)); if (PyLong_Check(py_buffersize)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_buffersize); 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.buffersize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_AccountDeltas_args_out(struct netr_AccountDeltas *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_buffer; PyObject *py_count_returned; PyObject *py_total_entries; PyObject *py_recordid; result = PyTuple_New(5); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, r->out.buffer, r->out.buffer); PyTuple_SetItem(result, 1, py_buffer); py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count_returned); PyTuple_SetItem(result, 2, py_count_returned); py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_entries); PyTuple_SetItem(result, 3, py_total_entries); py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, r->out.recordid, r->out.recordid); PyTuple_SetItem(result, 4, py_recordid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_AccountSync_in_get_logon_server(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } } return py_logon_server; } static int py_netr_AccountSync_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } if (value == Py_None) { object->in.logon_server = NULL; } else { object->in.logon_server = 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.logon_server = talloc_str; } } return 0; } static PyObject *py_netr_AccountSync_in_get_computername(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_computername; if (object->in.computername == NULL) { Py_RETURN_NONE; } if (object->in.computername == NULL) { py_computername = Py_None; Py_INCREF(py_computername); } else { py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore"); } return py_computername; } static int py_netr_AccountSync_in_set_computername(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername"); return -1; } object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername); if (object->in.computername == 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.computername = talloc_str; } return 0; } static PyObject *py_netr_AccountSync_in_get_credential(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_credential; py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, pytalloc_get_mem_ctx(obj), &object->in.credential); return py_credential; } static int py_netr_AccountSync_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountSync_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_AccountSync_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountSync_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_AccountSync_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountSync_in_get_reference(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_reference; py_reference = PyLong_FromUnsignedLongLong((uint32_t)object->in.reference); return py_reference; } static int py_netr_AccountSync_in_set_reference(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.reference"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.reference)); 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.reference = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountSync_in_get_level(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_netr_AccountSync_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)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_netr_AccountSync_in_get_buffersize(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_buffersize; py_buffersize = PyLong_FromUnsignedLongLong((uint32_t)object->in.buffersize); return py_buffersize; } static int py_netr_AccountSync_in_set_buffersize(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffersize"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffersize)); 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.buffersize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountSync_out_get_buffer(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_buffer; if (object->out.buffer == NULL) { Py_RETURN_NONE; } py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, object->out.buffer, object->out.buffer); return py_buffer; } static int py_netr_AccountSync_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer"); return -1; } object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer); if (object->out.buffer == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_AccountBuffer_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.buffer = (struct netr_AccountBuffer *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountSync_out_get_count_returned(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_count_returned; if (object->out.count_returned == NULL) { Py_RETURN_NONE; } py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count_returned); return py_count_returned; } static int py_netr_AccountSync_out_set_count_returned(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count_returned)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count_returned"); return -1; } object->out.count_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count_returned); if (object->out.count_returned == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count_returned)); 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.count_returned = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountSync_out_get_total_entries(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_total_entries; if (object->out.total_entries == NULL) { Py_RETURN_NONE; } py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_entries); return py_total_entries; } static int py_netr_AccountSync_out_set_total_entries(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_entries"); return -1; } object->out.total_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_entries); if (object->out.total_entries == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_entries)); 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.total_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountSync_out_get_next_reference(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_next_reference; if (object->out.next_reference == NULL) { Py_RETURN_NONE; } py_next_reference = PyLong_FromUnsignedLongLong((uint32_t)*object->out.next_reference); return py_next_reference; } static int py_netr_AccountSync_out_set_next_reference(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.next_reference)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.next_reference"); return -1; } object->out.next_reference = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.next_reference); if (object->out.next_reference == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.next_reference)); 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.next_reference = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_AccountSync_in_get_recordid(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_recordid; if (object->in.recordid == NULL) { Py_RETURN_NONE; } py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, object->in.recordid, object->in.recordid); return py_recordid; } static int py_netr_AccountSync_in_set_recordid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.recordid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.recordid"); return -1; } object->in.recordid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.recordid); if (object->in.recordid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_UAS_INFO_0_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.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountSync_out_get_recordid(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_recordid; if (object->out.recordid == NULL) { Py_RETURN_NONE; } py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, object->out.recordid, object->out.recordid); return py_recordid; } static int py_netr_AccountSync_out_set_recordid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.recordid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.recordid"); return -1; } object->out.recordid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.recordid); if (object->out.recordid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_UAS_INFO_0_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.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_AccountSync_get_result(PyObject *obj, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_AccountSync_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_AccountSync *object = (struct netr_AccountSync *)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_netr_AccountSync_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_AccountSync_in_get_logon_server, .set = py_netr_AccountSync_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computername"), .get = py_netr_AccountSync_in_get_computername, .set = py_netr_AccountSync_in_set_computername, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_AccountSync_in_get_credential, .set = py_netr_AccountSync_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_AccountSync_in_get_return_authenticator, .set = py_netr_AccountSync_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_AccountSync_out_get_return_authenticator, .set = py_netr_AccountSync_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_reference"), .get = py_netr_AccountSync_in_get_reference, .set = py_netr_AccountSync_in_set_reference, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_level"), .get = py_netr_AccountSync_in_get_level, .set = py_netr_AccountSync_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_buffersize"), .get = py_netr_AccountSync_in_get_buffersize, .set = py_netr_AccountSync_in_set_buffersize, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_buffer"), .get = py_netr_AccountSync_out_get_buffer, .set = py_netr_AccountSync_out_set_buffer, .doc = discard_const_p(char, "PIDL-generated element of base type netr_AccountBuffer") }, { .name = discard_const_p(char, "out_count_returned"), .get = py_netr_AccountSync_out_get_count_returned, .set = py_netr_AccountSync_out_set_count_returned, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_total_entries"), .get = py_netr_AccountSync_out_get_total_entries, .set = py_netr_AccountSync_out_set_total_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_next_reference"), .get = py_netr_AccountSync_out_get_next_reference, .set = py_netr_AccountSync_out_set_next_reference, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_recordid"), .get = py_netr_AccountSync_in_get_recordid, .set = py_netr_AccountSync_in_set_recordid, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0") }, { .name = discard_const_p(char, "out_recordid"), .get = py_netr_AccountSync_out_get_recordid, .set = py_netr_AccountSync_out_set_recordid, .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0") }, { .name = discard_const_p(char, "result"), .get = py_netr_AccountSync_get_result, .set = py_netr_AccountSync_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_AccountSync_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_AccountSync, type); struct netr_AccountSync *_self = (struct netr_AccountSync *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer); _self->out.count_returned = talloc_zero(mem_ctx, uint32_t); _self->out.total_entries = talloc_zero(mem_ctx, uint32_t); _self->out.next_reference = talloc_zero(mem_ctx, uint32_t); _self->in.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0); _self->out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0); return self; } static PyObject *py_netr_AccountSync_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(10); } static PyObject *py_netr_AccountSync_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountSync_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_AccountSync_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_netr_AccountSync_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_AccountSync_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_netr_AccountSync_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_AccountSync_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 netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountSync_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_AccountSync_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_netr_AccountSync_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_AccountSync_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_netr_AccountSync_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_AccountSync_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountSync_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_AccountSync_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_AccountSync_ndr_print(py_obj, "netr_AccountSync_in", NDR_IN); } static PyObject *py_netr_AccountSync_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_AccountSync_ndr_print(py_obj, "netr_AccountSync_out", NDR_OUT); } static PyMethodDef py_netr_AccountSync_methods[] = { { "opnum", (PyCFunction)py_netr_AccountSync_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_AccountSync.opnum() -> 10 (0x0a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountSync_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_netr_AccountSync_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_netr_AccountSync_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_netr_AccountSync_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_netr_AccountSync_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_AccountSync_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_AccountSync_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_AccountSync", .tp_getset = py_netr_AccountSync_getsetters, .tp_methods = py_netr_AccountSync_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_AccountSync_new, }; static bool pack_py_netr_AccountSync_args_in(PyObject *args, PyObject *kwargs, struct netr_AccountSync *r) { PyObject *py_logon_server; PyObject *py_computername; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_reference; PyObject *py_level; PyObject *py_buffersize; PyObject *py_recordid; const char *kwnames[] = { "logon_server", "computername", "credential", "return_authenticator", "reference", "level", "buffersize", "recordid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_AccountSync", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_reference, &py_level, &py_buffersize, &py_recordid)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } if (py_logon_server == Py_None) { r->in.logon_server = NULL; } else { r->in.logon_server = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } } if (py_computername == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername"); return false; } r->in.computername = talloc_ptrtype(r, r->in.computername); if (r->in.computername == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computername)) { unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computername)) { test_str = PyBytes_AS_STRING(py_computername); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->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.computername = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_reference == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.reference"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.reference)); if (PyLong_Check(py_reference)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_reference); 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.reference = 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_buffersize == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffersize"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffersize)); if (PyLong_Check(py_buffersize)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_buffersize); 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.buffersize = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_recordid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.recordid"); return false; } r->in.recordid = talloc_ptrtype(r, r->in.recordid); if (r->in.recordid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, py_recordid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_recordid)) == NULL) { PyErr_NoMemory(); return false; } r->in.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_recordid); return true; } static PyObject *unpack_py_netr_AccountSync_args_out(struct netr_AccountSync *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_buffer; PyObject *py_count_returned; PyObject *py_total_entries; PyObject *py_next_reference; PyObject *py_recordid; result = PyTuple_New(6); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, r->out.buffer, r->out.buffer); PyTuple_SetItem(result, 1, py_buffer); py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count_returned); PyTuple_SetItem(result, 2, py_count_returned); py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_entries); PyTuple_SetItem(result, 3, py_total_entries); py_next_reference = PyLong_FromUnsignedLongLong((uint32_t)*r->out.next_reference); PyTuple_SetItem(result, 4, py_next_reference); py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, r->out.recordid, r->out.recordid); PyTuple_SetItem(result, 5, py_recordid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_GetDcName_in_get_logon_server(PyObject *obj, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } return py_logon_server; } static int py_netr_GetDcName_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server); if (object->in.logon_server == 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.logon_server = talloc_str; } return 0; } static PyObject *py_netr_GetDcName_in_get_domainname(PyObject *obj, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj); PyObject *py_domainname; if (object->in.domainname == NULL) { Py_RETURN_NONE; } if (object->in.domainname == NULL) { py_domainname = Py_None; Py_INCREF(py_domainname); } else { if (object->in.domainname == NULL) { py_domainname = Py_None; Py_INCREF(py_domainname); } else { py_domainname = PyUnicode_Decode(object->in.domainname, strlen(object->in.domainname), "utf-8", "ignore"); } } return py_domainname; } static int py_netr_GetDcName_in_set_domainname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domainname"); return -1; } if (value == Py_None) { object->in.domainname = NULL; } else { object->in.domainname = 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.domainname = talloc_str; } } return 0; } static PyObject *py_netr_GetDcName_out_get_dcname(PyObject *obj, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)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_netr_GetDcName_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)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_netr_GetDcName_get_result(PyObject *obj, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_GetDcName_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetDcName *object = (struct netr_GetDcName *)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_netr_GetDcName_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_GetDcName_in_get_logon_server, .set = py_netr_GetDcName_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domainname"), .get = py_netr_GetDcName_in_get_domainname, .set = py_netr_GetDcName_in_set_domainname, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_dcname"), .get = py_netr_GetDcName_out_get_dcname, .set = py_netr_GetDcName_out_set_dcname, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "result"), .get = py_netr_GetDcName_get_result, .set = py_netr_GetDcName_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_GetDcName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_GetDcName, type); return self; } static PyObject *py_netr_GetDcName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(11); } static PyObject *py_netr_GetDcName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetDcName_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_GetDcName_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_netr_GetDcName_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_GetDcName_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_netr_GetDcName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_GetDcName_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 netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetDcName_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_GetDcName_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_netr_GetDcName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_GetDcName_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_netr_GetDcName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_GetDcName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetDcName_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_GetDcName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_GetDcName_ndr_print(py_obj, "netr_GetDcName_in", NDR_IN); } static PyObject *py_netr_GetDcName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_GetDcName_ndr_print(py_obj, "netr_GetDcName_out", NDR_OUT); } static PyMethodDef py_netr_GetDcName_methods[] = { { "opnum", (PyCFunction)py_netr_GetDcName_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_GetDcName.opnum() -> 11 (0x0b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetDcName_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_netr_GetDcName_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_netr_GetDcName_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_netr_GetDcName_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_netr_GetDcName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_GetDcName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_GetDcName_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_GetDcName", .tp_getset = py_netr_GetDcName_getsetters, .tp_methods = py_netr_GetDcName_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_GetDcName_new, }; static bool pack_py_netr_GetDcName_args_in(PyObject *args, PyObject *kwargs, struct netr_GetDcName *r) { PyObject *py_logon_server; PyObject *py_domainname; const char *kwnames[] = { "logon_server", "domainname", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_GetDcName", discard_const_p(char *, kwnames), &py_logon_server, &py_domainname)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } r->in.logon_server = talloc_ptrtype(r, r->in.logon_server); if (r->in.logon_server == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } if (py_domainname == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domainname"); return false; } if (py_domainname == Py_None) { r->in.domainname = NULL; } else { r->in.domainname = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_domainname)) { unicode = PyUnicode_AsEncodedString(py_domainname, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_domainname)) { test_str = PyBytes_AS_STRING(py_domainname); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domainname)->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.domainname = talloc_str; } } return true; } static PyObject *unpack_py_netr_GetDcName_args_out(struct netr_GetDcName *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 (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonControl_in_get_logon_server(PyObject *obj, void *closure) { struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } } return py_logon_server; } static int py_netr_LogonControl_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } if (value == Py_None) { object->in.logon_server = NULL; } else { object->in.logon_server = 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.logon_server = talloc_str; } } return 0; } static PyObject *py_netr_LogonControl_in_get_function_code(PyObject *obj, void *closure) { struct netr_LogonControl *object = (struct netr_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_netr_LogonControl_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl *object = (struct netr_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_netr_LogonControl_in_get_level(PyObject *obj, void *closure) { struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_netr_LogonControl_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl *object = (struct netr_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_netr_LogonControl_out_get_query(PyObject *obj, void *closure) { struct netr_LogonControl *object = (struct netr_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_netr_LogonControl_out_set_query(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl *object = (struct netr_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_netr_LogonControl_get_result(PyObject *obj, void *closure) { struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_LogonControl_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl *object = (struct netr_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_netr_LogonControl_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_LogonControl_in_get_logon_server, .set = py_netr_LogonControl_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_function_code"), .get = py_netr_LogonControl_in_get_function_code, .set = py_netr_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_netr_LogonControl_in_get_level, .set = py_netr_LogonControl_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_query"), .get = py_netr_LogonControl_out_get_query, .set = py_netr_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_netr_LogonControl_get_result, .set = py_netr_LogonControl_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_LogonControl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonControl, type); struct netr_LogonControl *_self = (struct netr_LogonControl *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION); return self; } static PyObject *py_netr_LogonControl_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(12); } static PyObject *py_netr_LogonControl_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonControl *object = (struct netr_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_netlogon.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_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_netr_LogonControl_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_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_netr_LogonControl_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_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 netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_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_netr_LogonControl_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_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_netr_LogonControl_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonControl_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonControl_ndr_print(py_obj, "netr_LogonControl_in", NDR_IN); } static PyObject *py_netr_LogonControl_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonControl_ndr_print(py_obj, "netr_LogonControl_out", NDR_OUT); } static PyMethodDef py_netr_LogonControl_methods[] = { { "opnum", (PyCFunction)py_netr_LogonControl_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonControl.opnum() -> 12 (0x0c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_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_netr_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_netr_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_netr_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_netr_LogonControl_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonControl_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonControl_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonControl", .tp_getset = py_netr_LogonControl_getsetters, .tp_methods = py_netr_LogonControl_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonControl_new, }; static bool pack_py_netr_LogonControl_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonControl *r) { PyObject *py_logon_server; PyObject *py_function_code; PyObject *py_level; const char *kwnames[] = { "logon_server", "function_code", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_LogonControl", discard_const_p(char *, kwnames), &py_logon_server, &py_function_code, &py_level)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } if (py_logon_server == Py_None) { r->in.logon_server = NULL; } else { r->in.logon_server = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } } 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; } } return true; } static PyObject *unpack_py_netr_LogonControl_args_out(struct netr_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_netr_GetAnyDCName_in_get_logon_server(PyObject *obj, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } } return py_logon_server; } static int py_netr_GetAnyDCName_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } if (value == Py_None) { object->in.logon_server = NULL; } else { object->in.logon_server = 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.logon_server = talloc_str; } } return 0; } static PyObject *py_netr_GetAnyDCName_in_get_domainname(PyObject *obj, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj); PyObject *py_domainname; if (object->in.domainname == NULL) { Py_RETURN_NONE; } if (object->in.domainname == NULL) { py_domainname = Py_None; Py_INCREF(py_domainname); } else { if (object->in.domainname == NULL) { py_domainname = Py_None; Py_INCREF(py_domainname); } else { py_domainname = PyUnicode_Decode(object->in.domainname, strlen(object->in.domainname), "utf-8", "ignore"); } } return py_domainname; } static int py_netr_GetAnyDCName_in_set_domainname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domainname"); return -1; } if (value == Py_None) { object->in.domainname = NULL; } else { object->in.domainname = 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.domainname = talloc_str; } } return 0; } static PyObject *py_netr_GetAnyDCName_out_get_dcname(PyObject *obj, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)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_netr_GetAnyDCName_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)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_netr_GetAnyDCName_get_result(PyObject *obj, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_GetAnyDCName_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)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_netr_GetAnyDCName_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_GetAnyDCName_in_get_logon_server, .set = py_netr_GetAnyDCName_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domainname"), .get = py_netr_GetAnyDCName_in_get_domainname, .set = py_netr_GetAnyDCName_in_set_domainname, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_dcname"), .get = py_netr_GetAnyDCName_out_get_dcname, .set = py_netr_GetAnyDCName_out_set_dcname, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "result"), .get = py_netr_GetAnyDCName_get_result, .set = py_netr_GetAnyDCName_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_GetAnyDCName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_GetAnyDCName, type); return self; } static PyObject *py_netr_GetAnyDCName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(13); } static PyObject *py_netr_GetAnyDCName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetAnyDCName_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_GetAnyDCName_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_netr_GetAnyDCName_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_GetAnyDCName_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_netr_GetAnyDCName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_GetAnyDCName_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 netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetAnyDCName_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_GetAnyDCName_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_netr_GetAnyDCName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_GetAnyDCName_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_netr_GetAnyDCName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_GetAnyDCName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetAnyDCName_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_GetAnyDCName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_GetAnyDCName_ndr_print(py_obj, "netr_GetAnyDCName_in", NDR_IN); } static PyObject *py_netr_GetAnyDCName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_GetAnyDCName_ndr_print(py_obj, "netr_GetAnyDCName_out", NDR_OUT); } static PyMethodDef py_netr_GetAnyDCName_methods[] = { { "opnum", (PyCFunction)py_netr_GetAnyDCName_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_GetAnyDCName.opnum() -> 13 (0x0d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetAnyDCName_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_netr_GetAnyDCName_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_netr_GetAnyDCName_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_netr_GetAnyDCName_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_netr_GetAnyDCName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_GetAnyDCName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_GetAnyDCName_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_GetAnyDCName", .tp_getset = py_netr_GetAnyDCName_getsetters, .tp_methods = py_netr_GetAnyDCName_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_GetAnyDCName_new, }; static bool pack_py_netr_GetAnyDCName_args_in(PyObject *args, PyObject *kwargs, struct netr_GetAnyDCName *r) { PyObject *py_logon_server; PyObject *py_domainname; const char *kwnames[] = { "logon_server", "domainname", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_GetAnyDCName", discard_const_p(char *, kwnames), &py_logon_server, &py_domainname)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } if (py_logon_server == Py_None) { r->in.logon_server = NULL; } else { r->in.logon_server = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } } if (py_domainname == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domainname"); return false; } if (py_domainname == Py_None) { r->in.domainname = NULL; } else { r->in.domainname = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_domainname)) { unicode = PyUnicode_AsEncodedString(py_domainname, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_domainname)) { test_str = PyBytes_AS_STRING(py_domainname); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domainname)->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.domainname = talloc_str; } } return true; } static PyObject *unpack_py_netr_GetAnyDCName_args_out(struct netr_GetAnyDCName *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 (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonControl2_in_get_logon_server(PyObject *obj, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } } return py_logon_server; } static int py_netr_LogonControl2_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } if (value == Py_None) { object->in.logon_server = NULL; } else { object->in.logon_server = 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.logon_server = talloc_str; } } return 0; } static PyObject *py_netr_LogonControl2_in_get_function_code(PyObject *obj, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_in_get_level(PyObject *obj, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_netr_LogonControl2_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_in_get_data(PyObject *obj, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_in_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_out_get_query(PyObject *obj, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_out_set_query(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_get_result(PyObject *obj, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_LogonControl2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)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_netr_LogonControl2_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_LogonControl2_in_get_logon_server, .set = py_netr_LogonControl2_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_function_code"), .get = py_netr_LogonControl2_in_get_function_code, .set = py_netr_LogonControl2_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_netr_LogonControl2_in_get_level, .set = py_netr_LogonControl2_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_data"), .get = py_netr_LogonControl2_in_get_data, .set = py_netr_LogonControl2_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_netr_LogonControl2_out_get_query, .set = py_netr_LogonControl2_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_netr_LogonControl2_get_result, .set = py_netr_LogonControl2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_LogonControl2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonControl2, type); struct netr_LogonControl2 *_self = (struct netr_LogonControl2 *)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_netr_LogonControl2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(14); } static PyObject *py_netr_LogonControl2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl2_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_netr_LogonControl2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonControl2_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_netr_LogonControl2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonControl2_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 netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl2_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_netr_LogonControl2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonControl2_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_netr_LogonControl2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonControl2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonControl2_ndr_print(py_obj, "netr_LogonControl2_in", NDR_IN); } static PyObject *py_netr_LogonControl2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonControl2_ndr_print(py_obj, "netr_LogonControl2_out", NDR_OUT); } static PyMethodDef py_netr_LogonControl2_methods[] = { { "opnum", (PyCFunction)py_netr_LogonControl2_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonControl2.opnum() -> 14 (0x0e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2_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_netr_LogonControl2_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_netr_LogonControl2_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_netr_LogonControl2_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_netr_LogonControl2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonControl2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonControl2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonControl2", .tp_getset = py_netr_LogonControl2_getsetters, .tp_methods = py_netr_LogonControl2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonControl2_new, }; static bool pack_py_netr_LogonControl2_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonControl2 *r) { PyObject *py_logon_server; PyObject *py_function_code; PyObject *py_level; PyObject *py_data; const char *kwnames[] = { "logon_server", "function_code", "level", "data", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_LogonControl2", discard_const_p(char *, kwnames), &py_logon_server, &py_function_code, &py_level, &py_data)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } if (py_logon_server == Py_None) { r->in.logon_server = NULL; } else { r->in.logon_server = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } } 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_netr_LogonControl2_args_out(struct netr_LogonControl2 *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_netr_ServerAuthenticate2_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerAuthenticate2_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerAuthenticate2_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerAuthenticate2_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerAuthenticate2_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerAuthenticate2_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate2_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerAuthenticate2_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerAuthenticate2_in_get_credentials(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_credentials; if (object->in.credentials == NULL) { Py_RETURN_NONE; } py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials); return py_credentials; } static int py_netr_ServerAuthenticate2_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials"); return -1; } object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials); if (object->in.credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerAuthenticate2_out_get_return_credentials(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_return_credentials; if (object->out.return_credentials == NULL) { Py_RETURN_NONE; } py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials); return py_return_credentials; } static int py_netr_ServerAuthenticate2_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials"); return -1; } object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials); if (object->out.return_credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerAuthenticate2_in_get_negotiate_flags(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_negotiate_flags; if (object->in.negotiate_flags == NULL) { Py_RETURN_NONE; } py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.negotiate_flags); return py_negotiate_flags; } static int py_netr_ServerAuthenticate2_in_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.negotiate_flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.negotiate_flags"); return -1; } object->in.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.negotiate_flags); if (object->in.negotiate_flags == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.negotiate_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.negotiate_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate2_out_get_negotiate_flags(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_negotiate_flags; if (object->out.negotiate_flags == NULL) { Py_RETURN_NONE; } py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.negotiate_flags); return py_negotiate_flags; } static int py_netr_ServerAuthenticate2_out_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.negotiate_flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.negotiate_flags"); return -1; } object->out.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.negotiate_flags); if (object->out.negotiate_flags == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.negotiate_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->out.negotiate_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate2_get_result(PyObject *obj, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerAuthenticate2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)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_netr_ServerAuthenticate2_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerAuthenticate2_in_get_server_name, .set = py_netr_ServerAuthenticate2_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerAuthenticate2_in_get_account_name, .set = py_netr_ServerAuthenticate2_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerAuthenticate2_in_get_secure_channel_type, .set = py_netr_ServerAuthenticate2_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerAuthenticate2_in_get_computer_name, .set = py_netr_ServerAuthenticate2_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credentials"), .get = py_netr_ServerAuthenticate2_in_get_credentials, .set = py_netr_ServerAuthenticate2_in_set_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "out_return_credentials"), .get = py_netr_ServerAuthenticate2_out_get_return_credentials, .set = py_netr_ServerAuthenticate2_out_set_return_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "in_negotiate_flags"), .get = py_netr_ServerAuthenticate2_in_get_negotiate_flags, .set = py_netr_ServerAuthenticate2_in_set_negotiate_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags") }, { .name = discard_const_p(char, "out_negotiate_flags"), .get = py_netr_ServerAuthenticate2_out_get_negotiate_flags, .set = py_netr_ServerAuthenticate2_out_set_negotiate_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerAuthenticate2_get_result, .set = py_netr_ServerAuthenticate2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerAuthenticate2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerAuthenticate2, type); struct netr_ServerAuthenticate2 *_self = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential); _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential); _self->in.negotiate_flags = talloc_zero(mem_ctx, uint32_t); _self->out.negotiate_flags = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_netr_ServerAuthenticate2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(15); } static PyObject *py_netr_ServerAuthenticate2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate2_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerAuthenticate2_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 netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate2_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerAuthenticate2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate2_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_ServerAuthenticate2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerAuthenticate2_ndr_print(py_obj, "netr_ServerAuthenticate2_in", NDR_IN); } static PyObject *py_netr_ServerAuthenticate2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerAuthenticate2_ndr_print(py_obj, "netr_ServerAuthenticate2_out", NDR_OUT); } static PyMethodDef py_netr_ServerAuthenticate2_methods[] = { { "opnum", (PyCFunction)py_netr_ServerAuthenticate2_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerAuthenticate2.opnum() -> 15 (0x0f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerAuthenticate2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerAuthenticate2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerAuthenticate2", .tp_getset = py_netr_ServerAuthenticate2_getsetters, .tp_methods = py_netr_ServerAuthenticate2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerAuthenticate2_new, }; static bool pack_py_netr_ServerAuthenticate2_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerAuthenticate2 *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credentials; PyObject *py_negotiate_flags; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credentials", "negotiate_flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerAuthenticate2", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credentials, &py_negotiate_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credentials == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials"); return false; } r->in.credentials = talloc_ptrtype(r, r->in.credentials); if (r->in.credentials == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) { PyErr_NoMemory(); return false; } r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials); if (py_negotiate_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.negotiate_flags"); return false; } r->in.negotiate_flags = talloc_ptrtype(r, r->in.negotiate_flags); if (r->in.negotiate_flags == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.negotiate_flags)); if (PyLong_Check(py_negotiate_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_negotiate_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.negotiate_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_ServerAuthenticate2_args_out(struct netr_ServerAuthenticate2 *r) { PyObject *result; PyObject *py_return_credentials; PyObject *py_negotiate_flags; result = PyTuple_New(2); py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials); PyTuple_SetItem(result, 0, py_return_credentials); py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.negotiate_flags); PyTuple_SetItem(result, 1, py_negotiate_flags); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DatabaseSync2_in_get_logon_server(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } return py_logon_server; } static int py_netr_DatabaseSync2_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server); if (object->in.logon_server == 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.logon_server = talloc_str; } return 0; } static PyObject *py_netr_DatabaseSync2_in_get_computername(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_computername; if (object->in.computername == NULL) { Py_RETURN_NONE; } if (object->in.computername == NULL) { py_computername = Py_None; Py_INCREF(py_computername); } else { py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore"); } return py_computername; } static int py_netr_DatabaseSync2_in_set_computername(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername"); return -1; } object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername); if (object->in.computername == 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.computername = talloc_str; } return 0; } static PyObject *py_netr_DatabaseSync2_in_get_credential(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_DatabaseSync2_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseSync2_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseSync2_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseSync2_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseSync2_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseSync2_in_get_database_id(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_database_id; py_database_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.database_id); return py_database_id; } static int py_netr_DatabaseSync2_in_set_database_id(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.database_id"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.database_id)); 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.database_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync2_in_get_restart_state(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_restart_state; py_restart_state = PyLong_FromLong((uint16_t)object->in.restart_state); return py_restart_state; } static int py_netr_DatabaseSync2_in_set_restart_state(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.restart_state"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.restart_state)); 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.restart_state = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync2_in_get_sync_context(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_sync_context; if (object->in.sync_context == NULL) { Py_RETURN_NONE; } py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->in.sync_context); return py_sync_context; } static int py_netr_DatabaseSync2_in_set_sync_context(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sync_context)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sync_context"); return -1; } object->in.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sync_context); if (object->in.sync_context == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.sync_context)); 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.sync_context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync2_out_get_sync_context(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_sync_context; if (object->out.sync_context == NULL) { Py_RETURN_NONE; } py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sync_context); return py_sync_context; } static int py_netr_DatabaseSync2_out_set_sync_context(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sync_context)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sync_context"); return -1; } object->out.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sync_context); if (object->out.sync_context == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sync_context)); 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.sync_context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync2_out_get_delta_enum_array(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_delta_enum_array; if (object->out.delta_enum_array == NULL) { Py_RETURN_NONE; } if (*object->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array); } return py_delta_enum_array; } static int py_netr_DatabaseSync2_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array"); return -1; } object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array); if (object->out.delta_enum_array == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.delta_enum_array = NULL; } else { *object->out.delta_enum_array = NULL; PY_CHECK_TYPE(&netr_DELTA_ENUM_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.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DatabaseSync2_in_get_preferredmaximumlength(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_preferredmaximumlength; py_preferredmaximumlength = PyLong_FromUnsignedLongLong((uint32_t)object->in.preferredmaximumlength); return py_preferredmaximumlength; } static int py_netr_DatabaseSync2_in_set_preferredmaximumlength(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.preferredmaximumlength"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.preferredmaximumlength)); 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.preferredmaximumlength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseSync2_get_result(PyObject *obj, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_DatabaseSync2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)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_netr_DatabaseSync2_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_DatabaseSync2_in_get_logon_server, .set = py_netr_DatabaseSync2_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computername"), .get = py_netr_DatabaseSync2_in_get_computername, .set = py_netr_DatabaseSync2_in_set_computername, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_DatabaseSync2_in_get_credential, .set = py_netr_DatabaseSync2_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_DatabaseSync2_in_get_return_authenticator, .set = py_netr_DatabaseSync2_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_DatabaseSync2_out_get_return_authenticator, .set = py_netr_DatabaseSync2_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_database_id"), .get = py_netr_DatabaseSync2_in_get_database_id, .set = py_netr_DatabaseSync2_in_set_database_id, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID") }, { .name = discard_const_p(char, "in_restart_state"), .get = py_netr_DatabaseSync2_in_get_restart_state, .set = py_netr_DatabaseSync2_in_set_restart_state, .doc = discard_const_p(char, "PIDL-generated element of base type SyncStateEnum") }, { .name = discard_const_p(char, "in_sync_context"), .get = py_netr_DatabaseSync2_in_get_sync_context, .set = py_netr_DatabaseSync2_in_set_sync_context, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_sync_context"), .get = py_netr_DatabaseSync2_out_get_sync_context, .set = py_netr_DatabaseSync2_out_set_sync_context, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_delta_enum_array"), .get = py_netr_DatabaseSync2_out_get_delta_enum_array, .set = py_netr_DatabaseSync2_out_set_delta_enum_array, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY") }, { .name = discard_const_p(char, "in_preferredmaximumlength"), .get = py_netr_DatabaseSync2_in_get_preferredmaximumlength, .set = py_netr_DatabaseSync2_in_set_preferredmaximumlength, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_netr_DatabaseSync2_get_result, .set = py_netr_DatabaseSync2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_DatabaseSync2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DatabaseSync2, type); struct netr_DatabaseSync2 *_self = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.sync_context = talloc_zero(mem_ctx, uint32_t); _self->out.sync_context = talloc_zero(mem_ctx, uint32_t); /* a pointer to a NULL pointer */ _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *); return self; } static PyObject *py_netr_DatabaseSync2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(16); } static PyObject *py_netr_DatabaseSync2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync2_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseSync2_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_netr_DatabaseSync2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DatabaseSync2_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_netr_DatabaseSync2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DatabaseSync2_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 netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync2_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseSync2_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_netr_DatabaseSync2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseSync2_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_netr_DatabaseSync2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseSync2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync2_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseSync2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseSync2_ndr_print(py_obj, "netr_DatabaseSync2_in", NDR_IN); } static PyObject *py_netr_DatabaseSync2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseSync2_ndr_print(py_obj, "netr_DatabaseSync2_out", NDR_OUT); } static PyMethodDef py_netr_DatabaseSync2_methods[] = { { "opnum", (PyCFunction)py_netr_DatabaseSync2_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DatabaseSync2.opnum() -> 16 (0x10) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync2_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_netr_DatabaseSync2_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_netr_DatabaseSync2_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_netr_DatabaseSync2_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_netr_DatabaseSync2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseSync2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DatabaseSync2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DatabaseSync2", .tp_getset = py_netr_DatabaseSync2_getsetters, .tp_methods = py_netr_DatabaseSync2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DatabaseSync2_new, }; static bool pack_py_netr_DatabaseSync2_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseSync2 *r) { PyObject *py_logon_server; PyObject *py_computername; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_database_id; PyObject *py_restart_state; PyObject *py_sync_context; PyObject *py_preferredmaximumlength; const char *kwnames[] = { "logon_server", "computername", "credential", "return_authenticator", "database_id", "restart_state", "sync_context", "preferredmaximumlength", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_DatabaseSync2", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_database_id, &py_restart_state, &py_sync_context, &py_preferredmaximumlength)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } r->in.logon_server = talloc_ptrtype(r, r->in.logon_server); if (r->in.logon_server == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } if (py_computername == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername"); return false; } r->in.computername = talloc_ptrtype(r, r->in.computername); if (r->in.computername == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computername)) { unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computername)) { test_str = PyBytes_AS_STRING(py_computername); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->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.computername = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_database_id == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.database_id"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.database_id)); if (PyLong_Check(py_database_id)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_database_id); 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.database_id = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_restart_state == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.restart_state"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.restart_state)); if (PyLong_Check(py_restart_state)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_restart_state); 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.restart_state = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_sync_context == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sync_context"); return false; } r->in.sync_context = talloc_ptrtype(r, r->in.sync_context); if (r->in.sync_context == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.sync_context)); if (PyLong_Check(py_sync_context)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_sync_context); 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.sync_context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_preferredmaximumlength == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.preferredmaximumlength"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.preferredmaximumlength)); if (PyLong_Check(py_preferredmaximumlength)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_preferredmaximumlength); 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.preferredmaximumlength = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_DatabaseSync2_args_out(struct netr_DatabaseSync2 *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_sync_context; PyObject *py_delta_enum_array; result = PyTuple_New(3); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sync_context); PyTuple_SetItem(result, 1, py_sync_context); if (*r->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array); } PyTuple_SetItem(result, 2, py_delta_enum_array); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DatabaseRedo_in_get_logon_server(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } return py_logon_server; } static int py_netr_DatabaseRedo_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server); if (object->in.logon_server == 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.logon_server = talloc_str; } return 0; } static PyObject *py_netr_DatabaseRedo_in_get_computername(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_computername; if (object->in.computername == NULL) { Py_RETURN_NONE; } if (object->in.computername == NULL) { py_computername = Py_None; Py_INCREF(py_computername); } else { py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore"); } return py_computername; } static int py_netr_DatabaseRedo_in_set_computername(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername"); return -1; } object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername); if (object->in.computername == 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.computername = talloc_str; } return 0; } static PyObject *py_netr_DatabaseRedo_in_get_credential(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_DatabaseRedo_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseRedo_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseRedo_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseRedo_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_DatabaseRedo_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseRedo_in_get_change_log_entry(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_change_log_entry; py_change_log_entry = pytalloc_reference_ex(&netr_ChangeLogEntry_Type, pytalloc_get_mem_ctx(obj), &object->in.change_log_entry); return py_change_log_entry; } static int py_netr_DatabaseRedo_in_set_change_log_entry(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.change_log_entry"); return -1; } PY_CHECK_TYPE(&netr_ChangeLogEntry_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.change_log_entry = *(struct netr_ChangeLogEntry *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DatabaseRedo_in_get_change_log_entry_size(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_change_log_entry_size; py_change_log_entry_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.change_log_entry_size); return py_change_log_entry_size; } static int py_netr_DatabaseRedo_in_set_change_log_entry_size(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.change_log_entry_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.change_log_entry_size)); 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.change_log_entry_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DatabaseRedo_out_get_delta_enum_array(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_delta_enum_array; if (object->out.delta_enum_array == NULL) { Py_RETURN_NONE; } if (*object->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array); } return py_delta_enum_array; } static int py_netr_DatabaseRedo_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array"); return -1; } object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array); if (object->out.delta_enum_array == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.delta_enum_array = NULL; } else { *object->out.delta_enum_array = NULL; PY_CHECK_TYPE(&netr_DELTA_ENUM_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.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DatabaseRedo_get_result(PyObject *obj, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_DatabaseRedo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)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_netr_DatabaseRedo_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_DatabaseRedo_in_get_logon_server, .set = py_netr_DatabaseRedo_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computername"), .get = py_netr_DatabaseRedo_in_get_computername, .set = py_netr_DatabaseRedo_in_set_computername, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_DatabaseRedo_in_get_credential, .set = py_netr_DatabaseRedo_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_DatabaseRedo_in_get_return_authenticator, .set = py_netr_DatabaseRedo_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_DatabaseRedo_out_get_return_authenticator, .set = py_netr_DatabaseRedo_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_change_log_entry"), .get = py_netr_DatabaseRedo_in_get_change_log_entry, .set = py_netr_DatabaseRedo_in_set_change_log_entry, .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChangeLogEntry") }, { .name = discard_const_p(char, "in_change_log_entry_size"), .get = py_netr_DatabaseRedo_in_get_change_log_entry_size, .set = py_netr_DatabaseRedo_in_set_change_log_entry_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_delta_enum_array"), .get = py_netr_DatabaseRedo_out_get_delta_enum_array, .set = py_netr_DatabaseRedo_out_set_delta_enum_array, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY") }, { .name = discard_const_p(char, "result"), .get = py_netr_DatabaseRedo_get_result, .set = py_netr_DatabaseRedo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_DatabaseRedo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DatabaseRedo, type); struct netr_DatabaseRedo *_self = (struct netr_DatabaseRedo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); /* a pointer to a NULL pointer */ _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *); return self; } static PyObject *py_netr_DatabaseRedo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(17); } static PyObject *py_netr_DatabaseRedo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseRedo_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseRedo_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_netr_DatabaseRedo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DatabaseRedo_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_netr_DatabaseRedo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DatabaseRedo_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 netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseRedo_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseRedo_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_netr_DatabaseRedo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseRedo_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_netr_DatabaseRedo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DatabaseRedo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseRedo_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_DatabaseRedo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseRedo_ndr_print(py_obj, "netr_DatabaseRedo_in", NDR_IN); } static PyObject *py_netr_DatabaseRedo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DatabaseRedo_ndr_print(py_obj, "netr_DatabaseRedo_out", NDR_OUT); } static PyMethodDef py_netr_DatabaseRedo_methods[] = { { "opnum", (PyCFunction)py_netr_DatabaseRedo_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DatabaseRedo.opnum() -> 17 (0x11) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseRedo_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_netr_DatabaseRedo_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_netr_DatabaseRedo_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_netr_DatabaseRedo_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_netr_DatabaseRedo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseRedo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DatabaseRedo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DatabaseRedo", .tp_getset = py_netr_DatabaseRedo_getsetters, .tp_methods = py_netr_DatabaseRedo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DatabaseRedo_new, }; static bool pack_py_netr_DatabaseRedo_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseRedo *r) { PyObject *py_logon_server; PyObject *py_computername; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_change_log_entry; PyObject *py_change_log_entry_size; const char *kwnames[] = { "logon_server", "computername", "credential", "return_authenticator", "change_log_entry", "change_log_entry_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_DatabaseRedo", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_change_log_entry, &py_change_log_entry_size)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } r->in.logon_server = talloc_ptrtype(r, r->in.logon_server); if (r->in.logon_server == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } if (py_computername == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername"); return false; } r->in.computername = talloc_ptrtype(r, r->in.computername); if (r->in.computername == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computername)) { unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computername)) { test_str = PyBytes_AS_STRING(py_computername); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->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.computername = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_change_log_entry == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.change_log_entry"); return false; } PY_CHECK_TYPE(&netr_ChangeLogEntry_Type, py_change_log_entry, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_change_log_entry)) == NULL) { PyErr_NoMemory(); return false; } r->in.change_log_entry = *(struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_change_log_entry); if (py_change_log_entry_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.change_log_entry_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.change_log_entry_size)); if (PyLong_Check(py_change_log_entry_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_change_log_entry_size); 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.change_log_entry_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_DatabaseRedo_args_out(struct netr_DatabaseRedo *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_delta_enum_array; result = PyTuple_New(2); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); if (*r->out.delta_enum_array == NULL) { py_delta_enum_array = Py_None; Py_INCREF(py_delta_enum_array); } else { py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array); } PyTuple_SetItem(result, 1, py_delta_enum_array); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonControl2Ex_in_get_logon_server(PyObject *obj, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj); PyObject *py_logon_server; if (object->in.logon_server == NULL) { Py_RETURN_NONE; } if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { if (object->in.logon_server == NULL) { py_logon_server = Py_None; Py_INCREF(py_logon_server); } else { py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore"); } } return py_logon_server; } static int py_netr_LogonControl2Ex_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server"); return -1; } if (value == Py_None) { object->in.logon_server = NULL; } else { object->in.logon_server = 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.logon_server = talloc_str; } } return 0; } static PyObject *py_netr_LogonControl2Ex_in_get_function_code(PyObject *obj, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_in_get_level(PyObject *obj, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_netr_LogonControl2Ex_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_in_get_data(PyObject *obj, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_in_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_out_get_query(PyObject *obj, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_out_set_query(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_get_result(PyObject *obj, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_LogonControl2Ex_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_getsetters[] = { { .name = discard_const_p(char, "in_logon_server"), .get = py_netr_LogonControl2Ex_in_get_logon_server, .set = py_netr_LogonControl2Ex_in_set_logon_server, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_function_code"), .get = py_netr_LogonControl2Ex_in_get_function_code, .set = py_netr_LogonControl2Ex_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_netr_LogonControl2Ex_in_get_level, .set = py_netr_LogonControl2Ex_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_data"), .get = py_netr_LogonControl2Ex_in_get_data, .set = py_netr_LogonControl2Ex_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_netr_LogonControl2Ex_out_get_query, .set = py_netr_LogonControl2Ex_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_netr_LogonControl2Ex_get_result, .set = py_netr_LogonControl2Ex_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_LogonControl2Ex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonControl2Ex, type); struct netr_LogonControl2Ex *_self = (struct netr_LogonControl2Ex *)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_netr_LogonControl2Ex_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(18); } static PyObject *py_netr_LogonControl2Ex_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2Ex_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl2Ex_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_netr_LogonControl2Ex_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonControl2Ex_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_netr_LogonControl2Ex_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonControl2Ex_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 netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2Ex_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl2Ex_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_netr_LogonControl2Ex_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonControl2Ex_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_netr_LogonControl2Ex_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonControl2Ex_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2Ex_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonControl2Ex_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonControl2Ex_ndr_print(py_obj, "netr_LogonControl2Ex_in", NDR_IN); } static PyObject *py_netr_LogonControl2Ex_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonControl2Ex_ndr_print(py_obj, "netr_LogonControl2Ex_out", NDR_OUT); } static PyMethodDef py_netr_LogonControl2Ex_methods[] = { { "opnum", (PyCFunction)py_netr_LogonControl2Ex_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonControl2Ex.opnum() -> 18 (0x12) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2Ex_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_netr_LogonControl2Ex_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_netr_LogonControl2Ex_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_netr_LogonControl2Ex_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_netr_LogonControl2Ex_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonControl2Ex_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonControl2Ex_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonControl2Ex", .tp_getset = py_netr_LogonControl2Ex_getsetters, .tp_methods = py_netr_LogonControl2Ex_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonControl2Ex_new, }; static bool pack_py_netr_LogonControl2Ex_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonControl2Ex *r) { PyObject *py_logon_server; PyObject *py_function_code; PyObject *py_level; PyObject *py_data; const char *kwnames[] = { "logon_server", "function_code", "level", "data", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_LogonControl2Ex", discard_const_p(char *, kwnames), &py_logon_server, &py_function_code, &py_level, &py_data)) { return false; } if (py_logon_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server"); return false; } if (py_logon_server == Py_None) { r->in.logon_server = NULL; } else { r->in.logon_server = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_logon_server)) { unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_logon_server)) { test_str = PyBytes_AS_STRING(py_logon_server); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->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.logon_server = talloc_str; } } 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_netr_LogonControl2Ex_args_out(struct netr_LogonControl2Ex *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_netr_NetrEnumerateTrustedDomains_in_get_server_name(PyObject *obj, void *closure) { struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_NetrEnumerateTrustedDomains_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_NetrEnumerateTrustedDomains_out_get_trusted_domains_blob(PyObject *obj, void *closure) { struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(obj); PyObject *py_trusted_domains_blob; if (object->out.trusted_domains_blob == NULL) { Py_RETURN_NONE; } py_trusted_domains_blob = pytalloc_reference_ex(&netr_Blob_Type, object->out.trusted_domains_blob, object->out.trusted_domains_blob); return py_trusted_domains_blob; } static int py_netr_NetrEnumerateTrustedDomains_out_set_trusted_domains_blob(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trusted_domains_blob)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trusted_domains_blob"); return -1; } object->out.trusted_domains_blob = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trusted_domains_blob); if (object->out.trusted_domains_blob == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Blob_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.trusted_domains_blob = (struct netr_Blob *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_NetrEnumerateTrustedDomains_get_result(PyObject *obj, void *closure) { struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_NetrEnumerateTrustedDomains_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)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_netr_NetrEnumerateTrustedDomains_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_NetrEnumerateTrustedDomains_in_get_server_name, .set = py_netr_NetrEnumerateTrustedDomains_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_trusted_domains_blob"), .get = py_netr_NetrEnumerateTrustedDomains_out_get_trusted_domains_blob, .set = py_netr_NetrEnumerateTrustedDomains_out_set_trusted_domains_blob, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Blob") }, { .name = discard_const_p(char, "result"), .get = py_netr_NetrEnumerateTrustedDomains_get_result, .set = py_netr_NetrEnumerateTrustedDomains_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_NetrEnumerateTrustedDomains_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_NetrEnumerateTrustedDomains, type); struct netr_NetrEnumerateTrustedDomains *_self = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.trusted_domains_blob = talloc_zero(mem_ctx, struct netr_Blob); return self; } static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(19); } static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomains_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_NetrEnumerateTrustedDomains_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 netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomains_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomains_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_NetrEnumerateTrustedDomains_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_NetrEnumerateTrustedDomains_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomains_in", NDR_IN); } static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_NetrEnumerateTrustedDomains_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomains_out", NDR_OUT); } static PyMethodDef py_netr_NetrEnumerateTrustedDomains_methods[] = { { "opnum", (PyCFunction)py_netr_NetrEnumerateTrustedDomains_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_NetrEnumerateTrustedDomains.opnum() -> 19 (0x13) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_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_netr_NetrEnumerateTrustedDomains_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_NetrEnumerateTrustedDomains_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_NetrEnumerateTrustedDomains_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NetrEnumerateTrustedDomains", .tp_getset = py_netr_NetrEnumerateTrustedDomains_getsetters, .tp_methods = py_netr_NetrEnumerateTrustedDomains_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NetrEnumerateTrustedDomains_new, }; static bool pack_py_netr_NetrEnumerateTrustedDomains_args_in(PyObject *args, PyObject *kwargs, struct netr_NetrEnumerateTrustedDomains *r) { PyObject *py_server_name; const char *kwnames[] = { "server_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_NetrEnumerateTrustedDomains", discard_const_p(char *, kwnames), &py_server_name)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } return true; } static PyObject *unpack_py_netr_NetrEnumerateTrustedDomains_args_out(struct netr_NetrEnumerateTrustedDomains *r) { PyObject *result; PyObject *py_trusted_domains_blob; py_trusted_domains_blob = pytalloc_reference_ex(&netr_Blob_Type, r->out.trusted_domains_blob, r->out.trusted_domains_blob); result = py_trusted_domains_blob; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRGetDCName_in_get_server_unc(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj); PyObject *py_server_unc; if (object->in.server_unc == NULL) { Py_RETURN_NONE; } if (object->in.server_unc == NULL) { py_server_unc = Py_None; Py_INCREF(py_server_unc); } else { if (object->in.server_unc == NULL) { py_server_unc = Py_None; Py_INCREF(py_server_unc); } else { py_server_unc = PyUnicode_Decode(object->in.server_unc, strlen(object->in.server_unc), "utf-8", "ignore"); } } return py_server_unc; } static int py_netr_DsRGetDCName_in_set_server_unc(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_unc"); return -1; } if (value == Py_None) { object->in.server_unc = NULL; } else { object->in.server_unc = 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.server_unc = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCName_in_get_domain_name(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)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 { 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_netr_DsRGetDCName_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } if (value == Py_None) { object->in.domain_name = NULL; } else { object->in.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.domain_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCName_in_get_domain_guid(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)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_netr_DsRGetDCName_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)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_netr_DsRGetDCName_in_get_site_guid(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj); PyObject *py_site_guid; if (object->in.site_guid == NULL) { Py_RETURN_NONE; } if (object->in.site_guid == NULL) { py_site_guid = Py_None; Py_INCREF(py_site_guid); } else { py_site_guid = pytalloc_reference_ex(GUID_Type, object->in.site_guid, object->in.site_guid); } return py_site_guid; } static int py_netr_DsRGetDCName_in_set_site_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.site_guid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_guid"); return -1; } if (value == Py_None) { object->in.site_guid = NULL; } else { object->in.site_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.site_guid = (struct GUID *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsRGetDCName_in_get_flags(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_netr_DsRGetDCName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)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_netr_DsRGetDCName_out_get_info(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *object->out.info, *object->out.info); } return py_info; } static int py_netr_DsRGetDCName_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)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; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.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.info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsRGetDCName_get_result(PyObject *obj, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRGetDCName_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)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_netr_DsRGetDCName_getsetters[] = { { .name = discard_const_p(char, "in_server_unc"), .get = py_netr_DsRGetDCName_in_get_server_unc, .set = py_netr_DsRGetDCName_in_set_server_unc, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_name"), .get = py_netr_DsRGetDCName_in_get_domain_name, .set = py_netr_DsRGetDCName_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_guid"), .get = py_netr_DsRGetDCName_in_get_domain_guid, .set = py_netr_DsRGetDCName_in_set_domain_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_site_guid"), .get = py_netr_DsRGetDCName_in_get_site_guid, .set = py_netr_DsRGetDCName_in_set_site_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_flags"), .get = py_netr_DsRGetDCName_in_get_flags, .set = py_netr_DsRGetDCName_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCName_flags") }, { .name = discard_const_p(char, "out_info"), .get = py_netr_DsRGetDCName_out_get_info, .set = py_netr_DsRGetDCName_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsRGetDCName_get_result, .set = py_netr_DsRGetDCName_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRGetDCName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRGetDCName, type); struct netr_DsRGetDCName *_self = (struct netr_DsRGetDCName *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *); return self; } static PyObject *py_netr_DsRGetDCName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(20); } static PyObject *py_netr_DsRGetDCName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCName_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_DsRGetDCName_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_netr_DsRGetDCName_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRGetDCName_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_netr_DsRGetDCName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRGetDCName_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 netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCName_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_DsRGetDCName_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_netr_DsRGetDCName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetDCName_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_netr_DsRGetDCName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetDCName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCName_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_DsRGetDCName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetDCName_ndr_print(py_obj, "netr_DsRGetDCName_in", NDR_IN); } static PyObject *py_netr_DsRGetDCName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetDCName_ndr_print(py_obj, "netr_DsRGetDCName_out", NDR_OUT); } static PyMethodDef py_netr_DsRGetDCName_methods[] = { { "opnum", (PyCFunction)py_netr_DsRGetDCName_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRGetDCName.opnum() -> 20 (0x14) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCName_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_netr_DsRGetDCName_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_netr_DsRGetDCName_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_netr_DsRGetDCName_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_netr_DsRGetDCName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetDCName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRGetDCName_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRGetDCName", .tp_getset = py_netr_DsRGetDCName_getsetters, .tp_methods = py_netr_DsRGetDCName_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRGetDCName_new, }; static bool pack_py_netr_DsRGetDCName_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetDCName *r) { PyObject *py_server_unc; PyObject *py_domain_name; PyObject *py_domain_guid; PyObject *py_site_guid; PyObject *py_flags; const char *kwnames[] = { "server_unc", "domain_name", "domain_guid", "site_guid", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_DsRGetDCName", discard_const_p(char *, kwnames), &py_server_unc, &py_domain_name, &py_domain_guid, &py_site_guid, &py_flags)) { return false; } if (py_server_unc == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_unc"); return false; } if (py_server_unc == Py_None) { r->in.server_unc = NULL; } else { r->in.server_unc = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_unc)) { unicode = PyUnicode_AsEncodedString(py_server_unc, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_unc)) { test_str = PyBytes_AS_STRING(py_server_unc); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_unc)->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.server_unc = talloc_str; } } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } if (py_domain_name == Py_None) { r->in.domain_name = NULL; } else { r->in.domain_name = NULL; { 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_guid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_guid"); return false; } if (py_site_guid == Py_None) { r->in.site_guid = NULL; } else { r->in.site_guid = NULL; PY_CHECK_TYPE(GUID_Type, py_site_guid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_site_guid)) == NULL) { PyErr_NoMemory(); return false; } r->in.site_guid = (struct GUID *)pytalloc_get_ptr(py_site_guid); } 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_netr_DsRGetDCName_args_out(struct netr_DsRGetDCName *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *r->out.info, *r->out.info); } result = py_info; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonGetCapabilities_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } return py_server_name; } static int py_netr_LogonGetCapabilities_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } object->in.server_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.server_name); if (object->in.server_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.server_name = talloc_str; } return 0; } static PyObject *py_netr_LogonGetCapabilities_in_get_computer_name(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_LogonGetCapabilities_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonGetCapabilities_in_get_credential(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_LogonGetCapabilities_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonGetCapabilities_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_LogonGetCapabilities_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonGetCapabilities_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_LogonGetCapabilities_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonGetCapabilities_in_get_query_level(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_query_level; py_query_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.query_level); return py_query_level; } static int py_netr_LogonGetCapabilities_in_set_query_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.query_level"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.query_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.query_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_LogonGetCapabilities_out_get_capabilities(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_capabilities; if (object->out.capabilities == NULL) { Py_RETURN_NONE; } py_capabilities = pyrpc_import_union(&netr_Capabilities_Type, object->out.capabilities, object->in.query_level, object->out.capabilities, "union netr_Capabilities"); if (py_capabilities == NULL) { return NULL; } return py_capabilities; } static int py_netr_LogonGetCapabilities_out_set_capabilities(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.capabilities)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.capabilities"); return -1; } object->out.capabilities = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.capabilities); if (object->out.capabilities == NULL) { PyErr_NoMemory(); return -1; } { union netr_Capabilities *capabilities_switch_1; capabilities_switch_1 = (union netr_Capabilities *)pyrpc_export_union(&netr_Capabilities_Type, pytalloc_get_mem_ctx(py_obj), object->in.query_level, value, "union netr_Capabilities"); if (capabilities_switch_1 == NULL) { return -1; } object->out.capabilities = capabilities_switch_1; } return 0; } static PyObject *py_netr_LogonGetCapabilities_get_result(PyObject *obj, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_LogonGetCapabilities_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)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_netr_LogonGetCapabilities_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonGetCapabilities_in_get_server_name, .set = py_netr_LogonGetCapabilities_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_LogonGetCapabilities_in_get_computer_name, .set = py_netr_LogonGetCapabilities_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_LogonGetCapabilities_in_get_credential, .set = py_netr_LogonGetCapabilities_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_LogonGetCapabilities_in_get_return_authenticator, .set = py_netr_LogonGetCapabilities_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_LogonGetCapabilities_out_get_return_authenticator, .set = py_netr_LogonGetCapabilities_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_query_level"), .get = py_netr_LogonGetCapabilities_in_get_query_level, .set = py_netr_LogonGetCapabilities_in_set_query_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_capabilities"), .get = py_netr_LogonGetCapabilities_out_get_capabilities, .set = py_netr_LogonGetCapabilities_out_set_capabilities, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Capabilities") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonGetCapabilities_get_result, .set = py_netr_LogonGetCapabilities_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_LogonGetCapabilities_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonGetCapabilities, type); struct netr_LogonGetCapabilities *_self = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.capabilities = talloc_zero(mem_ctx, union netr_Capabilities); return self; } static PyObject *py_netr_LogonGetCapabilities_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(21); } static PyObject *py_netr_LogonGetCapabilities_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetCapabilities_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonGetCapabilities_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 netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetCapabilities_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonGetCapabilities_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetCapabilities_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonGetCapabilities_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonGetCapabilities_ndr_print(py_obj, "netr_LogonGetCapabilities_in", NDR_IN); } static PyObject *py_netr_LogonGetCapabilities_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonGetCapabilities_ndr_print(py_obj, "netr_LogonGetCapabilities_out", NDR_OUT); } static PyMethodDef py_netr_LogonGetCapabilities_methods[] = { { "opnum", (PyCFunction)py_netr_LogonGetCapabilities_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonGetCapabilities.opnum() -> 21 (0x15) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_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_netr_LogonGetCapabilities_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonGetCapabilities_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonGetCapabilities_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonGetCapabilities", .tp_getset = py_netr_LogonGetCapabilities_getsetters, .tp_methods = py_netr_LogonGetCapabilities_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonGetCapabilities_new, }; static bool pack_py_netr_LogonGetCapabilities_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonGetCapabilities *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_query_level; const char *kwnames[] = { "server_name", "computer_name", "credential", "return_authenticator", "query_level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_LogonGetCapabilities", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_query_level)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } r->in.server_name = talloc_ptrtype(r, r->in.server_name); if (r->in.server_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); if (py_query_level == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.query_level"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.query_level)); if (PyLong_Check(py_query_level)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_query_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.query_level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_LogonGetCapabilities_args_out(struct netr_LogonGetCapabilities *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_capabilities; result = PyTuple_New(2); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_capabilities = pyrpc_import_union(&netr_Capabilities_Type, r->out.capabilities, r->in.query_level, r->out.capabilities, "union netr_Capabilities"); if (py_capabilities == NULL) { return NULL; } PyTuple_SetItem(result, 1, py_capabilities); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonGetTrustRid_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonGetTrustRid_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonGetTrustRid_in_get_domain_name(PyObject *obj, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)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 { 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_netr_LogonGetTrustRid_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } if (value == Py_None) { object->in.domain_name = NULL; } else { object->in.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.domain_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonGetTrustRid_out_get_rid(PyObject *obj, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj); PyObject *py_rid; if (object->out.rid == NULL) { Py_RETURN_NONE; } py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid); return py_rid; } static int py_netr_LogonGetTrustRid_out_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid"); return -1; } object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid); if (object->out.rid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.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->out.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_LogonGetTrustRid_get_result(PyObject *obj, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_LogonGetTrustRid_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)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_netr_LogonGetTrustRid_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonGetTrustRid_in_get_server_name, .set = py_netr_LogonGetTrustRid_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_name"), .get = py_netr_LogonGetTrustRid_in_get_domain_name, .set = py_netr_LogonGetTrustRid_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_rid"), .get = py_netr_LogonGetTrustRid_out_get_rid, .set = py_netr_LogonGetTrustRid_out_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonGetTrustRid_get_result, .set = py_netr_LogonGetTrustRid_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_LogonGetTrustRid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonGetTrustRid, type); struct netr_LogonGetTrustRid *_self = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.rid = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_netr_LogonGetTrustRid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(23); } static PyObject *py_netr_LogonGetTrustRid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetTrustRid_ndr_pack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonGetTrustRid_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 netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetTrustRid_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonGetTrustRid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetTrustRid_ndr_print"); return NULL; } call = &ndr_table_netlogon.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_netr_LogonGetTrustRid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonGetTrustRid_ndr_print(py_obj, "netr_LogonGetTrustRid_in", NDR_IN); } static PyObject *py_netr_LogonGetTrustRid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonGetTrustRid_ndr_print(py_obj, "netr_LogonGetTrustRid_out", NDR_OUT); } static PyMethodDef py_netr_LogonGetTrustRid_methods[] = { { "opnum", (PyCFunction)py_netr_LogonGetTrustRid_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonGetTrustRid.opnum() -> 23 (0x17) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_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_netr_LogonGetTrustRid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonGetTrustRid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonGetTrustRid_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonGetTrustRid", .tp_getset = py_netr_LogonGetTrustRid_getsetters, .tp_methods = py_netr_LogonGetTrustRid_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonGetTrustRid_new, }; static bool pack_py_netr_LogonGetTrustRid_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonGetTrustRid *r) { PyObject *py_server_name; PyObject *py_domain_name; const char *kwnames[] = { "server_name", "domain_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_LogonGetTrustRid", discard_const_p(char *, kwnames), &py_server_name, &py_domain_name)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } if (py_domain_name == Py_None) { r->in.domain_name = NULL; } else { r->in.domain_name = NULL; { 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; } } return true; } static PyObject *unpack_py_netr_LogonGetTrustRid_args_out(struct netr_LogonGetTrustRid *r) { PyObject *result; PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid); result = py_rid; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerAuthenticate3_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerAuthenticate3_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerAuthenticate3_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerAuthenticate3_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerAuthenticate3_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerAuthenticate3_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate3_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerAuthenticate3_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerAuthenticate3_in_get_credentials(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_credentials; if (object->in.credentials == NULL) { Py_RETURN_NONE; } py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials); return py_credentials; } static int py_netr_ServerAuthenticate3_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials"); return -1; } object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials); if (object->in.credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerAuthenticate3_out_get_return_credentials(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_return_credentials; if (object->out.return_credentials == NULL) { Py_RETURN_NONE; } py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials); return py_return_credentials; } static int py_netr_ServerAuthenticate3_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials"); return -1; } object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials); if (object->out.return_credentials == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Credential_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.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerAuthenticate3_in_get_negotiate_flags(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_negotiate_flags; if (object->in.negotiate_flags == NULL) { Py_RETURN_NONE; } py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.negotiate_flags); return py_negotiate_flags; } static int py_netr_ServerAuthenticate3_in_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.negotiate_flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.negotiate_flags"); return -1; } object->in.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.negotiate_flags); if (object->in.negotiate_flags == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.negotiate_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.negotiate_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate3_out_get_negotiate_flags(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_negotiate_flags; if (object->out.negotiate_flags == NULL) { Py_RETURN_NONE; } py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.negotiate_flags); return py_negotiate_flags; } static int py_netr_ServerAuthenticate3_out_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.negotiate_flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.negotiate_flags"); return -1; } object->out.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.negotiate_flags); if (object->out.negotiate_flags == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.negotiate_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->out.negotiate_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate3_out_get_rid(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_rid; if (object->out.rid == NULL) { Py_RETURN_NONE; } py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid); return py_rid; } static int py_netr_ServerAuthenticate3_out_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid"); return -1; } object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid); if (object->out.rid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.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->out.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerAuthenticate3_get_result(PyObject *obj, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerAuthenticate3_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)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_netr_ServerAuthenticate3_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerAuthenticate3_in_get_server_name, .set = py_netr_ServerAuthenticate3_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerAuthenticate3_in_get_account_name, .set = py_netr_ServerAuthenticate3_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerAuthenticate3_in_get_secure_channel_type, .set = py_netr_ServerAuthenticate3_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerAuthenticate3_in_get_computer_name, .set = py_netr_ServerAuthenticate3_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credentials"), .get = py_netr_ServerAuthenticate3_in_get_credentials, .set = py_netr_ServerAuthenticate3_in_set_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "out_return_credentials"), .get = py_netr_ServerAuthenticate3_out_get_return_credentials, .set = py_netr_ServerAuthenticate3_out_set_return_credentials, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential") }, { .name = discard_const_p(char, "in_negotiate_flags"), .get = py_netr_ServerAuthenticate3_in_get_negotiate_flags, .set = py_netr_ServerAuthenticate3_in_set_negotiate_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags") }, { .name = discard_const_p(char, "out_negotiate_flags"), .get = py_netr_ServerAuthenticate3_out_get_negotiate_flags, .set = py_netr_ServerAuthenticate3_out_set_negotiate_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags") }, { .name = discard_const_p(char, "out_rid"), .get = py_netr_ServerAuthenticate3_out_get_rid, .set = py_netr_ServerAuthenticate3_out_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerAuthenticate3_get_result, .set = py_netr_ServerAuthenticate3_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerAuthenticate3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerAuthenticate3, type); struct netr_ServerAuthenticate3 *_self = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential); _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential); _self->in.negotiate_flags = talloc_zero(mem_ctx, uint32_t); _self->out.negotiate_flags = talloc_zero(mem_ctx, uint32_t); _self->out.rid = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_netr_ServerAuthenticate3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(26); } static PyObject *py_netr_ServerAuthenticate3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 27) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate3_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[26]; 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_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerAuthenticate3_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 netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 27) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate3_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[26]; 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_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerAuthenticate3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 27) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate3_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[26]; 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_netr_ServerAuthenticate3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerAuthenticate3_ndr_print(py_obj, "netr_ServerAuthenticate3_in", NDR_IN); } static PyObject *py_netr_ServerAuthenticate3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerAuthenticate3_ndr_print(py_obj, "netr_ServerAuthenticate3_out", NDR_OUT); } static PyMethodDef py_netr_ServerAuthenticate3_methods[] = { { "opnum", (PyCFunction)py_netr_ServerAuthenticate3_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerAuthenticate3.opnum() -> 26 (0x1a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_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_netr_ServerAuthenticate3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerAuthenticate3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerAuthenticate3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerAuthenticate3", .tp_getset = py_netr_ServerAuthenticate3_getsetters, .tp_methods = py_netr_ServerAuthenticate3_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerAuthenticate3_new, }; static bool pack_py_netr_ServerAuthenticate3_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerAuthenticate3 *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credentials; PyObject *py_negotiate_flags; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credentials", "negotiate_flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerAuthenticate3", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credentials, &py_negotiate_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credentials == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials"); return false; } r->in.credentials = talloc_ptrtype(r, r->in.credentials); if (r->in.credentials == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) { PyErr_NoMemory(); return false; } r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials); if (py_negotiate_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.negotiate_flags"); return false; } r->in.negotiate_flags = talloc_ptrtype(r, r->in.negotiate_flags); if (r->in.negotiate_flags == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.negotiate_flags)); if (PyLong_Check(py_negotiate_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_negotiate_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.negotiate_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_ServerAuthenticate3_args_out(struct netr_ServerAuthenticate3 *r) { PyObject *result; PyObject *py_return_credentials; PyObject *py_negotiate_flags; PyObject *py_rid; result = PyTuple_New(3); py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials); PyTuple_SetItem(result, 0, py_return_credentials); py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.negotiate_flags); PyTuple_SetItem(result, 1, py_negotiate_flags); py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid); PyTuple_SetItem(result, 2, py_rid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRGetDCNameEx_in_get_server_unc(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj); PyObject *py_server_unc; if (object->in.server_unc == NULL) { Py_RETURN_NONE; } if (object->in.server_unc == NULL) { py_server_unc = Py_None; Py_INCREF(py_server_unc); } else { if (object->in.server_unc == NULL) { py_server_unc = Py_None; Py_INCREF(py_server_unc); } else { py_server_unc = PyUnicode_Decode(object->in.server_unc, strlen(object->in.server_unc), "utf-8", "ignore"); } } return py_server_unc; } static int py_netr_DsRGetDCNameEx_in_set_server_unc(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_unc"); return -1; } if (value == Py_None) { object->in.server_unc = NULL; } else { object->in.server_unc = 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.server_unc = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameEx_in_get_domain_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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 { 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_netr_DsRGetDCNameEx_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } if (value == Py_None) { object->in.domain_name = NULL; } else { object->in.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.domain_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameEx_in_get_domain_guid(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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_netr_DsRGetDCNameEx_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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_netr_DsRGetDCNameEx_in_get_site_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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_netr_DsRGetDCNameEx_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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_netr_DsRGetDCNameEx_in_get_flags(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_netr_DsRGetDCNameEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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_netr_DsRGetDCNameEx_out_get_info(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *object->out.info, *object->out.info); } return py_info; } static int py_netr_DsRGetDCNameEx_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.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.info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsRGetDCNameEx_get_result(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRGetDCNameEx_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)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_netr_DsRGetDCNameEx_getsetters[] = { { .name = discard_const_p(char, "in_server_unc"), .get = py_netr_DsRGetDCNameEx_in_get_server_unc, .set = py_netr_DsRGetDCNameEx_in_set_server_unc, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_name"), .get = py_netr_DsRGetDCNameEx_in_get_domain_name, .set = py_netr_DsRGetDCNameEx_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_guid"), .get = py_netr_DsRGetDCNameEx_in_get_domain_guid, .set = py_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_in_get_site_name, .set = py_netr_DsRGetDCNameEx_in_set_site_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_flags"), .get = py_netr_DsRGetDCNameEx_in_get_flags, .set = py_netr_DsRGetDCNameEx_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCName_flags") }, { .name = discard_const_p(char, "out_info"), .get = py_netr_DsRGetDCNameEx_out_get_info, .set = py_netr_DsRGetDCNameEx_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsRGetDCNameEx_get_result, .set = py_netr_DsRGetDCNameEx_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRGetDCNameEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRGetDCNameEx, type); struct netr_DsRGetDCNameEx *_self = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *); return self; } static PyObject *py_netr_DsRGetDCNameEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(27); } static PyObject *py_netr_DsRGetDCNameEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 28) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[27]; 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_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRGetDCNameEx_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 netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 28) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[27]; 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_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetDCNameEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 28) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[27]; 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_netr_DsRGetDCNameEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetDCNameEx_ndr_print(py_obj, "netr_DsRGetDCNameEx_in", NDR_IN); } static PyObject *py_netr_DsRGetDCNameEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetDCNameEx_ndr_print(py_obj, "netr_DsRGetDCNameEx_out", NDR_OUT); } static PyMethodDef py_netr_DsRGetDCNameEx_methods[] = { { "opnum", (PyCFunction)py_netr_DsRGetDCNameEx_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRGetDCNameEx.opnum() -> 27 (0x1b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetDCNameEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRGetDCNameEx_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRGetDCNameEx", .tp_getset = py_netr_DsRGetDCNameEx_getsetters, .tp_methods = py_netr_DsRGetDCNameEx_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRGetDCNameEx_new, }; static bool pack_py_netr_DsRGetDCNameEx_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetDCNameEx *r) { PyObject *py_server_unc; PyObject *py_domain_name; PyObject *py_domain_guid; PyObject *py_site_name; PyObject *py_flags; const char *kwnames[] = { "server_unc", "domain_name", "domain_guid", "site_name", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_DsRGetDCNameEx", discard_const_p(char *, kwnames), &py_server_unc, &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) { return false; } if (py_server_unc == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_unc"); return false; } if (py_server_unc == Py_None) { r->in.server_unc = NULL; } else { r->in.server_unc = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_unc)) { unicode = PyUnicode_AsEncodedString(py_server_unc, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_unc)) { test_str = PyBytes_AS_STRING(py_server_unc); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_unc)->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.server_unc = talloc_str; } } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } if (py_domain_name == Py_None) { r->in.domain_name = NULL; } else { r->in.domain_name = NULL; { 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_netr_DsRGetDCNameEx_args_out(struct netr_DsRGetDCNameEx *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *r->out.info, *r->out.info); } result = py_info; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRGetSiteName_in_get_computer_name(PyObject *obj, void *closure) { struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_DsRGetSiteName_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetSiteName_out_get_site(PyObject *obj, void *closure) { struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(obj); PyObject *py_site; if (object->out.site == NULL) { Py_RETURN_NONE; } if (*object->out.site == NULL) { py_site = Py_None; Py_INCREF(py_site); } else { if (*object->out.site == NULL) { py_site = Py_None; Py_INCREF(py_site); } else { py_site = PyUnicode_Decode(*object->out.site, strlen(*object->out.site), "utf-8", "ignore"); } } return py_site; } static int py_netr_DsRGetSiteName_out_set_site(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.site)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.site"); return -1; } object->out.site = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.site); if (object->out.site == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.site = NULL; } else { *object->out.site = 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.site = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetSiteName_get_result(PyObject *obj, void *closure) { struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRGetSiteName_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)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_netr_DsRGetSiteName_getsetters[] = { { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_DsRGetSiteName_in_get_computer_name, .set = py_netr_DsRGetSiteName_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_site"), .get = py_netr_DsRGetSiteName_out_get_site, .set = py_netr_DsRGetSiteName_out_set_site, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsRGetSiteName_get_result, .set = py_netr_DsRGetSiteName_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRGetSiteName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRGetSiteName, type); return self; } static PyObject *py_netr_DsRGetSiteName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(28); } static PyObject *py_netr_DsRGetSiteName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 29) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetSiteName_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[28]; 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_netr_DsRGetSiteName_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_netr_DsRGetSiteName_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRGetSiteName_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_netr_DsRGetSiteName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRGetSiteName_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 netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 29) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetSiteName_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[28]; 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_netr_DsRGetSiteName_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_netr_DsRGetSiteName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetSiteName_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_netr_DsRGetSiteName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetSiteName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 29) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetSiteName_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[28]; 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_netr_DsRGetSiteName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetSiteName_ndr_print(py_obj, "netr_DsRGetSiteName_in", NDR_IN); } static PyObject *py_netr_DsRGetSiteName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetSiteName_ndr_print(py_obj, "netr_DsRGetSiteName_out", NDR_OUT); } static PyMethodDef py_netr_DsRGetSiteName_methods[] = { { "opnum", (PyCFunction)py_netr_DsRGetSiteName_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRGetSiteName.opnum() -> 28 (0x1c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetSiteName_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_netr_DsRGetSiteName_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_netr_DsRGetSiteName_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_netr_DsRGetSiteName_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_netr_DsRGetSiteName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetSiteName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRGetSiteName_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRGetSiteName", .tp_getset = py_netr_DsRGetSiteName_getsetters, .tp_methods = py_netr_DsRGetSiteName_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRGetSiteName_new, }; static bool pack_py_netr_DsRGetSiteName_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetSiteName *r) { PyObject *py_computer_name; const char *kwnames[] = { "computer_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_DsRGetSiteName", discard_const_p(char *, kwnames), &py_computer_name)) { return false; } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } return true; } static PyObject *unpack_py_netr_DsRGetSiteName_args_out(struct netr_DsRGetSiteName *r) { PyObject *result; PyObject *py_site; if (*r->out.site == NULL) { py_site = Py_None; Py_INCREF(py_site); } else { if (*r->out.site == NULL) { py_site = Py_None; Py_INCREF(py_site); } else { py_site = PyUnicode_Decode(*r->out.site, strlen(*r->out.site), "utf-8", "ignore"); } } result = py_site; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonGetDomainInfo_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } return py_server_name; } static int py_netr_LogonGetDomainInfo_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } object->in.server_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.server_name); if (object->in.server_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.server_name = talloc_str; } return 0; } static PyObject *py_netr_LogonGetDomainInfo_in_get_computer_name(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_LogonGetDomainInfo_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonGetDomainInfo_in_get_credential(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_LogonGetDomainInfo_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonGetDomainInfo_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); return py_return_authenticator; } static int py_netr_LogonGetDomainInfo_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator); if (object->in.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonGetDomainInfo_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_LogonGetDomainInfo_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_LogonGetDomainInfo_in_get_level(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level); return py_level; } static int py_netr_LogonGetDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)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_netr_LogonGetDomainInfo_in_get_query(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_query; if (object->in.query == NULL) { Py_RETURN_NONE; } py_query = pyrpc_import_union(&netr_WorkstationInfo_Type, object->in.query, object->in.level, object->in.query, "union netr_WorkstationInfo"); if (py_query == NULL) { return NULL; } return py_query; } static int py_netr_LogonGetDomainInfo_in_set_query(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.query)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.query"); return -1; } object->in.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.query); if (object->in.query == NULL) { PyErr_NoMemory(); return -1; } { union netr_WorkstationInfo *query_switch_1; query_switch_1 = (union netr_WorkstationInfo *)pyrpc_export_union(&netr_WorkstationInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_WorkstationInfo"); if (query_switch_1 == NULL) { return -1; } object->in.query = query_switch_1; } return 0; } static PyObject *py_netr_LogonGetDomainInfo_out_get_info(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&netr_DomainInfo_Type, object->out.info, object->in.level, object->out.info, "union netr_DomainInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_netr_LogonGetDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)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; } { union netr_DomainInfo *info_switch_1; info_switch_1 = (union netr_DomainInfo *)pyrpc_export_union(&netr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_DomainInfo"); if (info_switch_1 == NULL) { return -1; } object->out.info = info_switch_1; } return 0; } static PyObject *py_netr_LogonGetDomainInfo_get_result(PyObject *obj, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_LogonGetDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)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_netr_LogonGetDomainInfo_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonGetDomainInfo_in_get_server_name, .set = py_netr_LogonGetDomainInfo_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_LogonGetDomainInfo_in_get_computer_name, .set = py_netr_LogonGetDomainInfo_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_LogonGetDomainInfo_in_get_credential, .set = py_netr_LogonGetDomainInfo_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_LogonGetDomainInfo_in_get_return_authenticator, .set = py_netr_LogonGetDomainInfo_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_LogonGetDomainInfo_out_get_return_authenticator, .set = py_netr_LogonGetDomainInfo_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_level"), .get = py_netr_LogonGetDomainInfo_in_get_level, .set = py_netr_LogonGetDomainInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_query"), .get = py_netr_LogonGetDomainInfo_in_get_query, .set = py_netr_LogonGetDomainInfo_in_set_query, .doc = discard_const_p(char, "PIDL-generated element of base type netr_WorkstationInfo") }, { .name = discard_const_p(char, "out_info"), .get = py_netr_LogonGetDomainInfo_out_get_info, .set = py_netr_LogonGetDomainInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonGetDomainInfo_get_result, .set = py_netr_LogonGetDomainInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_LogonGetDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonGetDomainInfo, type); struct netr_LogonGetDomainInfo *_self = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.query = talloc_zero(mem_ctx, union netr_WorkstationInfo); _self->out.info = talloc_zero(mem_ctx, union netr_DomainInfo); return self; } static PyObject *py_netr_LogonGetDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(29); } static PyObject *py_netr_LogonGetDomainInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 30) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetDomainInfo_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[29]; 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_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonGetDomainInfo_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 netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 30) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetDomainInfo_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[29]; 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_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonGetDomainInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 30) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetDomainInfo_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[29]; 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_netr_LogonGetDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonGetDomainInfo_ndr_print(py_obj, "netr_LogonGetDomainInfo_in", NDR_IN); } static PyObject *py_netr_LogonGetDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonGetDomainInfo_ndr_print(py_obj, "netr_LogonGetDomainInfo_out", NDR_OUT); } static PyMethodDef py_netr_LogonGetDomainInfo_methods[] = { { "opnum", (PyCFunction)py_netr_LogonGetDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonGetDomainInfo.opnum() -> 29 (0x1d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonGetDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonGetDomainInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonGetDomainInfo", .tp_getset = py_netr_LogonGetDomainInfo_getsetters, .tp_methods = py_netr_LogonGetDomainInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonGetDomainInfo_new, }; static bool pack_py_netr_LogonGetDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonGetDomainInfo *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_level; PyObject *py_query; const char *kwnames[] = { "server_name", "computer_name", "credential", "return_authenticator", "level", "query", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_LogonGetDomainInfo", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_level, &py_query)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } r->in.server_name = talloc_ptrtype(r, r->in.server_name); if (r->in.server_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator); if (r->in.return_authenticator == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); 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_query == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.query"); return false; } r->in.query = talloc_ptrtype(r, r->in.query); if (r->in.query == NULL) { PyErr_NoMemory(); return false; } { union netr_WorkstationInfo *query_switch_1; query_switch_1 = (union netr_WorkstationInfo *)pyrpc_export_union(&netr_WorkstationInfo_Type, r, r->in.level, py_query, "union netr_WorkstationInfo"); if (query_switch_1 == NULL) { return false; } r->in.query = query_switch_1; } return true; } static PyObject *unpack_py_netr_LogonGetDomainInfo_args_out(struct netr_LogonGetDomainInfo *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_info; result = PyTuple_New(2); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_info = pyrpc_import_union(&netr_DomainInfo_Type, r->out.info, r->in.level, r->out.info, "union netr_DomainInfo"); if (py_info == NULL) { return NULL; } PyTuple_SetItem(result, 1, py_info); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerPasswordSet2_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerPasswordSet2_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerPasswordSet2_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerPasswordSet2_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerPasswordSet2_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerPasswordSet2_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerPasswordSet2_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerPasswordSet2_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerPasswordSet2_in_get_credential(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_ServerPasswordSet2_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordSet2_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_ServerPasswordSet2_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordSet2_in_get_new_password(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_new_password; if (object->in.new_password == NULL) { Py_RETURN_NONE; } py_new_password = pytalloc_reference_ex(&netr_CryptPassword_Type, object->in.new_password, object->in.new_password); return py_new_password; } static int py_netr_ServerPasswordSet2_in_set_new_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_password"); return -1; } object->in.new_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_password); if (object->in.new_password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_CryptPassword_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.new_password = (struct netr_CryptPassword *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordSet2_get_result(PyObject *obj, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerPasswordSet2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)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_netr_ServerPasswordSet2_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerPasswordSet2_in_get_server_name, .set = py_netr_ServerPasswordSet2_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerPasswordSet2_in_get_account_name, .set = py_netr_ServerPasswordSet2_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerPasswordSet2_in_get_secure_channel_type, .set = py_netr_ServerPasswordSet2_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerPasswordSet2_in_get_computer_name, .set = py_netr_ServerPasswordSet2_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_ServerPasswordSet2_in_get_credential, .set = py_netr_ServerPasswordSet2_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_ServerPasswordSet2_out_get_return_authenticator, .set = py_netr_ServerPasswordSet2_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_new_password"), .get = py_netr_ServerPasswordSet2_in_get_new_password, .set = py_netr_ServerPasswordSet2_in_set_new_password, .doc = discard_const_p(char, "PIDL-generated element of base type netr_CryptPassword") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerPasswordSet2_get_result, .set = py_netr_ServerPasswordSet2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerPasswordSet2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerPasswordSet2, type); struct netr_ServerPasswordSet2 *_self = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.new_password = talloc_zero(mem_ctx, struct netr_CryptPassword); return self; } static PyObject *py_netr_ServerPasswordSet2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(30); } static PyObject *py_netr_ServerPasswordSet2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 31) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet2_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[30]; 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_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerPasswordSet2_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 netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 31) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet2_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[30]; 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_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerPasswordSet2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 31) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet2_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[30]; 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_netr_ServerPasswordSet2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerPasswordSet2_ndr_print(py_obj, "netr_ServerPasswordSet2_in", NDR_IN); } static PyObject *py_netr_ServerPasswordSet2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerPasswordSet2_ndr_print(py_obj, "netr_ServerPasswordSet2_out", NDR_OUT); } static PyMethodDef py_netr_ServerPasswordSet2_methods[] = { { "opnum", (PyCFunction)py_netr_ServerPasswordSet2_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerPasswordSet2.opnum() -> 30 (0x1e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerPasswordSet2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerPasswordSet2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerPasswordSet2", .tp_getset = py_netr_ServerPasswordSet2_getsetters, .tp_methods = py_netr_ServerPasswordSet2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerPasswordSet2_new, }; static bool pack_py_netr_ServerPasswordSet2_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerPasswordSet2 *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_new_password; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credential", "new_password", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerPasswordSet2", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential, &py_new_password)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_new_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_password"); return false; } r->in.new_password = talloc_ptrtype(r, r->in.new_password); if (r->in.new_password == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_CryptPassword_Type, py_new_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.new_password = (struct netr_CryptPassword *)pytalloc_get_ptr(py_new_password); return true; } static PyObject *unpack_py_netr_ServerPasswordSet2_args_out(struct netr_ServerPasswordSet2 *r) { PyObject *result; PyObject *py_return_authenticator; py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); result = py_return_authenticator; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerPasswordGet_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerPasswordGet_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerPasswordGet_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerPasswordGet_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerPasswordGet_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerPasswordGet_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerPasswordGet_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerPasswordGet_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerPasswordGet_in_get_credential(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_ServerPasswordGet_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordGet_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_ServerPasswordGet_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordGet_out_get_password(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_password; if (object->out.password == NULL) { Py_RETURN_NONE; } py_password = pytalloc_reference_ex(samr_Password_Type, object->out.password, object->out.password); return py_password; } static int py_netr_ServerPasswordGet_out_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.password"); return -1; } object->out.password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.password); if (object->out.password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(samr_Password_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.password = (struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerPasswordGet_get_result(PyObject *obj, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerPasswordGet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)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_netr_ServerPasswordGet_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerPasswordGet_in_get_server_name, .set = py_netr_ServerPasswordGet_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerPasswordGet_in_get_account_name, .set = py_netr_ServerPasswordGet_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerPasswordGet_in_get_secure_channel_type, .set = py_netr_ServerPasswordGet_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerPasswordGet_in_get_computer_name, .set = py_netr_ServerPasswordGet_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_ServerPasswordGet_in_get_credential, .set = py_netr_ServerPasswordGet_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_ServerPasswordGet_out_get_return_authenticator, .set = py_netr_ServerPasswordGet_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_password"), .get = py_netr_ServerPasswordGet_out_get_password, .set = py_netr_ServerPasswordGet_out_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerPasswordGet_get_result, .set = py_netr_ServerPasswordGet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerPasswordGet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerPasswordGet, type); struct netr_ServerPasswordGet *_self = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.password = talloc_zero(mem_ctx, struct samr_Password); return self; } static PyObject *py_netr_ServerPasswordGet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(31); } static PyObject *py_netr_ServerPasswordGet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 32) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordGet_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[31]; 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_netr_ServerPasswordGet_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_netr_ServerPasswordGet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerPasswordGet_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_netr_ServerPasswordGet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerPasswordGet_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 netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 32) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordGet_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[31]; 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_netr_ServerPasswordGet_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_netr_ServerPasswordGet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerPasswordGet_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_netr_ServerPasswordGet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerPasswordGet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 32) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordGet_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[31]; 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_netr_ServerPasswordGet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerPasswordGet_ndr_print(py_obj, "netr_ServerPasswordGet_in", NDR_IN); } static PyObject *py_netr_ServerPasswordGet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerPasswordGet_ndr_print(py_obj, "netr_ServerPasswordGet_out", NDR_OUT); } static PyMethodDef py_netr_ServerPasswordGet_methods[] = { { "opnum", (PyCFunction)py_netr_ServerPasswordGet_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerPasswordGet.opnum() -> 31 (0x1f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordGet_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_netr_ServerPasswordGet_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_netr_ServerPasswordGet_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_netr_ServerPasswordGet_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_netr_ServerPasswordGet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerPasswordGet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerPasswordGet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerPasswordGet", .tp_getset = py_netr_ServerPasswordGet_getsetters, .tp_methods = py_netr_ServerPasswordGet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerPasswordGet_new, }; static bool pack_py_netr_ServerPasswordGet_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerPasswordGet *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credential; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credential", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerPasswordGet", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); return true; } static PyObject *unpack_py_netr_ServerPasswordGet_args_out(struct netr_ServerPasswordGet *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_password; result = PyTuple_New(2); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_password = pytalloc_reference_ex(samr_Password_Type, r->out.password, r->out.password); PyTuple_SetItem(result, 1, py_password); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_NetrLogonSendToSam_in_get_server_name(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_NetrLogonSendToSam_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_NetrLogonSendToSam_in_get_computer_name(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_NetrLogonSendToSam_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_NetrLogonSendToSam_in_get_credential(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_NetrLogonSendToSam_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_NetrLogonSendToSam_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_NetrLogonSendToSam_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_NetrLogonSendToSam_in_get_opaque_buffer(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_opaque_buffer; if (object->in.opaque_buffer == NULL) { Py_RETURN_NONE; } py_opaque_buffer = PyList_New(object->in.buffer_len); if (py_opaque_buffer == NULL) { return NULL; } { int opaque_buffer_cntr_1; for (opaque_buffer_cntr_1 = 0; opaque_buffer_cntr_1 < (object->in.buffer_len); opaque_buffer_cntr_1++) { PyObject *py_opaque_buffer_1; py_opaque_buffer_1 = PyLong_FromLong((uint16_t)object->in.opaque_buffer[opaque_buffer_cntr_1]); PyList_SetItem(py_opaque_buffer, opaque_buffer_cntr_1, py_opaque_buffer_1); } } return py_opaque_buffer; } static int py_netr_NetrLogonSendToSam_in_set_opaque_buffer(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.opaque_buffer)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.opaque_buffer"); return -1; } object->in.opaque_buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.opaque_buffer); if (object->in.opaque_buffer == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int opaque_buffer_cntr_1; object->in.opaque_buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.opaque_buffer, PyList_GET_SIZE(value)); if (!object->in.opaque_buffer) { return -1;; } talloc_set_name_const(object->in.opaque_buffer, "ARRAY: object->in.opaque_buffer"); for (opaque_buffer_cntr_1 = 0; opaque_buffer_cntr_1 < PyList_GET_SIZE(value); opaque_buffer_cntr_1++) { if (PyList_GET_ITEM(value, opaque_buffer_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.opaque_buffer[opaque_buffer_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.opaque_buffer[opaque_buffer_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, opaque_buffer_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, opaque_buffer_cntr_1)); 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.opaque_buffer[opaque_buffer_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_netr_NetrLogonSendToSam_in_get_buffer_len(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_buffer_len; py_buffer_len = PyLong_FromUnsignedLongLong((uint32_t)object->in.buffer_len); return py_buffer_len; } static int py_netr_NetrLogonSendToSam_in_set_buffer_len(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer_len"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffer_len)); 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.buffer_len = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_NetrLogonSendToSam_get_result(PyObject *obj, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_NetrLogonSendToSam_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)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_netr_NetrLogonSendToSam_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_NetrLogonSendToSam_in_get_server_name, .set = py_netr_NetrLogonSendToSam_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_NetrLogonSendToSam_in_get_computer_name, .set = py_netr_NetrLogonSendToSam_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_NetrLogonSendToSam_in_get_credential, .set = py_netr_NetrLogonSendToSam_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_NetrLogonSendToSam_out_get_return_authenticator, .set = py_netr_NetrLogonSendToSam_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_opaque_buffer"), .get = py_netr_NetrLogonSendToSam_in_get_opaque_buffer, .set = py_netr_NetrLogonSendToSam_in_set_opaque_buffer, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_buffer_len"), .get = py_netr_NetrLogonSendToSam_in_get_buffer_len, .set = py_netr_NetrLogonSendToSam_in_set_buffer_len, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_netr_NetrLogonSendToSam_get_result, .set = py_netr_NetrLogonSendToSam_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_NetrLogonSendToSam_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_NetrLogonSendToSam, type); struct netr_NetrLogonSendToSam *_self = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->in.opaque_buffer = talloc_zero(mem_ctx, uint8_t); return self; } static PyObject *py_netr_NetrLogonSendToSam_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(32); } static PyObject *py_netr_NetrLogonSendToSam_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 33) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrLogonSendToSam_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[32]; 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_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_NetrLogonSendToSam_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 netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 33) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrLogonSendToSam_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[32]; 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_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_NetrLogonSendToSam_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 33) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrLogonSendToSam_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[32]; 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_netr_NetrLogonSendToSam_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_NetrLogonSendToSam_ndr_print(py_obj, "netr_NetrLogonSendToSam_in", NDR_IN); } static PyObject *py_netr_NetrLogonSendToSam_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_NetrLogonSendToSam_ndr_print(py_obj, "netr_NetrLogonSendToSam_out", NDR_OUT); } static PyMethodDef py_netr_NetrLogonSendToSam_methods[] = { { "opnum", (PyCFunction)py_netr_NetrLogonSendToSam_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_NetrLogonSendToSam.opnum() -> 32 (0x20) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_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_netr_NetrLogonSendToSam_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_NetrLogonSendToSam_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_NetrLogonSendToSam_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NetrLogonSendToSam", .tp_getset = py_netr_NetrLogonSendToSam_getsetters, .tp_methods = py_netr_NetrLogonSendToSam_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NetrLogonSendToSam_new, }; static bool pack_py_netr_NetrLogonSendToSam_args_in(PyObject *args, PyObject *kwargs, struct netr_NetrLogonSendToSam *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_opaque_buffer; const char *kwnames[] = { "server_name", "computer_name", "credential", "opaque_buffer", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_NetrLogonSendToSam", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_opaque_buffer)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); if (py_opaque_buffer == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.opaque_buffer"); return false; } r->in.opaque_buffer = talloc_ptrtype(r, r->in.opaque_buffer); if (r->in.opaque_buffer == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&PyList_Type, py_opaque_buffer, return false;); { int opaque_buffer_cntr_1; r->in.opaque_buffer = talloc_array_ptrtype(r, r->in.opaque_buffer, PyList_GET_SIZE(py_opaque_buffer)); if (!r->in.opaque_buffer) { return false;; } talloc_set_name_const(r->in.opaque_buffer, "ARRAY: r->in.opaque_buffer"); for (opaque_buffer_cntr_1 = 0; opaque_buffer_cntr_1 < PyList_GET_SIZE(py_opaque_buffer); opaque_buffer_cntr_1++) { if (PyList_GET_ITEM(py_opaque_buffer, opaque_buffer_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.opaque_buffer[opaque_buffer_cntr_1]"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.opaque_buffer[opaque_buffer_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(py_opaque_buffer, opaque_buffer_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_opaque_buffer, opaque_buffer_cntr_1)); 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.opaque_buffer[opaque_buffer_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } } } PY_CHECK_TYPE(&PyList_Type, py_opaque_buffer, return false;); r->in.buffer_len = PyList_GET_SIZE(py_opaque_buffer); return true; } static PyObject *unpack_py_netr_NetrLogonSendToSam_args_out(struct netr_NetrLogonSendToSam *r) { PyObject *result; PyObject *py_return_authenticator; py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); result = py_return_authenticator; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRAddressToSitenamesW_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsRAddressToSitenamesW_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesW_in_get_count(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.count); return py_count; } static int py_netr_DsRAddressToSitenamesW_in_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.count)); 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.count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesW_in_get_addresses(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj); PyObject *py_addresses; if (object->in.addresses == NULL) { Py_RETURN_NONE; } py_addresses = PyList_New(object->in.count); if (py_addresses == NULL) { return NULL; } { int addresses_cntr_1; for (addresses_cntr_1 = 0; addresses_cntr_1 < (object->in.count); addresses_cntr_1++) { PyObject *py_addresses_1; py_addresses_1 = pytalloc_reference_ex(&netr_DsRAddress_Type, object->in.addresses, &object->in.addresses[addresses_cntr_1]); PyList_SetItem(py_addresses, addresses_cntr_1, py_addresses_1); } } return py_addresses; } static int py_netr_DsRAddressToSitenamesW_in_set_addresses(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.addresses)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses"); return -1; } object->in.addresses = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses); if (object->in.addresses == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int addresses_cntr_1; object->in.addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses, PyList_GET_SIZE(value)); if (!object->in.addresses) { return -1;; } talloc_set_name_const(object->in.addresses, "ARRAY: object->in.addresses"); for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(value); addresses_cntr_1++) { if (PyList_GET_ITEM(value, addresses_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses[addresses_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(value, addresses_cntr_1), return -1;); if (talloc_reference(object->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_1)); } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesW_out_get_ctr(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj); PyObject *py_ctr; if (object->out.ctr == NULL) { Py_RETURN_NONE; } if (*object->out.ctr == NULL) { py_ctr = Py_None; Py_INCREF(py_ctr); } else { py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesWCtr_Type, *object->out.ctr, *object->out.ctr); } return py_ctr; } static int py_netr_DsRAddressToSitenamesW_out_set_ctr(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ctr)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ctr"); return -1; } object->out.ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ctr); if (object->out.ctr == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.ctr = NULL; } else { *object->out.ctr = NULL; PY_CHECK_TYPE(&netr_DsRAddressToSitenamesWCtr_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.ctr = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsRAddressToSitenamesW_get_result(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRAddressToSitenamesW_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)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_netr_DsRAddressToSitenamesW_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsRAddressToSitenamesW_in_get_server_name, .set = py_netr_DsRAddressToSitenamesW_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_count"), .get = py_netr_DsRAddressToSitenamesW_in_get_count, .set = py_netr_DsRAddressToSitenamesW_in_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_addresses"), .get = py_netr_DsRAddressToSitenamesW_in_get_addresses, .set = py_netr_DsRAddressToSitenamesW_in_set_addresses, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddress") }, { .name = discard_const_p(char, "out_ctr"), .get = py_netr_DsRAddressToSitenamesW_out_get_ctr, .set = py_netr_DsRAddressToSitenamesW_out_set_ctr, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddressToSitenamesWCtr") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsRAddressToSitenamesW_get_result, .set = py_netr_DsRAddressToSitenamesW_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRAddressToSitenamesW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRAddressToSitenamesW, type); struct netr_DsRAddressToSitenamesW *_self = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.addresses = talloc_zero(mem_ctx, struct netr_DsRAddress); /* a pointer to a NULL pointer */ _self->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesWCtr *); return self; } static PyObject *py_netr_DsRAddressToSitenamesW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(33); } static PyObject *py_netr_DsRAddressToSitenamesW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 34) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesW_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[33]; 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_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRAddressToSitenamesW_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 netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 34) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesW_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[33]; 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_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRAddressToSitenamesW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 34) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesW_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[33]; 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_netr_DsRAddressToSitenamesW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRAddressToSitenamesW_ndr_print(py_obj, "netr_DsRAddressToSitenamesW_in", NDR_IN); } static PyObject *py_netr_DsRAddressToSitenamesW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRAddressToSitenamesW_ndr_print(py_obj, "netr_DsRAddressToSitenamesW_out", NDR_OUT); } static PyMethodDef py_netr_DsRAddressToSitenamesW_methods[] = { { "opnum", (PyCFunction)py_netr_DsRAddressToSitenamesW_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRAddressToSitenamesW.opnum() -> 33 (0x21) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRAddressToSitenamesW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRAddressToSitenamesW_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRAddressToSitenamesW", .tp_getset = py_netr_DsRAddressToSitenamesW_getsetters, .tp_methods = py_netr_DsRAddressToSitenamesW_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRAddressToSitenamesW_new, }; static bool pack_py_netr_DsRAddressToSitenamesW_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRAddressToSitenamesW *r) { PyObject *py_server_name; PyObject *py_addresses; const char *kwnames[] = { "server_name", "addresses", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_DsRAddressToSitenamesW", discard_const_p(char *, kwnames), &py_server_name, &py_addresses)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;); r->in.count = PyList_GET_SIZE(py_addresses); if (py_addresses == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses"); return false; } r->in.addresses = talloc_ptrtype(r, r->in.addresses); if (r->in.addresses == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;); { int addresses_cntr_1; r->in.addresses = talloc_array_ptrtype(r, r->in.addresses, PyList_GET_SIZE(py_addresses)); if (!r->in.addresses) { return false;; } talloc_set_name_const(r->in.addresses, "ARRAY: r->in.addresses"); for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(py_addresses); addresses_cntr_1++) { if (PyList_GET_ITEM(py_addresses, addresses_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses[addresses_cntr_1]"); return false; } PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(py_addresses, addresses_cntr_1), return false;); if (talloc_reference(r->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_addresses, addresses_cntr_1))) == NULL) { PyErr_NoMemory(); return false; } r->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(py_addresses, addresses_cntr_1)); } } return true; } static PyObject *unpack_py_netr_DsRAddressToSitenamesW_args_out(struct netr_DsRAddressToSitenamesW *r) { PyObject *result; PyObject *py_ctr; if (*r->out.ctr == NULL) { py_ctr = Py_None; Py_INCREF(py_ctr); } else { py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesWCtr_Type, *r->out.ctr, *r->out.ctr); } result = py_ctr; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRGetDCNameEx2_in_get_server_unc(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj); PyObject *py_server_unc; if (object->in.server_unc == NULL) { Py_RETURN_NONE; } if (object->in.server_unc == NULL) { py_server_unc = Py_None; Py_INCREF(py_server_unc); } else { if (object->in.server_unc == NULL) { py_server_unc = Py_None; Py_INCREF(py_server_unc); } else { py_server_unc = PyUnicode_Decode(object->in.server_unc, strlen(object->in.server_unc), "utf-8", "ignore"); } } return py_server_unc; } static int py_netr_DsRGetDCNameEx2_in_set_server_unc(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_unc"); return -1; } if (value == Py_None) { object->in.server_unc = NULL; } else { object->in.server_unc = 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.server_unc = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameEx2_in_get_client_account(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj); PyObject *py_client_account; if (object->in.client_account == NULL) { Py_RETURN_NONE; } if (object->in.client_account == NULL) { py_client_account = Py_None; Py_INCREF(py_client_account); } else { if (object->in.client_account == NULL) { py_client_account = Py_None; Py_INCREF(py_client_account); } else { py_client_account = PyUnicode_Decode(object->in.client_account, strlen(object->in.client_account), "utf-8", "ignore"); } } return py_client_account; } static int py_netr_DsRGetDCNameEx2_in_set_client_account(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_account"); return -1; } if (value == Py_None) { object->in.client_account = NULL; } else { object->in.client_account = 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.client_account = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameEx2_in_get_mask(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj); PyObject *py_mask; py_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.mask); return py_mask; } static int py_netr_DsRGetDCNameEx2_in_set_mask(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.mask)); 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.mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRGetDCNameEx2_in_get_domain_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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 { 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_netr_DsRGetDCNameEx2_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } if (value == Py_None) { object->in.domain_name = NULL; } else { object->in.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.domain_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetDCNameEx2_in_get_domain_guid(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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_netr_DsRGetDCNameEx2_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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_netr_DsRGetDCNameEx2_in_get_site_name(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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_netr_DsRGetDCNameEx2_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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_netr_DsRGetDCNameEx2_in_get_flags(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_netr_DsRGetDCNameEx2_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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_netr_DsRGetDCNameEx2_out_get_info(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *object->out.info, *object->out.info); } return py_info; } static int py_netr_DsRGetDCNameEx2_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.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.info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsRGetDCNameEx2_get_result(PyObject *obj, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRGetDCNameEx2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)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_netr_DsRGetDCNameEx2_getsetters[] = { { .name = discard_const_p(char, "in_server_unc"), .get = py_netr_DsRGetDCNameEx2_in_get_server_unc, .set = py_netr_DsRGetDCNameEx2_in_set_server_unc, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_client_account"), .get = py_netr_DsRGetDCNameEx2_in_get_client_account, .set = py_netr_DsRGetDCNameEx2_in_set_client_account, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_mask"), .get = py_netr_DsRGetDCNameEx2_in_get_mask, .set = py_netr_DsRGetDCNameEx2_in_set_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "in_domain_name"), .get = py_netr_DsRGetDCNameEx2_in_get_domain_name, .set = py_netr_DsRGetDCNameEx2_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_guid"), .get = py_netr_DsRGetDCNameEx2_in_get_domain_guid, .set = py_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_in_get_site_name, .set = py_netr_DsRGetDCNameEx2_in_set_site_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_flags"), .get = py_netr_DsRGetDCNameEx2_in_get_flags, .set = py_netr_DsRGetDCNameEx2_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCName_flags") }, { .name = discard_const_p(char, "out_info"), .get = py_netr_DsRGetDCNameEx2_out_get_info, .set = py_netr_DsRGetDCNameEx2_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsRGetDCNameEx2_get_result, .set = py_netr_DsRGetDCNameEx2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRGetDCNameEx2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRGetDCNameEx2, type); struct netr_DsRGetDCNameEx2 *_self = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *); return self; } static PyObject *py_netr_DsRGetDCNameEx2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(34); } static PyObject *py_netr_DsRGetDCNameEx2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 35) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx2_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[34]; 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_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRGetDCNameEx2_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 netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 35) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx2_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[34]; 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_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetDCNameEx2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 35) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx2_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[34]; 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_netr_DsRGetDCNameEx2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetDCNameEx2_ndr_print(py_obj, "netr_DsRGetDCNameEx2_in", NDR_IN); } static PyObject *py_netr_DsRGetDCNameEx2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetDCNameEx2_ndr_print(py_obj, "netr_DsRGetDCNameEx2_out", NDR_OUT); } static PyMethodDef py_netr_DsRGetDCNameEx2_methods[] = { { "opnum", (PyCFunction)py_netr_DsRGetDCNameEx2_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRGetDCNameEx2.opnum() -> 34 (0x22) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetDCNameEx2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRGetDCNameEx2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRGetDCNameEx2", .tp_getset = py_netr_DsRGetDCNameEx2_getsetters, .tp_methods = py_netr_DsRGetDCNameEx2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRGetDCNameEx2_new, }; static bool pack_py_netr_DsRGetDCNameEx2_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetDCNameEx2 *r) { PyObject *py_server_unc; PyObject *py_client_account; PyObject *py_mask; PyObject *py_domain_name; PyObject *py_domain_guid; PyObject *py_site_name; PyObject *py_flags; const char *kwnames[] = { "server_unc", "client_account", "mask", "domain_name", "domain_guid", "site_name", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_DsRGetDCNameEx2", discard_const_p(char *, kwnames), &py_server_unc, &py_client_account, &py_mask, &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) { return false; } if (py_server_unc == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_unc"); return false; } if (py_server_unc == Py_None) { r->in.server_unc = NULL; } else { r->in.server_unc = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_unc)) { unicode = PyUnicode_AsEncodedString(py_server_unc, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_unc)) { test_str = PyBytes_AS_STRING(py_server_unc); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_unc)->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.server_unc = talloc_str; } } if (py_client_account == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_account"); return false; } if (py_client_account == Py_None) { r->in.client_account = NULL; } else { r->in.client_account = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_client_account)) { unicode = PyUnicode_AsEncodedString(py_client_account, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_client_account)) { test_str = PyBytes_AS_STRING(py_client_account); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_account)->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.client_account = talloc_str; } } if (py_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.mask)); if (PyLong_Check(py_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_mask); 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.mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } if (py_domain_name == Py_None) { r->in.domain_name = NULL; } else { r->in.domain_name = NULL; { 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_netr_DsRGetDCNameEx2_args_out(struct netr_DsRGetDCNameEx2 *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *r->out.info, *r->out.info); } result = py_info; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_in_get_server_name(PyObject *obj, void *closure) { struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_NetrEnumerateTrustedDomainsEx_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_out_get_dom_trust_list(PyObject *obj, void *closure) { struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(obj); PyObject *py_dom_trust_list; if (object->out.dom_trust_list == NULL) { Py_RETURN_NONE; } py_dom_trust_list = pytalloc_reference_ex(&netr_DomainTrustList_Type, object->out.dom_trust_list, object->out.dom_trust_list); return py_dom_trust_list; } static int py_netr_NetrEnumerateTrustedDomainsEx_out_set_dom_trust_list(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dom_trust_list)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dom_trust_list"); return -1; } object->out.dom_trust_list = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dom_trust_list); if (object->out.dom_trust_list == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_DomainTrustList_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.dom_trust_list = (struct netr_DomainTrustList *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_get_result(PyObject *obj, void *closure) { struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_NetrEnumerateTrustedDomainsEx_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)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_netr_NetrEnumerateTrustedDomainsEx_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_NetrEnumerateTrustedDomainsEx_in_get_server_name, .set = py_netr_NetrEnumerateTrustedDomainsEx_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_dom_trust_list"), .get = py_netr_NetrEnumerateTrustedDomainsEx_out_get_dom_trust_list, .set = py_netr_NetrEnumerateTrustedDomainsEx_out_set_dom_trust_list, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrustList") }, { .name = discard_const_p(char, "result"), .get = py_netr_NetrEnumerateTrustedDomainsEx_get_result, .set = py_netr_NetrEnumerateTrustedDomainsEx_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_NetrEnumerateTrustedDomainsEx, type); struct netr_NetrEnumerateTrustedDomainsEx *_self = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.dom_trust_list = talloc_zero(mem_ctx, struct netr_DomainTrustList); return self; } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(36); } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 37) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[36]; 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_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_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 netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 37) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[36]; 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_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 37) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomainsEx_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[36]; 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_netr_NetrEnumerateTrustedDomainsEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_NetrEnumerateTrustedDomainsEx_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomainsEx_in", NDR_IN); } static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_NetrEnumerateTrustedDomainsEx_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomainsEx_out", NDR_OUT); } static PyMethodDef py_netr_NetrEnumerateTrustedDomainsEx_methods[] = { { "opnum", (PyCFunction)py_netr_NetrEnumerateTrustedDomainsEx_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_NetrEnumerateTrustedDomainsEx.opnum() -> 36 (0x24) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_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_netr_NetrEnumerateTrustedDomainsEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_NetrEnumerateTrustedDomainsEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_NetrEnumerateTrustedDomainsEx_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_NetrEnumerateTrustedDomainsEx", .tp_getset = py_netr_NetrEnumerateTrustedDomainsEx_getsetters, .tp_methods = py_netr_NetrEnumerateTrustedDomainsEx_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_NetrEnumerateTrustedDomainsEx_new, }; static bool pack_py_netr_NetrEnumerateTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct netr_NetrEnumerateTrustedDomainsEx *r) { PyObject *py_server_name; const char *kwnames[] = { "server_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_NetrEnumerateTrustedDomainsEx", discard_const_p(char *, kwnames), &py_server_name)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } return true; } static PyObject *unpack_py_netr_NetrEnumerateTrustedDomainsEx_args_out(struct netr_NetrEnumerateTrustedDomainsEx *r) { PyObject *result; PyObject *py_dom_trust_list; py_dom_trust_list = pytalloc_reference_ex(&netr_DomainTrustList_Type, r->out.dom_trust_list, r->out.dom_trust_list); result = py_dom_trust_list; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRAddressToSitenamesExW_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsRAddressToSitenamesExW_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesExW_in_get_count(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.count); return py_count; } static int py_netr_DsRAddressToSitenamesExW_in_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.count)); 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.count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesExW_in_get_addresses(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj); PyObject *py_addresses; if (object->in.addresses == NULL) { Py_RETURN_NONE; } py_addresses = PyList_New(object->in.count); if (py_addresses == NULL) { return NULL; } { int addresses_cntr_1; for (addresses_cntr_1 = 0; addresses_cntr_1 < (object->in.count); addresses_cntr_1++) { PyObject *py_addresses_1; py_addresses_1 = pytalloc_reference_ex(&netr_DsRAddress_Type, object->in.addresses, &object->in.addresses[addresses_cntr_1]); PyList_SetItem(py_addresses, addresses_cntr_1, py_addresses_1); } } return py_addresses; } static int py_netr_DsRAddressToSitenamesExW_in_set_addresses(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.addresses)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses"); return -1; } object->in.addresses = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses); if (object->in.addresses == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int addresses_cntr_1; object->in.addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses, PyList_GET_SIZE(value)); if (!object->in.addresses) { return -1;; } talloc_set_name_const(object->in.addresses, "ARRAY: object->in.addresses"); for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(value); addresses_cntr_1++) { if (PyList_GET_ITEM(value, addresses_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses[addresses_cntr_1]"); return -1; } PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(value, addresses_cntr_1), return -1;); if (talloc_reference(object->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_1)); } } return 0; } static PyObject *py_netr_DsRAddressToSitenamesExW_out_get_ctr(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj); PyObject *py_ctr; if (object->out.ctr == NULL) { Py_RETURN_NONE; } if (*object->out.ctr == NULL) { py_ctr = Py_None; Py_INCREF(py_ctr); } else { py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesExWCtr_Type, *object->out.ctr, *object->out.ctr); } return py_ctr; } static int py_netr_DsRAddressToSitenamesExW_out_set_ctr(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ctr)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ctr"); return -1; } object->out.ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ctr); if (object->out.ctr == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.ctr = NULL; } else { *object->out.ctr = NULL; PY_CHECK_TYPE(&netr_DsRAddressToSitenamesExWCtr_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.ctr = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsRAddressToSitenamesExW_get_result(PyObject *obj, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRAddressToSitenamesExW_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)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_netr_DsRAddressToSitenamesExW_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsRAddressToSitenamesExW_in_get_server_name, .set = py_netr_DsRAddressToSitenamesExW_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_count"), .get = py_netr_DsRAddressToSitenamesExW_in_get_count, .set = py_netr_DsRAddressToSitenamesExW_in_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_addresses"), .get = py_netr_DsRAddressToSitenamesExW_in_get_addresses, .set = py_netr_DsRAddressToSitenamesExW_in_set_addresses, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddress") }, { .name = discard_const_p(char, "out_ctr"), .get = py_netr_DsRAddressToSitenamesExW_out_get_ctr, .set = py_netr_DsRAddressToSitenamesExW_out_set_ctr, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddressToSitenamesExWCtr") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsRAddressToSitenamesExW_get_result, .set = py_netr_DsRAddressToSitenamesExW_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRAddressToSitenamesExW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRAddressToSitenamesExW, type); struct netr_DsRAddressToSitenamesExW *_self = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.addresses = talloc_zero(mem_ctx, struct netr_DsRAddress); /* a pointer to a NULL pointer */ _self->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesExWCtr *); return self; } static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(37); } static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 38) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesExW_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[37]; 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_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRAddressToSitenamesExW_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 netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 38) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesExW_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[37]; 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_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 38) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesExW_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[37]; 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_netr_DsRAddressToSitenamesExW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRAddressToSitenamesExW_ndr_print(py_obj, "netr_DsRAddressToSitenamesExW_in", NDR_IN); } static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRAddressToSitenamesExW_ndr_print(py_obj, "netr_DsRAddressToSitenamesExW_out", NDR_OUT); } static PyMethodDef py_netr_DsRAddressToSitenamesExW_methods[] = { { "opnum", (PyCFunction)py_netr_DsRAddressToSitenamesExW_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRAddressToSitenamesExW.opnum() -> 37 (0x25) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRAddressToSitenamesExW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRAddressToSitenamesExW_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRAddressToSitenamesExW", .tp_getset = py_netr_DsRAddressToSitenamesExW_getsetters, .tp_methods = py_netr_DsRAddressToSitenamesExW_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRAddressToSitenamesExW_new, }; static bool pack_py_netr_DsRAddressToSitenamesExW_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRAddressToSitenamesExW *r) { PyObject *py_server_name; PyObject *py_addresses; const char *kwnames[] = { "server_name", "addresses", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_DsRAddressToSitenamesExW", discard_const_p(char *, kwnames), &py_server_name, &py_addresses)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;); r->in.count = PyList_GET_SIZE(py_addresses); if (py_addresses == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses"); return false; } r->in.addresses = talloc_ptrtype(r, r->in.addresses); if (r->in.addresses == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;); { int addresses_cntr_1; r->in.addresses = talloc_array_ptrtype(r, r->in.addresses, PyList_GET_SIZE(py_addresses)); if (!r->in.addresses) { return false;; } talloc_set_name_const(r->in.addresses, "ARRAY: r->in.addresses"); for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(py_addresses); addresses_cntr_1++) { if (PyList_GET_ITEM(py_addresses, addresses_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses[addresses_cntr_1]"); return false; } PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(py_addresses, addresses_cntr_1), return false;); if (talloc_reference(r->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_addresses, addresses_cntr_1))) == NULL) { PyErr_NoMemory(); return false; } r->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(py_addresses, addresses_cntr_1)); } } return true; } static PyObject *unpack_py_netr_DsRAddressToSitenamesExW_args_out(struct netr_DsRAddressToSitenamesExW *r) { PyObject *result; PyObject *py_ctr; if (*r->out.ctr == NULL) { py_ctr = Py_None; Py_INCREF(py_ctr); } else { py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesExWCtr_Type, *r->out.ctr, *r->out.ctr); } result = py_ctr; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsrGetDcSiteCoverageW_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsrGetDcSiteCoverageW_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsrGetDcSiteCoverageW_out_get_ctr(PyObject *obj, void *closure) { struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(obj); PyObject *py_ctr; if (object->out.ctr == NULL) { Py_RETURN_NONE; } if (*object->out.ctr == NULL) { py_ctr = Py_None; Py_INCREF(py_ctr); } else { py_ctr = pytalloc_reference_ex(&DcSitesCtr_Type, *object->out.ctr, *object->out.ctr); } return py_ctr; } static int py_netr_DsrGetDcSiteCoverageW_out_set_ctr(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ctr)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ctr"); return -1; } object->out.ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ctr); if (object->out.ctr == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.ctr = NULL; } else { *object->out.ctr = NULL; PY_CHECK_TYPE(&DcSitesCtr_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.ctr = (struct DcSitesCtr *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsrGetDcSiteCoverageW_get_result(PyObject *obj, void *closure) { struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsrGetDcSiteCoverageW_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)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_netr_DsrGetDcSiteCoverageW_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsrGetDcSiteCoverageW_in_get_server_name, .set = py_netr_DsrGetDcSiteCoverageW_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_ctr"), .get = py_netr_DsrGetDcSiteCoverageW_out_get_ctr, .set = py_netr_DsrGetDcSiteCoverageW_out_set_ctr, .doc = discard_const_p(char, "PIDL-generated element of base type DcSitesCtr") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsrGetDcSiteCoverageW_get_result, .set = py_netr_DsrGetDcSiteCoverageW_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsrGetDcSiteCoverageW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsrGetDcSiteCoverageW, type); struct netr_DsrGetDcSiteCoverageW *_self = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); /* a pointer to a NULL pointer */ _self->out.ctr = talloc_zero(mem_ctx, struct DcSitesCtr *); return self; } static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(38); } static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 39) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrGetDcSiteCoverageW_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[38]; 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_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsrGetDcSiteCoverageW_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 netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 39) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrGetDcSiteCoverageW_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[38]; 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_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 39) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrGetDcSiteCoverageW_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[38]; 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_netr_DsrGetDcSiteCoverageW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrGetDcSiteCoverageW_ndr_print(py_obj, "netr_DsrGetDcSiteCoverageW_in", NDR_IN); } static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrGetDcSiteCoverageW_ndr_print(py_obj, "netr_DsrGetDcSiteCoverageW_out", NDR_OUT); } static PyMethodDef py_netr_DsrGetDcSiteCoverageW_methods[] = { { "opnum", (PyCFunction)py_netr_DsrGetDcSiteCoverageW_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsrGetDcSiteCoverageW.opnum() -> 38 (0x26) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsrGetDcSiteCoverageW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsrGetDcSiteCoverageW_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsrGetDcSiteCoverageW", .tp_getset = py_netr_DsrGetDcSiteCoverageW_getsetters, .tp_methods = py_netr_DsrGetDcSiteCoverageW_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsrGetDcSiteCoverageW_new, }; static bool pack_py_netr_DsrGetDcSiteCoverageW_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrGetDcSiteCoverageW *r) { PyObject *py_server_name; const char *kwnames[] = { "server_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_DsrGetDcSiteCoverageW", discard_const_p(char *, kwnames), &py_server_name)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } return true; } static PyObject *unpack_py_netr_DsrGetDcSiteCoverageW_args_out(struct netr_DsrGetDcSiteCoverageW *r) { PyObject *result; PyObject *py_ctr; if (*r->out.ctr == NULL) { py_ctr = Py_None; Py_INCREF(py_ctr); } else { py_ctr = pytalloc_reference_ex(&DcSitesCtr_Type, *r->out.ctr, *r->out.ctr); } result = py_ctr; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonSamLogonEx_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonSamLogonEx_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogonEx_in_get_computer_name(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_LogonSamLogonEx_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogonEx_in_get_logon_level(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)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_netr_LogonSamLogonEx_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)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_netr_LogonSamLogonEx_in_get_logon(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_logon; if (object->in.logon == NULL) { Py_RETURN_NONE; } py_logon = pyrpc_import_union(&netr_LogonLevel_Type, object->in.logon, object->in.logon_level, object->in.logon, "union netr_LogonLevel"); if (py_logon == NULL) { return NULL; } return py_logon; } static int py_netr_LogonSamLogonEx_in_set_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.logon)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon"); return -1; } object->in.logon = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon); if (object->in.logon == NULL) { PyErr_NoMemory(); return -1; } { union netr_LogonLevel *logon_switch_1; logon_switch_1 = (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_1 == NULL) { return -1; } object->in.logon = logon_switch_1; } return 0; } static PyObject *py_netr_LogonSamLogonEx_in_get_validation_level(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)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_netr_LogonSamLogonEx_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)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_netr_LogonSamLogonEx_out_get_validation(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_validation; if (object->out.validation == NULL) { Py_RETURN_NONE; } py_validation = pyrpc_import_union(&netr_Validation_Type, object->out.validation, object->in.validation_level, object->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } return py_validation; } static int py_netr_LogonSamLogonEx_out_set_validation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation"); return -1; } object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation); if (object->out.validation == NULL) { PyErr_NoMemory(); return -1; } { union netr_Validation *validation_switch_1; validation_switch_1 = (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_1 == NULL) { return -1; } object->out.validation = validation_switch_1; } return 0; } static PyObject *py_netr_LogonSamLogonEx_out_get_authoritative(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_authoritative; if (object->out.authoritative == NULL) { Py_RETURN_NONE; } py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative); return py_authoritative; } static int py_netr_LogonSamLogonEx_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative"); return -1; } object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative); if (object->out.authoritative == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogonEx_in_get_flags(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_flags; if (object->in.flags == NULL) { Py_RETURN_NONE; } py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.flags); return py_flags; } static int py_netr_LogonSamLogonEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags"); return -1; } object->in.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.flags); if (object->in.flags == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogonEx_out_get_flags(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_flags; if (object->out.flags == NULL) { Py_RETURN_NONE; } py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.flags); return py_flags; } static int py_netr_LogonSamLogonEx_out_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.flags"); return -1; } object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags); if (object->out.flags == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.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->out.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_LogonSamLogonEx_get_result(PyObject *obj, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_LogonSamLogonEx_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)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_netr_LogonSamLogonEx_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonSamLogonEx_in_get_server_name, .set = py_netr_LogonSamLogonEx_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_LogonSamLogonEx_in_get_computer_name, .set = py_netr_LogonSamLogonEx_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_logon_level"), .get = py_netr_LogonSamLogonEx_in_get_logon_level, .set = py_netr_LogonSamLogonEx_in_set_logon_level, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass") }, { .name = discard_const_p(char, "in_logon"), .get = py_netr_LogonSamLogonEx_in_get_logon, .set = py_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_in_get_validation_level, .set = py_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_out_get_validation, .set = py_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_out_get_authoritative, .set = py_netr_LogonSamLogonEx_out_set_authoritative, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_flags"), .get = py_netr_LogonSamLogonEx_in_get_flags, .set = py_netr_LogonSamLogonEx_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags") }, { .name = discard_const_p(char, "out_flags"), .get = py_netr_LogonSamLogonEx_out_get_flags, .set = py_netr_LogonSamLogonEx_out_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonSamLogonEx_get_result, .set = py_netr_LogonSamLogonEx_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_LogonSamLogonEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonSamLogonEx, type); struct netr_LogonSamLogonEx *_self = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.logon = talloc_zero(mem_ctx, union netr_LogonLevel); _self->out.validation = talloc_zero(mem_ctx, union netr_Validation); _self->out.authoritative = talloc_zero(mem_ctx, uint8_t); _self->in.flags = talloc_zero(mem_ctx, uint32_t); _self->out.flags = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_netr_LogonSamLogonEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(39); } static PyObject *py_netr_LogonSamLogonEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 40) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonEx_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[39]; 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_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonSamLogonEx_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 netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 40) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonEx_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[39]; 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_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogonEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 40) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonEx_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[39]; 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_netr_LogonSamLogonEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogonEx_ndr_print(py_obj, "netr_LogonSamLogonEx_in", NDR_IN); } static PyObject *py_netr_LogonSamLogonEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogonEx_ndr_print(py_obj, "netr_LogonSamLogonEx_out", NDR_OUT); } static PyMethodDef py_netr_LogonSamLogonEx_methods[] = { { "opnum", (PyCFunction)py_netr_LogonSamLogonEx_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonSamLogonEx.opnum() -> 39 (0x27) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogonEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonSamLogonEx_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonSamLogonEx", .tp_getset = py_netr_LogonSamLogonEx_getsetters, .tp_methods = py_netr_LogonSamLogonEx_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonSamLogonEx_new, }; static bool pack_py_netr_LogonSamLogonEx_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogonEx *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_logon_level; PyObject *py_logon; PyObject *py_validation_level; PyObject *py_flags; const char *kwnames[] = { "server_name", "computer_name", "logon_level", "logon", "validation_level", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_LogonSamLogonEx", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_logon_level, &py_logon, &py_validation_level, &py_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } 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; } r->in.logon = talloc_ptrtype(r, r->in.logon); if (r->in.logon == NULL) { PyErr_NoMemory(); return false; } { union netr_LogonLevel *logon_switch_1; logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel"); if (logon_switch_1 == NULL) { return false; } r->in.logon = logon_switch_1; } 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; } } if (py_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags"); return false; } r->in.flags = talloc_ptrtype(r, r->in.flags); if (r->in.flags == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogonEx_args_out(struct netr_LogonSamLogonEx *r) { PyObject *result; PyObject *py_validation; PyObject *py_authoritative; PyObject *py_flags; result = PyTuple_New(3); py_validation = pyrpc_import_union(&netr_Validation_Type, r->out.validation, 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); py_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.flags); PyTuple_SetItem(result, 2, py_flags); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsrEnumerateDomainTrusts_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsrEnumerateDomainTrusts_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsrEnumerateDomainTrusts_in_get_trust_flags(PyObject *obj, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj); PyObject *py_trust_flags; py_trust_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.trust_flags); return py_trust_flags; } static int py_netr_DsrEnumerateDomainTrusts_in_set_trust_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trust_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.trust_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.trust_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_DsrEnumerateDomainTrusts_out_get_trusts(PyObject *obj, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj); PyObject *py_trusts; if (object->out.trusts == NULL) { Py_RETURN_NONE; } py_trusts = pytalloc_reference_ex(&netr_DomainTrustList_Type, object->out.trusts, object->out.trusts); return py_trusts; } static int py_netr_DsrEnumerateDomainTrusts_out_set_trusts(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trusts)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trusts"); return -1; } object->out.trusts = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trusts); if (object->out.trusts == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_DomainTrustList_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.trusts = (struct netr_DomainTrustList *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DsrEnumerateDomainTrusts_get_result(PyObject *obj, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsrEnumerateDomainTrusts_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)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_netr_DsrEnumerateDomainTrusts_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsrEnumerateDomainTrusts_in_get_server_name, .set = py_netr_DsrEnumerateDomainTrusts_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_trust_flags"), .get = py_netr_DsrEnumerateDomainTrusts_in_get_trust_flags, .set = py_netr_DsrEnumerateDomainTrusts_in_set_trust_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustFlags") }, { .name = discard_const_p(char, "out_trusts"), .get = py_netr_DsrEnumerateDomainTrusts_out_get_trusts, .set = py_netr_DsrEnumerateDomainTrusts_out_set_trusts, .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrustList") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsrEnumerateDomainTrusts_get_result, .set = py_netr_DsrEnumerateDomainTrusts_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsrEnumerateDomainTrusts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsrEnumerateDomainTrusts, type); struct netr_DsrEnumerateDomainTrusts *_self = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.trusts = talloc_zero(mem_ctx, struct netr_DomainTrustList); return self; } static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(40); } static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 41) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrEnumerateDomainTrusts_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[40]; 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_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsrEnumerateDomainTrusts_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 netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 41) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrEnumerateDomainTrusts_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[40]; 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_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 41) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrEnumerateDomainTrusts_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[40]; 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_netr_DsrEnumerateDomainTrusts_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrEnumerateDomainTrusts_ndr_print(py_obj, "netr_DsrEnumerateDomainTrusts_in", NDR_IN); } static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrEnumerateDomainTrusts_ndr_print(py_obj, "netr_DsrEnumerateDomainTrusts_out", NDR_OUT); } static PyMethodDef py_netr_DsrEnumerateDomainTrusts_methods[] = { { "opnum", (PyCFunction)py_netr_DsrEnumerateDomainTrusts_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsrEnumerateDomainTrusts.opnum() -> 40 (0x28) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsrEnumerateDomainTrusts_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsrEnumerateDomainTrusts_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsrEnumerateDomainTrusts", .tp_getset = py_netr_DsrEnumerateDomainTrusts_getsetters, .tp_methods = py_netr_DsrEnumerateDomainTrusts_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsrEnumerateDomainTrusts_new, }; static bool pack_py_netr_DsrEnumerateDomainTrusts_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrEnumerateDomainTrusts *r) { PyObject *py_server_name; PyObject *py_trust_flags; const char *kwnames[] = { "server_name", "trust_flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_DsrEnumerateDomainTrusts", discard_const_p(char *, kwnames), &py_server_name, &py_trust_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_trust_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trust_flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.trust_flags)); if (PyLong_Check(py_trust_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_trust_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.trust_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_netr_DsrEnumerateDomainTrusts_args_out(struct netr_DsrEnumerateDomainTrusts *r) { PyObject *result; PyObject *py_trusts; py_trusts = pytalloc_reference_ex(&netr_DomainTrustList_Type, r->out.trusts, r->out.trusts); result = py_trusts; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsrDeregisterDNSHostRecords_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_domain(PyObject *obj, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)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 { 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_netr_DsrDeregisterDNSHostRecords_in_set_domain(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain"); return -1; } if (value == Py_None) { object->in.domain = NULL; } else { object->in.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->in.domain = talloc_str; } } return 0; } static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_domain_guid(PyObject *obj, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)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_netr_DsrDeregisterDNSHostRecords_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)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_netr_DsrDeregisterDNSHostRecords_in_get_dsa_guid(PyObject *obj, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj); PyObject *py_dsa_guid; if (object->in.dsa_guid == NULL) { Py_RETURN_NONE; } if (object->in.dsa_guid == NULL) { py_dsa_guid = Py_None; Py_INCREF(py_dsa_guid); } else { py_dsa_guid = pytalloc_reference_ex(GUID_Type, object->in.dsa_guid, object->in.dsa_guid); } return py_dsa_guid; } static int py_netr_DsrDeregisterDNSHostRecords_in_set_dsa_guid(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dsa_guid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dsa_guid"); return -1; } if (value == Py_None) { object->in.dsa_guid = NULL; } else { object->in.dsa_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.dsa_guid = (struct GUID *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_dns_host(PyObject *obj, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj); PyObject *py_dns_host; if (object->in.dns_host == NULL) { Py_RETURN_NONE; } if (object->in.dns_host == NULL) { py_dns_host = Py_None; Py_INCREF(py_dns_host); } else { py_dns_host = PyUnicode_Decode(object->in.dns_host, strlen(object->in.dns_host), "utf-8", "ignore"); } return py_dns_host; } static int py_netr_DsrDeregisterDNSHostRecords_in_set_dns_host(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_host"); return -1; } object->in.dns_host = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_host); if (object->in.dns_host == 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.dns_host = talloc_str; } return 0; } static PyObject *py_netr_DsrDeregisterDNSHostRecords_get_result(PyObject *obj, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsrDeregisterDNSHostRecords_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)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_netr_DsrDeregisterDNSHostRecords_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsrDeregisterDNSHostRecords_in_get_server_name, .set = py_netr_DsrDeregisterDNSHostRecords_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain"), .get = py_netr_DsrDeregisterDNSHostRecords_in_get_domain, .set = py_netr_DsrDeregisterDNSHostRecords_in_set_domain, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_domain_guid"), .get = py_netr_DsrDeregisterDNSHostRecords_in_get_domain_guid, .set = py_netr_DsrDeregisterDNSHostRecords_in_set_domain_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_dsa_guid"), .get = py_netr_DsrDeregisterDNSHostRecords_in_get_dsa_guid, .set = py_netr_DsrDeregisterDNSHostRecords_in_set_dsa_guid, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_dns_host"), .get = py_netr_DsrDeregisterDNSHostRecords_in_get_dns_host, .set = py_netr_DsrDeregisterDNSHostRecords_in_set_dns_host, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "result"), .get = py_netr_DsrDeregisterDNSHostRecords_get_result, .set = py_netr_DsrDeregisterDNSHostRecords_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsrDeregisterDNSHostRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsrDeregisterDNSHostRecords, type); return self; } static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(41); } static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 42) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrDeregisterDNSHostRecords_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[41]; 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_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsrDeregisterDNSHostRecords_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 netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 42) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrDeregisterDNSHostRecords_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[41]; 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_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 42) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrDeregisterDNSHostRecords_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[41]; 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_netr_DsrDeregisterDNSHostRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrDeregisterDNSHostRecords_ndr_print(py_obj, "netr_DsrDeregisterDNSHostRecords_in", NDR_IN); } static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrDeregisterDNSHostRecords_ndr_print(py_obj, "netr_DsrDeregisterDNSHostRecords_out", NDR_OUT); } static PyMethodDef py_netr_DsrDeregisterDNSHostRecords_methods[] = { { "opnum", (PyCFunction)py_netr_DsrDeregisterDNSHostRecords_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsrDeregisterDNSHostRecords.opnum() -> 41 (0x29) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_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_netr_DsrDeregisterDNSHostRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsrDeregisterDNSHostRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsrDeregisterDNSHostRecords_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsrDeregisterDNSHostRecords", .tp_getset = py_netr_DsrDeregisterDNSHostRecords_getsetters, .tp_methods = py_netr_DsrDeregisterDNSHostRecords_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsrDeregisterDNSHostRecords_new, }; static bool pack_py_netr_DsrDeregisterDNSHostRecords_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrDeregisterDNSHostRecords *r) { PyObject *py_server_name; PyObject *py_domain; PyObject *py_domain_guid; PyObject *py_dsa_guid; PyObject *py_dns_host; const char *kwnames[] = { "server_name", "domain", "domain_guid", "dsa_guid", "dns_host", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_DsrDeregisterDNSHostRecords", discard_const_p(char *, kwnames), &py_server_name, &py_domain, &py_domain_guid, &py_dsa_guid, &py_dns_host)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_domain == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain"); return false; } if (py_domain == Py_None) { r->in.domain = NULL; } else { r->in.domain = NULL; { 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_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_dsa_guid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dsa_guid"); return false; } if (py_dsa_guid == Py_None) { r->in.dsa_guid = NULL; } else { r->in.dsa_guid = NULL; PY_CHECK_TYPE(GUID_Type, py_dsa_guid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_dsa_guid)) == NULL) { PyErr_NoMemory(); return false; } r->in.dsa_guid = (struct GUID *)pytalloc_get_ptr(py_dsa_guid); } if (py_dns_host == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_host"); return false; } r->in.dns_host = talloc_ptrtype(r, r->in.dns_host); if (r->in.dns_host == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_dns_host)) { unicode = PyUnicode_AsEncodedString(py_dns_host, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_dns_host)) { test_str = PyBytes_AS_STRING(py_dns_host); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dns_host)->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.dns_host = talloc_str; } return true; } static PyObject *unpack_py_netr_DsrDeregisterDNSHostRecords_args_out(struct netr_DsrDeregisterDNSHostRecords *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerTrustPasswordsGet_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerTrustPasswordsGet_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerTrustPasswordsGet_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerTrustPasswordsGet_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerTrustPasswordsGet_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_in_get_credential(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_ServerTrustPasswordsGet_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_ServerTrustPasswordsGet_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_out_get_new_owf_password(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_new_owf_password; if (object->out.new_owf_password == NULL) { Py_RETURN_NONE; } py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.new_owf_password, object->out.new_owf_password); return py_new_owf_password; } static int py_netr_ServerTrustPasswordsGet_out_set_new_owf_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_owf_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_owf_password"); return -1; } object->out.new_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_owf_password); if (object->out.new_owf_password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(samr_Password_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.new_owf_password = (struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_out_get_old_owf_password(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_old_owf_password; if (object->out.old_owf_password == NULL) { Py_RETURN_NONE; } py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.old_owf_password, object->out.old_owf_password); return py_old_owf_password; } static int py_netr_ServerTrustPasswordsGet_out_set_old_owf_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_owf_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_owf_password"); return -1; } object->out.old_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_owf_password); if (object->out.old_owf_password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(samr_Password_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.old_owf_password = (struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerTrustPasswordsGet_get_result(PyObject *obj, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerTrustPasswordsGet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)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_netr_ServerTrustPasswordsGet_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerTrustPasswordsGet_in_get_server_name, .set = py_netr_ServerTrustPasswordsGet_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerTrustPasswordsGet_in_get_account_name, .set = py_netr_ServerTrustPasswordsGet_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerTrustPasswordsGet_in_get_secure_channel_type, .set = py_netr_ServerTrustPasswordsGet_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerTrustPasswordsGet_in_get_computer_name, .set = py_netr_ServerTrustPasswordsGet_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_ServerTrustPasswordsGet_in_get_credential, .set = py_netr_ServerTrustPasswordsGet_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_ServerTrustPasswordsGet_out_get_return_authenticator, .set = py_netr_ServerTrustPasswordsGet_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_new_owf_password"), .get = py_netr_ServerTrustPasswordsGet_out_get_new_owf_password, .set = py_netr_ServerTrustPasswordsGet_out_set_new_owf_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "out_old_owf_password"), .get = py_netr_ServerTrustPasswordsGet_out_get_old_owf_password, .set = py_netr_ServerTrustPasswordsGet_out_set_old_owf_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerTrustPasswordsGet_get_result, .set = py_netr_ServerTrustPasswordsGet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerTrustPasswordsGet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerTrustPasswordsGet, type); struct netr_ServerTrustPasswordsGet *_self = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.new_owf_password = talloc_zero(mem_ctx, struct samr_Password); _self->out.old_owf_password = talloc_zero(mem_ctx, struct samr_Password); return self; } static PyObject *py_netr_ServerTrustPasswordsGet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(42); } static PyObject *py_netr_ServerTrustPasswordsGet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 43) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerTrustPasswordsGet_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[42]; 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_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerTrustPasswordsGet_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 netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 43) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerTrustPasswordsGet_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[42]; 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_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerTrustPasswordsGet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 43) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerTrustPasswordsGet_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[42]; 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_netr_ServerTrustPasswordsGet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerTrustPasswordsGet_ndr_print(py_obj, "netr_ServerTrustPasswordsGet_in", NDR_IN); } static PyObject *py_netr_ServerTrustPasswordsGet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerTrustPasswordsGet_ndr_print(py_obj, "netr_ServerTrustPasswordsGet_out", NDR_OUT); } static PyMethodDef py_netr_ServerTrustPasswordsGet_methods[] = { { "opnum", (PyCFunction)py_netr_ServerTrustPasswordsGet_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerTrustPasswordsGet.opnum() -> 42 (0x2a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerTrustPasswordsGet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerTrustPasswordsGet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerTrustPasswordsGet", .tp_getset = py_netr_ServerTrustPasswordsGet_getsetters, .tp_methods = py_netr_ServerTrustPasswordsGet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerTrustPasswordsGet_new, }; static bool pack_py_netr_ServerTrustPasswordsGet_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerTrustPasswordsGet *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credential; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credential", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerTrustPasswordsGet", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); return true; } static PyObject *unpack_py_netr_ServerTrustPasswordsGet_args_out(struct netr_ServerTrustPasswordsGet *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_new_owf_password; PyObject *py_old_owf_password; result = PyTuple_New(3); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.new_owf_password, r->out.new_owf_password); PyTuple_SetItem(result, 1, py_new_owf_password); py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.old_owf_password, r->out.old_owf_password); PyTuple_SetItem(result, 2, py_old_owf_password); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_DsRGetForestTrustInformation_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsRGetForestTrustInformation_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsRGetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_in_get_flags(PyObject *obj, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_netr_DsRGetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_get_result(PyObject *obj, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromWERROR(object->out.result); return py_result; } static int py_netr_DsRGetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsRGetForestTrustInformation_in_get_server_name, .set = py_netr_DsRGetForestTrustInformation_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_trusted_domain_name"), .get = py_netr_DsRGetForestTrustInformation_in_get_trusted_domain_name, .set = py_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_in_get_flags, .set = py_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_out_get_forest_trust_info, .set = py_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_get_result, .set = py_netr_DsRGetForestTrustInformation_set_result, .doc = discard_const_p(char, "PIDL-generated element of type WERROR") }, { .name = NULL } }; static PyObject *py_netr_DsRGetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsRGetForestTrustInformation, type); struct netr_DsRGetForestTrustInformation *_self = (struct netr_DsRGetForestTrustInformation *)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_netr_DsRGetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(43); } static PyObject *py_netr_DsRGetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 44) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetForestTrustInformation_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[43]; 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_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_DsRGetForestTrustInformation_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 netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 44) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetForestTrustInformation_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[43]; 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_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsRGetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 44) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetForestTrustInformation_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[43]; 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_netr_DsRGetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetForestTrustInformation_ndr_print(py_obj, "netr_DsRGetForestTrustInformation_in", NDR_IN); } static PyObject *py_netr_DsRGetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsRGetForestTrustInformation_ndr_print(py_obj, "netr_DsRGetForestTrustInformation_out", NDR_OUT); } static PyMethodDef py_netr_DsRGetForestTrustInformation_methods[] = { { "opnum", (PyCFunction)py_netr_DsRGetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsRGetForestTrustInformation.opnum() -> 43 (0x2b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsRGetForestTrustInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsRGetForestTrustInformation", .tp_getset = py_netr_DsRGetForestTrustInformation_getsetters, .tp_methods = py_netr_DsRGetForestTrustInformation_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsRGetForestTrustInformation_new, }; static bool pack_py_netr_DsRGetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetForestTrustInformation *r) { PyObject *py_server_name; PyObject *py_trusted_domain_name; PyObject *py_flags; const char *kwnames[] = { "server_name", "trusted_domain_name", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_DsRGetForestTrustInformation", discard_const_p(char *, kwnames), &py_server_name, &py_trusted_domain_name, &py_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } 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_netr_DsRGetForestTrustInformation_args_out(struct netr_DsRGetForestTrustInformation *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_netr_GetForestTrustInformation_in_get_server_name(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_GetForestTrustInformation_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_GetForestTrustInformation_in_get_computer_name(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_GetForestTrustInformation_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_GetForestTrustInformation_in_get_credential(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_GetForestTrustInformation_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_GetForestTrustInformation_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_GetForestTrustInformation_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_GetForestTrustInformation_in_get_flags(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_netr_GetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_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_netr_GetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_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_netr_GetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_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_netr_GetForestTrustInformation_get_result(PyObject *obj, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_GetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_GetForestTrustInformation *object = (struct netr_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 = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_netr_GetForestTrustInformation_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_GetForestTrustInformation_in_get_server_name, .set = py_netr_GetForestTrustInformation_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_GetForestTrustInformation_in_get_computer_name, .set = py_netr_GetForestTrustInformation_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_GetForestTrustInformation_in_get_credential, .set = py_netr_GetForestTrustInformation_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_GetForestTrustInformation_out_get_return_authenticator, .set = py_netr_GetForestTrustInformation_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_flags"), .get = py_netr_GetForestTrustInformation_in_get_flags, .set = py_netr_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_netr_GetForestTrustInformation_out_get_forest_trust_info, .set = py_netr_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_netr_GetForestTrustInformation_get_result, .set = py_netr_GetForestTrustInformation_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_GetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_GetForestTrustInformation, type); struct netr_GetForestTrustInformation *_self = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); /* a pointer to a NULL pointer */ _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *); return self; } static PyObject *py_netr_GetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(44); } static PyObject *py_netr_GetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_GetForestTrustInformation *object = (struct netr_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_netlogon.num_calls < 45) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetForestTrustInformation_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[44]; 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_netr_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_netr_GetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_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_netr_GetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_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 netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 45) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetForestTrustInformation_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[44]; 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_netr_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_netr_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_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_netr_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_GetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 45) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetForestTrustInformation_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[44]; 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_netr_GetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_GetForestTrustInformation_ndr_print(py_obj, "netr_GetForestTrustInformation_in", NDR_IN); } static PyObject *py_netr_GetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_GetForestTrustInformation_ndr_print(py_obj, "netr_GetForestTrustInformation_out", NDR_OUT); } static PyMethodDef py_netr_GetForestTrustInformation_methods[] = { { "opnum", (PyCFunction)py_netr_GetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_GetForestTrustInformation.opnum() -> 44 (0x2c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_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_netr_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_netr_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_netr_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_netr_GetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_GetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_GetForestTrustInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_GetForestTrustInformation", .tp_getset = py_netr_GetForestTrustInformation_getsetters, .tp_methods = py_netr_GetForestTrustInformation_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_GetForestTrustInformation_new, }; static bool pack_py_netr_GetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct netr_GetForestTrustInformation *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_flags; const char *kwnames[] = { "server_name", "computer_name", "credential", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_GetForestTrustInformation", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); 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_netr_GetForestTrustInformation_args_out(struct netr_GetForestTrustInformation *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_forest_trust_info; result = PyTuple_New(2); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); 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); } PyTuple_SetItem(result, 1, py_forest_trust_info); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_LogonSamLogonWithFlags_in_get_server_name(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_LogonSamLogonWithFlags_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_in_get_computer_name(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } } return py_computer_name; } static int py_netr_LogonSamLogonWithFlags_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } if (value == Py_None) { object->in.computer_name = NULL; } else { object->in.computer_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.computer_name = talloc_str; } } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_in_get_credential(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } if (object->in.credential == NULL) { py_credential = Py_None; Py_INCREF(py_credential); } else { py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); } return py_credential; } static int py_netr_LogonSamLogonWithFlags_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } if (value == Py_None) { object->in.credential = NULL; } else { object->in.credential = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_in_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->in.return_authenticator == NULL) { Py_RETURN_NONE; } if (object->in.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator); } return py_return_authenticator; } static int py_netr_LogonSamLogonWithFlags_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator"); return -1; } if (value == Py_None) { object->in.return_authenticator = NULL; } else { object->in.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } if (object->out.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); } return py_return_authenticator; } static int py_netr_LogonSamLogonWithFlags_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } if (value == Py_None) { object->out.return_authenticator = NULL; } else { object->out.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_in_get_logon_level(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)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_netr_LogonSamLogonWithFlags_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)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_netr_LogonSamLogonWithFlags_in_get_logon(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_logon; if (object->in.logon == NULL) { Py_RETURN_NONE; } py_logon = pyrpc_import_union(&netr_LogonLevel_Type, object->in.logon, object->in.logon_level, object->in.logon, "union netr_LogonLevel"); if (py_logon == NULL) { return NULL; } return py_logon; } static int py_netr_LogonSamLogonWithFlags_in_set_logon(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.logon)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon"); return -1; } object->in.logon = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon); if (object->in.logon == NULL) { PyErr_NoMemory(); return -1; } { union netr_LogonLevel *logon_switch_1; logon_switch_1 = (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_1 == NULL) { return -1; } object->in.logon = logon_switch_1; } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_in_get_validation_level(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)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_netr_LogonSamLogonWithFlags_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)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_netr_LogonSamLogonWithFlags_out_get_validation(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_validation; if (object->out.validation == NULL) { Py_RETURN_NONE; } py_validation = pyrpc_import_union(&netr_Validation_Type, object->out.validation, object->in.validation_level, object->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } return py_validation; } static int py_netr_LogonSamLogonWithFlags_out_set_validation(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation"); return -1; } object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation); if (object->out.validation == NULL) { PyErr_NoMemory(); return -1; } { union netr_Validation *validation_switch_1; validation_switch_1 = (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_1 == NULL) { return -1; } object->out.validation = validation_switch_1; } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_out_get_authoritative(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_authoritative; if (object->out.authoritative == NULL) { Py_RETURN_NONE; } py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative); return py_authoritative; } static int py_netr_LogonSamLogonWithFlags_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative"); return -1; } object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative); if (object->out.authoritative == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogonWithFlags_in_get_flags(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_flags; if (object->in.flags == NULL) { Py_RETURN_NONE; } py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.flags); return py_flags; } static int py_netr_LogonSamLogonWithFlags_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags"); return -1; } object->in.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.flags); if (object->in.flags == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogonWithFlags_out_get_flags(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_flags; if (object->out.flags == NULL) { Py_RETURN_NONE; } py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.flags); return py_flags; } static int py_netr_LogonSamLogonWithFlags_out_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.flags"); return -1; } object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags); if (object->out.flags == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.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->out.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_LogonSamLogonWithFlags_get_result(PyObject *obj, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_LogonSamLogonWithFlags_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)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_netr_LogonSamLogonWithFlags_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_LogonSamLogonWithFlags_in_get_server_name, .set = py_netr_LogonSamLogonWithFlags_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_LogonSamLogonWithFlags_in_get_computer_name, .set = py_netr_LogonSamLogonWithFlags_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_LogonSamLogonWithFlags_in_get_credential, .set = py_netr_LogonSamLogonWithFlags_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_return_authenticator"), .get = py_netr_LogonSamLogonWithFlags_in_get_return_authenticator, .set = py_netr_LogonSamLogonWithFlags_in_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_LogonSamLogonWithFlags_out_get_return_authenticator, .set = py_netr_LogonSamLogonWithFlags_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_logon_level"), .get = py_netr_LogonSamLogonWithFlags_in_get_logon_level, .set = py_netr_LogonSamLogonWithFlags_in_set_logon_level, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass") }, { .name = discard_const_p(char, "in_logon"), .get = py_netr_LogonSamLogonWithFlags_in_get_logon, .set = py_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_in_get_validation_level, .set = py_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_out_get_validation, .set = py_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_out_get_authoritative, .set = py_netr_LogonSamLogonWithFlags_out_set_authoritative, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_flags"), .get = py_netr_LogonSamLogonWithFlags_in_get_flags, .set = py_netr_LogonSamLogonWithFlags_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags") }, { .name = discard_const_p(char, "out_flags"), .get = py_netr_LogonSamLogonWithFlags_out_get_flags, .set = py_netr_LogonSamLogonWithFlags_out_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags") }, { .name = discard_const_p(char, "result"), .get = py_netr_LogonSamLogonWithFlags_get_result, .set = py_netr_LogonSamLogonWithFlags_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_LogonSamLogonWithFlags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_LogonSamLogonWithFlags, type); struct netr_LogonSamLogonWithFlags *_self = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.logon = talloc_zero(mem_ctx, union netr_LogonLevel); _self->out.validation = talloc_zero(mem_ctx, union netr_Validation); _self->out.authoritative = talloc_zero(mem_ctx, uint8_t); _self->in.flags = talloc_zero(mem_ctx, uint32_t); _self->out.flags = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_netr_LogonSamLogonWithFlags_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(45); } static PyObject *py_netr_LogonSamLogonWithFlags_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 46) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonWithFlags_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[45]; 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_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_LogonSamLogonWithFlags_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 netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 46) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonWithFlags_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[45]; 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_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_LogonSamLogonWithFlags_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 46) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonWithFlags_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[45]; 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_netr_LogonSamLogonWithFlags_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogonWithFlags_ndr_print(py_obj, "netr_LogonSamLogonWithFlags_in", NDR_IN); } static PyObject *py_netr_LogonSamLogonWithFlags_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_LogonSamLogonWithFlags_ndr_print(py_obj, "netr_LogonSamLogonWithFlags_out", NDR_OUT); } static PyMethodDef py_netr_LogonSamLogonWithFlags_methods[] = { { "opnum", (PyCFunction)py_netr_LogonSamLogonWithFlags_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_LogonSamLogonWithFlags.opnum() -> 45 (0x2d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogonWithFlags_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_LogonSamLogonWithFlags_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_LogonSamLogonWithFlags", .tp_getset = py_netr_LogonSamLogonWithFlags_getsetters, .tp_methods = py_netr_LogonSamLogonWithFlags_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_LogonSamLogonWithFlags_new, }; static bool pack_py_netr_LogonSamLogonWithFlags_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogonWithFlags *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_return_authenticator; PyObject *py_logon_level; PyObject *py_logon; PyObject *py_validation_level; PyObject *py_flags; const char *kwnames[] = { "server_name", "computer_name", "credential", "return_authenticator", "logon_level", "logon", "validation_level", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_LogonSamLogonWithFlags", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_logon_level, &py_logon, &py_validation_level, &py_flags)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } if (py_computer_name == Py_None) { r->in.computer_name = NULL; } else { r->in.computer_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } if (py_credential == Py_None) { r->in.credential = NULL; } else { r->in.credential = NULL; PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); } if (py_return_authenticator == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator"); return false; } if (py_return_authenticator == Py_None) { r->in.return_authenticator = NULL; } else { r->in.return_authenticator = NULL; PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) { PyErr_NoMemory(); return false; } r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator); } 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; } r->in.logon = talloc_ptrtype(r, r->in.logon); if (r->in.logon == NULL) { PyErr_NoMemory(); return false; } { union netr_LogonLevel *logon_switch_1; logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel"); if (logon_switch_1 == NULL) { return false; } r->in.logon = logon_switch_1; } 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; } } if (py_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags"); return false; } r->in.flags = talloc_ptrtype(r, r->in.flags); if (r->in.flags == NULL) { PyErr_NoMemory(); 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_netr_LogonSamLogonWithFlags_args_out(struct netr_LogonSamLogonWithFlags *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_validation; PyObject *py_authoritative; PyObject *py_flags; result = PyTuple_New(4); if (r->out.return_authenticator == NULL) { py_return_authenticator = Py_None; Py_INCREF(py_return_authenticator); } else { py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); } PyTuple_SetItem(result, 0, py_return_authenticator); py_validation = pyrpc_import_union(&netr_Validation_Type, r->out.validation, r->in.validation_level, r->out.validation, "union netr_Validation"); if (py_validation == NULL) { return NULL; } PyTuple_SetItem(result, 1, py_validation); py_authoritative = PyLong_FromLong((uint16_t)*r->out.authoritative); PyTuple_SetItem(result, 2, py_authoritative); py_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.flags); PyTuple_SetItem(result, 3, py_flags); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_ServerGetTrustInfo_in_get_server_name(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_ServerGetTrustInfo_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_ServerGetTrustInfo_in_get_account_name(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } if (object->in.account_name == NULL) { py_account_name = Py_None; Py_INCREF(py_account_name); } else { py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore"); } return py_account_name; } static int py_netr_ServerGetTrustInfo_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_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.account_name = talloc_str; } return 0; } static PyObject *py_netr_ServerGetTrustInfo_in_get_secure_channel_type(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_secure_channel_type; py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type); return py_secure_channel_type; } static int py_netr_ServerGetTrustInfo_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_netr_ServerGetTrustInfo_in_get_computer_name(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_ServerGetTrustInfo_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_ServerGetTrustInfo_in_get_credential(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_ServerGetTrustInfo_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerGetTrustInfo_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_ServerGetTrustInfo_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerGetTrustInfo_out_get_new_owf_password(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_new_owf_password; if (object->out.new_owf_password == NULL) { Py_RETURN_NONE; } py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.new_owf_password, object->out.new_owf_password); return py_new_owf_password; } static int py_netr_ServerGetTrustInfo_out_set_new_owf_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_owf_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_owf_password"); return -1; } object->out.new_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_owf_password); if (object->out.new_owf_password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(samr_Password_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.new_owf_password = (struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerGetTrustInfo_out_get_old_owf_password(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_old_owf_password; if (object->out.old_owf_password == NULL) { Py_RETURN_NONE; } py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.old_owf_password, object->out.old_owf_password); return py_old_owf_password; } static int py_netr_ServerGetTrustInfo_out_set_old_owf_password(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_owf_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_owf_password"); return -1; } object->out.old_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_owf_password); if (object->out.old_owf_password == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(samr_Password_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.old_owf_password = (struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_ServerGetTrustInfo_out_get_trust_info(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_trust_info; if (object->out.trust_info == NULL) { Py_RETURN_NONE; } if (*object->out.trust_info == NULL) { py_trust_info = Py_None; Py_INCREF(py_trust_info); } else { py_trust_info = pytalloc_reference_ex(&netr_TrustInfo_Type, *object->out.trust_info, *object->out.trust_info); } return py_trust_info; } static int py_netr_ServerGetTrustInfo_out_set_trust_info(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trust_info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trust_info"); return -1; } object->out.trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trust_info); if (object->out.trust_info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.trust_info = NULL; } else { *object->out.trust_info = NULL; PY_CHECK_TYPE(&netr_TrustInfo_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.trust_info = (struct netr_TrustInfo *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_netr_ServerGetTrustInfo_get_result(PyObject *obj, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_ServerGetTrustInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)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_netr_ServerGetTrustInfo_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_ServerGetTrustInfo_in_get_server_name, .set = py_netr_ServerGetTrustInfo_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_account_name"), .get = py_netr_ServerGetTrustInfo_in_get_account_name, .set = py_netr_ServerGetTrustInfo_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_secure_channel_type"), .get = py_netr_ServerGetTrustInfo_in_get_secure_channel_type, .set = py_netr_ServerGetTrustInfo_in_set_secure_channel_type, .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_ServerGetTrustInfo_in_get_computer_name, .set = py_netr_ServerGetTrustInfo_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_ServerGetTrustInfo_in_get_credential, .set = py_netr_ServerGetTrustInfo_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_ServerGetTrustInfo_out_get_return_authenticator, .set = py_netr_ServerGetTrustInfo_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_new_owf_password"), .get = py_netr_ServerGetTrustInfo_out_get_new_owf_password, .set = py_netr_ServerGetTrustInfo_out_set_new_owf_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "out_old_owf_password"), .get = py_netr_ServerGetTrustInfo_out_get_old_owf_password, .set = py_netr_ServerGetTrustInfo_out_set_old_owf_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "out_trust_info"), .get = py_netr_ServerGetTrustInfo_out_get_trust_info, .set = py_netr_ServerGetTrustInfo_out_set_trust_info, .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustInfo") }, { .name = discard_const_p(char, "result"), .get = py_netr_ServerGetTrustInfo_get_result, .set = py_netr_ServerGetTrustInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_ServerGetTrustInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_ServerGetTrustInfo, type); struct netr_ServerGetTrustInfo *_self = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.new_owf_password = talloc_zero(mem_ctx, struct samr_Password); _self->out.old_owf_password = talloc_zero(mem_ctx, struct samr_Password); /* a pointer to a NULL pointer */ _self->out.trust_info = talloc_zero(mem_ctx, struct netr_TrustInfo *); return self; } static PyObject *py_netr_ServerGetTrustInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(46); } static PyObject *py_netr_ServerGetTrustInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 47) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerGetTrustInfo_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[46]; 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_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_ServerGetTrustInfo_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 netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 47) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerGetTrustInfo_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[46]; 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_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_ServerGetTrustInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 47) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerGetTrustInfo_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[46]; 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_netr_ServerGetTrustInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerGetTrustInfo_ndr_print(py_obj, "netr_ServerGetTrustInfo_in", NDR_IN); } static PyObject *py_netr_ServerGetTrustInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_ServerGetTrustInfo_ndr_print(py_obj, "netr_ServerGetTrustInfo_out", NDR_OUT); } static PyMethodDef py_netr_ServerGetTrustInfo_methods[] = { { "opnum", (PyCFunction)py_netr_ServerGetTrustInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_ServerGetTrustInfo.opnum() -> 46 (0x2e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_ServerGetTrustInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_ServerGetTrustInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_ServerGetTrustInfo", .tp_getset = py_netr_ServerGetTrustInfo_getsetters, .tp_methods = py_netr_ServerGetTrustInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_ServerGetTrustInfo_new, }; static bool pack_py_netr_ServerGetTrustInfo_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerGetTrustInfo *r) { PyObject *py_server_name; PyObject *py_account_name; PyObject *py_secure_channel_type; PyObject *py_computer_name; PyObject *py_credential; const char *kwnames[] = { "server_name", "account_name", "secure_channel_type", "computer_name", "credential", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerGetTrustInfo", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_account_name)) { unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_account_name)) { test_str = PyBytes_AS_STRING(py_account_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_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.account_name = talloc_str; } if (py_secure_channel_type == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type)); if (PyLong_Check(py_secure_channel_type)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_secure_channel_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.secure_channel_type = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); return true; } static PyObject *unpack_py_netr_ServerGetTrustInfo_args_out(struct netr_ServerGetTrustInfo *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_new_owf_password; PyObject *py_old_owf_password; PyObject *py_trust_info; result = PyTuple_New(4); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.new_owf_password, r->out.new_owf_password); PyTuple_SetItem(result, 1, py_new_owf_password); py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.old_owf_password, r->out.old_owf_password); PyTuple_SetItem(result, 2, py_old_owf_password); if (*r->out.trust_info == NULL) { py_trust_info = Py_None; Py_INCREF(py_trust_info); } else { py_trust_info = pytalloc_reference_ex(&netr_TrustInfo_Type, *r->out.trust_info, *r->out.trust_info); } PyTuple_SetItem(result, 3, py_trust_info); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_netr_Unused47_get_result(PyObject *obj, void *closure) { struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_Unused47_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_Unused47 *object = (struct netr_Unused47 *)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_netr_Unused47_getsetters[] = { { .name = discard_const_p(char, "result"), .get = py_netr_Unused47_get_result, .set = py_netr_Unused47_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_Unused47_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_Unused47, type); return self; } static PyObject *py_netr_Unused47_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(47); } static PyObject *py_netr_Unused47_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 48) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_Unused47_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[47]; 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_netr_Unused47_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_netr_Unused47_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_Unused47_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_netr_Unused47_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_Unused47_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 netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 48) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_Unused47_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[47]; 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_netr_Unused47_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_netr_Unused47_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_Unused47_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_netr_Unused47_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_Unused47_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 48) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_Unused47_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[47]; 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_netr_Unused47_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_Unused47_ndr_print(py_obj, "netr_Unused47_in", NDR_IN); } static PyObject *py_netr_Unused47_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_Unused47_ndr_print(py_obj, "netr_Unused47_out", NDR_OUT); } static PyMethodDef py_netr_Unused47_methods[] = { { "opnum", (PyCFunction)py_netr_Unused47_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_Unused47.opnum() -> 47 (0x2f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Unused47_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_netr_Unused47_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_netr_Unused47_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_netr_Unused47_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_netr_Unused47_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_Unused47_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_Unused47_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_Unused47", .tp_getset = py_netr_Unused47_getsetters, .tp_methods = py_netr_Unused47_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_Unused47_new, }; static bool pack_py_netr_Unused47_args_in(PyObject *args, PyObject *kwargs, struct netr_Unused47 *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":netr_Unused47", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_netr_Unused47_args_out(struct netr_Unused47 *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_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_server_name(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_server_name; if (object->in.server_name == NULL) { Py_RETURN_NONE; } if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { if (object->in.server_name == NULL) { py_server_name = Py_None; Py_INCREF(py_server_name); } else { py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore"); } } return py_server_name; } static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name"); return -1; } if (value == Py_None) { object->in.server_name = NULL; } else { object->in.server_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.server_name = talloc_str; } } return 0; } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_computer_name(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_computer_name; if (object->in.computer_name == NULL) { Py_RETURN_NONE; } if (object->in.computer_name == NULL) { py_computer_name = Py_None; Py_INCREF(py_computer_name); } else { py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore"); } return py_computer_name; } static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name"); return -1; } object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name); if (object->in.computer_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.computer_name = talloc_str; } return 0; } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_credential(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_credential; if (object->in.credential == NULL) { Py_RETURN_NONE; } py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential); return py_credential; } static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_credential(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential"); return -1; } object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential); if (object->in.credential == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_return_authenticator(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_return_authenticator; if (object->out.return_authenticator == NULL) { Py_RETURN_NONE; } py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator); return py_return_authenticator; } static int py_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator"); return -1; } object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator); if (object->out.return_authenticator == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&netr_Authenticator_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.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value); return 0; } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_get_result(PyObject *obj, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_netr_DsrUpdateReadOnlyServerDnsRecords_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_getsetters[] = { { .name = discard_const_p(char, "in_server_name"), .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_server_name, .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_server_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_computer_name"), .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_computer_name, .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_computer_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_credential"), .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_credential, .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_credential, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "out_return_authenticator"), .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_return_authenticator, .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_return_authenticator, .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator") }, { .name = discard_const_p(char, "in_site_name"), .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name, .set = py_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl, .set = py_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names, .set = py_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names, .set = py_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_get_result, .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct netr_DsrUpdateReadOnlyServerDnsRecords, type); struct netr_DsrUpdateReadOnlyServerDnsRecords *_self = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator); _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator); _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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(48); } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_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_netlogon.num_calls < 49) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack"); return NULL; } call = &ndr_table_netlogon.calls[48]; 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_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_netr_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 netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_netlogon.num_calls < 49) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack"); return NULL; } call = &ndr_table_netlogon.calls[48]; 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_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_netlogon.num_calls < 49) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print"); return NULL; } call = &ndr_table_netlogon.calls[48]; 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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "netr_DsrUpdateReadOnlyServerDnsRecords_in", NDR_IN); } static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "netr_DsrUpdateReadOnlyServerDnsRecords_out", NDR_OUT); } static PyMethodDef py_netr_DsrUpdateReadOnlyServerDnsRecords_methods[] = { { "opnum", (PyCFunction)py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum, METH_NOARGS|METH_CLASS, "netlogon.netr_DsrUpdateReadOnlyServerDnsRecords.opnum() -> 48 (0x30) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_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_netr_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_netr_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_netr_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_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject netr_DsrUpdateReadOnlyServerDnsRecords_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netr_DsrUpdateReadOnlyServerDnsRecords", .tp_getset = py_netr_DsrUpdateReadOnlyServerDnsRecords_getsetters, .tp_methods = py_netr_DsrUpdateReadOnlyServerDnsRecords_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_netr_DsrUpdateReadOnlyServerDnsRecords_new, }; static bool pack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrUpdateReadOnlyServerDnsRecords *r) { PyObject *py_server_name; PyObject *py_computer_name; PyObject *py_credential; PyObject *py_site_name; PyObject *py_dns_ttl; PyObject *py_dns_names; const char *kwnames[] = { "server_name", "computer_name", "credential", "site_name", "dns_ttl", "dns_names", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_DsrUpdateReadOnlyServerDnsRecords", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_site_name, &py_dns_ttl, &py_dns_names)) { return false; } if (py_server_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name"); return false; } if (py_server_name == Py_None) { r->in.server_name = NULL; } else { r->in.server_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_server_name)) { unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_server_name)) { test_str = PyBytes_AS_STRING(py_server_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_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.server_name = talloc_str; } } if (py_computer_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name"); return false; } r->in.computer_name = talloc_ptrtype(r, r->in.computer_name); if (r->in.computer_name == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_computer_name)) { unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_computer_name)) { test_str = PyBytes_AS_STRING(py_computer_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_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.computer_name = talloc_str; } if (py_credential == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential"); return false; } r->in.credential = talloc_ptrtype(r, r->in.credential); if (r->in.credential == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) { PyErr_NoMemory(); return false; } r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential); 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_netr_DsrUpdateReadOnlyServerDnsRecords_args_out(struct netr_DsrUpdateReadOnlyServerDnsRecords *r) { PyObject *result; PyObject *py_return_authenticator; PyObject *py_dns_names; result = PyTuple_New(2); py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator); PyTuple_SetItem(result, 0, py_return_authenticator); py_dns_names = pytalloc_reference_ex(&NL_DNS_NAME_INFO_ARRAY_Type, r->out.dns_names, r->out.dns_names); PyTuple_SetItem(result, 1, py_dns_names); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } const struct PyNdrRpcMethodDef py_ndr_netlogon_methods[] = { { "netr_LogonUasLogon", "S.netr_LogonUasLogon(server_name, account_name, workstation) -> info", (py_dcerpc_call_fn)dcerpc_netr_LogonUasLogon_r, (py_data_pack_fn)pack_py_netr_LogonUasLogon_args_in, (py_data_unpack_fn)unpack_py_netr_LogonUasLogon_args_out, 0, &ndr_table_netlogon }, { "netr_LogonUasLogoff", "S.netr_LogonUasLogoff(server_name, account_name, workstation) -> info", (py_dcerpc_call_fn)dcerpc_netr_LogonUasLogoff_r, (py_data_pack_fn)pack_py_netr_LogonUasLogoff_args_in, (py_data_unpack_fn)unpack_py_netr_LogonUasLogoff_args_out, 1, &ndr_table_netlogon }, { "netr_LogonSamLogon", "S.netr_LogonSamLogon(server_name, computer_name, credential, return_authenticator, logon_level, logon, validation_level) -> (return_authenticator, validation, authoritative)", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogon_r, (py_data_pack_fn)pack_py_netr_LogonSamLogon_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogon_args_out, 2, &ndr_table_netlogon }, { "netr_LogonSamLogoff", "S.netr_LogonSamLogoff(server_name, computer_name, credential, return_authenticator, logon_level, logon) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogoff_r, (py_data_pack_fn)pack_py_netr_LogonSamLogoff_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogoff_args_out, 3, &ndr_table_netlogon }, { "netr_ServerReqChallenge", "S.netr_ServerReqChallenge(server_name, computer_name, credentials) -> return_credentials", (py_dcerpc_call_fn)dcerpc_netr_ServerReqChallenge_r, (py_data_pack_fn)pack_py_netr_ServerReqChallenge_args_in, (py_data_unpack_fn)unpack_py_netr_ServerReqChallenge_args_out, 4, &ndr_table_netlogon }, { "netr_ServerAuthenticate", "S.netr_ServerAuthenticate(server_name, account_name, secure_channel_type, computer_name, credentials) -> return_credentials", (py_dcerpc_call_fn)dcerpc_netr_ServerAuthenticate_r, (py_data_pack_fn)pack_py_netr_ServerAuthenticate_args_in, (py_data_unpack_fn)unpack_py_netr_ServerAuthenticate_args_out, 5, &ndr_table_netlogon }, { "netr_ServerPasswordSet", "S.netr_ServerPasswordSet(server_name, account_name, secure_channel_type, computer_name, credential, new_password) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_ServerPasswordSet_r, (py_data_pack_fn)pack_py_netr_ServerPasswordSet_args_in, (py_data_unpack_fn)unpack_py_netr_ServerPasswordSet_args_out, 6, &ndr_table_netlogon }, { "netr_DatabaseDeltas", "S.netr_DatabaseDeltas(logon_server, computername, credential, return_authenticator, database_id, sequence_num, preferredmaximumlength) -> (return_authenticator, sequence_num, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseDeltas_r, (py_data_pack_fn)pack_py_netr_DatabaseDeltas_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseDeltas_args_out, 7, &ndr_table_netlogon }, { "netr_DatabaseSync", "S.netr_DatabaseSync(logon_server, computername, credential, return_authenticator, database_id, sync_context, preferredmaximumlength) -> (return_authenticator, sync_context, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseSync_r, (py_data_pack_fn)pack_py_netr_DatabaseSync_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseSync_args_out, 8, &ndr_table_netlogon }, { "netr_AccountDeltas", "S.netr_AccountDeltas(logon_server, computername, credential, return_authenticator, uas, count, level, buffersize) -> (return_authenticator, buffer, count_returned, total_entries, recordid)", (py_dcerpc_call_fn)dcerpc_netr_AccountDeltas_r, (py_data_pack_fn)pack_py_netr_AccountDeltas_args_in, (py_data_unpack_fn)unpack_py_netr_AccountDeltas_args_out, 9, &ndr_table_netlogon }, { "netr_AccountSync", "S.netr_AccountSync(logon_server, computername, credential, return_authenticator, reference, level, buffersize, recordid) -> (return_authenticator, buffer, count_returned, total_entries, next_reference, recordid)", (py_dcerpc_call_fn)dcerpc_netr_AccountSync_r, (py_data_pack_fn)pack_py_netr_AccountSync_args_in, (py_data_unpack_fn)unpack_py_netr_AccountSync_args_out, 10, &ndr_table_netlogon }, { "netr_GetDcName", "S.netr_GetDcName(logon_server, domainname) -> dcname", (py_dcerpc_call_fn)dcerpc_netr_GetDcName_r, (py_data_pack_fn)pack_py_netr_GetDcName_args_in, (py_data_unpack_fn)unpack_py_netr_GetDcName_args_out, 11, &ndr_table_netlogon }, { "netr_LogonControl", "S.netr_LogonControl(logon_server, function_code, level) -> query", (py_dcerpc_call_fn)dcerpc_netr_LogonControl_r, (py_data_pack_fn)pack_py_netr_LogonControl_args_in, (py_data_unpack_fn)unpack_py_netr_LogonControl_args_out, 12, &ndr_table_netlogon }, { "netr_GetAnyDCName", "S.netr_GetAnyDCName(logon_server, domainname) -> dcname", (py_dcerpc_call_fn)dcerpc_netr_GetAnyDCName_r, (py_data_pack_fn)pack_py_netr_GetAnyDCName_args_in, (py_data_unpack_fn)unpack_py_netr_GetAnyDCName_args_out, 13, &ndr_table_netlogon }, { "netr_LogonControl2", "S.netr_LogonControl2(logon_server, function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_netr_LogonControl2_r, (py_data_pack_fn)pack_py_netr_LogonControl2_args_in, (py_data_unpack_fn)unpack_py_netr_LogonControl2_args_out, 14, &ndr_table_netlogon }, { "netr_ServerAuthenticate2", "S.netr_ServerAuthenticate2(server_name, account_name, secure_channel_type, computer_name, credentials, negotiate_flags) -> (return_credentials, negotiate_flags)", (py_dcerpc_call_fn)dcerpc_netr_ServerAuthenticate2_r, (py_data_pack_fn)pack_py_netr_ServerAuthenticate2_args_in, (py_data_unpack_fn)unpack_py_netr_ServerAuthenticate2_args_out, 15, &ndr_table_netlogon }, { "netr_DatabaseSync2", "S.netr_DatabaseSync2(logon_server, computername, credential, return_authenticator, database_id, restart_state, sync_context, preferredmaximumlength) -> (return_authenticator, sync_context, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseSync2_r, (py_data_pack_fn)pack_py_netr_DatabaseSync2_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseSync2_args_out, 16, &ndr_table_netlogon }, { "netr_DatabaseRedo", "S.netr_DatabaseRedo(logon_server, computername, credential, return_authenticator, change_log_entry, change_log_entry_size) -> (return_authenticator, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseRedo_r, (py_data_pack_fn)pack_py_netr_DatabaseRedo_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseRedo_args_out, 17, &ndr_table_netlogon }, { "netr_LogonControl2Ex", "S.netr_LogonControl2Ex(logon_server, function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_netr_LogonControl2Ex_r, (py_data_pack_fn)pack_py_netr_LogonControl2Ex_args_in, (py_data_unpack_fn)unpack_py_netr_LogonControl2Ex_args_out, 18, &ndr_table_netlogon }, { "netr_NetrEnumerateTrustedDomains", "S.netr_NetrEnumerateTrustedDomains(server_name) -> trusted_domains_blob", (py_dcerpc_call_fn)dcerpc_netr_NetrEnumerateTrustedDomains_r, (py_data_pack_fn)pack_py_netr_NetrEnumerateTrustedDomains_args_in, (py_data_unpack_fn)unpack_py_netr_NetrEnumerateTrustedDomains_args_out, 19, &ndr_table_netlogon }, { "netr_DsRGetDCName", "S.netr_DsRGetDCName(server_unc, domain_name, domain_guid, site_guid, flags) -> info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetDCName_r, (py_data_pack_fn)pack_py_netr_DsRGetDCName_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetDCName_args_out, 20, &ndr_table_netlogon }, { "netr_LogonGetCapabilities", "S.netr_LogonGetCapabilities(server_name, computer_name, credential, return_authenticator, query_level) -> (return_authenticator, capabilities)", (py_dcerpc_call_fn)dcerpc_netr_LogonGetCapabilities_r, (py_data_pack_fn)pack_py_netr_LogonGetCapabilities_args_in, (py_data_unpack_fn)unpack_py_netr_LogonGetCapabilities_args_out, 21, &ndr_table_netlogon }, { "netr_LogonGetTrustRid", "S.netr_LogonGetTrustRid(server_name, domain_name) -> rid", (py_dcerpc_call_fn)dcerpc_netr_LogonGetTrustRid_r, (py_data_pack_fn)pack_py_netr_LogonGetTrustRid_args_in, (py_data_unpack_fn)unpack_py_netr_LogonGetTrustRid_args_out, 23, &ndr_table_netlogon }, { "netr_ServerAuthenticate3", "S.netr_ServerAuthenticate3(server_name, account_name, secure_channel_type, computer_name, credentials, negotiate_flags) -> (return_credentials, negotiate_flags, rid)", (py_dcerpc_call_fn)dcerpc_netr_ServerAuthenticate3_r, (py_data_pack_fn)pack_py_netr_ServerAuthenticate3_args_in, (py_data_unpack_fn)unpack_py_netr_ServerAuthenticate3_args_out, 26, &ndr_table_netlogon }, { "netr_DsRGetDCNameEx", "S.netr_DsRGetDCNameEx(server_unc, domain_name, domain_guid, site_name, flags) -> info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetDCNameEx_r, (py_data_pack_fn)pack_py_netr_DsRGetDCNameEx_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetDCNameEx_args_out, 27, &ndr_table_netlogon }, { "netr_DsRGetSiteName", "S.netr_DsRGetSiteName(computer_name) -> site", (py_dcerpc_call_fn)dcerpc_netr_DsRGetSiteName_r, (py_data_pack_fn)pack_py_netr_DsRGetSiteName_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetSiteName_args_out, 28, &ndr_table_netlogon }, { "netr_LogonGetDomainInfo", "S.netr_LogonGetDomainInfo(server_name, computer_name, credential, return_authenticator, level, query) -> (return_authenticator, info)", (py_dcerpc_call_fn)dcerpc_netr_LogonGetDomainInfo_r, (py_data_pack_fn)pack_py_netr_LogonGetDomainInfo_args_in, (py_data_unpack_fn)unpack_py_netr_LogonGetDomainInfo_args_out, 29, &ndr_table_netlogon }, { "netr_ServerPasswordSet2", "S.netr_ServerPasswordSet2(server_name, account_name, secure_channel_type, computer_name, credential, new_password) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_ServerPasswordSet2_r, (py_data_pack_fn)pack_py_netr_ServerPasswordSet2_args_in, (py_data_unpack_fn)unpack_py_netr_ServerPasswordSet2_args_out, 30, &ndr_table_netlogon }, { "netr_ServerPasswordGet", "S.netr_ServerPasswordGet(server_name, account_name, secure_channel_type, computer_name, credential) -> (return_authenticator, password)", (py_dcerpc_call_fn)dcerpc_netr_ServerPasswordGet_r, (py_data_pack_fn)pack_py_netr_ServerPasswordGet_args_in, (py_data_unpack_fn)unpack_py_netr_ServerPasswordGet_args_out, 31, &ndr_table_netlogon }, { "netr_NetrLogonSendToSam", "S.netr_NetrLogonSendToSam(server_name, computer_name, credential, opaque_buffer) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_NetrLogonSendToSam_r, (py_data_pack_fn)pack_py_netr_NetrLogonSendToSam_args_in, (py_data_unpack_fn)unpack_py_netr_NetrLogonSendToSam_args_out, 32, &ndr_table_netlogon }, { "netr_DsRAddressToSitenamesW", "S.netr_DsRAddressToSitenamesW(server_name, addresses) -> ctr", (py_dcerpc_call_fn)dcerpc_netr_DsRAddressToSitenamesW_r, (py_data_pack_fn)pack_py_netr_DsRAddressToSitenamesW_args_in, (py_data_unpack_fn)unpack_py_netr_DsRAddressToSitenamesW_args_out, 33, &ndr_table_netlogon }, { "netr_DsRGetDCNameEx2", "S.netr_DsRGetDCNameEx2(server_unc, client_account, mask, domain_name, domain_guid, site_name, flags) -> info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetDCNameEx2_r, (py_data_pack_fn)pack_py_netr_DsRGetDCNameEx2_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetDCNameEx2_args_out, 34, &ndr_table_netlogon }, { "netr_NetrEnumerateTrustedDomainsEx", "S.netr_NetrEnumerateTrustedDomainsEx(server_name) -> dom_trust_list", (py_dcerpc_call_fn)dcerpc_netr_NetrEnumerateTrustedDomainsEx_r, (py_data_pack_fn)pack_py_netr_NetrEnumerateTrustedDomainsEx_args_in, (py_data_unpack_fn)unpack_py_netr_NetrEnumerateTrustedDomainsEx_args_out, 36, &ndr_table_netlogon }, { "netr_DsRAddressToSitenamesExW", "S.netr_DsRAddressToSitenamesExW(server_name, addresses) -> ctr", (py_dcerpc_call_fn)dcerpc_netr_DsRAddressToSitenamesExW_r, (py_data_pack_fn)pack_py_netr_DsRAddressToSitenamesExW_args_in, (py_data_unpack_fn)unpack_py_netr_DsRAddressToSitenamesExW_args_out, 37, &ndr_table_netlogon }, { "netr_DsrGetDcSiteCoverageW", "S.netr_DsrGetDcSiteCoverageW(server_name) -> ctr", (py_dcerpc_call_fn)dcerpc_netr_DsrGetDcSiteCoverageW_r, (py_data_pack_fn)pack_py_netr_DsrGetDcSiteCoverageW_args_in, (py_data_unpack_fn)unpack_py_netr_DsrGetDcSiteCoverageW_args_out, 38, &ndr_table_netlogon }, { "netr_LogonSamLogonEx", "S.netr_LogonSamLogonEx(server_name, computer_name, logon_level, logon, validation_level, flags) -> (validation, authoritative, flags)", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogonEx_r, (py_data_pack_fn)pack_py_netr_LogonSamLogonEx_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogonEx_args_out, 39, &ndr_table_netlogon }, { "netr_DsrEnumerateDomainTrusts", "S.netr_DsrEnumerateDomainTrusts(server_name, trust_flags) -> trusts", (py_dcerpc_call_fn)dcerpc_netr_DsrEnumerateDomainTrusts_r, (py_data_pack_fn)pack_py_netr_DsrEnumerateDomainTrusts_args_in, (py_data_unpack_fn)unpack_py_netr_DsrEnumerateDomainTrusts_args_out, 40, &ndr_table_netlogon }, { "netr_DsrDeregisterDNSHostRecords", "S.netr_DsrDeregisterDNSHostRecords(server_name, domain, domain_guid, dsa_guid, dns_host) -> None", (py_dcerpc_call_fn)dcerpc_netr_DsrDeregisterDNSHostRecords_r, (py_data_pack_fn)pack_py_netr_DsrDeregisterDNSHostRecords_args_in, (py_data_unpack_fn)unpack_py_netr_DsrDeregisterDNSHostRecords_args_out, 41, &ndr_table_netlogon }, { "netr_ServerTrustPasswordsGet", "S.netr_ServerTrustPasswordsGet(server_name, account_name, secure_channel_type, computer_name, credential) -> (return_authenticator, new_owf_password, old_owf_password)", (py_dcerpc_call_fn)dcerpc_netr_ServerTrustPasswordsGet_r, (py_data_pack_fn)pack_py_netr_ServerTrustPasswordsGet_args_in, (py_data_unpack_fn)unpack_py_netr_ServerTrustPasswordsGet_args_out, 42, &ndr_table_netlogon }, { "netr_DsRGetForestTrustInformation", "S.netr_DsRGetForestTrustInformation(server_name, trusted_domain_name, flags) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetForestTrustInformation_r, (py_data_pack_fn)pack_py_netr_DsRGetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetForestTrustInformation_args_out, 43, &ndr_table_netlogon }, { "netr_GetForestTrustInformation", "S.netr_GetForestTrustInformation(server_name, computer_name, credential, flags) -> (return_authenticator, forest_trust_info)", (py_dcerpc_call_fn)dcerpc_netr_GetForestTrustInformation_r, (py_data_pack_fn)pack_py_netr_GetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_netr_GetForestTrustInformation_args_out, 44, &ndr_table_netlogon }, { "netr_LogonSamLogonWithFlags", "S.netr_LogonSamLogonWithFlags(server_name, computer_name, credential, return_authenticator, logon_level, logon, validation_level, flags) -> (return_authenticator, validation, authoritative, flags)", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogonWithFlags_r, (py_data_pack_fn)pack_py_netr_LogonSamLogonWithFlags_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogonWithFlags_args_out, 45, &ndr_table_netlogon }, { "netr_ServerGetTrustInfo", "S.netr_ServerGetTrustInfo(server_name, account_name, secure_channel_type, computer_name, credential) -> (return_authenticator, new_owf_password, old_owf_password, trust_info)", (py_dcerpc_call_fn)dcerpc_netr_ServerGetTrustInfo_r, (py_data_pack_fn)pack_py_netr_ServerGetTrustInfo_args_in, (py_data_unpack_fn)unpack_py_netr_ServerGetTrustInfo_args_out, 46, &ndr_table_netlogon }, { "netr_Unused47", "S.netr_Unused47() -> None", (py_dcerpc_call_fn)dcerpc_netr_Unused47_r, (py_data_pack_fn)pack_py_netr_Unused47_args_in, (py_data_unpack_fn)unpack_py_netr_Unused47_args_out, 47, &ndr_table_netlogon }, { "netr_DsrUpdateReadOnlyServerDnsRecords", "S.netr_DsrUpdateReadOnlyServerDnsRecords(server_name, computer_name, credential, site_name, dns_ttl, dns_names) -> (return_authenticator, dns_names)", (py_dcerpc_call_fn)dcerpc_netr_DsrUpdateReadOnlyServerDnsRecords_r, (py_data_pack_fn)pack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_in, (py_data_unpack_fn)unpack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_out, 48, &ndr_table_netlogon }, {0} }; static PyObject *interface_netlogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_netlogon); } static PyTypeObject netlogon_InterfaceType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netlogon", .tp_basicsize = sizeof(dcerpc_InterfaceObject), .tp_doc = "netlogon(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", .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = interface_netlogon_new, }; static PyObject *syntax_netlogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_netlogon.syntax_id); } static PyTypeObject netlogon_SyntaxType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "netlogon.netlogon_abstract_syntax", .tp_doc = "netlogon_abstract_syntax()\n", .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = syntax_netlogon_new, }; static PyMethodDef netlogon_methods[] = { { NULL, NULL, 0, NULL } }; static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, .m_name = "netlogon", .m_doc = "netlogon DCE/RPC", .m_size = -1, .m_methods = netlogon_methods, }; MODULE_INIT_FUNC(netlogon) { PyObject *m = NULL; PyObject *dep_samba_dcerpc_misc = NULL; PyObject *dep_samba_dcerpc_lsa = NULL; PyObject *dep_samba_dcerpc_samr = NULL; PyObject *dep_samba_dcerpc_security = NULL; PyObject *dep_talloc = NULL; PyObject *dep_samba_dcerpc_base = NULL; dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc"); if (dep_samba_dcerpc_misc == NULL) goto out; dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa"); if (dep_samba_dcerpc_lsa == NULL) goto out; dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr"); if (dep_samba_dcerpc_samr == NULL) goto out; dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security"); if (dep_samba_dcerpc_security == 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; BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject"); if (BaseObject_Type == NULL) goto out; lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String"); if (lsa_String_Type == NULL) goto out; samr_Password_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "Password"); if (samr_Password_Type == NULL) goto out; samr_RidWithAttributeArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "RidWithAttributeArray"); if (samr_RidWithAttributeArray_Type == NULL) goto out; lsa_StringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "StringLarge"); if (lsa_StringLarge_Type == NULL) goto out; dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid"); if (dom_sid_Type == NULL) goto out; samr_LogonHours_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "LogonHours"); if (samr_LogonHours_Type == NULL) goto out; lsa_BinaryString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "BinaryString"); if (lsa_BinaryString_Type == NULL) goto out; sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf"); if (sec_desc_buf_Type == NULL) goto out; lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray"); if (lsa_SidArray_Type == NULL) goto out; GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID"); if (GUID_Type == NULL) goto out; lsa_ForestTrustInformation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "ForestTrustInformation"); if (lsa_ForestTrustInformation_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; netr_UasInfo_Type.tp_base = BaseObject_Type; netr_UasInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_UasLogoffInfo_Type.tp_base = BaseObject_Type; netr_UasLogoffInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_AcctLockStr_Type.tp_base = BaseObject_Type; netr_AcctLockStr_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_IdentityInfo_Type.tp_base = BaseObject_Type; netr_IdentityInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_PasswordInfo_Type.tp_base = BaseObject_Type; netr_PasswordInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ChallengeResponse_Type.tp_base = BaseObject_Type; netr_ChallengeResponse_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NetworkInfo_Type.tp_base = BaseObject_Type; netr_NetworkInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_GenericInfo_Type.tp_base = BaseObject_Type; netr_GenericInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonLevel_Type.tp_base = BaseObject_Type; netr_LogonLevel_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_UserSessionKey_Type.tp_base = BaseObject_Type; netr_UserSessionKey_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LMSessionKey_Type.tp_base = BaseObject_Type; netr_LMSessionKey_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SamBaseInfo_Type.tp_base = BaseObject_Type; netr_SamBaseInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SamInfo2_Type.tp_base = BaseObject_Type; netr_SamInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SidAttr_Type.tp_base = BaseObject_Type; netr_SidAttr_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SamInfo3_Type.tp_base = BaseObject_Type; netr_SamInfo3_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SamInfo6_Type.tp_base = BaseObject_Type; netr_SamInfo6_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_PacInfo_Type.tp_base = BaseObject_Type; netr_PacInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_GenericInfo2_Type.tp_base = BaseObject_Type; netr_GenericInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_Validation_Type.tp_base = BaseObject_Type; netr_Validation_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_Credential_Type.tp_base = BaseObject_Type; netr_Credential_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_Authenticator_Type.tp_base = BaseObject_Type; netr_Authenticator_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_DELETE_USER_Type.tp_base = BaseObject_Type; netr_DELTA_DELETE_USER_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_USER_KEY16_Type.tp_base = BaseObject_Type; netr_USER_KEY16_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_PasswordHistory_Type.tp_base = BaseObject_Type; netr_PasswordHistory_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_USER_KEYS2_Type.tp_base = BaseObject_Type; netr_USER_KEYS2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_USER_KEY_UNION_Type.tp_base = BaseObject_Type; netr_USER_KEY_UNION_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_USER_KEYS_Type.tp_base = BaseObject_Type; netr_USER_KEYS_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_USER_PRIVATE_INFO_Type.tp_base = BaseObject_Type; netr_USER_PRIVATE_INFO_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_USER_Type.tp_base = BaseObject_Type; netr_DELTA_USER_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_DOMAIN_Type.tp_base = BaseObject_Type; netr_DELTA_DOMAIN_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_GROUP_Type.tp_base = BaseObject_Type; netr_DELTA_GROUP_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_RENAME_Type.tp_base = BaseObject_Type; netr_DELTA_RENAME_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_GROUP_MEMBER_Type.tp_base = BaseObject_Type; netr_DELTA_GROUP_MEMBER_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_ALIAS_Type.tp_base = BaseObject_Type; netr_DELTA_ALIAS_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_ALIAS_MEMBER_Type.tp_base = BaseObject_Type; netr_DELTA_ALIAS_MEMBER_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_QUOTA_LIMITS_Type.tp_base = BaseObject_Type; netr_QUOTA_LIMITS_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_POLICY_Type.tp_base = BaseObject_Type; netr_DELTA_POLICY_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_TRUSTED_DOMAIN_Type.tp_base = BaseObject_Type; netr_DELTA_TRUSTED_DOMAIN_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_ACCOUNT_Type.tp_base = BaseObject_Type; netr_DELTA_ACCOUNT_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_CIPHER_VALUE_Type.tp_base = BaseObject_Type; netr_CIPHER_VALUE_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_SECRET_Type.tp_base = BaseObject_Type; netr_DELTA_SECRET_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_UNION_Type.tp_base = BaseObject_Type; netr_DELTA_UNION_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_ID_UNION_Type.tp_base = BaseObject_Type; netr_DELTA_ID_UNION_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_ENUM_Type.tp_base = BaseObject_Type; netr_DELTA_ENUM_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DELTA_ENUM_ARRAY_Type.tp_base = BaseObject_Type; netr_DELTA_ENUM_ARRAY_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_UAS_INFO_0_Type.tp_base = BaseObject_Type; netr_UAS_INFO_0_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_AccountBuffer_Type.tp_base = BaseObject_Type; netr_AccountBuffer_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NETLOGON_INFO_1_Type.tp_base = BaseObject_Type; netr_NETLOGON_INFO_1_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NETLOGON_INFO_2_Type.tp_base = BaseObject_Type; netr_NETLOGON_INFO_2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NETLOGON_INFO_3_Type.tp_base = BaseObject_Type; netr_NETLOGON_INFO_3_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NETLOGON_INFO_4_Type.tp_base = BaseObject_Type; netr_NETLOGON_INFO_4_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_CONTROL_QUERY_INFORMATION_Type.tp_base = BaseObject_Type; netr_CONTROL_QUERY_INFORMATION_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_CONTROL_DATA_INFORMATION_Type.tp_base = BaseObject_Type; netr_CONTROL_DATA_INFORMATION_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ChangeLogObject_Type.tp_base = BaseObject_Type; netr_ChangeLogObject_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ChangeLogEntry_Type.tp_base = BaseObject_Type; netr_ChangeLogEntry_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_Blob_Type.tp_base = BaseObject_Type; netr_Blob_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRGetDCNameInfo_Type.tp_base = BaseObject_Type; netr_DsRGetDCNameInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_Capabilities_Type.tp_base = BaseObject_Type; netr_Capabilities_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LsaPolicyInformation_Type.tp_base = BaseObject_Type; netr_LsaPolicyInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_OsVersionInfoEx_Type.tp_base = BaseObject_Type; netr_OsVersionInfoEx_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_OsVersion_Type.tp_base = BaseObject_Type; netr_OsVersion_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_OsVersionContainer_Type.tp_base = BaseObject_Type; netr_OsVersionContainer_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_WorkstationInformation_Type.tp_base = BaseObject_Type; netr_WorkstationInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_WorkstationInfo_Type.tp_base = BaseObject_Type; netr_WorkstationInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_trust_extension_info_Type.tp_base = BaseObject_Type; netr_trust_extension_info_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_trust_extension_Type.tp_base = BaseObject_Type; netr_trust_extension_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_trust_extension_container_Type.tp_base = BaseObject_Type; netr_trust_extension_container_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_OneDomainInfo_Type.tp_base = BaseObject_Type; netr_OneDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DomainInformation_Type.tp_base = BaseObject_Type; netr_DomainInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DomainInfo_Type.tp_base = BaseObject_Type; netr_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); NL_PASSWORD_VERSION_Type.tp_base = BaseObject_Type; NL_PASSWORD_VERSION_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_CryptPassword_Type.tp_base = BaseObject_Type; netr_CryptPassword_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SendToSamResetBadPasswordCount_Type.tp_base = BaseObject_Type; netr_SendToSamResetBadPasswordCount_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SendToSamMessage_Type.tp_base = BaseObject_Type; netr_SendToSamMessage_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_SendToSamBase_Type.tp_base = BaseObject_Type; netr_SendToSamBase_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRAddressToSitenamesWCtr_Type.tp_base = BaseObject_Type; netr_DsRAddressToSitenamesWCtr_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRAddress_Type.tp_base = BaseObject_Type; netr_DsRAddress_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DomainTrust_Type.tp_base = BaseObject_Type; netr_DomainTrust_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DomainTrustList_Type.tp_base = BaseObject_Type; netr_DomainTrustList_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRAddressToSitenamesExWCtr_Type.tp_base = BaseObject_Type; netr_DsRAddressToSitenamesExWCtr_Type.tp_basicsize = pytalloc_BaseObject_size(); DcSitesCtr_Type.tp_base = BaseObject_Type; DcSitesCtr_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_TrustInfo_Type.tp_base = BaseObject_Type; netr_TrustInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); NL_DNS_NAME_INFO_Type.tp_base = BaseObject_Type; NL_DNS_NAME_INFO_Type.tp_basicsize = pytalloc_BaseObject_size(); NL_DNS_NAME_INFO_ARRAY_Type.tp_base = BaseObject_Type; NL_DNS_NAME_INFO_ARRAY_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonUasLogon_Type.tp_base = BaseObject_Type; netr_LogonUasLogon_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonUasLogoff_Type.tp_base = BaseObject_Type; netr_LogonUasLogoff_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonSamLogon_Type.tp_base = BaseObject_Type; netr_LogonSamLogon_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonSamLogoff_Type.tp_base = BaseObject_Type; netr_LogonSamLogoff_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerReqChallenge_Type.tp_base = BaseObject_Type; netr_ServerReqChallenge_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerAuthenticate_Type.tp_base = BaseObject_Type; netr_ServerAuthenticate_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerPasswordSet_Type.tp_base = BaseObject_Type; netr_ServerPasswordSet_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DatabaseDeltas_Type.tp_base = BaseObject_Type; netr_DatabaseDeltas_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DatabaseSync_Type.tp_base = BaseObject_Type; netr_DatabaseSync_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_AccountDeltas_Type.tp_base = BaseObject_Type; netr_AccountDeltas_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_AccountSync_Type.tp_base = BaseObject_Type; netr_AccountSync_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_GetDcName_Type.tp_base = BaseObject_Type; netr_GetDcName_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonControl_Type.tp_base = BaseObject_Type; netr_LogonControl_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_GetAnyDCName_Type.tp_base = BaseObject_Type; netr_GetAnyDCName_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonControl2_Type.tp_base = BaseObject_Type; netr_LogonControl2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerAuthenticate2_Type.tp_base = BaseObject_Type; netr_ServerAuthenticate2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DatabaseSync2_Type.tp_base = BaseObject_Type; netr_DatabaseSync2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DatabaseRedo_Type.tp_base = BaseObject_Type; netr_DatabaseRedo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonControl2Ex_Type.tp_base = BaseObject_Type; netr_LogonControl2Ex_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NetrEnumerateTrustedDomains_Type.tp_base = BaseObject_Type; netr_NetrEnumerateTrustedDomains_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRGetDCName_Type.tp_base = BaseObject_Type; netr_DsRGetDCName_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonGetCapabilities_Type.tp_base = BaseObject_Type; netr_LogonGetCapabilities_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonGetTrustRid_Type.tp_base = BaseObject_Type; netr_LogonGetTrustRid_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerAuthenticate3_Type.tp_base = BaseObject_Type; netr_ServerAuthenticate3_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRGetDCNameEx_Type.tp_base = BaseObject_Type; netr_DsRGetDCNameEx_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRGetSiteName_Type.tp_base = BaseObject_Type; netr_DsRGetSiteName_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonGetDomainInfo_Type.tp_base = BaseObject_Type; netr_LogonGetDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerPasswordSet2_Type.tp_base = BaseObject_Type; netr_ServerPasswordSet2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerPasswordGet_Type.tp_base = BaseObject_Type; netr_ServerPasswordGet_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NetrLogonSendToSam_Type.tp_base = BaseObject_Type; netr_NetrLogonSendToSam_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRAddressToSitenamesW_Type.tp_base = BaseObject_Type; netr_DsRAddressToSitenamesW_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRGetDCNameEx2_Type.tp_base = BaseObject_Type; netr_DsRGetDCNameEx2_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_NetrEnumerateTrustedDomainsEx_Type.tp_base = BaseObject_Type; netr_NetrEnumerateTrustedDomainsEx_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRAddressToSitenamesExW_Type.tp_base = BaseObject_Type; netr_DsRAddressToSitenamesExW_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsrGetDcSiteCoverageW_Type.tp_base = BaseObject_Type; netr_DsrGetDcSiteCoverageW_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonSamLogonEx_Type.tp_base = BaseObject_Type; netr_LogonSamLogonEx_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsrEnumerateDomainTrusts_Type.tp_base = BaseObject_Type; netr_DsrEnumerateDomainTrusts_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsrDeregisterDNSHostRecords_Type.tp_base = BaseObject_Type; netr_DsrDeregisterDNSHostRecords_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerTrustPasswordsGet_Type.tp_base = BaseObject_Type; netr_ServerTrustPasswordsGet_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsRGetForestTrustInformation_Type.tp_base = BaseObject_Type; netr_DsRGetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_GetForestTrustInformation_Type.tp_base = BaseObject_Type; netr_GetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_LogonSamLogonWithFlags_Type.tp_base = BaseObject_Type; netr_LogonSamLogonWithFlags_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_ServerGetTrustInfo_Type.tp_base = BaseObject_Type; netr_ServerGetTrustInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_Unused47_Type.tp_base = BaseObject_Type; netr_Unused47_Type.tp_basicsize = pytalloc_BaseObject_size(); netr_DsrUpdateReadOnlyServerDnsRecords_Type.tp_base = BaseObject_Type; netr_DsrUpdateReadOnlyServerDnsRecords_Type.tp_basicsize = pytalloc_BaseObject_size(); netlogon_InterfaceType.tp_base = ClientConnection_Type; netlogon_SyntaxType.tp_base = ndr_syntax_id_Type; netlogon_SyntaxType.tp_basicsize = pytalloc_BaseObject_size(); if (PyType_Ready(&netr_UasInfo_Type) < 0) goto out; if (PyType_Ready(&netr_UasLogoffInfo_Type) < 0) goto out; if (PyType_Ready(&netr_AcctLockStr_Type) < 0) goto out; if (PyType_Ready(&netr_IdentityInfo_Type) < 0) goto out; if (PyType_Ready(&netr_PasswordInfo_Type) < 0) goto out; if (PyType_Ready(&netr_ChallengeResponse_Type) < 0) goto out; if (PyType_Ready(&netr_NetworkInfo_Type) < 0) goto out; if (PyType_Ready(&netr_GenericInfo_Type) < 0) goto out; if (PyType_Ready(&netr_LogonLevel_Type) < 0) goto out; if (PyType_Ready(&netr_UserSessionKey_Type) < 0) goto out; if (PyType_Ready(&netr_LMSessionKey_Type) < 0) goto out; if (PyType_Ready(&netr_SamBaseInfo_Type) < 0) goto out; if (PyType_Ready(&netr_SamInfo2_Type) < 0) goto out; if (PyType_Ready(&netr_SidAttr_Type) < 0) goto out; if (PyType_Ready(&netr_SamInfo3_Type) < 0) goto out; if (PyType_Ready(&netr_SamInfo6_Type) < 0) goto out; if (PyType_Ready(&netr_PacInfo_Type) < 0) goto out; if (PyType_Ready(&netr_GenericInfo2_Type) < 0) goto out; if (PyType_Ready(&netr_Validation_Type) < 0) goto out; if (PyType_Ready(&netr_Credential_Type) < 0) goto out; if (PyType_Ready(&netr_Authenticator_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_DELETE_USER_Type) < 0) goto out; if (PyType_Ready(&netr_USER_KEY16_Type) < 0) goto out; if (PyType_Ready(&netr_PasswordHistory_Type) < 0) goto out; if (PyType_Ready(&netr_USER_KEYS2_Type) < 0) goto out; if (PyType_Ready(&netr_USER_KEY_UNION_Type) < 0) goto out; if (PyType_Ready(&netr_USER_KEYS_Type) < 0) goto out; if (PyType_Ready(&netr_USER_PRIVATE_INFO_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_USER_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_DOMAIN_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_GROUP_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_RENAME_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_GROUP_MEMBER_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_ALIAS_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_ALIAS_MEMBER_Type) < 0) goto out; if (PyType_Ready(&netr_QUOTA_LIMITS_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_POLICY_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_TRUSTED_DOMAIN_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_ACCOUNT_Type) < 0) goto out; if (PyType_Ready(&netr_CIPHER_VALUE_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_SECRET_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_UNION_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_ID_UNION_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_ENUM_Type) < 0) goto out; if (PyType_Ready(&netr_DELTA_ENUM_ARRAY_Type) < 0) goto out; if (PyType_Ready(&netr_UAS_INFO_0_Type) < 0) goto out; if (PyType_Ready(&netr_AccountBuffer_Type) < 0) goto out; if (PyType_Ready(&netr_NETLOGON_INFO_1_Type) < 0) goto out; if (PyType_Ready(&netr_NETLOGON_INFO_2_Type) < 0) goto out; if (PyType_Ready(&netr_NETLOGON_INFO_3_Type) < 0) goto out; if (PyType_Ready(&netr_NETLOGON_INFO_4_Type) < 0) goto out; if (PyType_Ready(&netr_CONTROL_QUERY_INFORMATION_Type) < 0) goto out; if (PyType_Ready(&netr_CONTROL_DATA_INFORMATION_Type) < 0) goto out; if (PyType_Ready(&netr_ChangeLogObject_Type) < 0) goto out; if (PyType_Ready(&netr_ChangeLogEntry_Type) < 0) goto out; if (PyType_Ready(&netr_Blob_Type) < 0) goto out; if (PyType_Ready(&netr_DsRGetDCNameInfo_Type) < 0) goto out; if (PyType_Ready(&netr_Capabilities_Type) < 0) goto out; if (PyType_Ready(&netr_LsaPolicyInformation_Type) < 0) goto out; if (PyType_Ready(&netr_OsVersionInfoEx_Type) < 0) goto out; if (PyType_Ready(&netr_OsVersion_Type) < 0) goto out; if (PyType_Ready(&netr_OsVersionContainer_Type) < 0) goto out; if (PyType_Ready(&netr_WorkstationInformation_Type) < 0) goto out; if (PyType_Ready(&netr_WorkstationInfo_Type) < 0) goto out; if (PyType_Ready(&netr_trust_extension_info_Type) < 0) goto out; if (PyType_Ready(&netr_trust_extension_Type) < 0) goto out; if (PyType_Ready(&netr_trust_extension_container_Type) < 0) goto out; if (PyType_Ready(&netr_OneDomainInfo_Type) < 0) goto out; if (PyType_Ready(&netr_DomainInformation_Type) < 0) goto out; if (PyType_Ready(&netr_DomainInfo_Type) < 0) goto out; if (PyType_Ready(&NL_PASSWORD_VERSION_Type) < 0) goto out; if (PyType_Ready(&netr_CryptPassword_Type) < 0) goto out; if (PyType_Ready(&netr_SendToSamResetBadPasswordCount_Type) < 0) goto out; if (PyType_Ready(&netr_SendToSamMessage_Type) < 0) goto out; if (PyType_Ready(&netr_SendToSamBase_Type) < 0) goto out; if (PyType_Ready(&netr_DsRAddressToSitenamesWCtr_Type) < 0) goto out; if (PyType_Ready(&netr_DsRAddress_Type) < 0) goto out; if (PyType_Ready(&netr_DomainTrust_Type) < 0) goto out; if (PyType_Ready(&netr_DomainTrustList_Type) < 0) goto out; if (PyType_Ready(&netr_DsRAddressToSitenamesExWCtr_Type) < 0) goto out; if (PyType_Ready(&DcSitesCtr_Type) < 0) goto out; if (PyType_Ready(&netr_TrustInfo_Type) < 0) goto out; if (PyType_Ready(&NL_DNS_NAME_INFO_Type) < 0) goto out; if (PyType_Ready(&NL_DNS_NAME_INFO_ARRAY_Type) < 0) goto out; if (PyType_Ready(&netr_LogonUasLogon_Type) < 0) goto out; if (PyType_Ready(&netr_LogonUasLogoff_Type) < 0) goto out; if (PyType_Ready(&netr_LogonSamLogon_Type) < 0) goto out; if (PyType_Ready(&netr_LogonSamLogoff_Type) < 0) goto out; if (PyType_Ready(&netr_ServerReqChallenge_Type) < 0) goto out; if (PyType_Ready(&netr_ServerAuthenticate_Type) < 0) goto out; if (PyType_Ready(&netr_ServerPasswordSet_Type) < 0) goto out; if (PyType_Ready(&netr_DatabaseDeltas_Type) < 0) goto out; if (PyType_Ready(&netr_DatabaseSync_Type) < 0) goto out; if (PyType_Ready(&netr_AccountDeltas_Type) < 0) goto out; if (PyType_Ready(&netr_AccountSync_Type) < 0) goto out; if (PyType_Ready(&netr_GetDcName_Type) < 0) goto out; if (PyType_Ready(&netr_LogonControl_Type) < 0) goto out; if (PyType_Ready(&netr_GetAnyDCName_Type) < 0) goto out; if (PyType_Ready(&netr_LogonControl2_Type) < 0) goto out; if (PyType_Ready(&netr_ServerAuthenticate2_Type) < 0) goto out; if (PyType_Ready(&netr_DatabaseSync2_Type) < 0) goto out; if (PyType_Ready(&netr_DatabaseRedo_Type) < 0) goto out; if (PyType_Ready(&netr_LogonControl2Ex_Type) < 0) goto out; if (PyType_Ready(&netr_NetrEnumerateTrustedDomains_Type) < 0) goto out; if (PyType_Ready(&netr_DsRGetDCName_Type) < 0) goto out; if (PyType_Ready(&netr_LogonGetCapabilities_Type) < 0) goto out; if (PyType_Ready(&netr_LogonGetTrustRid_Type) < 0) goto out; if (PyType_Ready(&netr_ServerAuthenticate3_Type) < 0) goto out; if (PyType_Ready(&netr_DsRGetDCNameEx_Type) < 0) goto out; if (PyType_Ready(&netr_DsRGetSiteName_Type) < 0) goto out; if (PyType_Ready(&netr_LogonGetDomainInfo_Type) < 0) goto out; if (PyType_Ready(&netr_ServerPasswordSet2_Type) < 0) goto out; if (PyType_Ready(&netr_ServerPasswordGet_Type) < 0) goto out; if (PyType_Ready(&netr_NetrLogonSendToSam_Type) < 0) goto out; if (PyType_Ready(&netr_DsRAddressToSitenamesW_Type) < 0) goto out; if (PyType_Ready(&netr_DsRGetDCNameEx2_Type) < 0) goto out; if (PyType_Ready(&netr_NetrEnumerateTrustedDomainsEx_Type) < 0) goto out; if (PyType_Ready(&netr_DsRAddressToSitenamesExW_Type) < 0) goto out; if (PyType_Ready(&netr_DsrGetDcSiteCoverageW_Type) < 0) goto out; if (PyType_Ready(&netr_LogonSamLogonEx_Type) < 0) goto out; if (PyType_Ready(&netr_DsrEnumerateDomainTrusts_Type) < 0) goto out; if (PyType_Ready(&netr_DsrDeregisterDNSHostRecords_Type) < 0) goto out; if (PyType_Ready(&netr_ServerTrustPasswordsGet_Type) < 0) goto out; if (PyType_Ready(&netr_DsRGetForestTrustInformation_Type) < 0) goto out; if (PyType_Ready(&netr_GetForestTrustInformation_Type) < 0) goto out; if (PyType_Ready(&netr_LogonSamLogonWithFlags_Type) < 0) goto out; if (PyType_Ready(&netr_ServerGetTrustInfo_Type) < 0) goto out; if (PyType_Ready(&netr_Unused47_Type) < 0) goto out; if (PyType_Ready(&netr_DsrUpdateReadOnlyServerDnsRecords_Type) < 0) goto out; if (PyType_Ready(&netlogon_InterfaceType) < 0) goto out; if (PyType_Ready(&netlogon_SyntaxType) < 0) goto out; if (!PyInterface_AddNdrRpcMethods(&netlogon_InterfaceType, py_ndr_netlogon_methods)) return NULL; #ifdef PY_NETR_UASINFO_PATCH PY_NETR_UASINFO_PATCH(&netr_UasInfo_Type); #endif #ifdef PY_NETR_UASLOGOFFINFO_PATCH PY_NETR_UASLOGOFFINFO_PATCH(&netr_UasLogoffInfo_Type); #endif #ifdef PY_NETR_ACCTLOCKSTR_PATCH PY_NETR_ACCTLOCKSTR_PATCH(&netr_AcctLockStr_Type); #endif #ifdef PY_NETR_IDENTITYINFO_PATCH PY_NETR_IDENTITYINFO_PATCH(&netr_IdentityInfo_Type); #endif #ifdef PY_NETR_PASSWORDINFO_PATCH PY_NETR_PASSWORDINFO_PATCH(&netr_PasswordInfo_Type); #endif #ifdef PY_NETR_CHALLENGERESPONSE_PATCH PY_NETR_CHALLENGERESPONSE_PATCH(&netr_ChallengeResponse_Type); #endif #ifdef PY_NETR_NETWORKINFO_PATCH PY_NETR_NETWORKINFO_PATCH(&netr_NetworkInfo_Type); #endif #ifdef PY_NETR_GENERICINFO_PATCH PY_NETR_GENERICINFO_PATCH(&netr_GenericInfo_Type); #endif #ifdef PY_NETR_LOGONLEVEL_PATCH PY_NETR_LOGONLEVEL_PATCH(&netr_LogonLevel_Type); #endif #ifdef PY_NETR_USERSESSIONKEY_PATCH PY_NETR_USERSESSIONKEY_PATCH(&netr_UserSessionKey_Type); #endif #ifdef PY_NETR_LMSESSIONKEY_PATCH PY_NETR_LMSESSIONKEY_PATCH(&netr_LMSessionKey_Type); #endif #ifdef PY_NETR_SAMBASEINFO_PATCH PY_NETR_SAMBASEINFO_PATCH(&netr_SamBaseInfo_Type); #endif #ifdef PY_NETR_SAMINFO2_PATCH PY_NETR_SAMINFO2_PATCH(&netr_SamInfo2_Type); #endif #ifdef PY_NETR_SIDATTR_PATCH PY_NETR_SIDATTR_PATCH(&netr_SidAttr_Type); #endif #ifdef PY_NETR_SAMINFO3_PATCH PY_NETR_SAMINFO3_PATCH(&netr_SamInfo3_Type); #endif #ifdef PY_NETR_SAMINFO6_PATCH PY_NETR_SAMINFO6_PATCH(&netr_SamInfo6_Type); #endif #ifdef PY_NETR_PACINFO_PATCH PY_NETR_PACINFO_PATCH(&netr_PacInfo_Type); #endif #ifdef PY_NETR_GENERICINFO2_PATCH PY_NETR_GENERICINFO2_PATCH(&netr_GenericInfo2_Type); #endif #ifdef PY_NETR_VALIDATION_PATCH PY_NETR_VALIDATION_PATCH(&netr_Validation_Type); #endif #ifdef PY_NETR_CREDENTIAL_PATCH PY_NETR_CREDENTIAL_PATCH(&netr_Credential_Type); #endif #ifdef PY_NETR_AUTHENTICATOR_PATCH PY_NETR_AUTHENTICATOR_PATCH(&netr_Authenticator_Type); #endif #ifdef PY_NETR_DELTA_DELETE_USER_PATCH PY_NETR_DELTA_DELETE_USER_PATCH(&netr_DELTA_DELETE_USER_Type); #endif #ifdef PY_NETR_USER_KEY16_PATCH PY_NETR_USER_KEY16_PATCH(&netr_USER_KEY16_Type); #endif #ifdef PY_NETR_PASSWORDHISTORY_PATCH PY_NETR_PASSWORDHISTORY_PATCH(&netr_PasswordHistory_Type); #endif #ifdef PY_NETR_USER_KEYS2_PATCH PY_NETR_USER_KEYS2_PATCH(&netr_USER_KEYS2_Type); #endif #ifdef PY_NETR_USER_KEY_UNION_PATCH PY_NETR_USER_KEY_UNION_PATCH(&netr_USER_KEY_UNION_Type); #endif #ifdef PY_NETR_USER_KEYS_PATCH PY_NETR_USER_KEYS_PATCH(&netr_USER_KEYS_Type); #endif #ifdef PY_NETR_USER_PRIVATE_INFO_PATCH PY_NETR_USER_PRIVATE_INFO_PATCH(&netr_USER_PRIVATE_INFO_Type); #endif #ifdef PY_NETR_DELTA_USER_PATCH PY_NETR_DELTA_USER_PATCH(&netr_DELTA_USER_Type); #endif #ifdef PY_NETR_DELTA_DOMAIN_PATCH PY_NETR_DELTA_DOMAIN_PATCH(&netr_DELTA_DOMAIN_Type); #endif #ifdef PY_NETR_DELTA_GROUP_PATCH PY_NETR_DELTA_GROUP_PATCH(&netr_DELTA_GROUP_Type); #endif #ifdef PY_NETR_DELTA_RENAME_PATCH PY_NETR_DELTA_RENAME_PATCH(&netr_DELTA_RENAME_Type); #endif #ifdef PY_NETR_DELTA_GROUP_MEMBER_PATCH PY_NETR_DELTA_GROUP_MEMBER_PATCH(&netr_DELTA_GROUP_MEMBER_Type); #endif #ifdef PY_NETR_DELTA_ALIAS_PATCH PY_NETR_DELTA_ALIAS_PATCH(&netr_DELTA_ALIAS_Type); #endif #ifdef PY_NETR_DELTA_ALIAS_MEMBER_PATCH PY_NETR_DELTA_ALIAS_MEMBER_PATCH(&netr_DELTA_ALIAS_MEMBER_Type); #endif #ifdef PY_NETR_QUOTA_LIMITS_PATCH PY_NETR_QUOTA_LIMITS_PATCH(&netr_QUOTA_LIMITS_Type); #endif #ifdef PY_NETR_DELTA_POLICY_PATCH PY_NETR_DELTA_POLICY_PATCH(&netr_DELTA_POLICY_Type); #endif #ifdef PY_NETR_DELTA_TRUSTED_DOMAIN_PATCH PY_NETR_DELTA_TRUSTED_DOMAIN_PATCH(&netr_DELTA_TRUSTED_DOMAIN_Type); #endif #ifdef PY_NETR_DELTA_ACCOUNT_PATCH PY_NETR_DELTA_ACCOUNT_PATCH(&netr_DELTA_ACCOUNT_Type); #endif #ifdef PY_NETR_CIPHER_VALUE_PATCH PY_NETR_CIPHER_VALUE_PATCH(&netr_CIPHER_VALUE_Type); #endif #ifdef PY_NETR_DELTA_SECRET_PATCH PY_NETR_DELTA_SECRET_PATCH(&netr_DELTA_SECRET_Type); #endif #ifdef PY_NETR_DELTA_UNION_PATCH PY_NETR_DELTA_UNION_PATCH(&netr_DELTA_UNION_Type); #endif #ifdef PY_NETR_DELTA_ID_UNION_PATCH PY_NETR_DELTA_ID_UNION_PATCH(&netr_DELTA_ID_UNION_Type); #endif #ifdef PY_NETR_DELTA_ENUM_PATCH PY_NETR_DELTA_ENUM_PATCH(&netr_DELTA_ENUM_Type); #endif #ifdef PY_NETR_DELTA_ENUM_ARRAY_PATCH PY_NETR_DELTA_ENUM_ARRAY_PATCH(&netr_DELTA_ENUM_ARRAY_Type); #endif #ifdef PY_NETR_UAS_INFO_0_PATCH PY_NETR_UAS_INFO_0_PATCH(&netr_UAS_INFO_0_Type); #endif #ifdef PY_NETR_ACCOUNTBUFFER_PATCH PY_NETR_ACCOUNTBUFFER_PATCH(&netr_AccountBuffer_Type); #endif #ifdef PY_NETR_NETLOGON_INFO_1_PATCH PY_NETR_NETLOGON_INFO_1_PATCH(&netr_NETLOGON_INFO_1_Type); #endif #ifdef PY_NETR_NETLOGON_INFO_2_PATCH PY_NETR_NETLOGON_INFO_2_PATCH(&netr_NETLOGON_INFO_2_Type); #endif #ifdef PY_NETR_NETLOGON_INFO_3_PATCH PY_NETR_NETLOGON_INFO_3_PATCH(&netr_NETLOGON_INFO_3_Type); #endif #ifdef PY_NETR_NETLOGON_INFO_4_PATCH PY_NETR_NETLOGON_INFO_4_PATCH(&netr_NETLOGON_INFO_4_Type); #endif #ifdef PY_NETR_CONTROL_QUERY_INFORMATION_PATCH PY_NETR_CONTROL_QUERY_INFORMATION_PATCH(&netr_CONTROL_QUERY_INFORMATION_Type); #endif #ifdef PY_NETR_CONTROL_DATA_INFORMATION_PATCH PY_NETR_CONTROL_DATA_INFORMATION_PATCH(&netr_CONTROL_DATA_INFORMATION_Type); #endif #ifdef PY_NETR_CHANGELOGOBJECT_PATCH PY_NETR_CHANGELOGOBJECT_PATCH(&netr_ChangeLogObject_Type); #endif #ifdef PY_NETR_CHANGELOGENTRY_PATCH PY_NETR_CHANGELOGENTRY_PATCH(&netr_ChangeLogEntry_Type); #endif #ifdef PY_NETR_BLOB_PATCH PY_NETR_BLOB_PATCH(&netr_Blob_Type); #endif #ifdef PY_NETR_DSRGETDCNAMEINFO_PATCH PY_NETR_DSRGETDCNAMEINFO_PATCH(&netr_DsRGetDCNameInfo_Type); #endif #ifdef PY_NETR_CAPABILITIES_PATCH PY_NETR_CAPABILITIES_PATCH(&netr_Capabilities_Type); #endif #ifdef PY_NETR_LSAPOLICYINFORMATION_PATCH PY_NETR_LSAPOLICYINFORMATION_PATCH(&netr_LsaPolicyInformation_Type); #endif #ifdef PY_NETR_OSVERSIONINFOEX_PATCH PY_NETR_OSVERSIONINFOEX_PATCH(&netr_OsVersionInfoEx_Type); #endif #ifdef PY_NETR_OSVERSION_PATCH PY_NETR_OSVERSION_PATCH(&netr_OsVersion_Type); #endif #ifdef PY_NETR_OSVERSIONCONTAINER_PATCH PY_NETR_OSVERSIONCONTAINER_PATCH(&netr_OsVersionContainer_Type); #endif #ifdef PY_NETR_WORKSTATIONINFORMATION_PATCH PY_NETR_WORKSTATIONINFORMATION_PATCH(&netr_WorkstationInformation_Type); #endif #ifdef PY_NETR_WORKSTATIONINFO_PATCH PY_NETR_WORKSTATIONINFO_PATCH(&netr_WorkstationInfo_Type); #endif #ifdef PY_NETR_TRUST_EXTENSION_INFO_PATCH PY_NETR_TRUST_EXTENSION_INFO_PATCH(&netr_trust_extension_info_Type); #endif #ifdef PY_NETR_TRUST_EXTENSION_PATCH PY_NETR_TRUST_EXTENSION_PATCH(&netr_trust_extension_Type); #endif #ifdef PY_NETR_TRUST_EXTENSION_CONTAINER_PATCH PY_NETR_TRUST_EXTENSION_CONTAINER_PATCH(&netr_trust_extension_container_Type); #endif #ifdef PY_NETR_ONEDOMAININFO_PATCH PY_NETR_ONEDOMAININFO_PATCH(&netr_OneDomainInfo_Type); #endif #ifdef PY_NETR_DOMAININFORMATION_PATCH PY_NETR_DOMAININFORMATION_PATCH(&netr_DomainInformation_Type); #endif #ifdef PY_NETR_DOMAININFO_PATCH PY_NETR_DOMAININFO_PATCH(&netr_DomainInfo_Type); #endif #ifdef PY_NL_PASSWORD_VERSION_PATCH PY_NL_PASSWORD_VERSION_PATCH(&NL_PASSWORD_VERSION_Type); #endif #ifdef PY_NETR_CRYPTPASSWORD_PATCH PY_NETR_CRYPTPASSWORD_PATCH(&netr_CryptPassword_Type); #endif #ifdef PY_NETR_SENDTOSAMRESETBADPASSWORDCOUNT_PATCH PY_NETR_SENDTOSAMRESETBADPASSWORDCOUNT_PATCH(&netr_SendToSamResetBadPasswordCount_Type); #endif #ifdef PY_NETR_SENDTOSAMMESSAGE_PATCH PY_NETR_SENDTOSAMMESSAGE_PATCH(&netr_SendToSamMessage_Type); #endif #ifdef PY_NETR_SENDTOSAMBASE_PATCH PY_NETR_SENDTOSAMBASE_PATCH(&netr_SendToSamBase_Type); #endif #ifdef PY_NETR_DSRADDRESSTOSITENAMESWCTR_PATCH PY_NETR_DSRADDRESSTOSITENAMESWCTR_PATCH(&netr_DsRAddressToSitenamesWCtr_Type); #endif #ifdef PY_NETR_DSRADDRESS_PATCH PY_NETR_DSRADDRESS_PATCH(&netr_DsRAddress_Type); #endif #ifdef PY_NETR_DOMAINTRUST_PATCH PY_NETR_DOMAINTRUST_PATCH(&netr_DomainTrust_Type); #endif #ifdef PY_NETR_DOMAINTRUSTLIST_PATCH PY_NETR_DOMAINTRUSTLIST_PATCH(&netr_DomainTrustList_Type); #endif #ifdef PY_NETR_DSRADDRESSTOSITENAMESEXWCTR_PATCH PY_NETR_DSRADDRESSTOSITENAMESEXWCTR_PATCH(&netr_DsRAddressToSitenamesExWCtr_Type); #endif #ifdef PY_DCSITESCTR_PATCH PY_DCSITESCTR_PATCH(&DcSitesCtr_Type); #endif #ifdef PY_NETR_TRUSTINFO_PATCH PY_NETR_TRUSTINFO_PATCH(&netr_TrustInfo_Type); #endif #ifdef PY_NL_DNS_NAME_INFO_PATCH PY_NL_DNS_NAME_INFO_PATCH(&NL_DNS_NAME_INFO_Type); #endif #ifdef PY_NL_DNS_NAME_INFO_ARRAY_PATCH PY_NL_DNS_NAME_INFO_ARRAY_PATCH(&NL_DNS_NAME_INFO_ARRAY_Type); #endif #ifdef PY_NETR_LOGONUASLOGON_PATCH PY_NETR_LOGONUASLOGON_PATCH(&netr_LogonUasLogon_Type); #endif #ifdef PY_NETR_LOGONUASLOGOFF_PATCH PY_NETR_LOGONUASLOGOFF_PATCH(&netr_LogonUasLogoff_Type); #endif #ifdef PY_NETR_LOGONSAMLOGON_PATCH PY_NETR_LOGONSAMLOGON_PATCH(&netr_LogonSamLogon_Type); #endif #ifdef PY_NETR_LOGONSAMLOGOFF_PATCH PY_NETR_LOGONSAMLOGOFF_PATCH(&netr_LogonSamLogoff_Type); #endif #ifdef PY_NETR_SERVERREQCHALLENGE_PATCH PY_NETR_SERVERREQCHALLENGE_PATCH(&netr_ServerReqChallenge_Type); #endif #ifdef PY_NETR_SERVERAUTHENTICATE_PATCH PY_NETR_SERVERAUTHENTICATE_PATCH(&netr_ServerAuthenticate_Type); #endif #ifdef PY_NETR_SERVERPASSWORDSET_PATCH PY_NETR_SERVERPASSWORDSET_PATCH(&netr_ServerPasswordSet_Type); #endif #ifdef PY_NETR_DATABASEDELTAS_PATCH PY_NETR_DATABASEDELTAS_PATCH(&netr_DatabaseDeltas_Type); #endif #ifdef PY_NETR_DATABASESYNC_PATCH PY_NETR_DATABASESYNC_PATCH(&netr_DatabaseSync_Type); #endif #ifdef PY_NETR_ACCOUNTDELTAS_PATCH PY_NETR_ACCOUNTDELTAS_PATCH(&netr_AccountDeltas_Type); #endif #ifdef PY_NETR_ACCOUNTSYNC_PATCH PY_NETR_ACCOUNTSYNC_PATCH(&netr_AccountSync_Type); #endif #ifdef PY_NETR_GETDCNAME_PATCH PY_NETR_GETDCNAME_PATCH(&netr_GetDcName_Type); #endif #ifdef PY_NETR_LOGONCONTROL_PATCH PY_NETR_LOGONCONTROL_PATCH(&netr_LogonControl_Type); #endif #ifdef PY_NETR_GETANYDCNAME_PATCH PY_NETR_GETANYDCNAME_PATCH(&netr_GetAnyDCName_Type); #endif #ifdef PY_NETR_LOGONCONTROL2_PATCH PY_NETR_LOGONCONTROL2_PATCH(&netr_LogonControl2_Type); #endif #ifdef PY_NETR_SERVERAUTHENTICATE2_PATCH PY_NETR_SERVERAUTHENTICATE2_PATCH(&netr_ServerAuthenticate2_Type); #endif #ifdef PY_NETR_DATABASESYNC2_PATCH PY_NETR_DATABASESYNC2_PATCH(&netr_DatabaseSync2_Type); #endif #ifdef PY_NETR_DATABASEREDO_PATCH PY_NETR_DATABASEREDO_PATCH(&netr_DatabaseRedo_Type); #endif #ifdef PY_NETR_LOGONCONTROL2EX_PATCH PY_NETR_LOGONCONTROL2EX_PATCH(&netr_LogonControl2Ex_Type); #endif #ifdef PY_NETR_NETRENUMERATETRUSTEDDOMAINS_PATCH PY_NETR_NETRENUMERATETRUSTEDDOMAINS_PATCH(&netr_NetrEnumerateTrustedDomains_Type); #endif #ifdef PY_NETR_DSRGETDCNAME_PATCH PY_NETR_DSRGETDCNAME_PATCH(&netr_DsRGetDCName_Type); #endif #ifdef PY_NETR_LOGONGETCAPABILITIES_PATCH PY_NETR_LOGONGETCAPABILITIES_PATCH(&netr_LogonGetCapabilities_Type); #endif #ifdef PY_NETR_LOGONGETTRUSTRID_PATCH PY_NETR_LOGONGETTRUSTRID_PATCH(&netr_LogonGetTrustRid_Type); #endif #ifdef PY_NETR_SERVERAUTHENTICATE3_PATCH PY_NETR_SERVERAUTHENTICATE3_PATCH(&netr_ServerAuthenticate3_Type); #endif #ifdef PY_NETR_DSRGETDCNAMEEX_PATCH PY_NETR_DSRGETDCNAMEEX_PATCH(&netr_DsRGetDCNameEx_Type); #endif #ifdef PY_NETR_DSRGETSITENAME_PATCH PY_NETR_DSRGETSITENAME_PATCH(&netr_DsRGetSiteName_Type); #endif #ifdef PY_NETR_LOGONGETDOMAININFO_PATCH PY_NETR_LOGONGETDOMAININFO_PATCH(&netr_LogonGetDomainInfo_Type); #endif #ifdef PY_NETR_SERVERPASSWORDSET2_PATCH PY_NETR_SERVERPASSWORDSET2_PATCH(&netr_ServerPasswordSet2_Type); #endif #ifdef PY_NETR_SERVERPASSWORDGET_PATCH PY_NETR_SERVERPASSWORDGET_PATCH(&netr_ServerPasswordGet_Type); #endif #ifdef PY_NETR_NETRLOGONSENDTOSAM_PATCH PY_NETR_NETRLOGONSENDTOSAM_PATCH(&netr_NetrLogonSendToSam_Type); #endif #ifdef PY_NETR_DSRADDRESSTOSITENAMESW_PATCH PY_NETR_DSRADDRESSTOSITENAMESW_PATCH(&netr_DsRAddressToSitenamesW_Type); #endif #ifdef PY_NETR_DSRGETDCNAMEEX2_PATCH PY_NETR_DSRGETDCNAMEEX2_PATCH(&netr_DsRGetDCNameEx2_Type); #endif #ifdef PY_NETR_NETRENUMERATETRUSTEDDOMAINSEX_PATCH PY_NETR_NETRENUMERATETRUSTEDDOMAINSEX_PATCH(&netr_NetrEnumerateTrustedDomainsEx_Type); #endif #ifdef PY_NETR_DSRADDRESSTOSITENAMESEXW_PATCH PY_NETR_DSRADDRESSTOSITENAMESEXW_PATCH(&netr_DsRAddressToSitenamesExW_Type); #endif #ifdef PY_NETR_DSRGETDCSITECOVERAGEW_PATCH PY_NETR_DSRGETDCSITECOVERAGEW_PATCH(&netr_DsrGetDcSiteCoverageW_Type); #endif #ifdef PY_NETR_LOGONSAMLOGONEX_PATCH PY_NETR_LOGONSAMLOGONEX_PATCH(&netr_LogonSamLogonEx_Type); #endif #ifdef PY_NETR_DSRENUMERATEDOMAINTRUSTS_PATCH PY_NETR_DSRENUMERATEDOMAINTRUSTS_PATCH(&netr_DsrEnumerateDomainTrusts_Type); #endif #ifdef PY_NETR_DSRDEREGISTERDNSHOSTRECORDS_PATCH PY_NETR_DSRDEREGISTERDNSHOSTRECORDS_PATCH(&netr_DsrDeregisterDNSHostRecords_Type); #endif #ifdef PY_NETR_SERVERTRUSTPASSWORDSGET_PATCH PY_NETR_SERVERTRUSTPASSWORDSGET_PATCH(&netr_ServerTrustPasswordsGet_Type); #endif #ifdef PY_NETR_DSRGETFORESTTRUSTINFORMATION_PATCH PY_NETR_DSRGETFORESTTRUSTINFORMATION_PATCH(&netr_DsRGetForestTrustInformation_Type); #endif #ifdef PY_NETR_GETFORESTTRUSTINFORMATION_PATCH PY_NETR_GETFORESTTRUSTINFORMATION_PATCH(&netr_GetForestTrustInformation_Type); #endif #ifdef PY_NETR_LOGONSAMLOGONWITHFLAGS_PATCH PY_NETR_LOGONSAMLOGONWITHFLAGS_PATCH(&netr_LogonSamLogonWithFlags_Type); #endif #ifdef PY_NETR_SERVERGETTRUSTINFO_PATCH PY_NETR_SERVERGETTRUSTINFO_PATCH(&netr_ServerGetTrustInfo_Type); #endif #ifdef PY_NETR_UNUSED47_PATCH PY_NETR_UNUSED47_PATCH(&netr_Unused47_Type); #endif #ifdef PY_NETR_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH PY_NETR_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH(&netr_DsrUpdateReadOnlyServerDnsRecords_Type); #endif #ifdef PY_NETLOGON_PATCH PY_NETLOGON_PATCH(&netlogon_InterfaceType); #endif #ifdef PY_NETLOGON_ABSTRACT_SYNTAX_PATCH PY_NETLOGON_ABSTRACT_SYNTAX_PATCH(&netlogon_SyntaxType); #endif #ifdef PY_ABSTRACT_SYNTAX_PATCH PY_ABSTRACT_SYNTAX_PATCH(&netlogon_SyntaxType); #endif m = PyModule_Create(&moduledef); if (m == NULL) goto out; PyModule_AddObject(m, "NETLOGON_NEG_128BIT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_STRONG_KEYS)); PyModule_AddObject(m, "NETLOGON_NEG_SCHANNEL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AUTHENTICATED_RPC)); PyModule_AddObject(m, "DSGETDC_VALID_FLAGS", PyLong_FromLong((DS_FORCE_REDISCOVERY|DS_DIRECTORY_SERVICE_REQUIRED|DS_DIRECTORY_SERVICE_PREFERRED|DS_GC_SERVER_REQUIRED|DS_PDC_REQUIRED|DS_BACKGROUND_ONLY|DS_IP_REQUIRED|DS_KDC_REQUIRED|DS_TIMESERV_REQUIRED|DS_WRITABLE_REQUIRED|DS_GOOD_TIMESERV_PREFERRED|DS_AVOID_SELF|DS_ONLY_LDAP_NEEDED|DS_IS_FLAT_NAME|DS_IS_DNS_NAME|DS_TRY_NEXTCLOSEST_SITE|DS_DIRECTORY_SERVICE_6_REQUIRED|DS_WEB_SERVICE_REQUIRED|DS_RETURN_FLAT_NAME|DS_RETURN_DNS_NAME))); PyModule_AddObject(m, "NETLOGON_PASSWORD_VERSION_NUMBER_PRESENT", PyLong_FromUnsignedLongLong(0x02231968)); PyModule_AddObject(m, "DS_GFTI_UPDATE_TDO", PyLong_FromUnsignedLongLong(0x1)); PyModule_AddObject(m, "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_CLEARTEXT_PASSWORD_ALLOWED)); PyModule_AddObject(m, "MSV1_0_UPDATE_LOGON_STATISTICS", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_UPDATE_LOGON_STATISTICS)); PyModule_AddObject(m, "MSV1_0_RETURN_USER_PARAMETERS", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_RETURN_USER_PARAMETERS)); PyModule_AddObject(m, "MSV1_0_DONT_TRY_GUEST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_DONT_TRY_GUEST_ACCOUNT)); PyModule_AddObject(m, "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT)); PyModule_AddObject(m, "MSV1_0_RETURN_PASSWORD_EXPIRY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_RETURN_PASSWORD_EXPIRY)); PyModule_AddObject(m, "MSV1_0_USE_CLIENT_CHALLENGE", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_USE_CLIENT_CHALLENGE)); PyModule_AddObject(m, "MSV1_0_TRY_GUEST_ACCOUNT_ONLY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_TRY_GUEST_ACCOUNT_ONLY)); PyModule_AddObject(m, "MSV1_0_RETURN_PROFILE_PATH", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_RETURN_PROFILE_PATH)); PyModule_AddObject(m, "MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY)); PyModule_AddObject(m, "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT)); PyModule_AddObject(m, "MSV1_0_DISABLE_PERSONAL_FALLBACK", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_DISABLE_PERSONAL_FALLBACK)); PyModule_AddObject(m, "MSV1_0_ALLOW_FORCE_GUEST", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_FORCE_GUEST)); PyModule_AddObject(m, "MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED)); PyModule_AddObject(m, "MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY)); PyModule_AddObject(m, "MSV1_0_ALLOW_MSVCHAPV2", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_MSVCHAPV2)); PyModule_AddObject(m, "MSV1_0_S4U2SELF", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_S4U2SELF)); PyModule_AddObject(m, "MSV1_0_CHECK_LOGONHOURS_FOR_S4U", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_CHECK_LOGONHOURS_FOR_S4U)); PyModule_AddObject(m, "MSV1_0_SUBAUTHENTICATION_DLL_EX", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_SUBAUTHENTICATION_DLL_EX)); PyModule_AddObject(m, "NetlogonInteractiveInformation", PyLong_FromLong((uint16_t)NetlogonInteractiveInformation)); PyModule_AddObject(m, "NetlogonNetworkInformation", PyLong_FromLong((uint16_t)NetlogonNetworkInformation)); PyModule_AddObject(m, "NetlogonServiceInformation", PyLong_FromLong((uint16_t)NetlogonServiceInformation)); PyModule_AddObject(m, "NetlogonGenericInformation", PyLong_FromLong((uint16_t)NetlogonGenericInformation)); PyModule_AddObject(m, "NetlogonInteractiveTransitiveInformation", PyLong_FromLong((uint16_t)NetlogonInteractiveTransitiveInformation)); PyModule_AddObject(m, "NetlogonNetworkTransitiveInformation", PyLong_FromLong((uint16_t)NetlogonNetworkTransitiveInformation)); PyModule_AddObject(m, "NetlogonServiceTransitiveInformation", PyLong_FromLong((uint16_t)NetlogonServiceTransitiveInformation)); PyModule_AddObject(m, "NETLOGON_GUEST", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_GUEST)); PyModule_AddObject(m, "NETLOGON_NOENCRYPTION", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NOENCRYPTION)); PyModule_AddObject(m, "NETLOGON_CACHED_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CACHED_ACCOUNT)); PyModule_AddObject(m, "NETLOGON_USED_LM_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_USED_LM_PASSWORD)); PyModule_AddObject(m, "NETLOGON_EXTRA_SIDS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_EXTRA_SIDS)); PyModule_AddObject(m, "NETLOGON_SUBAUTH_SESSION_KEY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SUBAUTH_SESSION_KEY)); PyModule_AddObject(m, "NETLOGON_SERVER_TRUST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SERVER_TRUST_ACCOUNT)); PyModule_AddObject(m, "NETLOGON_NTLMV2_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NTLMV2_ENABLED)); PyModule_AddObject(m, "NETLOGON_RESOURCE_GROUPS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_RESOURCE_GROUPS)); PyModule_AddObject(m, "NETLOGON_PROFILE_PATH_RETURNED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_PROFILE_PATH_RETURNED)); PyModule_AddObject(m, "NETLOGON_GRACE_LOGON", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_GRACE_LOGON)); PyModule_AddObject(m, "NetlogonValidationUasInfo", PyLong_FromLong((uint16_t)NetlogonValidationUasInfo)); PyModule_AddObject(m, "NetlogonValidationSamInfo", PyLong_FromLong((uint16_t)NetlogonValidationSamInfo)); PyModule_AddObject(m, "NetlogonValidationSamInfo2", PyLong_FromLong((uint16_t)NetlogonValidationSamInfo2)); PyModule_AddObject(m, "NetlogonValidationGenericInfo2", PyLong_FromLong((uint16_t)NetlogonValidationGenericInfo2)); PyModule_AddObject(m, "NetlogonValidationSamInfo4", PyLong_FromLong((uint16_t)NetlogonValidationSamInfo4)); PyModule_AddObject(m, "NETR_DELTA_DOMAIN", PyLong_FromLong((uint16_t)NETR_DELTA_DOMAIN)); PyModule_AddObject(m, "NETR_DELTA_GROUP", PyLong_FromLong((uint16_t)NETR_DELTA_GROUP)); PyModule_AddObject(m, "NETR_DELTA_DELETE_GROUP", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_GROUP)); PyModule_AddObject(m, "NETR_DELTA_RENAME_GROUP", PyLong_FromLong((uint16_t)NETR_DELTA_RENAME_GROUP)); PyModule_AddObject(m, "NETR_DELTA_USER", PyLong_FromLong((uint16_t)NETR_DELTA_USER)); PyModule_AddObject(m, "NETR_DELTA_DELETE_USER", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_USER)); PyModule_AddObject(m, "NETR_DELTA_RENAME_USER", PyLong_FromLong((uint16_t)NETR_DELTA_RENAME_USER)); PyModule_AddObject(m, "NETR_DELTA_GROUP_MEMBER", PyLong_FromLong((uint16_t)NETR_DELTA_GROUP_MEMBER)); PyModule_AddObject(m, "NETR_DELTA_ALIAS", PyLong_FromLong((uint16_t)NETR_DELTA_ALIAS)); PyModule_AddObject(m, "NETR_DELTA_DELETE_ALIAS", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_ALIAS)); PyModule_AddObject(m, "NETR_DELTA_RENAME_ALIAS", PyLong_FromLong((uint16_t)NETR_DELTA_RENAME_ALIAS)); PyModule_AddObject(m, "NETR_DELTA_ALIAS_MEMBER", PyLong_FromLong((uint16_t)NETR_DELTA_ALIAS_MEMBER)); PyModule_AddObject(m, "NETR_DELTA_POLICY", PyLong_FromLong((uint16_t)NETR_DELTA_POLICY)); PyModule_AddObject(m, "NETR_DELTA_TRUSTED_DOMAIN", PyLong_FromLong((uint16_t)NETR_DELTA_TRUSTED_DOMAIN)); PyModule_AddObject(m, "NETR_DELTA_DELETE_TRUST", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_TRUST)); PyModule_AddObject(m, "NETR_DELTA_ACCOUNT", PyLong_FromLong((uint16_t)NETR_DELTA_ACCOUNT)); PyModule_AddObject(m, "NETR_DELTA_DELETE_ACCOUNT", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_ACCOUNT)); PyModule_AddObject(m, "NETR_DELTA_SECRET", PyLong_FromLong((uint16_t)NETR_DELTA_SECRET)); PyModule_AddObject(m, "NETR_DELTA_DELETE_SECRET", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_SECRET)); PyModule_AddObject(m, "NETR_DELTA_DELETE_GROUP2", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_GROUP2)); PyModule_AddObject(m, "NETR_DELTA_DELETE_USER2", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_USER2)); PyModule_AddObject(m, "NETR_DELTA_MODIFY_COUNT", PyLong_FromLong((uint16_t)NETR_DELTA_MODIFY_COUNT)); PyModule_AddObject(m, "NETLOGON_REPLICATION_NEEDED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_REPLICATION_NEEDED)); PyModule_AddObject(m, "NETLOGON_REPLICATION_IN_PROGRESS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_REPLICATION_IN_PROGRESS)); PyModule_AddObject(m, "NETLOGON_FULL_SYNC_REPLICATION", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_FULL_SYNC_REPLICATION)); PyModule_AddObject(m, "NETLOGON_REDO_NEEDED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_REDO_NEEDED)); PyModule_AddObject(m, "NETLOGON_HAS_IP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_HAS_IP)); PyModule_AddObject(m, "NETLOGON_HAS_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_HAS_TIMESERV)); PyModule_AddObject(m, "NETLOGON_DNS_UPDATE_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_DNS_UPDATE_FAILURE)); PyModule_AddObject(m, "NETLOGON_VERIFY_STATUS_RETURNED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_VERIFY_STATUS_RETURNED)); PyModule_AddObject(m, "NETLOGON_CONTROL_QUERY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_QUERY)); PyModule_AddObject(m, "NETLOGON_CONTROL_REPLICATE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_REPLICATE)); PyModule_AddObject(m, "NETLOGON_CONTROL_SYNCHRONIZE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_SYNCHRONIZE)); PyModule_AddObject(m, "NETLOGON_CONTROL_PDC_REPLICATE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_PDC_REPLICATE)); PyModule_AddObject(m, "NETLOGON_CONTROL_REDISCOVER", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_REDISCOVER)); PyModule_AddObject(m, "NETLOGON_CONTROL_TC_QUERY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TC_QUERY)); PyModule_AddObject(m, "NETLOGON_CONTROL_TRANSPORT_NOTIFY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TRANSPORT_NOTIFY)); PyModule_AddObject(m, "NETLOGON_CONTROL_FIND_USER", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_FIND_USER)); PyModule_AddObject(m, "NETLOGON_CONTROL_CHANGE_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_CHANGE_PASSWORD)); PyModule_AddObject(m, "NETLOGON_CONTROL_TC_VERIFY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TC_VERIFY)); PyModule_AddObject(m, "NETLOGON_CONTROL_FORCE_DNS_REG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_FORCE_DNS_REG)); PyModule_AddObject(m, "NETLOGON_CONTROL_QUERY_DNS_REG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_QUERY_DNS_REG)); PyModule_AddObject(m, "NETLOGON_CONTROL_BACKUP_CHANGE_LOG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_BACKUP_CHANGE_LOG)); PyModule_AddObject(m, "NETLOGON_CONTROL_TRUNCATE_LOG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TRUNCATE_LOG)); PyModule_AddObject(m, "NETLOGON_CONTROL_SET_DBFLAG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_SET_DBFLAG)); PyModule_AddObject(m, "NETLOGON_CONTROL_BREAKPOINT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_BREAKPOINT)); PyModule_AddObject(m, "NETLOGON_NEG_ACCOUNT_LOCKOUT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_ACCOUNT_LOCKOUT)); PyModule_AddObject(m, "NETLOGON_NEG_PERSISTENT_SAMREPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PERSISTENT_SAMREPL)); PyModule_AddObject(m, "NETLOGON_NEG_ARCFOUR", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_ARCFOUR)); PyModule_AddObject(m, "NETLOGON_NEG_PROMOTION_COUNT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PROMOTION_COUNT)); PyModule_AddObject(m, "NETLOGON_NEG_CHANGELOG_BDC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_CHANGELOG_BDC)); PyModule_AddObject(m, "NETLOGON_NEG_FULL_SYNC_REPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_FULL_SYNC_REPL)); PyModule_AddObject(m, "NETLOGON_NEG_MULTIPLE_SIDS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_MULTIPLE_SIDS)); PyModule_AddObject(m, "NETLOGON_NEG_REDO", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_REDO)); PyModule_AddObject(m, "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL)); PyModule_AddObject(m, "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_SEND_PASSWORD_INFO_PDC)); PyModule_AddObject(m, "NETLOGON_NEG_GENERIC_PASSTHROUGH", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_GENERIC_PASSTHROUGH)); PyModule_AddObject(m, "NETLOGON_NEG_CONCURRENT_RPC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_CONCURRENT_RPC)); PyModule_AddObject(m, "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL)); PyModule_AddObject(m, "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL)); PyModule_AddObject(m, "NETLOGON_NEG_STRONG_KEYS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_STRONG_KEYS)); PyModule_AddObject(m, "NETLOGON_NEG_TRANSITIVE_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_TRANSITIVE_TRUSTS)); PyModule_AddObject(m, "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_DNS_DOMAIN_TRUSTS)); PyModule_AddObject(m, "NETLOGON_NEG_PASSWORD_SET2", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PASSWORD_SET2)); PyModule_AddObject(m, "NETLOGON_NEG_GETDOMAININFO", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_GETDOMAININFO)); PyModule_AddObject(m, "NETLOGON_NEG_CROSS_FOREST_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_CROSS_FOREST_TRUSTS)); PyModule_AddObject(m, "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION)); PyModule_AddObject(m, "NETLOGON_NEG_RODC_PASSTHROUGH", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_RODC_PASSTHROUGH)); PyModule_AddObject(m, "NETLOGON_NEG_SUPPORTS_AES_SHA2", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_SUPPORTS_AES_SHA2)); PyModule_AddObject(m, "NETLOGON_NEG_SUPPORTS_AES", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_SUPPORTS_AES)); PyModule_AddObject(m, "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AUTHENTICATED_RPC_LSASS)); PyModule_AddObject(m, "NETLOGON_NEG_AUTHENTICATED_RPC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AUTHENTICATED_RPC)); PyModule_AddObject(m, "SYNCSTATE_NORMAL_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_NORMAL_STATE)); PyModule_AddObject(m, "SYNCSTATE_DOMAIN_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_DOMAIN_STATE)); PyModule_AddObject(m, "SYNCSTATE_GROUP_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_GROUP_STATE)); PyModule_AddObject(m, "SYNCSTATE_UAS_BUILT_IN_GROUP_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_UAS_BUILT_IN_GROUP_STATE)); PyModule_AddObject(m, "SYNCSTATE_USER_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_USER_STATE)); PyModule_AddObject(m, "SYNCSTATE_GROUP_MEMBER_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_GROUP_MEMBER_STATE)); PyModule_AddObject(m, "SYNCSTATE_ALIAS_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_ALIAS_STATE)); PyModule_AddObject(m, "SYNCSTATE_ALIAS_MEMBER_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_ALIAS_MEMBER_STATE)); PyModule_AddObject(m, "SYNCSTATE_SAM_DONE_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_SAM_DONE_STATE)); PyModule_AddObject(m, "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", PyLong_FromLong((uint16_t)NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED)); PyModule_AddObject(m, "NETR_CHANGELOG_CHANGED_PASSWORD", PyLong_FromLong((uint16_t)NETR_CHANGELOG_CHANGED_PASSWORD)); PyModule_AddObject(m, "NETR_CHANGELOG_SID_INCLUDED", PyLong_FromLong((uint16_t)NETR_CHANGELOG_SID_INCLUDED)); PyModule_AddObject(m, "NETR_CHANGELOG_NAME_INCLUDED", PyLong_FromLong((uint16_t)NETR_CHANGELOG_NAME_INCLUDED)); PyModule_AddObject(m, "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", PyLong_FromLong((uint16_t)NETR_CHANGELOG_FIRST_PROMOTION_OBJ)); PyModule_AddObject(m, "DS_FORCE_REDISCOVERY", PyLong_FromUnsignedLongLong((uint32_t)DS_FORCE_REDISCOVERY)); PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_REQUIRED)); PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_PREFERRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_PREFERRED)); PyModule_AddObject(m, "DS_GC_SERVER_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_GC_SERVER_REQUIRED)); PyModule_AddObject(m, "DS_PDC_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_PDC_REQUIRED)); PyModule_AddObject(m, "DS_BACKGROUND_ONLY", PyLong_FromUnsignedLongLong((uint32_t)DS_BACKGROUND_ONLY)); PyModule_AddObject(m, "DS_IP_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_IP_REQUIRED)); PyModule_AddObject(m, "DS_KDC_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_KDC_REQUIRED)); PyModule_AddObject(m, "DS_TIMESERV_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_TIMESERV_REQUIRED)); PyModule_AddObject(m, "DS_WRITABLE_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_WRITABLE_REQUIRED)); PyModule_AddObject(m, "DS_GOOD_TIMESERV_PREFERRED", PyLong_FromUnsignedLongLong((uint32_t)DS_GOOD_TIMESERV_PREFERRED)); PyModule_AddObject(m, "DS_AVOID_SELF", PyLong_FromUnsignedLongLong((uint32_t)DS_AVOID_SELF)); PyModule_AddObject(m, "DS_ONLY_LDAP_NEEDED", PyLong_FromUnsignedLongLong((uint32_t)DS_ONLY_LDAP_NEEDED)); PyModule_AddObject(m, "DS_IS_FLAT_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_IS_FLAT_NAME)); PyModule_AddObject(m, "DS_IS_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_IS_DNS_NAME)); PyModule_AddObject(m, "DS_TRY_NEXTCLOSEST_SITE", PyLong_FromUnsignedLongLong((uint32_t)DS_TRY_NEXTCLOSEST_SITE)); PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_6_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_6_REQUIRED)); PyModule_AddObject(m, "DS_WEB_SERVICE_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_WEB_SERVICE_REQUIRED)); PyModule_AddObject(m, "DS_RETURN_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_RETURN_DNS_NAME)); PyModule_AddObject(m, "DS_RETURN_FLAT_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_RETURN_FLAT_NAME)); PyModule_AddObject(m, "DS_ADDRESS_TYPE_INET", PyLong_FromUnsignedLongLong((uint32_t)DS_ADDRESS_TYPE_INET)); PyModule_AddObject(m, "DS_ADDRESS_TYPE_NETBIOS", PyLong_FromUnsignedLongLong((uint32_t)DS_ADDRESS_TYPE_NETBIOS)); PyModule_AddObject(m, "DS_SERVER_PDC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_PDC)); PyModule_AddObject(m, "DS_SERVER_GC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_GC)); PyModule_AddObject(m, "DS_SERVER_LDAP", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_LDAP)); PyModule_AddObject(m, "DS_SERVER_DS", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_DS)); PyModule_AddObject(m, "DS_SERVER_KDC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_KDC)); PyModule_AddObject(m, "DS_SERVER_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_TIMESERV)); PyModule_AddObject(m, "DS_SERVER_CLOSEST", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_CLOSEST)); PyModule_AddObject(m, "DS_SERVER_WRITABLE", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_WRITABLE)); PyModule_AddObject(m, "DS_SERVER_GOOD_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_GOOD_TIMESERV)); PyModule_AddObject(m, "DS_SERVER_NDNC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_NDNC)); PyModule_AddObject(m, "DS_SERVER_SELECT_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_SELECT_SECRET_DOMAIN_6)); PyModule_AddObject(m, "DS_SERVER_FULL_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_FULL_SECRET_DOMAIN_6)); PyModule_AddObject(m, "DS_SERVER_WEBSERV", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_WEBSERV)); PyModule_AddObject(m, "DS_SERVER_DS_8", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_DS_8)); PyModule_AddObject(m, "DS_DNS_CONTROLLER", PyLong_FromUnsignedLongLong((uint32_t)DS_DNS_CONTROLLER)); PyModule_AddObject(m, "DS_DNS_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)DS_DNS_DOMAIN)); PyModule_AddObject(m, "DS_DNS_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)DS_DNS_FOREST_ROOT)); PyModule_AddObject(m, "NETR_TRUST_FLAG_IN_FOREST", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_IN_FOREST)); PyModule_AddObject(m, "NETR_TRUST_FLAG_OUTBOUND", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_OUTBOUND)); PyModule_AddObject(m, "NETR_TRUST_FLAG_TREEROOT", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_TREEROOT)); PyModule_AddObject(m, "NETR_TRUST_FLAG_PRIMARY", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_PRIMARY)); PyModule_AddObject(m, "NETR_TRUST_FLAG_NATIVE", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_NATIVE)); PyModule_AddObject(m, "NETR_TRUST_FLAG_INBOUND", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_INBOUND)); PyModule_AddObject(m, "NETR_TRUST_FLAG_MIT_KRB5", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_MIT_KRB5)); PyModule_AddObject(m, "NETR_TRUST_FLAG_AES", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_AES)); PyModule_AddObject(m, "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS)); PyModule_AddObject(m, "NETR_WS_FLAG_HANDLES_SPN_UPDATE", PyLong_FromUnsignedLongLong((uint32_t)NETR_WS_FLAG_HANDLES_SPN_UPDATE)); PyModule_AddObject(m, "NETR_VER_SUITE_BACKOFFICE", PyLong_FromLong((uint16_t)NETR_VER_SUITE_BACKOFFICE)); PyModule_AddObject(m, "NETR_VER_SUITE_BLADE", PyLong_FromLong((uint16_t)NETR_VER_SUITE_BLADE)); PyModule_AddObject(m, "NETR_VER_SUITE_COMPUTE_SERVER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_COMPUTE_SERVER)); PyModule_AddObject(m, "NETR_VER_SUITE_DATACENTER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_DATACENTER)); PyModule_AddObject(m, "NETR_VER_SUITE_ENTERPRISE", PyLong_FromLong((uint16_t)NETR_VER_SUITE_ENTERPRISE)); PyModule_AddObject(m, "NETR_VER_SUITE_EMBEDDEDNT", PyLong_FromLong((uint16_t)NETR_VER_SUITE_EMBEDDEDNT)); PyModule_AddObject(m, "NETR_VER_SUITE_PERSONAL", PyLong_FromLong((uint16_t)NETR_VER_SUITE_PERSONAL)); PyModule_AddObject(m, "NETR_VER_SUITE_SINGLEUSERTS", PyLong_FromLong((uint16_t)NETR_VER_SUITE_SINGLEUSERTS)); PyModule_AddObject(m, "NETR_VER_SUITE_SMALLBUSINESS", PyLong_FromLong((uint16_t)NETR_VER_SUITE_SMALLBUSINESS)); PyModule_AddObject(m, "NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED", PyLong_FromLong((uint16_t)NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED)); PyModule_AddObject(m, "NETR_VER_SUITE_STORAGE_SERVER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_STORAGE_SERVER)); PyModule_AddObject(m, "NETR_VER_SUITE_TERMINAL", PyLong_FromLong((uint16_t)NETR_VER_SUITE_TERMINAL)); PyModule_AddObject(m, "NETR_VER_SUITE_WH_SERVER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_WH_SERVER)); PyModule_AddObject(m, "NETR_VER_NT_DOMAIN_CONTROLLER", PyLong_FromLong((uint16_t)NETR_VER_NT_DOMAIN_CONTROLLER)); PyModule_AddObject(m, "NETR_VER_NT_SERVER", PyLong_FromLong((uint16_t)NETR_VER_NT_SERVER)); PyModule_AddObject(m, "NETR_VER_NT_WORKSTATION", PyLong_FromLong((uint16_t)NETR_VER_NT_WORKSTATION)); PyModule_AddObject(m, "SendToSamUpdatePassword", PyLong_FromLong((uint16_t)SendToSamUpdatePassword)); PyModule_AddObject(m, "SendToSamResetBadPasswordCount", PyLong_FromLong((uint16_t)SendToSamResetBadPasswordCount)); PyModule_AddObject(m, "SendToSamUpdatePasswordForward", PyLong_FromLong((uint16_t)SendToSamUpdatePasswordForward)); PyModule_AddObject(m, "SendToSamUpdateLastLogonTimestamp", PyLong_FromLong((uint16_t)SendToSamUpdateLastLogonTimestamp)); PyModule_AddObject(m, "SendToSamResetSmartCardPassword", PyLong_FromLong((uint16_t)SendToSamResetSmartCardPassword)); PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_PASS_TO_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_PASS_TO_FOREST_ROOT)); PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_PASS_CROSS_FOREST_HOP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_PASS_CROSS_FOREST_HOP)); PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_RODC_TO_OTHER_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_RODC_TO_OTHER_DOMAIN)); PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_RODC_NTLM_REQUEST", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_RODC_NTLM_REQUEST)); PyModule_AddObject(m, "NlDnsLdapAtSite", PyLong_FromLong((uint16_t)NlDnsLdapAtSite)); PyModule_AddObject(m, "NlDnsGcAtSite", PyLong_FromLong((uint16_t)NlDnsGcAtSite)); PyModule_AddObject(m, "NlDnsDsaCname", PyLong_FromLong((uint16_t)NlDnsDsaCname)); PyModule_AddObject(m, "NlDnsKdcAtSite", PyLong_FromLong((uint16_t)NlDnsKdcAtSite)); PyModule_AddObject(m, "NlDnsDcAtSite", PyLong_FromLong((uint16_t)NlDnsDcAtSite)); PyModule_AddObject(m, "NlDnsRfc1510KdcAtSite", PyLong_FromLong((uint16_t)NlDnsRfc1510KdcAtSite)); PyModule_AddObject(m, "NlDnsGenericGcAtSite", PyLong_FromLong((uint16_t)NlDnsGenericGcAtSite)); PyModule_AddObject(m, "NlDnsInfoTypeNone", PyLong_FromLong((uint16_t)NlDnsInfoTypeNone)); PyModule_AddObject(m, "NlDnsDomainName", PyLong_FromLong((uint16_t)NlDnsDomainName)); PyModule_AddObject(m, "NlDnsDomainNameAlias", PyLong_FromLong((uint16_t)NlDnsDomainNameAlias)); PyModule_AddObject(m, "NlDnsForestName", PyLong_FromLong((uint16_t)NlDnsForestName)); PyModule_AddObject(m, "NlDnsForestNameAlias", PyLong_FromLong((uint16_t)NlDnsForestNameAlias)); PyModule_AddObject(m, "NlDnsNdncDomainName", PyLong_FromLong((uint16_t)NlDnsNdncDomainName)); PyModule_AddObject(m, "NlDnsRecordName", PyLong_FromLong((uint16_t)NlDnsRecordName)); Py_INCREF((PyObject *)(void *)&netr_UasInfo_Type); PyModule_AddObject(m, "netr_UasInfo", (PyObject *)(void *)&netr_UasInfo_Type); Py_INCREF((PyObject *)(void *)&netr_UasLogoffInfo_Type); PyModule_AddObject(m, "netr_UasLogoffInfo", (PyObject *)(void *)&netr_UasLogoffInfo_Type); Py_INCREF((PyObject *)(void *)&netr_AcctLockStr_Type); PyModule_AddObject(m, "netr_AcctLockStr", (PyObject *)(void *)&netr_AcctLockStr_Type); Py_INCREF((PyObject *)(void *)&netr_IdentityInfo_Type); PyModule_AddObject(m, "netr_IdentityInfo", (PyObject *)(void *)&netr_IdentityInfo_Type); Py_INCREF((PyObject *)(void *)&netr_PasswordInfo_Type); PyModule_AddObject(m, "netr_PasswordInfo", (PyObject *)(void *)&netr_PasswordInfo_Type); Py_INCREF((PyObject *)(void *)&netr_ChallengeResponse_Type); PyModule_AddObject(m, "netr_ChallengeResponse", (PyObject *)(void *)&netr_ChallengeResponse_Type); Py_INCREF((PyObject *)(void *)&netr_NetworkInfo_Type); PyModule_AddObject(m, "netr_NetworkInfo", (PyObject *)(void *)&netr_NetworkInfo_Type); Py_INCREF((PyObject *)(void *)&netr_GenericInfo_Type); PyModule_AddObject(m, "netr_GenericInfo", (PyObject *)(void *)&netr_GenericInfo_Type); Py_INCREF((PyObject *)(void *)&netr_LogonLevel_Type); PyModule_AddObject(m, "netr_LogonLevel", (PyObject *)(void *)&netr_LogonLevel_Type); Py_INCREF((PyObject *)(void *)&netr_UserSessionKey_Type); PyModule_AddObject(m, "netr_UserSessionKey", (PyObject *)(void *)&netr_UserSessionKey_Type); Py_INCREF((PyObject *)(void *)&netr_LMSessionKey_Type); PyModule_AddObject(m, "netr_LMSessionKey", (PyObject *)(void *)&netr_LMSessionKey_Type); Py_INCREF((PyObject *)(void *)&netr_SamBaseInfo_Type); PyModule_AddObject(m, "netr_SamBaseInfo", (PyObject *)(void *)&netr_SamBaseInfo_Type); Py_INCREF((PyObject *)(void *)&netr_SamInfo2_Type); PyModule_AddObject(m, "netr_SamInfo2", (PyObject *)(void *)&netr_SamInfo2_Type); Py_INCREF((PyObject *)(void *)&netr_SidAttr_Type); PyModule_AddObject(m, "netr_SidAttr", (PyObject *)(void *)&netr_SidAttr_Type); Py_INCREF((PyObject *)(void *)&netr_SamInfo3_Type); PyModule_AddObject(m, "netr_SamInfo3", (PyObject *)(void *)&netr_SamInfo3_Type); Py_INCREF((PyObject *)(void *)&netr_SamInfo6_Type); PyModule_AddObject(m, "netr_SamInfo6", (PyObject *)(void *)&netr_SamInfo6_Type); Py_INCREF((PyObject *)(void *)&netr_PacInfo_Type); PyModule_AddObject(m, "netr_PacInfo", (PyObject *)(void *)&netr_PacInfo_Type); Py_INCREF((PyObject *)(void *)&netr_GenericInfo2_Type); PyModule_AddObject(m, "netr_GenericInfo2", (PyObject *)(void *)&netr_GenericInfo2_Type); Py_INCREF((PyObject *)(void *)&netr_Validation_Type); PyModule_AddObject(m, "netr_Validation", (PyObject *)(void *)&netr_Validation_Type); Py_INCREF((PyObject *)(void *)&netr_Credential_Type); PyModule_AddObject(m, "netr_Credential", (PyObject *)(void *)&netr_Credential_Type); Py_INCREF((PyObject *)(void *)&netr_Authenticator_Type); PyModule_AddObject(m, "netr_Authenticator", (PyObject *)(void *)&netr_Authenticator_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_DELETE_USER_Type); PyModule_AddObject(m, "netr_DELTA_DELETE_USER", (PyObject *)(void *)&netr_DELTA_DELETE_USER_Type); Py_INCREF((PyObject *)(void *)&netr_USER_KEY16_Type); PyModule_AddObject(m, "netr_USER_KEY16", (PyObject *)(void *)&netr_USER_KEY16_Type); Py_INCREF((PyObject *)(void *)&netr_PasswordHistory_Type); PyModule_AddObject(m, "netr_PasswordHistory", (PyObject *)(void *)&netr_PasswordHistory_Type); Py_INCREF((PyObject *)(void *)&netr_USER_KEYS2_Type); PyModule_AddObject(m, "netr_USER_KEYS2", (PyObject *)(void *)&netr_USER_KEYS2_Type); Py_INCREF((PyObject *)(void *)&netr_USER_KEY_UNION_Type); PyModule_AddObject(m, "netr_USER_KEY_UNION", (PyObject *)(void *)&netr_USER_KEY_UNION_Type); Py_INCREF((PyObject *)(void *)&netr_USER_KEYS_Type); PyModule_AddObject(m, "netr_USER_KEYS", (PyObject *)(void *)&netr_USER_KEYS_Type); Py_INCREF((PyObject *)(void *)&netr_USER_PRIVATE_INFO_Type); PyModule_AddObject(m, "netr_USER_PRIVATE_INFO", (PyObject *)(void *)&netr_USER_PRIVATE_INFO_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_USER_Type); PyModule_AddObject(m, "netr_DELTA_USER", (PyObject *)(void *)&netr_DELTA_USER_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_DOMAIN_Type); PyModule_AddObject(m, "netr_DELTA_DOMAIN", (PyObject *)(void *)&netr_DELTA_DOMAIN_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_GROUP_Type); PyModule_AddObject(m, "netr_DELTA_GROUP", (PyObject *)(void *)&netr_DELTA_GROUP_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_RENAME_Type); PyModule_AddObject(m, "netr_DELTA_RENAME", (PyObject *)(void *)&netr_DELTA_RENAME_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_GROUP_MEMBER_Type); PyModule_AddObject(m, "netr_DELTA_GROUP_MEMBER", (PyObject *)(void *)&netr_DELTA_GROUP_MEMBER_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_ALIAS_Type); PyModule_AddObject(m, "netr_DELTA_ALIAS", (PyObject *)(void *)&netr_DELTA_ALIAS_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_ALIAS_MEMBER_Type); PyModule_AddObject(m, "netr_DELTA_ALIAS_MEMBER", (PyObject *)(void *)&netr_DELTA_ALIAS_MEMBER_Type); Py_INCREF((PyObject *)(void *)&netr_QUOTA_LIMITS_Type); PyModule_AddObject(m, "netr_QUOTA_LIMITS", (PyObject *)(void *)&netr_QUOTA_LIMITS_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_POLICY_Type); PyModule_AddObject(m, "netr_DELTA_POLICY", (PyObject *)(void *)&netr_DELTA_POLICY_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_TRUSTED_DOMAIN_Type); PyModule_AddObject(m, "netr_DELTA_TRUSTED_DOMAIN", (PyObject *)(void *)&netr_DELTA_TRUSTED_DOMAIN_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_ACCOUNT_Type); PyModule_AddObject(m, "netr_DELTA_ACCOUNT", (PyObject *)(void *)&netr_DELTA_ACCOUNT_Type); Py_INCREF((PyObject *)(void *)&netr_CIPHER_VALUE_Type); PyModule_AddObject(m, "netr_CIPHER_VALUE", (PyObject *)(void *)&netr_CIPHER_VALUE_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_SECRET_Type); PyModule_AddObject(m, "netr_DELTA_SECRET", (PyObject *)(void *)&netr_DELTA_SECRET_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_UNION_Type); PyModule_AddObject(m, "netr_DELTA_UNION", (PyObject *)(void *)&netr_DELTA_UNION_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_ID_UNION_Type); PyModule_AddObject(m, "netr_DELTA_ID_UNION", (PyObject *)(void *)&netr_DELTA_ID_UNION_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_ENUM_Type); PyModule_AddObject(m, "netr_DELTA_ENUM", (PyObject *)(void *)&netr_DELTA_ENUM_Type); Py_INCREF((PyObject *)(void *)&netr_DELTA_ENUM_ARRAY_Type); PyModule_AddObject(m, "netr_DELTA_ENUM_ARRAY", (PyObject *)(void *)&netr_DELTA_ENUM_ARRAY_Type); Py_INCREF((PyObject *)(void *)&netr_UAS_INFO_0_Type); PyModule_AddObject(m, "netr_UAS_INFO_0", (PyObject *)(void *)&netr_UAS_INFO_0_Type); Py_INCREF((PyObject *)(void *)&netr_AccountBuffer_Type); PyModule_AddObject(m, "netr_AccountBuffer", (PyObject *)(void *)&netr_AccountBuffer_Type); Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_1_Type); PyModule_AddObject(m, "netr_NETLOGON_INFO_1", (PyObject *)(void *)&netr_NETLOGON_INFO_1_Type); Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_2_Type); PyModule_AddObject(m, "netr_NETLOGON_INFO_2", (PyObject *)(void *)&netr_NETLOGON_INFO_2_Type); Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_3_Type); PyModule_AddObject(m, "netr_NETLOGON_INFO_3", (PyObject *)(void *)&netr_NETLOGON_INFO_3_Type); Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_4_Type); PyModule_AddObject(m, "netr_NETLOGON_INFO_4", (PyObject *)(void *)&netr_NETLOGON_INFO_4_Type); Py_INCREF((PyObject *)(void *)&netr_CONTROL_QUERY_INFORMATION_Type); PyModule_AddObject(m, "netr_CONTROL_QUERY_INFORMATION", (PyObject *)(void *)&netr_CONTROL_QUERY_INFORMATION_Type); Py_INCREF((PyObject *)(void *)&netr_CONTROL_DATA_INFORMATION_Type); PyModule_AddObject(m, "netr_CONTROL_DATA_INFORMATION", (PyObject *)(void *)&netr_CONTROL_DATA_INFORMATION_Type); Py_INCREF((PyObject *)(void *)&netr_ChangeLogObject_Type); PyModule_AddObject(m, "netr_ChangeLogObject", (PyObject *)(void *)&netr_ChangeLogObject_Type); Py_INCREF((PyObject *)(void *)&netr_ChangeLogEntry_Type); PyModule_AddObject(m, "netr_ChangeLogEntry", (PyObject *)(void *)&netr_ChangeLogEntry_Type); Py_INCREF((PyObject *)(void *)&netr_Blob_Type); PyModule_AddObject(m, "netr_Blob", (PyObject *)(void *)&netr_Blob_Type); Py_INCREF((PyObject *)(void *)&netr_DsRGetDCNameInfo_Type); PyModule_AddObject(m, "netr_DsRGetDCNameInfo", (PyObject *)(void *)&netr_DsRGetDCNameInfo_Type); Py_INCREF((PyObject *)(void *)&netr_Capabilities_Type); PyModule_AddObject(m, "netr_Capabilities", (PyObject *)(void *)&netr_Capabilities_Type); Py_INCREF((PyObject *)(void *)&netr_LsaPolicyInformation_Type); PyModule_AddObject(m, "netr_LsaPolicyInformation", (PyObject *)(void *)&netr_LsaPolicyInformation_Type); Py_INCREF((PyObject *)(void *)&netr_OsVersionInfoEx_Type); PyModule_AddObject(m, "netr_OsVersionInfoEx", (PyObject *)(void *)&netr_OsVersionInfoEx_Type); Py_INCREF((PyObject *)(void *)&netr_OsVersion_Type); PyModule_AddObject(m, "netr_OsVersion", (PyObject *)(void *)&netr_OsVersion_Type); Py_INCREF((PyObject *)(void *)&netr_OsVersionContainer_Type); PyModule_AddObject(m, "netr_OsVersionContainer", (PyObject *)(void *)&netr_OsVersionContainer_Type); Py_INCREF((PyObject *)(void *)&netr_WorkstationInformation_Type); PyModule_AddObject(m, "netr_WorkstationInformation", (PyObject *)(void *)&netr_WorkstationInformation_Type); Py_INCREF((PyObject *)(void *)&netr_WorkstationInfo_Type); PyModule_AddObject(m, "netr_WorkstationInfo", (PyObject *)(void *)&netr_WorkstationInfo_Type); Py_INCREF((PyObject *)(void *)&netr_trust_extension_info_Type); PyModule_AddObject(m, "netr_trust_extension_info", (PyObject *)(void *)&netr_trust_extension_info_Type); Py_INCREF((PyObject *)(void *)&netr_trust_extension_Type); PyModule_AddObject(m, "netr_trust_extension", (PyObject *)(void *)&netr_trust_extension_Type); Py_INCREF((PyObject *)(void *)&netr_trust_extension_container_Type); PyModule_AddObject(m, "netr_trust_extension_container", (PyObject *)(void *)&netr_trust_extension_container_Type); Py_INCREF((PyObject *)(void *)&netr_OneDomainInfo_Type); PyModule_AddObject(m, "netr_OneDomainInfo", (PyObject *)(void *)&netr_OneDomainInfo_Type); Py_INCREF((PyObject *)(void *)&netr_DomainInformation_Type); PyModule_AddObject(m, "netr_DomainInformation", (PyObject *)(void *)&netr_DomainInformation_Type); Py_INCREF((PyObject *)(void *)&netr_DomainInfo_Type); PyModule_AddObject(m, "netr_DomainInfo", (PyObject *)(void *)&netr_DomainInfo_Type); Py_INCREF((PyObject *)(void *)&NL_PASSWORD_VERSION_Type); PyModule_AddObject(m, "NL_PASSWORD_VERSION", (PyObject *)(void *)&NL_PASSWORD_VERSION_Type); Py_INCREF((PyObject *)(void *)&netr_CryptPassword_Type); PyModule_AddObject(m, "netr_CryptPassword", (PyObject *)(void *)&netr_CryptPassword_Type); Py_INCREF((PyObject *)(void *)&netr_SendToSamResetBadPasswordCount_Type); PyModule_AddObject(m, "netr_SendToSamResetBadPasswordCount", (PyObject *)(void *)&netr_SendToSamResetBadPasswordCount_Type); Py_INCREF((PyObject *)(void *)&netr_SendToSamMessage_Type); PyModule_AddObject(m, "netr_SendToSamMessage", (PyObject *)(void *)&netr_SendToSamMessage_Type); Py_INCREF((PyObject *)(void *)&netr_SendToSamBase_Type); PyModule_AddObject(m, "netr_SendToSamBase", (PyObject *)(void *)&netr_SendToSamBase_Type); Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesWCtr_Type); PyModule_AddObject(m, "netr_DsRAddressToSitenamesWCtr", (PyObject *)(void *)&netr_DsRAddressToSitenamesWCtr_Type); Py_INCREF((PyObject *)(void *)&netr_DsRAddress_Type); PyModule_AddObject(m, "netr_DsRAddress", (PyObject *)(void *)&netr_DsRAddress_Type); Py_INCREF((PyObject *)(void *)&netr_DomainTrust_Type); PyModule_AddObject(m, "netr_DomainTrust", (PyObject *)(void *)&netr_DomainTrust_Type); Py_INCREF((PyObject *)(void *)&netr_DomainTrustList_Type); PyModule_AddObject(m, "netr_DomainTrustList", (PyObject *)(void *)&netr_DomainTrustList_Type); Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesExWCtr_Type); PyModule_AddObject(m, "netr_DsRAddressToSitenamesExWCtr", (PyObject *)(void *)&netr_DsRAddressToSitenamesExWCtr_Type); Py_INCREF((PyObject *)(void *)&DcSitesCtr_Type); PyModule_AddObject(m, "DcSitesCtr", (PyObject *)(void *)&DcSitesCtr_Type); Py_INCREF((PyObject *)(void *)&netr_TrustInfo_Type); PyModule_AddObject(m, "netr_TrustInfo", (PyObject *)(void *)&netr_TrustInfo_Type); Py_INCREF((PyObject *)(void *)&NL_DNS_NAME_INFO_Type); PyModule_AddObject(m, "NL_DNS_NAME_INFO", (PyObject *)(void *)&NL_DNS_NAME_INFO_Type); Py_INCREF((PyObject *)(void *)&NL_DNS_NAME_INFO_ARRAY_Type); PyModule_AddObject(m, "NL_DNS_NAME_INFO_ARRAY", (PyObject *)(void *)&NL_DNS_NAME_INFO_ARRAY_Type); Py_INCREF((PyObject *)(void *)&netr_LogonUasLogon_Type); PyModule_AddObject(m, "netr_LogonUasLogon", (PyObject *)(void *)&netr_LogonUasLogon_Type); Py_INCREF((PyObject *)(void *)&netr_LogonUasLogoff_Type); PyModule_AddObject(m, "netr_LogonUasLogoff", (PyObject *)(void *)&netr_LogonUasLogoff_Type); Py_INCREF((PyObject *)(void *)&netr_LogonSamLogon_Type); PyModule_AddObject(m, "netr_LogonSamLogon", (PyObject *)(void *)&netr_LogonSamLogon_Type); Py_INCREF((PyObject *)(void *)&netr_LogonSamLogoff_Type); PyModule_AddObject(m, "netr_LogonSamLogoff", (PyObject *)(void *)&netr_LogonSamLogoff_Type); Py_INCREF((PyObject *)(void *)&netr_ServerReqChallenge_Type); PyModule_AddObject(m, "netr_ServerReqChallenge", (PyObject *)(void *)&netr_ServerReqChallenge_Type); Py_INCREF((PyObject *)(void *)&netr_ServerAuthenticate_Type); PyModule_AddObject(m, "netr_ServerAuthenticate", (PyObject *)(void *)&netr_ServerAuthenticate_Type); Py_INCREF((PyObject *)(void *)&netr_ServerPasswordSet_Type); PyModule_AddObject(m, "netr_ServerPasswordSet", (PyObject *)(void *)&netr_ServerPasswordSet_Type); Py_INCREF((PyObject *)(void *)&netr_DatabaseDeltas_Type); PyModule_AddObject(m, "netr_DatabaseDeltas", (PyObject *)(void *)&netr_DatabaseDeltas_Type); Py_INCREF((PyObject *)(void *)&netr_DatabaseSync_Type); PyModule_AddObject(m, "netr_DatabaseSync", (PyObject *)(void *)&netr_DatabaseSync_Type); Py_INCREF((PyObject *)(void *)&netr_AccountDeltas_Type); PyModule_AddObject(m, "netr_AccountDeltas", (PyObject *)(void *)&netr_AccountDeltas_Type); Py_INCREF((PyObject *)(void *)&netr_AccountSync_Type); PyModule_AddObject(m, "netr_AccountSync", (PyObject *)(void *)&netr_AccountSync_Type); Py_INCREF((PyObject *)(void *)&netr_GetDcName_Type); PyModule_AddObject(m, "netr_GetDcName", (PyObject *)(void *)&netr_GetDcName_Type); Py_INCREF((PyObject *)(void *)&netr_LogonControl_Type); PyModule_AddObject(m, "netr_LogonControl", (PyObject *)(void *)&netr_LogonControl_Type); Py_INCREF((PyObject *)(void *)&netr_GetAnyDCName_Type); PyModule_AddObject(m, "netr_GetAnyDCName", (PyObject *)(void *)&netr_GetAnyDCName_Type); Py_INCREF((PyObject *)(void *)&netr_LogonControl2_Type); PyModule_AddObject(m, "netr_LogonControl2", (PyObject *)(void *)&netr_LogonControl2_Type); Py_INCREF((PyObject *)(void *)&netr_ServerAuthenticate2_Type); PyModule_AddObject(m, "netr_ServerAuthenticate2", (PyObject *)(void *)&netr_ServerAuthenticate2_Type); Py_INCREF((PyObject *)(void *)&netr_DatabaseSync2_Type); PyModule_AddObject(m, "netr_DatabaseSync2", (PyObject *)(void *)&netr_DatabaseSync2_Type); Py_INCREF((PyObject *)(void *)&netr_DatabaseRedo_Type); PyModule_AddObject(m, "netr_DatabaseRedo", (PyObject *)(void *)&netr_DatabaseRedo_Type); Py_INCREF((PyObject *)(void *)&netr_LogonControl2Ex_Type); PyModule_AddObject(m, "netr_LogonControl2Ex", (PyObject *)(void *)&netr_LogonControl2Ex_Type); Py_INCREF((PyObject *)(void *)&netr_NetrEnumerateTrustedDomains_Type); PyModule_AddObject(m, "netr_NetrEnumerateTrustedDomains", (PyObject *)(void *)&netr_NetrEnumerateTrustedDomains_Type); Py_INCREF((PyObject *)(void *)&netr_DsRGetDCName_Type); PyModule_AddObject(m, "netr_DsRGetDCName", (PyObject *)(void *)&netr_DsRGetDCName_Type); Py_INCREF((PyObject *)(void *)&netr_LogonGetCapabilities_Type); PyModule_AddObject(m, "netr_LogonGetCapabilities", (PyObject *)(void *)&netr_LogonGetCapabilities_Type); Py_INCREF((PyObject *)(void *)&netr_LogonGetTrustRid_Type); PyModule_AddObject(m, "netr_LogonGetTrustRid", (PyObject *)(void *)&netr_LogonGetTrustRid_Type); Py_INCREF((PyObject *)(void *)&netr_ServerAuthenticate3_Type); PyModule_AddObject(m, "netr_ServerAuthenticate3", (PyObject *)(void *)&netr_ServerAuthenticate3_Type); Py_INCREF((PyObject *)(void *)&netr_DsRGetDCNameEx_Type); PyModule_AddObject(m, "netr_DsRGetDCNameEx", (PyObject *)(void *)&netr_DsRGetDCNameEx_Type); Py_INCREF((PyObject *)(void *)&netr_DsRGetSiteName_Type); PyModule_AddObject(m, "netr_DsRGetSiteName", (PyObject *)(void *)&netr_DsRGetSiteName_Type); Py_INCREF((PyObject *)(void *)&netr_LogonGetDomainInfo_Type); PyModule_AddObject(m, "netr_LogonGetDomainInfo", (PyObject *)(void *)&netr_LogonGetDomainInfo_Type); Py_INCREF((PyObject *)(void *)&netr_ServerPasswordSet2_Type); PyModule_AddObject(m, "netr_ServerPasswordSet2", (PyObject *)(void *)&netr_ServerPasswordSet2_Type); Py_INCREF((PyObject *)(void *)&netr_ServerPasswordGet_Type); PyModule_AddObject(m, "netr_ServerPasswordGet", (PyObject *)(void *)&netr_ServerPasswordGet_Type); Py_INCREF((PyObject *)(void *)&netr_NetrLogonSendToSam_Type); PyModule_AddObject(m, "netr_NetrLogonSendToSam", (PyObject *)(void *)&netr_NetrLogonSendToSam_Type); Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesW_Type); PyModule_AddObject(m, "netr_DsRAddressToSitenamesW", (PyObject *)(void *)&netr_DsRAddressToSitenamesW_Type); Py_INCREF((PyObject *)(void *)&netr_DsRGetDCNameEx2_Type); PyModule_AddObject(m, "netr_DsRGetDCNameEx2", (PyObject *)(void *)&netr_DsRGetDCNameEx2_Type); Py_INCREF((PyObject *)(void *)&netr_NetrEnumerateTrustedDomainsEx_Type); PyModule_AddObject(m, "netr_NetrEnumerateTrustedDomainsEx", (PyObject *)(void *)&netr_NetrEnumerateTrustedDomainsEx_Type); Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesExW_Type); PyModule_AddObject(m, "netr_DsRAddressToSitenamesExW", (PyObject *)(void *)&netr_DsRAddressToSitenamesExW_Type); Py_INCREF((PyObject *)(void *)&netr_DsrGetDcSiteCoverageW_Type); PyModule_AddObject(m, "netr_DsrGetDcSiteCoverageW", (PyObject *)(void *)&netr_DsrGetDcSiteCoverageW_Type); Py_INCREF((PyObject *)(void *)&netr_LogonSamLogonEx_Type); PyModule_AddObject(m, "netr_LogonSamLogonEx", (PyObject *)(void *)&netr_LogonSamLogonEx_Type); Py_INCREF((PyObject *)(void *)&netr_DsrEnumerateDomainTrusts_Type); PyModule_AddObject(m, "netr_DsrEnumerateDomainTrusts", (PyObject *)(void *)&netr_DsrEnumerateDomainTrusts_Type); Py_INCREF((PyObject *)(void *)&netr_DsrDeregisterDNSHostRecords_Type); PyModule_AddObject(m, "netr_DsrDeregisterDNSHostRecords", (PyObject *)(void *)&netr_DsrDeregisterDNSHostRecords_Type); Py_INCREF((PyObject *)(void *)&netr_ServerTrustPasswordsGet_Type); PyModule_AddObject(m, "netr_ServerTrustPasswordsGet", (PyObject *)(void *)&netr_ServerTrustPasswordsGet_Type); Py_INCREF((PyObject *)(void *)&netr_DsRGetForestTrustInformation_Type); PyModule_AddObject(m, "netr_DsRGetForestTrustInformation", (PyObject *)(void *)&netr_DsRGetForestTrustInformation_Type); Py_INCREF((PyObject *)(void *)&netr_GetForestTrustInformation_Type); PyModule_AddObject(m, "netr_GetForestTrustInformation", (PyObject *)(void *)&netr_GetForestTrustInformation_Type); Py_INCREF((PyObject *)(void *)&netr_LogonSamLogonWithFlags_Type); PyModule_AddObject(m, "netr_LogonSamLogonWithFlags", (PyObject *)(void *)&netr_LogonSamLogonWithFlags_Type); Py_INCREF((PyObject *)(void *)&netr_ServerGetTrustInfo_Type); PyModule_AddObject(m, "netr_ServerGetTrustInfo", (PyObject *)(void *)&netr_ServerGetTrustInfo_Type); Py_INCREF((PyObject *)(void *)&netr_Unused47_Type); PyModule_AddObject(m, "netr_Unused47", (PyObject *)(void *)&netr_Unused47_Type); Py_INCREF((PyObject *)(void *)&netr_DsrUpdateReadOnlyServerDnsRecords_Type); PyModule_AddObject(m, "netr_DsrUpdateReadOnlyServerDnsRecords", (PyObject *)(void *)&netr_DsrUpdateReadOnlyServerDnsRecords_Type); Py_INCREF((PyObject *)(void *)&netlogon_InterfaceType); PyModule_AddObject(m, "netlogon", (PyObject *)(void *)&netlogon_InterfaceType); Py_INCREF((PyObject *)(void *)&netlogon_SyntaxType); PyModule_AddObject(m, "netlogon_abstract_syntax", (PyObject *)(void *)&netlogon_SyntaxType); Py_INCREF((PyObject *)(void *)&netlogon_SyntaxType); PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&netlogon_SyntaxType); #ifdef PY_MOD_NETLOGON_PATCH PY_MOD_NETLOGON_PATCH(m); #endif out: Py_XDECREF(dep_samba_dcerpc_misc); Py_XDECREF(dep_samba_dcerpc_lsa); Py_XDECREF(dep_samba_dcerpc_samr); Py_XDECREF(dep_samba_dcerpc_security); Py_XDECREF(dep_talloc); Py_XDECREF(dep_samba_dcerpc_base); return m; }